For resellers

Purchase API documentation

Connect an existing SHOPCLONE7 POST client or build a new reseller integration. New websites can prevent duplicate purchases with a stable reference and recover order, delivery and refund facts through order_status.php.

Get API Key
Domainhttps://5go.co
  1. 1

    Get an API Key

    Sign in and go to Account › Purchase API to create a key and register your website server IP.

  2. 2

    Connect your website

    Use this domain and your API Key on your server. Save one stable client_order_id before each new purchase.

  3. 3

    Sync and sell

    Sync products and prices, pay with your wallet, then compare delivery counts before fulfilling your customer order.

Authentication

Send the X-API-Key header from your server; the legacy api_key query/body parameter is also accepted. Purchases require POST with multipart, urlencoded or JSON data. GET /api/buy_product returns 405. Keep the key out of browser code and logs.

curl -X POST "https://5go.co/api/buy_product?lang=en" \
  -H "X-API-Key: YOUR_API_KEY" \
  --data-urlencode "action=buyProduct" \
  --data-urlencode "id=12" --data-urlencode "amount=2" \
  --data-urlencode "client_order_id=SHOP-20261018-0001"

Prevent duplicate purchases and recover results

  1. Save a unique client_order_id before sending POST. Reuse it with the same id, amount and coupon on a retry; replayed=true identifies an existing purchase and does not charge again. Without a reference, legacy purchases have no duplicate protection.
  2. If POST times out, use GET order_status.php with the original client_order_id even if no trans_id arrived. A 404 can occur while the first request is still running. Keep the reference and do not create a new purchase reference.
  3. status="success" does not mean delivery is complete. Require delivery_status=delivered, requested_amount and delivered_amount matching your original quantity, and remaining_amount=0. data is the current complete snapshot; replace the previous snapshot instead of appending it.
  4. currency and total describe the 5GO order. refunded_total records completed 5GO refunds; wallet_refunded_total records refunds credited to your 5GO wallet. These are not automatic refunds to customers on your website. remaining_amount is not a confirmed refundable quantity.

delivery_status: pending = waiting, partial = incomplete, delivered = complete, cancelled = cancelled, refunded = fully refunded, needs_review = manual review. Follow poll_after_seconds for pending/partial and review other exceptional states before fulfilling or refunding.

curl --get "https://5go.co/api/order_status.php" \
  -H "X-API-Key: YOUR_API_KEY" \
  --data-urlencode "lang=en" \
  --data-urlencode "client_order_id=SHOP-20261018-0001"
GET/api/profile.php

Account info and wallet balance

Parameters

X-API-KeyRequiredYour API Key in this header; the legacy api_key parameter can be used instead

Sample response

{
  "status": "success",
  "msg": "Data retrieved successfully!",
  "data": { "username": "reseller01", "money": "1250.5", "currency": "THB" }
}
GET/api/products.php

Categories and products (prices for your tier)

Parameters

X-API-KeyRequiredYour API Key in this header; the legacy api_key parameter can be used instead
langOptionalQuery parameter for product names and messages: th, en

Sample response

{
  "status": "success",
  "msg": "Data retrieved successfully!",
  "categories": [
    {
      "id": "1", "parent_id": 0, "name": "Facebook", "icon": "https://.../facebook.png",
      "products": [
        { "id": "12", "name": "Facebook US | 2FA", "price": "35", "amount": 80,
          "description": "...", "flag": "us", "min": "1", "max": "500" }
      ]
    }
  ]
}
GET/api/product.php

A single product

Parameters

X-API-KeyRequiredYour API Key in this header; the legacy api_key parameter can be used instead
productRequiredProduct ID

Sample response

{
  "status": "success",
  "msg": "Data retrieved successfully!",
  "product": [
    { "id": "12", "name": "Facebook US | 2FA", "price": "35", "amount": 80,
      "description": "...", "flag": "us", "min": 1, "max": 500 }
  ]
}
POST/api/buy_product

POST purchase: action=buyProduct, id, amount; coupon and client_order_id are optional

