Resources
The Marketplace API is for approved sellers who run their own license system. It lets your system check a buyer's purchase code and be told at once when an order is paid or refunded. Buyers and traders do not need it.
Every marketplace order has a purchase code such as AIO-7KQ2-M9XD-P4TC. The buyer sees it on the order page and in the order e-mail. You can use it in two ways, alone or together:
Base URL: https://all-n-one-trading-ecosystem.com/market_api.php. All answers are JSON.
Create your key in Seller center → License system. It starts with aio_sk_ and is shown once; we keep only a hash of it. Creating a new key replaces the old one.
Send the key in a header with every request:
Authorization: Bearer aio_sk_your_key_hereX-Api-Key: aio_sk_... is accepted as well. Keep the key on your server; never put it inside an EA or an app that customers download.
GET /market_api.php?action=pingAnswers your store name when the key is valid:
{
"ok": true,
"store": "Your Store",
"seller_id": 12,
"time": "2026-11-22T10:15:00Z"
}GET /market_api.php?action=verify&code=AIO-7KQ2-M9XD-P4TCSpaces, missing dashes and lower case in the code are forgiven. Example with curl:
curl -H "Authorization: Bearer aio_sk_your_key_here" \
"https://all-n-one-trading-ecosystem.com/market_api.php?action=verify&code=AIO-7KQ2-M9XD-P4TC"Answer for an order of your store:
{
"ok": true,
"purchase_code": "AIO-7KQ2-M9XD-P4TC",
"valid": true,
"status": "active",
"order_id": 1042,
"product": { "id": 31, "name": "Your Product", "sku": "YOURSKU" },
"plan": { "label": "1 month", "months": 1, "lifetime": false },
"amount": 49,
"currency": "USD",
"purchased_at": "2026-11-20T09:30:00Z",
"expires_at": "2026-12-20T09:30:00Z",
"refunded_at": null,
"buyer": { "name": "Buyer Name", "email": "buyer@example.com", "country": "United Kingdom" }
}| Field | Meaning |
|---|---|
valid | true while the purchase is active: not refunded and not expired. Give access only when it is true. |
status | active, expired or refunded. |
plan.lifetime | true for a one-time purchase without an end; expires_at is then null. |
expires_at | End of the paid period (UTC). Renewals move it forward. |
buyer | The buyer's name, e-mail and country, for your records. Use them only to deliver and support the purchase. |
You only see orders of your own store: a code that belongs to another seller answers not_found.
The code AIO-TEST-TEST-TEST always answers a sample purchase of your first product, marked "test": true. Use it to build and test your integration without a real order.
| HTTP | error | Meaning |
|---|---|---|
| 400 | bad_code | The text is not a purchase code. |
| 400 | unknown_action | Use action=verify or action=ping. |
| 401 | missing_key / invalid_key | No key was sent, or the key was replaced or is wrong. |
| 404 | not_found | No order of your store has this code. |
| 429 | rate_limited | More than 60 requests a minute with one key. |
Every error has "ok": false and a readable message. Check a code when the buyer activates and then at a sensible interval (for example once a day), not on every start of your product.
Enter a webhook URL (https) in Seller center → License system. We then send a POST with a JSON body for these events:
| event | When |
|---|---|
order.paid | A buyer's payment for your product is confirmed. |
order.refunded | An order was refunded: remove the access. |
test | You clicked "Send a test event" in the seller center. |
{
"event": "order.paid",
"created_at": "2026-11-20T09:30:02Z",
"data": { ...the same fields as the verify answer... }
}Each request has two headers: X-AIO-Timestamp and X-AIO-Signature: sha256=.... The signature is the HMAC-SHA256 of timestamp + "." + raw body with your webhook secret. Reject a request whose signature does not match.
<?php
$secret = "your webhook secret";
$body = file_get_contents("php://input");
$ts = $_SERVER["HTTP_X_AIO_TIMESTAMP"] ?? "";
$sig = $_SERVER["HTTP_X_AIO_SIGNATURE"] ?? "";
$expect = "sha256=" . hash_hmac("sha256", $ts . "." . $body, $secret);
if (!hash_equals($expect, $sig)) { http_response_code(401); exit; }
$event = json_decode($body, true);
// $event["event"], $event["data"]["purchase_code"], ...
http_response_code(200);Answer with HTTP 2xx within a few seconds. If your server does not answer, we try again after 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours. The same event can arrive more than once, so make your handler safe to repeat.
The seller guide shows where these settings are, and how selling works in general. Questions about your integration: open a ticket. Not a seller yet? Open your store.