SellGate API

Orders API

Retrieve and manage customer orders

Orders API

Access and manage orders placed in your store.

Endpoints Overview

MethodEndpointDescription
GET/v1/ordersList all orders
POST/v1/ordersCreate a new order
GET/v1/orders/:idGet order details
PATCH/v1/orders/:idUpdate order

List Orders

Retrieve a paginated list of orders with optional filtering.

GET /v1/orders

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page (default: 25, max: 100)
statusstringFilter by status
emailstringFilter by customer email
product_idstringFilter 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/orders

Request Body

FieldTypeRequiredDescription
product_idstringYesProduct ID to order
buyer_emailstringYesCustomer's email address
payment_methodstringYesPayment method (see below)
quantityintegerNoQuantity to order (default: 1)
variant_idstringNoProduct variant ID
coupon_codestringNoCoupon code to apply
customer_ipstringNoCustomer's IP address
customer_countrystringNoCustomer's country name
customer_country_codestringNoCustomer'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/:id

Returns the same fields as the list endpoint, plus delivered_content for completed orders.


Update Order

Update order details.

PATCH /v1/orders/:id

Request Body

FieldTypeDescription
statusstringNew 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


Order Object Fields

On this page