curl --location --request POST 'https://api.stateset.network/v1/order/pay' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"order_id": "order_1234567890",
"payment_method": {
"type": "ssusd",
"wallet_address": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"amount": {
"value": "150.00",
"denom": "ssusd"
},
"chain": "stateset"
},
"split_payments": [
{
"recipient": "stateset1merchantaddress123",
"amount": "135.00",
"type": "merchant"
},
{
"recipient": "stateset1platformfeeaddress456",
"amount": "15.00",
"type": "platform_fee"
}
],
"metadata": {
"memo": "Payment for Order #1234567890",
"reference_number": "INV-2024-001",
"idempotency_key": "pay_order_1234567890_001"
}
}'
{
"success": true,
"transaction": {
"tx_hash": "B5E7A2D9F3C8E1A4D6B9C3F7E2A5D8B1E4C7F9A2D5B8E1C4F7A9D2E5B8C1F4A7",
"block_height": 1234567,
"timestamp": "2024-01-15T10:30:05Z",
"gas_used": "75000",
"chain": "stateset"
},
"payment": {
"payment_id": "pay_9h8g7f6e5d4c3b2a",
"order_id": "order_1234567890",
"amount": {
"value": "150.00",
"denom": "ssusd",
"usd_value": "150.00"
},
"status": "completed",
"splits": [
{
"recipient": "stateset1merchantaddress123",
"amount": "135.00",
"type": "merchant",
"tx_hash": "C6F8B3E0A6D9F4B7E3A6E9D4B7F0C3E8"
},
{
"recipient": "stateset1platformfeeaddress456",
"amount": "15.00",
"type": "platform_fee",
"tx_hash": "D7G9C4F1B7E0A5C8F4B7F0E5C8G1D4F9"
}
]
},
"order": {
"order_id": "order_1234567890",
"status": "processing",
"payment_status": "paid",
"paid_at": "2024-01-15T10:30:05Z"
}
}
Pay for an order using ssUSD on the StateSet Commerce Network
curl --location --request POST 'https://api.stateset.network/v1/order/pay' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"order_id": "order_1234567890",
"payment_method": {
"type": "ssusd",
"wallet_address": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"amount": {
"value": "150.00",
"denom": "ssusd"
},
"chain": "stateset"
},
"split_payments": [
{
"recipient": "stateset1merchantaddress123",
"amount": "135.00",
"type": "merchant"
},
{
"recipient": "stateset1platformfeeaddress456",
"amount": "15.00",
"type": "platform_fee"
}
],
"metadata": {
"memo": "Payment for Order #1234567890",
"reference_number": "INV-2024-001",
"idempotency_key": "pay_order_1234567890_001"
}
}'
{
"success": true,
"transaction": {
"tx_hash": "B5E7A2D9F3C8E1A4D6B9C3F7E2A5D8B1E4C7F9A2D5B8E1C4F7A9D2E5B8C1F4A7",
"block_height": 1234567,
"timestamp": "2024-01-15T10:30:05Z",
"gas_used": "75000",
"chain": "stateset"
},
"payment": {
"payment_id": "pay_9h8g7f6e5d4c3b2a",
"order_id": "order_1234567890",
"amount": {
"value": "150.00",
"denom": "ssusd",
"usd_value": "150.00"
},
"status": "completed",
"splits": [
{
"recipient": "stateset1merchantaddress123",
"amount": "135.00",
"type": "merchant",
"tx_hash": "C6F8B3E0A6D9F4B7E3A6E9D4B7F0C3E8"
},
{
"recipient": "stateset1platformfeeaddress456",
"amount": "15.00",
"type": "platform_fee",
"tx_hash": "D7G9C4F1B7E0A5C8F4B7F0E5C8G1D4F9"
}
]
},
"order": {
"order_id": "order_1234567890",
"status": "processing",
"payment_status": "paid",
"paid_at": "2024-01-15T10:30:05Z"
}
}
Show properties
Show properties
curl --location --request POST 'https://api.stateset.network/v1/order/pay' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"order_id": "order_1234567890",
"payment_method": {
"type": "ssusd",
"wallet_address": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"amount": {
"value": "150.00",
"denom": "ssusd"
},
"chain": "stateset"
},
"split_payments": [
{
"recipient": "stateset1merchantaddress123",
"amount": "135.00",
"type": "merchant"
},
{
"recipient": "stateset1platformfeeaddress456",
"amount": "15.00",
"type": "platform_fee"
}
],
"metadata": {
"memo": "Payment for Order #1234567890",
"reference_number": "INV-2024-001",
"idempotency_key": "pay_order_1234567890_001"
}
}'
{
"success": true,
"transaction": {
"tx_hash": "B5E7A2D9F3C8E1A4D6B9C3F7E2A5D8B1E4C7F9A2D5B8E1C4F7A9D2E5B8C1F4A7",
"block_height": 1234567,
"timestamp": "2024-01-15T10:30:05Z",
"gas_used": "75000",
"chain": "stateset"
},
"payment": {
"payment_id": "pay_9h8g7f6e5d4c3b2a",
"order_id": "order_1234567890",
"amount": {
"value": "150.00",
"denom": "ssusd",
"usd_value": "150.00"
},
"status": "completed",
"splits": [
{
"recipient": "stateset1merchantaddress123",
"amount": "135.00",
"type": "merchant",
"tx_hash": "C6F8B3E0A6D9F4B7E3A6E9D4B7F0C3E8"
},
{
"recipient": "stateset1platformfeeaddress456",
"amount": "15.00",
"type": "platform_fee",
"tx_hash": "D7G9C4F1B7E0A5C8F4B7F0E5C8G1D4F9"
}
]
},
"order": {
"order_id": "order_1234567890",
"status": "processing",
"payment_status": "paid",
"paid_at": "2024-01-15T10:30:05Z"
}
}
| Code | Description |
|---|---|
INSUFFICIENT_FUNDS | The wallet does not have enough USDC to complete the payment |
ORDER_NOT_FOUND | The specified order ID does not exist |
ORDER_ALREADY_PAID | The order has already been paid |
INVALID_WALLET_ADDRESS | The provided wallet address is invalid |
PAYMENT_EXPIRED | The payment window for this order has expired |
NETWORK_ERROR | There was an error communicating with the blockchain |
SMART_CONTRACT_ERROR | The smart contract execution failed |