---
title: "Encode order by order id"
method: POST
path: "/openapi/v1/orders/encodeTradeDataByOrderId"
tags: ["Orders"]
---

# Encode order by order id

`POST /openapi/v1/orders/encodeTradeDataByOrderId`

Use this endpoint to generate the transaction calldata encoded for the taker and the order.
The calldata includes the element oracle signature (valid for 1 hour) required to verify orders in the ElementEx contract.

## Request body

- EncodeTradeDataByOrderIdReq
  - `chain` 'eth' | 'bsc' | 'polygon' | 'avalanche' | 'arbitrum' | 'zksync' | 'linea' | 'opbnb' | 'base' | 'scroll' | 'manta_pacific' | 'optimism' | 'mantle' | 'zkfair' | 'blast' | 'merlin' | 'mode' | 'cyber' | 'bob' | 'lightlink' | 'zeta' | 'nibiru' | 'abstract' | 'bitlayer' | 'mantra' | 'monad' | 'ink', required — Chain Name
  - `taker` string, required — Taker address
  - `orderIdList` EncodeTradeDataByOrderIdReqItem[], required
    - `orderId` string, required — Order Id
    - `takeCount` integer, required — Take Count
    - `tokenId` string — Token Id.

## Response `200`

OK

- ApiResponseEncodeTradeData
  - `code` integer — Error Code
  - `msg` string — Error Message
  - `data` EncodeTradeData — Encode trade data response
    - `to` string — To contract address.
    - `data` string — Encode function data.
    - `value` string — Payable ETH value.
    - `flags` boolean[] — Flag list used to mark whether encoded.
  - `message` string

## Other responses

- `400` — Bad Request
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/element/apis/element-open-api.md) · [All operations](https://skmtc.net/element/apis/element-open-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/element/element-open-api/versions/fa83ac7feb23/schema)
