---
title: "Builds an instruction based on the request payload, supported instructions: RequestMint, ConfirmMint, CancelMint, RequestRedeem, ConfirmRedeem, CancelRedeem, Lock, Unlock, Withdraw"
method: POST
path: "/v1/instructions"
tags: ["crate::server"]
---

# Builds an instruction based on the request payload, supported instructions: RequestMint, ConfirmMint, CancelMint, RequestRedeem, ConfirmRedeem, CancelRedeem, Lock, Unlock, Withdraw

`POST /v1/instructions`

## Request body

- union — Types of instruction requests.
  - object
    - `data` RequestMintInput, required — Input requires for the RequestMint instruction. Payer is optional and will default to user if not provided. Collateral is required and must be one of the supported collateral types. Collateral account is optional and will default to user's ATA if not provided.
      - `amount` integer, required
      - `collateral` 'usdt' | 'usdc' | 'usdg', required — Type of collateral used in USX transactions.
      - `collateral_account` string, nullable
      - `payer` string, nullable
      - `user` string, required
    - `type` 'RequestMint', required
  - object
    - `data` ConfirmMintInput, required — Input requires for the ConfirmMint instruction. Payer is optional and will default to user if not provided. Collateral is required and must be one of the supported collateral types. Usx account is optional and will default to user's ATA if not provided.
      - `collateral` 'usdt' | 'usdc' | 'usdg', required — Type of collateral used in USX transactions.
      - `payer` string, nullable
      - `user` string, required
      - `usx_account` string, nullable
    - `type` 'ConfirmMint', required
  - object
    - `data` CancelMintInput, required — Input requires for the CancelMint instruction. Payer is optional and will default to user if not provided. Collateral is required and must be one of the supported collateral types.
      - `collateral` 'usdt' | 'usdc' | 'usdg', required — Type of collateral used in USX transactions.
      - `collateral_account` string, nullable
      - `payer` string, nullable
      - `user` string, required
    - `type` 'CancelMint', required
  - object
    - `data` RequestRedeemInput, required — Input requires for the RequestRedeem instruction. Payer is optional and will default to user if not provided. Collateral is required and must be one of the supported collateral types. Usx account is optional and will default to user's ATA if not provided.
      - `amount` integer, required
      - `collateral` 'usdt' | 'usdc' | 'usdg', required — Type of collateral used in USX transactions.
      - `payer` string, nullable
      - `user` string, required
      - `usx_account` string, nullable
    - `type` 'RequestRedeem', required
  - object
    - `data` ConfirmRedeemInput, required — Input requires for the ConfirmRedeem instruction. Payer is optional and will default to user if not provided. Collateral is required and must be one of the supported collateral types. Collateral account is optional and will default to user's ATA if not provided.
      - `collateral` 'usdt' | 'usdc' | 'usdg', required — Type of collateral used in USX transactions.
      - `collateral_account` string, nullable
      - `payer` string, nullable
      - `user` string, required
    - `type` 'ConfirmRedeem', required
  - object
    - `data` CancelRedeemInput, required — Input requires for the CancelRedeem instruction. Payer is optional and will default to user if not provided. Collateral is required and must be one of the supported collateral types. Usx account is optional and will default to user's ATA if not provided.
      - `collateral` 'usdt' | 'usdc' | 'usdg', required — Type of collateral used in USX transactions.
      - `payer` string, nullable
      - `user` string, required
      - `usx_account` string, nullable
    - `type` 'CancelRedeem', required
  - object
    - `data` LockInput, required — Input requires for the Lock instruction. Payer is optional and will default to user if not provided. Usx account is optional and will default to user's ATA if not provided. Eusx account is optional and will default to user's ATA if not provided.
      - `amount` integer, required
      - `eusx_account` string, nullable
      - `payer` string, nullable
      - `user` string, required
      - `usx_account` string, nullable
    - `type` 'Lock', required
  - object
    - `data` UnlockInput, required — Input requires for the Unlock instruction. Payer is optional and will default to user if not provided. Eusx account is optional and will default to user's ATA if not provided.
      - `amount` integer, required
      - `eusx_account` string, nullable
      - `payer` string, nullable
      - `user` string, required
    - `type` 'Unlock', required
  - object
    - `data` WithdrawInput, required — Input requires for the Withdraw instruction. Payer is optional and will default to user if not provided. Usx account is optional and will default to user's ATA if not provided.
      - `amount` integer, required
      - `payer` string, nullable
      - `user` string, required
      - `usx_account` string, nullable
    - `type` 'Withdraw', required

## Response `200`

Instruction Response

- InstructionResponse — Instruction response.
  - `instruction` string, required — Solana instruction to submit onchain

## Other responses

- `400` — Bad Request
- `500` — Internal Error

---

[API](https://skmtc.dev/solstice/apis/usx-protocol-api.md) · [All operations](https://skmtc.dev/solstice/apis/usx-protocol-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/solstice/usx-protocol-api/revisions/727a69fb14c3/schema)
