> For the complete documentation index, see [llms.txt](https://www.pionex.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pionex.com/docs/api-docs/institution-api/convert.md).

# Convert

Stablecoin / asset conversion.

## Create a conversion

> Create a conversion order. \`baseAmount\` is required only when \`side=SELL\`;\
> \`quoteAmount\` is required only when \`side=BUY\`.\
> \
> \*\*Errors:\*\*\
> \
> \| Error Code | Description |\
> \|------------|-------------|\
> \| \`P\_PAY\_OPEN\_API\_CONVERT\_INVALID\_AMOUNT\` | \`side=SELL\` without \`baseAmount\`, or \`side=BUY\` without \`quoteAmount\`. |\
> \| \`P\_PAY\_OPEN\_API\_SYMBOL\_MAINTENANCE\` | Trading pair under maintenance. |\
> \| \`P\_PAY\_OPEN\_API\_SYMBOL\_MARKET\_CLOSE\` | Trading pair closed (non-trading day). |<br>

```json
{"openapi":"3.0.3","info":{"title":"Pionex Institution Open API (v2)","version":"2.0.0"},"tags":[{"name":"Convert","description":"Stablecoin / asset conversion."}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"ApiKey":[],"Signature":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-APIKEY","description":"Your institution API Key, in the form `webot_xxxxxxxx`. Used to look up\nyour registered public key. Must be accompanied by the `X-Signature`\nheader. See the Authentication section for the full signing algorithm\n(RSA-PSS over SHA-256, or Ed25519) and the canonical-string construction.\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current time in **seconds** (Unix). Required on every signed request and\nparticipates in the signature. Must be within +/-5 seconds of server time.\n","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Success indicator."},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds."},"code":{"type":"string","description":"Error code (present only on failure)."},"message":{"type":"string","description":"Error message (present only on failure)."}}}},"responses":{"BadRequest":{"description":"Bad Request - the request body could not be read.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"}]}}}},"Unauthorized":{"description":"Unauthorized - authentication failed (missing key, bad signature, etc.).","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"}]}}}},"InternalError":{"description":"Internal or business error. Note that most business failures are returned\nas HTTP `200` with `result: false` and a `code`; this `500` covers\nserver-side internal errors.\n","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"}]}}}}}},"paths":{"/api/v2/institution/convert/order/create":{"post":{"tags":["Convert"],"summary":"Create a conversion","description":"Create a conversion order. `baseAmount` is required only when `side=SELL`;\n`quoteAmount` is required only when `side=BUY`.\n\n**Errors:**\n\n| Error Code | Description |\n|------------|-------------|\n| `P_PAY_OPEN_API_CONVERT_INVALID_AMOUNT` | `side=SELL` without `baseAmount`, or `side=BUY` without `quoteAmount`. |\n| `P_PAY_OPEN_API_SYMBOL_MAINTENANCE` | Trading pair under maintenance. |\n| `P_PAY_OPEN_API_SYMBOL_MARKET_CLOSE` | Trading pair closed (non-trading day). |\n","operationId":"institutionConvertOrderCreate","parameters":[{"$ref":"#/components/parameters/Timestamp"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId","baseCoin","quoteCoin","side"],"properties":{"userId":{"type":"string"},"baseCoin":{"type":"string","description":"Base currency."},"quoteCoin":{"type":"string","description":"Quote currency."},"side":{"type":"string","enum":["BUY","SELL"]},"baseAmount":{"type":"string","description":"Base amount - required only when `side=SELL`."},"quoteAmount":{"type":"string","description":"Quote amount - required only when `side=BUY`."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"orderId":{"type":"string"}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## List conversion orders

> List conversion orders for a \`userId\`.<br>

```json
{"openapi":"3.0.3","info":{"title":"Pionex Institution Open API (v2)","version":"2.0.0"},"tags":[{"name":"Convert","description":"Stablecoin / asset conversion."}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"ApiKey":[],"Signature":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-APIKEY","description":"Your institution API Key, in the form `webot_xxxxxxxx`. Used to look up\nyour registered public key. Must be accompanied by the `X-Signature`\nheader. See the Authentication section for the full signing algorithm\n(RSA-PSS over SHA-256, or Ed25519) and the canonical-string construction.\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current time in **seconds** (Unix). Required on every signed request and\nparticipates in the signature. Must be within +/-5 seconds of server time.\n","schema":{"type":"integer","format":"int64"}},"UserIdQueryRequired":{"name":"userId","in":"query","required":true,"description":"Target sub-account UUID. Participates in the signature.","schema":{"type":"string"}},"StartTime":{"name":"startTime","in":"query","required":false,"description":"Start time, millisecond Unix timestamp.","schema":{"type":"integer","format":"int64"}},"EndTime":{"name":"endTime","in":"query","required":false,"description":"End time, millisecond Unix timestamp.","schema":{"type":"integer","format":"int64"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Success indicator."},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds."},"code":{"type":"string","description":"Error code (present only on failure)."},"message":{"type":"string","description":"Error message (present only on failure)."}}},"ConvertRecord":{"type":"object","properties":{"orderId":{"type":"string"},"baseCoin":{"type":"string"},"quoteCoin":{"type":"string"},"baseAmount":{"type":"string"},"quoteAmount":{"type":"string"},"side":{"type":"string","enum":["BUY","SELL"]},"price":{"type":"string"},"status":{"type":"string"},"failReason":{"type":"string"},"createTime":{"type":"integer","format":"int64"},"updateTime":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad Request - the request body could not be read.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"}]}}}},"Unauthorized":{"description":"Unauthorized - authentication failed (missing key, bad signature, etc.).","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"}]}}}},"InternalError":{"description":"Internal or business error. Note that most business failures are returned\nas HTTP `200` with `result: false` and a `code`; this `500` covers\nserver-side internal errors.\n","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"}]}}}}}},"paths":{"/api/v2/institution/convert/orders":{"get":{"tags":["Convert"],"summary":"List conversion orders","description":"List conversion orders for a `userId`.\n","operationId":"institutionConvertOrdersList","parameters":[{"$ref":"#/components/parameters/Timestamp"},{"$ref":"#/components/parameters/UserIdQueryRequired"},{"$ref":"#/components/parameters/StartTime"},{"$ref":"#/components/parameters/EndTime"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/ConvertRecord"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Get a conversion order

> Get a single conversion order.<br>

```json
{"openapi":"3.0.3","info":{"title":"Pionex Institution Open API (v2)","version":"2.0.0"},"tags":[{"name":"Convert","description":"Stablecoin / asset conversion."}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"security":[{"ApiKey":[],"Signature":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-APIKEY","description":"Your institution API Key, in the form `webot_xxxxxxxx`. Used to look up\nyour registered public key. Must be accompanied by the `X-Signature`\nheader. See the Authentication section for the full signing algorithm\n(RSA-PSS over SHA-256, or Ed25519) and the canonical-string construction.\n"}},"parameters":{"Timestamp":{"name":"timestamp","in":"query","required":true,"description":"Current time in **seconds** (Unix). Required on every signed request and\nparticipates in the signature. Must be within +/-5 seconds of server time.\n","schema":{"type":"integer","format":"int64"}},"UserIdQueryRequired":{"name":"userId","in":"query","required":true,"description":"Target sub-account UUID. Participates in the signature.","schema":{"type":"string"}}},"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Success indicator."},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds."},"code":{"type":"string","description":"Error code (present only on failure)."},"message":{"type":"string","description":"Error message (present only on failure)."}}},"ConvertRecord":{"type":"object","properties":{"orderId":{"type":"string"},"baseCoin":{"type":"string"},"quoteCoin":{"type":"string"},"baseAmount":{"type":"string"},"quoteAmount":{"type":"string"},"side":{"type":"string","enum":["BUY","SELL"]},"price":{"type":"string"},"status":{"type":"string"},"failReason":{"type":"string"},"createTime":{"type":"integer","format":"int64"},"updateTime":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad Request - the request body could not be read.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"}]}}}},"Unauthorized":{"description":"Unauthorized - authentication failed (missing key, bad signature, etc.).","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"}]}}}},"InternalError":{"description":"Internal or business error. Note that most business failures are returned\nas HTTP `200` with `result: false` and a `code`; this `500` covers\nserver-side internal errors.\n","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"}]}}}}}},"paths":{"/api/v2/institution/convert/order":{"get":{"tags":["Convert"],"summary":"Get a conversion order","description":"Get a single conversion order.\n","operationId":"institutionConvertOrderGet","parameters":[{"$ref":"#/components/parameters/Timestamp"},{"$ref":"#/components/parameters/UserIdQueryRequired"},{"name":"orderId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ConvertRecord"}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```
