---
updatedAt: 2026-06-22T07:09:27.000Z
agentTools:
  projectIndex: https://element.readme.io/llms.txt
---

# Encode order by order id

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.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Element Open API",
    "description": "OpenAPI 3.0 based swagger docs for Element Public API.</br></br>If you have questions, Please review <a href=\"https://docs.element.market/welcome-to-element/support/faq\">HelpCenter</a> for help, Or <a href=\"mailto:api@element.market\">Contact Us</a>.",
    "contact": {
      "name": "Element",
      "url": "https://element.market/",
      "email": ""
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.element.market",
      "description": "Mainnet API"
    }
  ],
  "security": [
    {
      "X-Api-Key": []
    }
  ],
  "tags": [
    {
      "name": "Orders",
      "description": "Acount data are high level data, open to our partners, please contact us."
    },
    {
      "name": "Orders"
    }
  ],
  "paths": {
    "/openapi/v1/orders/encodeTradeDataByOrderId": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Encode order by order id",
        "description": "Use this endpoint to generate the transaction calldata encoded for the taker and the order.\nThe calldata includes the element oracle signature (valid for 1 hour) required to verify orders in the ElementEx contract.",
        "operationId": "encodeTradeDataByOrderId",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EncodeTradeDataByOrderIdReq"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponseEncodeTradeData"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BadRequestErrorResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32",
            "example": 400
          },
          "error": {
            "type": "string",
            "example": "Bad Request"
          },
          "message": {
            "type": "string",
            "example": "Missing Header: X-api-key"
          },
          "path": {
            "type": "string",
            "example": "/openapi/v1/orders/list"
          }
        }
      },
      "TooManyRequestsErrorResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32",
            "example": 429
          },
          "error": {
            "type": "string",
            "example": "Too Many Requests"
          },
          "message": {
            "type": "string",
            "example": "You have exhausted your API Request Quota"
          },
          "path": {
            "type": "string",
            "example": "/openapi/v1/orders/list"
          }
        }
      },
      "InternalServerErrorResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32",
            "example": 500
          },
          "error": {
            "type": "string",
            "example": "Internal server error"
          }
        }
      },
      "EncodeTradeDataByOrderIdReq": {
        "required": [
          "chain",
          "orderIdList",
          "taker"
        ],
        "type": "object",
        "properties": {
          "chain": {
            "type": "string",
            "description": "Chain Name",
            "example": "eth",
            "enum": [
              "eth",
              "bsc",
              "polygon",
              "arbitrum",
              "zksync",
              "linea",
              "opbnb",
              "base",
              "manta_pacific",
              "mantle",
              "zkfair",
              "merlin",
              "mode",
              "cyber",
              "bob",
              "lightlink",
              "zeta",
              "nibiru",
              "bitlayer",
              "mantra",
              "monad",
              "ink",
              "robinhood"
            ]
          },
          "taker": {
            "type": "string",
            "description": "Taker address",
            "example": "0x2177827dc49c7e89864d07853d1d65492c7a9327"
          },
          "orderIdList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EncodeTradeDataByOrderIdReqItem"
            }
          }
        }
      },
      "EncodeTradeDataByOrderIdReqItem": {
        "required": [
          "orderId",
          "takeCount"
        ],
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "description": "Order Id",
            "example": "974967556489302561"
          },
          "takeCount": {
            "type": "integer",
            "description": "Take Count",
            "format": "int64",
            "example": 1
          },
          "tokenId": {
            "type": "string",
            "description": "Token Id.",
            "example": "Collection offer and traits offer must pass tokenId"
          }
        }
      },
      "ApiResponseEncodeTradeData": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Error Code",
            "format": "int32"
          },
          "msg": {
            "type": "string",
            "description": "Error Message"
          },
          "data": {
            "$ref": "#/components/schemas/EncodeTradeData"
          },
          "message": {
            "type": "string",
            "writeOnly": true
          }
        }
      },
      "EncodeTradeData": {
        "type": "object",
        "properties": {
          "to": {
            "type": "string",
            "description": "To contract address.",
            "example": "0x20F780A973856B93f63670377900C1d2a50a77c4"
          },
          "data": {
            "type": "string",
            "description": "Encode function data.",
            "example": "0x..."
          },
          "value": {
            "type": "string",
            "description": "Payable ETH value.",
            "example": "1000000000000000000"
          },
          "flags": {
            "type": "array",
            "description": "Flag list used to mark whether encoded.",
            "example": [
              true,
              false,
              true,
              true
            ],
            "items": {
              "type": "boolean",
              "description": "Flag list used to mark whether encoded.",
              "example": false
            }
          }
        },
        "description": "Encode trade data response"
      }
    },
    "securitySchemes": {
      "X-Api-Key": {
        "type": "apiKey",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```