Orders API
Retrieve and manage customer orders
Orders API
Access and manage orders placed in your store.
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/orders | List all orders |
POST | /v1/orders | Create a new order |
GET | /v1/orders/:id | Get order details |
PATCH | /v1/orders/:id | Update order |
List Orders
Retrieve a paginated list of orders with optional filtering.
GET /v1/ordersQuery Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
limit | integer | Items per page (default: 25, max: 100) |
status | string | Filter by status |
email | string | Filter by customer email |
product_id | string | Filter by product ID |
Example Request
curl -X GET "https://api.sellgate.cc/v1/orders?status=completed&limit=50" \
-H "Authorization: Bearer sg_live_your_api_key"const response = await fetch(
'https://api.sellgate.cc/v1/orders?status=completed&limit=50',
{ headers: { 'Authorization': 'Bearer sg_live_your_api_key' } }
);
const data = await response.json();import requests
response = requests.get(
'https://api.sellgate.cc/v1/orders',
params={'status': 'completed', 'limit': 50},
headers={'Authorization': 'Bearer sg_live_your_api_key'}
)
data = response.json()Response
{
"data": [
{
"id": "ord_abc123",
"invoice_id": "INV-12345",
"order_number": "ORD-001",
"product_id": "prod_xyz789",
"product_name": "Premium License",
"variant_id": null,
"buyer_email": "customer@example.com",
"quantity": 1,
"total_amount": 29.99,
"currency": "USD",
"status": "completed",
"payment_method": "crypto",
"crypto_currency": "BTC",
"crypto_amount": 0.00045,
"payment_address": "bc1q...",
"amount_paid": 0.00045,
"txid": "abc123...",
"confirmations": 3,
"coupon_id": null,
"discount_amount": null,
"customer_ip": "192.168.1.1",
"customer_country": "United States",
"customer_country_code": "US",
"created_at": "2025-12-29T10:30:00Z",
"expires_at": "2025-12-29T11:00:00Z",
"completed_at": "2025-12-29T10:35:00Z"
}
],
"meta": {
"total": 156,
"limit": 25,
"offset": 0
}
}Create Order
Create a new order programmatically. This is useful for custom checkout integrations.
POST /v1/ordersRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
product_id | string | Yes | Product ID to order |
buyer_email | string | Yes | Customer's email address |
payment_method | string | Yes | Payment method (see below) |
quantity | integer | No | Quantity to order (default: 1) |
variant_id | string | No | Product variant ID |
coupon_code | string | No | Coupon code to apply |
customer_ip | string | No | Customer's IP address |
customer_country | string | No | Customer's country name |
customer_country_code | string | No | Customer's country code |
Payment Methods
SellGate Wallet (Crypto)
crypto_btc, crypto_ltc, crypto_eth, crypto_sol
FlexPay (Native)
flexpay_BTC, flexpay_LTC, flexpay_ETH, flexpay_SOL
FlexPay (USDT)
flexpay_USDT_TRC20, flexpay_USDT_ERC20, flexpay_USDT_BEP20, flexpay_USDT_SOL, flexpay_USDT_TON, flexpay_USDT_MATIC
FlexPay (USDC)
flexpay_USDC_ERC20, flexpay_USDC_BEP20, flexpay_USDC_SOL, flexpay_USDC_MATIC, flexpay_USDC_TRC20
Traditional
stripe, paypal
Payment methods must be enabled for both the store and the product. The API will return an error if you try to use a disabled payment method.
Example Request
curl -X POST "https://api.sellgate.cc/v1/orders" \
-H "Authorization: Bearer sg_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"product_id": "prod_xyz789",
"buyer_email": "customer@example.com",
"payment_method": "crypto_btc",
"quantity": 1
}'const response = await fetch('https://api.sellgate.cc/v1/orders', {
method: 'POST',
headers: {
'Authorization': 'Bearer sg_live_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
product_id: 'prod_xyz789',
buyer_email: 'customer@example.com',
payment_method: 'crypto_btc',
quantity: 1
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.sellgate.cc/v1/orders',
json={
'product_id': 'prod_xyz789',
'buyer_email': 'customer@example.com',
'payment_method': 'crypto_btc',
'quantity': 1
},
headers={'Authorization': 'Bearer sg_live_your_api_key'}
)
data = response.json()Response
{
"data": {
"id": "ord_abc123",
"invoice_id": "INV-M5KX2H-ABC1",
"order_number": "ORD-M5KX2H-XYZ9",
"product_id": "prod_xyz789",
"product_name": "Premium License",
"variant_id": null,
"buyer_email": "customer@example.com",
"quantity": 1,
"total_amount": 29.99,
"currency": "USD",
"status": "pending",
"payment_method": "crypto_btc",
"crypto_currency": "BTC",
"crypto_amount": 0.00045123,
"payment_address": "bc1q...",
"expires_at": "2025-12-29T11:00:00Z",
"created_at": "2025-12-29T10:30:00Z",
"discount_amount": null
}
}Get Order
Retrieve detailed information about a specific order.
GET /v1/orders/:idReturns the same fields as the list endpoint, plus delivered_content for completed orders.
Update Order
Update order details.
PATCH /v1/orders/:idRequest Body
| Field | Type | Description |
|---|---|---|
status | string | New order status |
Order Statuses
pending
Order created, awaiting payment
confirming
Payment detected, awaiting confirmations
completed
Order fulfilled successfully
refunded
Order has been refunded
cancelled
Order was cancelled
expired
Payment window expired