Trading

Create an order

Create an order to buy or sell an asset. If no source is given, an external source will be use.

Endpoint Permission: Owner, Admin, Non-Signing Admin, Signer, Editor.

For detailed information about error codes and troubleshooting, please refer to our API Error Codes documentation.

post/trading/orders

Request

Headers

Idempotency-Keystring

A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours.

Request body

customerInternalReferenceIdstring

Internal reference ID for the customer

notestring

Optional note for the order

Example request

{
  "via": {
    "type": "PROVIDER_ACCOUNT",
    "providerId": "prov_8c3f1a4b2d6e9f7c",
    "accountId": "acc_5e9a2d1c4b7f3e8a"
  },
  "executionRequestDetails": {
    "type": "MARKET",
    "baseAssetId": "USD",
    "quoteAssetId": "BTC",
    "side": "BUY",
    "baseAmount": "1000.00"
  },
  "settlement": {
    "type": "DVP",
    "sourceAccount": {
      "type": "VAULT_ACCOUNT",
      "id": "vault_acc_3f7e1d9b2c5a8e4f"
    },
    "destinationAccount": {
      "type": "VAULT_ACCOUNT",
      "id": "vault_acc_7b2e5d8f1c4a9e3b"
    }
  },
  "sourceOfFunds": {
    "reasonForPayment": "INVOICE_PAYMENT"
  },
  "customerInternalReferenceId": "order_ref_2024_001",
  "note": "Monthly investment order"
}

Response

Order creation response

idstring required
status'CREATED' | 'AWAITING_PAYMENT' | 'AWAITING_INFORMATION' | 'PENDING_USER_ACTION' | 'PROCESSING' | 'CANCELED' | 'COMPLETED' | 'FAILED' required
createdAtstring date-time required
updatedAtstring date-time
createdBystring required

The ID of the user who created the order

customerInternalReferenceIdstring

Internal reference ID for the customer

notestring

Optional note for the Order

expiresAtstring date-time

Example response

{
  "id": "order_9f4e2d8b1c6a5e73",
  "via": {
    "type": "PROVIDER_ACCOUNT",
    "providerId": "bridge-provider-001",
    "accountId": "acc_9f4e2d8b1c6a5e73"
  },
  "status": "PROCESSING",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:30.000Z",
  "receipt": {
    "type": "BLOCKCHAIN",
    "txHash": "0x1234567890abcdef",
    "amount": "0.02458"
  },
  "generalFees": [
    {
      "feeType": "ORDER",
      "assetId": "USDC",
      "amountType": "FIXED",
      "amount": "5.00"
    }
  ],
  "executionSteps": [
    {
      "type": "EXECUTE",
      "status": "PROCESSING",
      "fee": {
        "feeType": "NETWORK",
        "assetId": "ETH",
        "amountType": "FIXED",
        "amount": "0.01"
      },
      "txId": "tx_abc123def456"
    }
  ],
  "executionResponseDetails": {
    "type": "MARKET",
    "side": "BUY",
    "baseAmount": "1000.00",
    "baseAssetId": "USDC",
    "quoteAssetId": "BTC"
  },
  "settlement": {
    "type": "PREFUNDED",
    "destinationAccount": {
      "type": "VAULT_ACCOUNT",
      "accountId": "vault_acc_9f4e2d8b1c6a5e73"
    }
  },
  "createdBy": "user_123abc456def789",
  "customerInternalReferenceId": "order_ref_2024_001",
  "note": "Monthly investment order"
}

Changes

No recorded changes to this operation across all 1 revision of this API.