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.
https://5go.co- 1
Get an API Key
Sign in and go to Account › Purchase API to create a key and register your website server IP.
- 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
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
- 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.
- 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.
- 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.
- 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"
/api/profile.phpAccount info and wallet balance
Parameters
| X-API-Key | Required | Your 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" }
}/api/products.phpCategories and products (prices for your tier)
Parameters
| X-API-Key | Required | Your API Key in this header; the legacy api_key parameter can be used instead |
| lang | Optional | Query 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" }
]
}
]
}/api/product.phpA single product
Parameters
| X-API-Key | Required | Your API Key in this header; the legacy api_key parameter can be used instead |
| product | Required | Product 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 }
]
}/api/buy_productPOST purchase: action=buyProduct, id, amount; coupon and client_order_id are optional
Parameters
| action | Required | Always buyProduct |
| X-API-Key | Required | Your API Key in this header; the legacy api_key parameter can be used instead |
| id | Required | ID of the product to buy |
| amount | Required | Quantity (within the product's min – max) |
| coupon | Optional | Coupon code |
| client_order_id | Optional | Recommended 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-Key | Optional | Header 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"]
}/api/order.phpLegacy delivery lookup; returns 404 when no accounts are available yet
Parameters
| X-API-Key | Required | Your API Key in this header; the legacy api_key parameter can be used instead |
| order | Required | Order code (trans_id) returned when buying |
Sample response
{
"status": "success",
"msg": "Order retrieved successfully!",
"trans_id": "AW261012A6YQJM7H",
"data": ["uid|password|2fa", "uid|password|2fa"]
}/api/order_status.phpOrder, payment, delivery and refund facts by order or client_order_id
Parameters
| X-API-Key | Required | Your API Key in this header; the legacy api_key parameter can be used instead |
| order | Optional | Order 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_id | Optional | Reference supplied with the original purchase, or provide order. References are scoped to your reseller account. |
| lang | Optional | Query 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.