---
title: "Create a PayOrder"
method: POST
path: "/pay-orders"
tags: ["pay-orders"]
---

# Create a PayOrder

`POST /pay-orders`

Create a new PayOrder for cryptocurrency payment processing. `SALE` mode requires an `Authorization` signature; other modes accept either `X-API-KEY` or `Authorization`.

## Headers

- `X-API-KEY` string, required
- `Authorization-Signature` string, required

## Request body

- OrderRequest
  - `mode` 'SALE' | 'DEPOSIT', required
  - `metadata` OrderMetadata
    - `items` MetadataItems[]
      - `name` string, nullable
      - `description` string, nullable
      - `image` string, nullable
      - `quantity` integer, nullable
      - `unit_price` number, nullable
      - `currency` string, nullable
    - `refund` MetadataRefund
      - `name` string, nullable
      - `reason` string, nullable
      - `additional_info` string, nullable
      - `refund_amount` number, nullable
      - `currency` string, nullable
  - `intent` OrderIntent, required
    - `asset` CurrencyBase
      - `address` string, nullable
      - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
    - `amount` IntentAmount, required
      - `token_amount` number, nullable
      - `fiat` FiatAmount
        - `amount` number, required
        - `unit` 'USD' | 'EUR', required
    - `receiving_address` string, nullable

## Response `201`

PayOrder created successfully

