Skip to main content
POST
/
orders
Create Order
curl --request POST \
  --url https://api.coinvoyage.io/v3/orders \
  --header 'Authorization-Signature: <authorization-signature>' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "amount": "100.0",
  "currency": {
    "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "chain_id": 30000000000001
  },
  "fiat_unit": "USD",
  "metadata": {
    "items": [
      {
        "currency": "USD",
        "description": "High-quality widget with extra features",
        "image": "https://example.com/images/widget.png",
        "name": "Premium Widget",
        "quantity": 2,
        "unit_price": 49.99
      }
    ],
    "refund": {
      "additional_info": "Item was never shipped",
      "currency": "USD",
      "name": "Order Cancellation",
      "reason": "Customer requested refund",
      "refund_amount": 99.98
    }
  },
  "mode": "SALE",
  "recipient": "0x1234...abcd"
}
'
{
  "created_at": "2023-01-01T00:00:00Z",
  "fulfillment": {
    "amount": {
      "raw": "100000000",
      "ui": "100.0",
      "value_usd": 100
    },
    "asset": {
      "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "chain_id": 1,
      "decimals": 6,
      "id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "name": "USD Coin",
      "price_usd": 1,
      "symbol": "USDC"
    },
    "custom_fee_bps": 50,
    "fiat_unit": "USD",
    "rate_usd": "1.00",
    "recipient": "0x1234...abcd",
    "swap": {
      "slippage_bps": 50,
      "trade_type": "EXACT_INPUT"
    }
  },
  "hosted_url": "https://pay.coinvoyage.io/pay/cuidjkhg3e289y74u5t6v",
  "id": "cuidjkhg3e289y74u5t6v",
  "metadata": {
    "items": [
      {
        "currency": "USD",
        "description": "High-quality widget with extra features",
        "image": "https://example.com/images/widget.png",
        "name": "Premium Widget",
        "quantity": 2,
        "unit_price": 49.99
      }
    ],
    "refund": {
      "additional_info": "Item was never shipped",
      "currency": "USD",
      "name": "Order Cancellation",
      "reason": "Customer requested refund",
      "refund_amount": 99.98
    }
  },
  "mode": "SALE",
  "organization_id": "org_123",
  "payment": {
    "destination_tx_hash": "0x5678...efgh",
    "estimated_duration_seconds": 120,
    "expires_at": "2023-01-01T00:00:00Z",
    "fee_tx_hash": "0xfee1...fee2",
    "input": {
      "amount": {
        "raw": "100000000",
        "ui": "100.0",
        "value_usd": 100
      },
      "balance": {
        "raw": "100000000",
        "ui": "100.0",
        "value_usd": 100
      },
      "breakdown": {
        "base": {
          "raw": "100000000",
          "ui": "100.0",
          "value_usd": 100
        },
        "fees": {
          "custom_fee": {
            "raw": "100000000",
            "ui": "100.0",
            "value_usd": 100
          },
          "protocol_fee": {
            "raw": "100000000",
            "ui": "100.0",
            "value_usd": 100
          },
          "relayer_fee": {
            "raw": "100000000",
            "ui": "100.0",
            "value_usd": 100
          },
          "total_fee": {
            "raw": "100000000",
            "ui": "100.0",
            "value_usd": 100
          }
        },
        "gas": {
          "raw": "100000000",
          "ui": "100.0",
          "value_usd": 100
        },
        "total": {
          "raw": "100000000",
          "ui": "100.0",
          "value_usd": 100
        }
      },
      "currency": {
        "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "chain_id": 1,
        "decimals": 6,
        "id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "name": "USD Coin",
        "price_usd": 1,
        "symbol": "USDC"
      }
    },
    "output": {
      "amount": {
        "raw": "100000000",
        "ui": "100.0",
        "value_usd": 100
      },
      "amount_out_minimum": {
        "raw": "100000000",
        "ui": "100.0",
        "value_usd": 100
      },
      "currency": {
        "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "chain_id": 1,
        "decimals": 6,
        "id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "name": "USD Coin",
        "price_usd": 1,
        "symbol": "USDC"
      }
    },
    "payment_rail": "CRYPTO",
    "recipient": "0x1234...abcd",
    "refund": {
      "address": "0x1234...abcd",
      "reason": "execution failed: provider error",
      "tx_hash": "0x9abc...ijkl"
    },
    "source_tx_hash": "0x1234...abcd",
    "steps": [
      {
        "deposit_address": "5xVt9ovu6g6E4gvz9K9eV4kxY7yQZ8h3kZ2vY8xZ5xVt",
        "kind": "deposit",
        "rail": "CRYPTO"
      }
    ]
  },
  "settings": {
    "card_payments": true,
    "hide_footer": true
  },
  "status": "PENDING",
  "updated_at": "2023-01-01T00:00:00Z"
}