Parameters

actionRequiredAlways buyProduct
X-API-KeyRequiredYour API Key in this header; the legacy api_key parameter can be used instead
idRequiredID of the product to buy
amountRequiredQuantity (within the product's min – max)
couponOptionalCoupon code
client_order_idOptionalRecommended for new purchases: unique per reseller account, 1–128 characters, starting with a letter or digit; letters, digits, . _ : - are allowed. Retry with the same reference, id, amount and coupon.
Idempotency-KeyOptionalHeader alias for client_order_id. If both are sent, their values must match.

Sample response

{
  "status": "success",
  "msg": "Order created successfully!",
  "trans_id": "AW261012A6YQJM7H",
  "client_order_id": "SHOP-20261018-0001",
  "replayed": false,
  "order_status": "COMPLETED",
  "payment_status": "PAID",
  "delivery_status": "delivered",
  "requested_amount": 2,
  "delivered_amount": 2,
  "remaining_amount": 0,
  "currency": "THB",
  "total": "70.00",
  "refunded_total": "0.00",
  "wallet_refunded_total": "0.00",
  "poll_after_seconds": null,
  "data": ["demo_user_01|demo_password_01", "demo_user_02|demo_password_02"]
}
GET/api/order.php

Legacy delivery lookup; returns 404 when no accounts are available yet

Parameters

X-API-KeyRequiredYour API Key in this header; the legacy api_key parameter can be used instead
orderRequiredOrder code (trans_id) returned when buying

Sample response

{
  "status": "success",
  "msg": "Order retrieved successfully!",
  "trans_id": "AW261012A6YQJM7H",
  "data": ["uid|password|2fa", "uid|password|2fa"]
}
GET/api/order_status.php

Order, payment, delivery and refund facts by order or client_order_id

Parameters

X-API-KeyRequiredYour API Key in this header; the legacy api_key parameter can be used instead
orderOptionalOrder code (trans_id), or provide client_order_id. At least one is required; if both are provided they must identify the same order.
client_order_idOptionalReference supplied with the original purchase, or provide order. References are scoped to your reseller account.
langOptionalQuery parameter for product names and messages: th, en

Sample response

{
  "status": "success",
  "msg": "Order retrieved successfully!",
  "trans_id": "AW261012A6YQJM7H",
  "client_order_id": "SHOP-20261018-0001",
  "replayed": false,
  "order_status": "CONFIRMED",
  "payment_status": "PAID",
  "delivery_status": "partial",
  "requested_amount": 2,
  "delivered_amount": 1,
  "remaining_amount": 1,
  "currency": "THB",
  "total": "70.00",
  "refunded_total": "0.00",
  "wallet_refunded_total": "0.00",
  "poll_after_seconds": 5,
  "data": ["demo_user_01|demo_password_01"]
}

Error codes

Errors include status="error", msg, error_code and an HTTP code. Use structured fields for decisions; messages depend on language.

{ "status": "error", "msg": "...", "error_code": "IDEMPOTENCY_CONFLICT" }
  • 400Missing parameter, invalid ID or quantity, not enough stock
  • 401Invalid API Key or locked account
  • 402Insufficient wallet balance
  • 403IP not in the allowed list (includes client_ip)
  • 404Product or order not found; legacy order.php also uses 404 when no delivery data is ready
  • 405The purchase endpoint accepts POST only
  • 409IDEMPOTENCY_CONFLICT: the reference was already used for a different purchase; review the original order
  • 429Too many requests, please wait
  • 503API or delivery data unavailable, or the order is closed. This code alone does not confirm a refund; check the original order.

Notes

  • Returned prices are your own tier prices, in the store's base currency.
  • Orders are paid from your wallet balance — top up first on the Top up page.
  • Queue purchases for the same reseller account. On 429, follow Retry-After or retry_after_seconds when provided and reduce request frequency.
  • Use order_status.php for pending or closed orders: an existing order can return data=[]. Legacy order.php still returns 404 when no accounts are available. A missing reference is not proof that an in-progress purchase cannot commit later.