- PayOrderResponse
  - `id` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `organization_id` string, required
  - `mode` 'SALE' | 'DEPOSIT' | 'REFUND' | 'SWAP' | 'FEE_CLAIM', required
  - `status` 'PENDING' | 'EXPIRED' | 'FAILED' | 'AWAITING_PAYMENT' | 'OPTIMISTIC_CONFIRMED' | 'AWAITING_CONFIRMATION' | 'EXECUTING_ORDER' | 'COMPLETED' | 'REFUNDED' | 'PARTIAL_PAYMENT', required
  - `fulfillment` Fulfillment, required
    - `asset` Currency
      - `id` string, required
      - `address` string, nullable
      - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
      - `decimals` integer, required
      - `name` string, required
      - `ticker` string, required
      - `image_uri` string, nullable
      - `price_usd` number, nullable
    - `fiat` 'USD' | 'EUR'
    - `amount` CurrencyAmount, required
      - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
      - `ui_amount_display` string, required
      - `raw_amount` string, required — A big integer represented as a string to preserve precision
      - `value_usd` number, required
    - `rate_usd` string, nullable
    - `receiving_address` string, nullable
    - `custom_fee_bps` integer, nullable
    - `swap` SwapContext
      - `swap_mode` 'ExactIn' | 'ExactOut', required
      - `requested_amount` string, required
      - `requested_source_currency` CurrencyBase
        - `address` string, nullable
        - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
      - `requested_destination_currency` CurrencyBase
        - `address` string, nullable
        - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
      - `slippage_bps` integer, nullable
  - `payment` PaymentDataBase
    - `payment_rail` 'CRYPTO' | 'FIAT'
    - `src` QuoteWithCurrency, required
      - `id` string, required
      - `address` string, nullable
      - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
      - `decimals` integer, required
      - `name` string, required
      - `ticker` string, required
      - `image_uri` string, nullable
      - `price_usd` number, nullable
      - `currency_amount` CurrencyAmount, required
        - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
        - `ui_amount_display` string, required
        - `raw_amount` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, required
      - `amount_out_minimum` CurrencyAmount
        - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
        - `ui_amount_display` string, required
        - `raw_amount` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, required
      - `total` CurrencyAmount, required
        - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
        - `ui_amount_display` string, required
        - `raw_amount` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, required
      - `base` CurrencyAmount, required
        - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
        - `ui_amount_display` string, required
        - `raw_amount` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, required
      - `fees` FeeBreakdown
        - `total_fee` CurrencyAmount, required
          - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
          - `ui_amount_display` string, required
          - `raw_amount` string, required — A big integer represented as a string to preserve precision
          - `value_usd` number, required
        - `protocol_fee` CurrencyAmount
          - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
          - `ui_amount_display` string, required
          - `raw_amount` string, required — A big integer represented as a string to preserve precision
          - `value_usd` number, required
        - `custom_fee` CurrencyAmount
          - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
          - `ui_amount_display` string, required
          - `raw_amount` string, required — A big integer represented as a string to preserve precision
          - `value_usd` number, required
        - `relayer_fee` CurrencyAmount
          - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
          - `ui_amount_display` string, required
          - `raw_amount` string, required — A big integer represented as a string to preserve precision
          - `value_usd` number, required
      - `gas` CurrencyAmount
        - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
        - `ui_amount_display` string, required
        - `raw_amount` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, required
    - `dst` CurrencyWithAmount, required
      - `id` string, required
      - `address` string, nullable
      - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
      - `decimals` integer, required
      - `name` string, required
      - `ticker` string, required
      - `image_uri` string, nullable
      - `price_usd` number, nullable
      - `currency_amount` CurrencyAmount, required
        - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
        - `ui_amount_display` string, required
        - `raw_amount` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, required
      - `amount_out_minimum` CurrencyAmount
        - `ui_amount` number, required — Approximate numeric amount. Do not use for payment construction; use raw_amount for exact amounts and ui_amount_display for display.
        - `ui_amount_display` string, required
        - `raw_amount` string, required — A big integer represented as a string to preserve precision
        - `value_usd` number, required
    - `estimated_duration_seconds` number, nullable
    - `receiving_address` string, required
    - `refund_address` string, nullable
    - `source_tx_hash` string, nullable
    - `destination_tx_hash` string, nullable
    - `refund_tx_hash` string, nullable
    - `refunded_reason` string, nullable
    - `fee_tx_hash` string, nullable
    - `deposit_address` string, required — Use steps
    - `steps` PaymentStep[], required
      - `rail` 'CRYPTO' | 'FIAT', required
      - `kind` 'deposit' | 'transaction' | 'stripe_onramp', required
      - `deposit_address` string — Use data.deposit_address instead
      - `data` union, required
        - DepositStepData
          - `deposit_address` string, required
          - `currency` CurrencyBase, required
            - `address` string, nullable
            - `chain_id` 1 | 10 | 56 | 137 | 8453 | 42161 | 20000000000001 | 30000000000001 | 30000000000002, required
          - `amount` string, required — A big integer represented as a string to preserve precision
        - ChainPaymentData
          - `evm` EVMPaymentData
            - `from` string, required
            - `to` string, required
            - `data` string, required
            - `value` string, required
            - `chainId` integer, required
            - `maxFeePerGas` string
            - `maxPriorityFeePerGas` string
          - `bitcoin` BitcoinPaymentData
            - `psbt` string, required
          - `solana` SolanaPaymentData
            - `transaction` union, required — Serialized Solana transaction object returned by the solana-go SDK.
              - …
          - `sui` SuiPaymentData
            - `transaction` union, required — Serialized Sui transaction object returned by the sui-go-sdk.
              - …
        - StripeOnrampPaymentData
          - `session_id` string, required
          - `stripe_publishable_key` string, required
          - `client_secret` string, required
          - `status` string, required
          - `hosted_url` string, nullable
          - `source_currency` string, nullable
          - `destination_currency` 'btc' | 'eth' | 'pol' | 'sol' | 'usdc', required
          - `destination_network` 'base' | 'ethereum' | 'optimism' | 'polygon' | 'solana', required
          - `destination_amount` string, required
          - `wallet_address` string, required
          - `quote` StripeOnrampQuote
            - `source_currency` string, nullable
            - `source_amount` string, nullable
            - `source_total_amount` string, nullable
            - `destination_currency` 'btc' | 'eth' | 'pol' | 'sol' | 'usdc', required
            - `destination_network` 'base' | 'ethereum' | 'optimism' | 'polygon' | 'solana', required
            - `destination_amount` string, required
            - `exchange_rate` string, nullable
            - `network_fee_amount` string, nullable
            - `transaction_fee_amount` string, nullable
    - `expires_at` string, date-time, required
  - `metadata` OrderMetadata
    - `items` MetadataItems[]
      - `name` string, nullable
      - `description` string, nullable
      - `image` string, nullable
      - `quantity` integer, nullable
      - `unit_price` number, nullable
      - `currency` string, nullable
    - `refund` MetadataRefund
      - `name` string, nullable
      - `reason` string, nullable
      - `additional_info` string, nullable
      - `refund_amount` number, nullable
      - `currency` string, nullable
  - `settings` OrganizationSettings — Widget/client UI settings configured on the organization. Known fields are documented here; arbitrary extra JSON settings are also allowed.
    - `hide_footer` boolean
    - `card_payments` boolean
  - `hosted_url` string, required

## Other responses

- `401` — Unauthorized - Authentication required
- `403` — Forbidden - Organization is not configured for the requested order flow or the receiving address is sanctioned
- `422` — Unprocessable Entity - Invalid request body or validation failed
- `500` — Internal Server Error

---

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