Authorizations

X-API-KEY
string
header
required

Headers

X-API-KEY
string
required

API key for authentication

Authorization-Signature
string
required

HMAC-SHA256 signature header: 'APIKey=<api_key>,signature=,timestamp=<unix_timestamp>'. The signature is computed over METHOD + path (with the /v3 prefix stripped) + timestamp.

Body

application/json
mode
enum<string>
required
Available options:
SALE,
DEPOSIT,
REFUND,
SWAP,
FEE_CLAIM
Example:

"SALE"

amount
string
required
Example:

"100.0"

fiat_unit
string | null
Example:

"USD"

currency
object
Example:
{
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"chain_id": 30000000000001
}
recipient
string | null
Example:

"0x1234...abcd"

metadata
object
Example:
{
"items": [
{
"currency": "USD",
"description": "High-quality widget with extra features",
"image": "https://example.com/images/widget.png",
"name": "Premium Widget",
"quantity": 2,
"unit_price": 49.99
}
],
"refund": {
"additional_info": "Item was never shipped",
"currency": "USD",
"name": "Order Cancellation",
"reason": "Customer requested refund",
"refund_amount": 99.98
}
}

Response

Order created

id
string
required
Example:

"cuidjkhg3e289y74u5t6v"

created_at
string<date-time>
required
Example:

"2023-01-01T00:00:00Z"

updated_at
string<date-time>
required
Example:

"2023-01-01T00:00:00Z"

organization_id
string
required
Example:

"org_123"

mode
enum<string>
required
Available options:
SALE,
DEPOSIT,
REFUND,
SWAP,
FEE_CLAIM
Example:

"SALE"

status
enum<string>
required
Available options:
PENDING,
EXPIRED,
FAILED,
AWAITING_PAYMENT,
OPTIMISTIC_CONFIRMED,
AWAITING_CONFIRMATION,
EXECUTING_ORDER,
COMPLETED,
REFUNDED,
PARTIAL_PAYMENT
Example:

"PENDING"

fulfillment
object
required
Example:
{
"amount": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"asset": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1,
"decimals": 6,
"id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"name": "USD Coin",
"price_usd": 1,
"symbol": "USDC"
},
"custom_fee_bps": 50,
"fiat_unit": "USD",
"rate_usd": "1.00",
"recipient": "0x1234...abcd",
"swap": {
"slippage_bps": 50,
"trade_type": "EXACT_INPUT"
}
}
hosted_url
string
required
Example:

"https://pay.coinvoyage.io/pay/cuidjkhg3e289y74u5t6v"

payment
object
Example:
{
"destination_tx_hash": "0x5678...efgh",
"estimated_duration_seconds": 120,
"expires_at": "2023-01-01T00:00:00Z",
"fee_tx_hash": "0xfee1...fee2",
"input": {
"amount": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"balance": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"breakdown": {
"base": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"fees": {
"custom_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"protocol_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"relayer_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"total_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
}
},
"gas": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"total": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
}
},
"currency": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1,
"decimals": 6,
"id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"name": "USD Coin",
"price_usd": 1,
"symbol": "USDC"
}
},
"output": {
"amount": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"amount_out_minimum": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"currency": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1,
"decimals": 6,
"id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"name": "USD Coin",
"price_usd": 1,
"symbol": "USDC"
}
},
"payment_rail": "CRYPTO",
"recipient": "0x1234...abcd",
"refund": {
"address": "0x1234...abcd",
"reason": "execution failed: provider error",
"tx_hash": "0x9abc...ijkl"
},
"source_tx_hash": "0x1234...abcd",
"steps": [
{
"deposit_address": "5xVt9ovu6g6E4gvz9K9eV4kxY7yQZ8h3kZ2vY8xZ5xVt",
"kind": "deposit",
"rail": "CRYPTO"
}
]
}
metadata
object
Example:
{
"items": [
{
"currency": "USD",
"description": "High-quality widget with extra features",
"image": "https://example.com/images/widget.png",
"name": "Premium Widget",
"quantity": 2,
"unit_price": 49.99
}
],
"refund": {
"additional_info": "Item was never shipped",
"currency": "USD",
"name": "Order Cancellation",
"reason": "Customer requested refund",
"refund_amount": 99.98
}
}
settings
object

Widget/client UI settings configured on the organization. Known fields are documented here; arbitrary extra JSON settings are also allowed.

Example:
{
"card_payments": true,
"hide_footer": true,
"logo_url": "https://example.com/logo.png",
"theme_color": "#000000"
}