Get started on the G2G OpenAPI with our guide on managing your information on G2G. The G2G OpenAPI can provide the following functionalities for our sellers:
Access keys consist of an access key ID and secret access key.
To access G2G OpenAPI, you will need to request from G2G.
When your request to access G2G OpenAPI is approved, you can create access keys from G2G OpenAPI management page. You authenticate with our API by providing the appropriate key in the request Authorization header. Never share your secret keys. Keep them guarded and secure.
Authentication is handled via HTTP headers, as shown in the table below:
Param | Type | Descritpion |
---|---|---|
g2g-api-key | String | Your access key ID created in G2G. Example: c09222e3fc40ffb25fc947f738b1abf1 |
g2g-userid | String | Your G2G user ID. Example: 509205 |
g2g-signature | String | Signature generated by API path, api_key, user_id and timestamp via HMAC-SHA256 hashing algorithm. Example: e318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2 |
g2g-timestamp | timestamp | This is to indicate the timestamp of the request, in miliseconds. Required for all requests. Expires in 5 minutes. Example: 1654675838694 |
Login to https://www.g2g.com/.
On top right of the menu bar, click on your avatar, select API Integration.
Request API integration access if you have not gotten permission to use G2G OpenAPI.
On the API integration page, click "Generate key" to generate the G2G API and Secret key.
var CryptoJS = require("crypto-js");
const secretKey = "dJirm8nG5AqQWoh7J5EHw3373Dk95zjRHaQ3gnv99kw"; // Your API Secret Key
const apiKey = "b5769724c1cb1d52c58717d3d12ae2fe"; // Your API Key
const userId = "100000"; // Your User ID
const timestamp = "1653278884000"; // g2g-timestamp
const canonicalUrl = "/v1/offers/G1650445167989US/inventory_items/ba8551d9-47e3-424a-a809-4f043059eefb"; // API Endpoint
let canonicalString = canonicalUrl + apiKey + userId + String(timestamp);
const signature = CryptoJS.HmacSHA256(canonicalString, secretKey);
console.log(String(signature)) // This value should match with g2g-signature, which is 0884a10b8d07d9fb69cccd3ae0d00fdfbedc6b74fff22ed86b14cd235e73268c
import hashlib, hmac
secret_key = "dJirm8nG5AqQWoh7J5EHw3373Dk95zjRHaQ3gnv99kw" # Your API Secret Key
api_key = "b5769724c1cb1d52c58717d3d12ae2fe" # Your API Key
user_id = "100000" # Your User ID
timestamp = "1653278884000" # g2g-timestamp
canonical_url = "/v1/offers/G1650445167989US/inventory_items/ba8551d9-47e3-424a-a809-4f043059eefb" # API Endpoint
canonical_string = canonical_url + api_key + user_id + str(timestamp);
signature = hmac.new(
key=bytes(secret_key.encode("utf8")),
msg=bytes(canonical_string.encode("utf8")),
digestmod=hashlib.sha256,
).hexdigest()
print(signature) # This value should match with g2g-signature, which is 0884a10b8d07d9fb69cccd3ae0d00fdfbedc6b74fff22ed86b14cd235e73268c
$secret_key = "dJirm8nG5AqQWoh7J5EHw3373Dk95zjRHaQ3gnv99kw"; // Your API Secret Key
$api_key = "b5769724c1cb1d52c58717d3d12ae2fe"; // Your API Key
$user_id = "100000"; // Your User ID
$timestamp = "1653278884000"; // g2g-timestamp
$canonical_url = "/v1/offers/G1650445167989US/inventory_items/ba8551d9-47e3-424a-a809-4f043059eefb"; // API Endpoint
$canonical_string = $canonical_url.$api_key.$user_id.(string)$timestamp;
$signature = hash_hmac("sha256", $canonical_string, $secret_key);
echo $signature; // This value should match with g2g-signature, which is 0884a10b8d07d9fb69cccd3ae0d00fdfbedc6b74fff22ed86b14cd235e73268c
Top Up only supported in V2
Order Delivery Flow is mainly for Top Up order.
delivery_method_list
will be returned in the response.delivery_method_list
, lookup attribute_group_list
.{
"attribute_group_list": [
{
"attribute_group_id": "e02308e5",
"attribute_group_name": "User ID",
"input_field": "text",
"input_settings": {},
"is_required": true,
"attribute_key": "delivery_info_1",
"attribute_list": []
},
{
"attribute_group_id": "1759fb6c",
"attribute_group_name": "Servers (Ragnarok X: Next Generation)",
"input_field": "dropdown",
"input_settings": {
"is_searchable": false
},
"is_required": true,
"attribute_key": "delivery_info_2",
"attribute_list": [
{
"attribute_id": "98f0250f",
"attribute_name": "Aldebaran",
"sub_attribute_list": []
},
{
"attribute_id": "6ab853d2",
"attribute_name": "Angeling",
"sub_attribute_list": []
},
... // more options
]
}
]
}
text
field, which is refers to User ID
input and the attribute_key
is delivery_info_1
.dropdown
field, which is refers to Server
input and the attribute_key
is delivery_info_2
.attribute_key
for integration instead of attribute_group_id
or attribute_group_name
.order.api_delivery
and delivery_method_list
will be provided in the payload.{
"delivery_method_list": [
{
"attribute_group_id": "e02308e5",
"attribute_group_name": "User ID",
"attribute_key": "delivery_info_1",
"attribute_id": "",
"attribute_value": "",
"value": "hello_world"
},
{
"attribute_group_id": "1759fb6c",
"attribute_group_name": "Servers (Ragnarok X: Next Generation)",
"attribute_key": "delivery_info_2",
"attribute_id": "98f0250f",
"attribute_value": "Aldebaran",
"value": ""
}
]
}
delivery_info_1
refers to User ID
and hello_world
is the User ID provided by buyer.delivery_info_2
refers to Servers
and Aldebaran
is the server chosen by buyer.# | Order Status | Description |
---|---|---|
1 | unpaid | Buyer started the checkout process but not yet complete the payment. |
2 | cancelled | Order is cancelled. |
3 | unpaid (rollback from cancelled) | A cancelled order is moved back to unpaid. |
4 | paid | Buyer has completed the checkout process and payment is done and confirmed. |
5 | start_delivering | Delivery is ready. |
6 | delivering | Delivery in progress. |
7 | awaiting_buyer_confirmation | Delivery completed, pending buyer to confirm order received. |
8 | delivered | Buyer has confirmed order received. Quantities in the order is fully delivered. |
9 | partial_delivered | Buyer has confirmed order received. Only some quantities in the order is delivered. |
10 | delivering (rollback from delivered / partial_delivered) | Buyer reported issue after confirmed receipt. |
11 | refunded | Quantity is refunded due to not receiving or defect. |
The following code snippet is a sample error response that contains an error code and message pair:
{
"code": 40400001,
"message": "The requested resource does not exist.",
"warning": "",
"request_id": "595285dc-9c43-4b9c-a1e6-0cd9aff5b084",
"payload": {}
}
When troubleshooting the error, you can divide the error code into two components: REST API HTTP status code and error category code. See the following error code sample:
40400001
404
The following table summarizes the HTTP response codes you may receive from the G2GOpen API.
Status Code | Description |
---|---|
200 | Everything worked as expected. |
400 | The request was unacceptable, often due to missing a required parameter, incorrect data type or incorrect request schema. |
401 | No valid API key provided. For eg:
|
403 | The API key doesn't have permissions to perform the request. |
404 | The requested resource doesn't exist. |
409 | The request conflicts with another request. |
422 | Unprocessable Entity. |
429 | The request cannot be completed because client have exceeded his rate limits. |
500 | Something went wrong on G2GOpenAPI’s end, these are rare. |
Code | Descritpion |
---|---|
40000001 | The request was unacceptable, often due to missing a required parameter. |
40100001 | The request is not authorized and cannot access the requested resource. |
40300001 | The application identified with the request is not available. |
40400001 | The requested resource does not exist. |
40900001 | The requested resource already exists. |
40900002 | Data constraint violation. |
42200001 | Validation error. |
42900001 | Throttle request. |
50000001 | The server encounters an unexpected exception while trying to process the request. Please retry the request. |
Version | Descritpion |
---|---|
V1 | Deprecated. We encourage to use the latest version of G2G OpenAPI. |
V2 | Current version of G2G OpenAPI. |
Please visit https://github.com/g2g-official/open-api-sample to download the sample postman collection as a reference to kickstart your API integration.
Get list of all available services.
language | string Default: "en" Enum: "en" "zh-CN" "id" "zh-TW" Language |
{- "code": 20000001,
- "message": "",
- "warning": "",
- "request_id": "595285dc-9c43-4b9c-a1e6-0cd9aff5b084",
- "payload": {
- "service_list": [
- {
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "service_name": "Gift Cards",
- "categories": [
- {
- "category_name": "Gift Cards",
- "category_id": "f6fc99db-96d2-4158-a29f-663d9a2f6199"
}, - {
- "category_name": "Video Games",
- "sub_categories": [
- {
- "category_name": "PC Platform",
- "category_id": "2994a61d-3993-44ba-8190-e3daac599278"
}, - {
- "category_name": "PSN (Playstation) Platform",
- "category_id": "96364cef-838f-49c0-9efb-0fa90dfa06d2"
}, - {
- "category_name": "Xbox Platform",
- "category_id": "148255f6-4ab4-4af4-833d-4deedb4fd574"
}, - {
- "category_name": "Nintendo Switch Platform",
- "category_id": "dc67a04b-3aa1-460c-aaa3-549ebecb3404"
}
]
}
]
}
]
}
}
Get brands of a service.
service_id required | string <uuid> Example: 44b3148a-0dc8-4262-81d8-c762559f0d74 The unique identifier of a service. Note: This API have a limit of 1000 results per request |
language | string Default: "en" Enum: "en" "zh-CN" "id" "zh-TW" Language |
q | string Example: q=itunes Search brands by keyword. |
after | string <uuid> Example: after=ba683457-f9d0-4330-bea7-923ed300d2e5 Retrieve next set of brands. |
{- "code": 20000001,
- "message": "",
- "warning": "",
- "request_id": "595285dc-9c43-4b9c-a1e6-0cd9aff5b084",
- "payload": {
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_list": [
- {
- "brand_id": "8c42b2d4-6d2c-4188-931a-240d2f94183f",
- "brand_name": "Apple iTunes"
}, - {
- "brand_id": "lgc_game_25055",
- "brand_name": "PlayStation Network"
}
], - "after": "lgc_game_25055"
}
}
Get products of a brand.
category_id | string <uuid> Example: category_id=f6fc99db-96d2-4158-a29f-663d9a2f6199 The unique identifier of a category. |
service_id | string <uuid> Example: service_id=44b3148a-0dc8-4262-81d8-c762559f0d74 The unique identifier of a service. Required when category_id is not provided |
brand_id | string <uuid> Example: brand_id=8c42b2d4-6d2c-4188-931a-240d2f94183f The unique identifier of a brand. Required when service_id is provided |
q | string Example: q=itunes Search products by brand keyword. |
{- "code": 20000001,
- "message": "",
- "warning": "",
- "request_id": "5cd2b212-868f-4d0a-b05f-37e93a37529b",
- "payload": {
- "product_list": [
- {
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_id": "8c42b2d4-6d2c-4188-931a-240d2f94183f",
- "product_id": "814298ea-fd9f-4741-8134-f5fef5614714",
- "category_id": "f6fc99db-96d2-4158-a29f-663d9a2f6199",
- "product_name": "Gift Cards > Apple iTunes > JP",
- "service_name": "Gift Cards",
- "brand_name": "Apple iTunes",
- "region_name": "JP"
}, - {
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_id": "8c42b2d4-6d2c-4188-931a-240d2f94183f",
- "product_id": "3c0d0298-408d-43b4-b069-8a56d9d5ac08",
- "category_id": "f6fc99db-96d2-4158-a29f-663d9a2f6199",
- "product_name": "Gift Cards > Apple iTunes > RU",
- "service_name": "Gift Cards",
- "brand_name": "Apple iTunes",
- "region_name": "RU"
}, - {
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_id": "8c42b2d4-6d2c-4188-931a-240d2f94183f",
- "product_id": "4a610301-4e3a-4cc7-b242-35ebc1a521a7",
- "category_id": "f6fc99db-96d2-4158-a29f-663d9a2f6199",
- "product_name": "Gift Cards > Apple iTunes > US",
- "service_name": "Gift Cards",
- "brand_name": "Apple iTunes",
- "region_name": "US"
}
]
}
}
Get attributes of a product.
product_id required | string <uuid> Example: 4a610301-4e3a-4cc7-b242-35ebc1a521a7 The unique identifier of a product. |
{- "request_id": "e48919cd-12be-4005-ba09-fe4004f08925",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "product_id": "c9bf2323-fa8d-4c88-acc8-87d2ced62b72",
- "attribute_group_list": [
- {
- "attribute_group_id": "30258ae5-3143-441d-95a4-cd6b2d69b503",
- "attribute_group_name": "Denomination",
- "input_field": "dropdown",
- "is_required": true,
- "attribute_list": [
- {
- "attribute_id": "e3c21690-d2c3-436e-9137-c554e1938ee8",
- "attribute_name": "Karma Koin USD100"
}, - {
- "attribute_id": "a4591035-5956-43b2-aabc-f6b9a7ce5bcf",
- "attribute_name": "Karma Koin USD50"
}
]
}
], - "delivery_method_list": [
- {
- "delivery_code": "direct_top_up",
- "delivery_method_id": "k8ej93u6-5956-43b2-aabc-f6b9a7ce5bcf",
- "delivery_method_name": "Direct Top Up",
- "attribute_group_list": [
- {
- "attribute_group_id": "10533bad",
- "attribute_group_name": "Account ID",
- "attribute_key": "delivery_info_1",
- "input_field": "text",
- "input_settings": {
- "max_length": "20",
- "min_length": 1
}, - "is_required": true,
- "attribute_list": [ ]
}, - {
- "attribute_group_id": "0283e116",
- "attribute_group_name": "Server",
- "attribute_key": "delivery_info_2",
- "input_field": "dropdown",
- "input_settings": {
- "is_searchable": true
}, - "is_required": true,
- "attribute_list": [
- {
- "attribute_id": "e3c21690-d2c3-436e-9137-c554e1938ee8",
- "attribute_name": "MiskaTown",
- "sub_attribute_list": [ ]
}, - {
- "attribute_id": "a4591035-5956-43b2-aabc-f6b9a7ce5bcf",
- "attribute_name": "SandCastle",
- "sub_attribute_list": [ ]
}
]
}, - {
- "attribute_group_id": "10533bad",
- "attribute_group_name": "Login",
- "attribute_key": "delivery_info_3",
- "input_field": "text",
- "input_settings": {
- "max_length": "20",
- "min_length": 1
}, - "is_required": true,
- "attribute_list": [ ]
}
]
}
], - "additional_info_list": [
- {
- "attribute_group_id": "10533bad",
- "attribute_group_name": "Special note to seller",
- "attribute_key": "additional_info_1",
- "input_field": "textarea",
- "input_settings": {
- "max_length": "128",
- "min_length": 1
}, - "is_required": true,
- "attribute_list": [ ]
}
]
}
}
Create a new offer.
product_id required | string <uuid> The unique identifier of the product. |
title | string The title of an offer. Not applicable for Giftcard & Top Up |
description | string Description of an offer. Not applicable for Giftcard |
min_qty required | integer >= 1 Minimum purchase quantity. |
api_qty required | int >= 0 The quantity of stock to sell in G2G via OpenAPI. |
low_stock_alert_qty required | int >= 0 When reach low_stock_alert_qty, will receive offer.low_stock webhook |
required | Array of objects[ items ] |
currency required | string Currency ISO code. Reference |
unit_price required | number <double> > 0 Unit price of an offer item. |
Array of objects [ 1 .. 3 ] items [ items ] | |
Array of objects[ items ] Other currency pricing that you may have for an offer. | |
Array of objects[ items ] The wholesale detail setting for other currency that you may have for an offer. | |
object Setting to allow or disallowed buyer from specific country to purchase the offer. Default global, no country restriction | |
delivery_method_ids | Array of strings <uuid> A list of uid string that respresent delivery method of an offer. Does not required for Gift Card offer |
{- "product_id": "c9bf2323-fa8d-4c88-acc8-87d2ced62b72",
- "offer_attributes": [
- {
- "attribute_group_id": "30258ae5-3143-441d-95a4-cd6b2d69b503",
- "attribute_id": "e3c21690-d2c3-436e-9137-c554e1938ee8"
}
], - "unit_price": 200.99,
- "min_qty": 2,
- "api_qty": 100,
- "low_stock_alert_qty": 2,
- "wholesale_details": [
- {
- "max": 20,
- "min": 11,
- "unit_price": 195.99
}, - {
- "max": 30,
- "min": 21,
- "unit_price": 190.99
}
], - "other_pricing": [
- {
- "unit_price": 14.87,
- "currency": "SGD"
}, - {
- "unit_price": 16.42,
- "currency": "AUD"
}
], - "other_wholesale_details": [
- {
- "wholesale_details": [
- {
- "unit_price": 13.87,
- "max": 50,
- "min": 1
}, - {
- "unit_price": 10.87,
- "max": 100,
- "min": 51
}
], - "currency": "SGD"
}
], - "sales_territory_settings": {
- "settings_type": "global",
- "countries": [ ]
}, - "delivery_method_ids": [
- "ee2dd500-a0ff-49f2-850a-2fc8431b06ed"
], - "currency": "MYR"
}
{- "request_id": "09b046f7-8fd8-424e-ad95-fa98061acf88",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "seller_id": "684814",
- "offer_id": "G1661160362663JS",
- "offer_type": "public",
- "delivery_type": [
- "instant_inventory"
], - "product_id": "5b31192f-a693-4fec-bf03-50cc0fba044d",
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_id": "9c2d4957-415c-4b21-8810-b9b43f596820",
- "region_id": "6ed86369-8a10-4106-b09b-6a66b774e0f8",
- "title": "iTunes Gift Card USD 250",
- "description": "",
- "status": "live",
- "currency": "MYR",
- "unit_price": 200.99,
- "min_qty": 1,
- "available_qty": 123,
- "api_qty": 123,
- "low_stock_alert_qty": 123,
- "offer_attributes": [
- {
- "attribute_group_id": "a1dcdd2b",
- "attribute_id": "9e66f41c"
}
], - "wholesale_details": [
- {
- "max": 20,
- "min": 11,
- "unit_price": 195.99
}, - {
- "max": 30,
- "min": 21,
- "unit_price": 190.99
}
], - "other_pricing": [
- {
- "unit_price": 14.87,
- "currency": "SGD"
}, - {
- "unit_price": 16.42,
- "currency": "AUD"
}
], - "other_wholesale_details": [
- {
- "wholesale_details": [
- {
- "unit_price": 13.87,
- "max": 50,
- "min": 1
}, - {
- "unit_price": 10.87,
- "max": 100,
- "min": 51
}
], - "currency": "SGD"
}
], - "sales_territory_settings": {
- "countries": [ ],
- "settings_type": "global"
}, - "delivery_method_ids": [
- "ee2dd500-a0ff-49f2-850a-2fc8431b06ed"
], - "delivery_speed": "instant",
- "created_at": 1661160362663,
- "updated_at": 1661496821684
}
}
Get a specific offer based on offer id.
offer_id required | string Example: G1650341633714BW The unique identifier of an offer. |
{- "request_id": "793d2a29-42b2-456a-9fdc-788c59c80199",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "offer_id": "G1657548552630BT",
- "seller_id": "684814",
- "offer_type": "public",
- "delivery_type": [
- "instant_inventory"
], - "product_id": "c9bf2323-fa8d-4c88-acc8-87d2ced62b72",
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_id": "6380b311-ec2a-4bd0-b0a3-e61445daabbf",
- "region_id": "3d24cdb8-c56a-49d6-8389-44900e6fef15",
- "title": "Karma Coin 20 USD",
- "description": "",
- "status": "live",
- "currency": "MYR",
- "unit_price": 200.99,
- "min_qty": 1,
- "available_qty": 987,
- "api_qty": 997,
- "low_stock_alert_qty": 10,
- "offer_attributes": [
- {
- "attribute_group_id": "30258ae5-3143-441d-95a4-cd6b2d69b503",
- "attribute_id": "5d3f8581-cea4-486b-ab71-c43a320afa7e"
}
], - "wholesale_details": [
- {
- "max": 20,
- "min": 11,
- "unit_price": 195.99
}, - {
- "max": 30,
- "min": 21,
- "unit_price": 190.99
}
], - "other_pricing": [
- {
- "unit_price": 14.87,
- "currency": "SGD"
}, - {
- "unit_price": 16.42,
- "currency": "AUD"
}
], - "other_wholesale_details": [
- {
- "wholesale_details": [
- {
- "unit_price": 13.87,
- "max": 50,
- "min": 1
}, - {
- "unit_price": 10.87,
- "max": 100,
- "min": 51
}
], - "currency": "SGD"
}
], - "sales_territory_settings": {
- "countries": [ ],
- "settings_type": "global"
}, - "delivery_method_ids": [
- "ee2dd500-a0ff-49f2-850a-2fc8431b06ed"
], - "delivery_speed": "instant",
- "code_label": "Serial Code,Expiry",
- "created_at": 1657548552630,
- "updated_at": 1661479426651
}
}
Update a specific offer based on offer id.
offer_id required | string Example: G1650341633714BW The unique identifier of an offer. |
min_qty | integer >= 1 Minimum purchase quantity. |
api_qty | int >= 0 The quantity of stock to sell in G2G via OpenAPI. |
low_stock_alert_qty | int >= 0 When reach low_stock_alert_qty, will receive offer.low_stock webhook |
Array of objects[ items ] | |
currency | string Currency ISO code. Reference |
unit_price | number <double> > 0 Unit price of an offer item. |
Array of objects [ 1 .. 3 ] items [ items ] | |
Array of objects[ items ] Other currency pricing that you may have for an offer. | |
Array of objects[ items ] The wholesale detail setting for other currency that you may have for an offer. | |
object Setting to allow or disallowed buyer from specific country to purchase the offer. Default global, no country restriction | |
delivery_method_ids | Array of strings <uuid> A list of uid string that respresent delivery method of an offer. Does not required for Gift Card offer |
{- "offer_attributes": [
- {
- "attribute_group_id": "30258ae5-3143-441d-95a4-cd6b2d69b503",
- "attribute_id": "a4591035-5956-43b2-aabc-f6b9a7ce5bcf"
}
], - "unit_price": 300.99,
- "min_qty": 2,
- "api_qty": 50,
- "low_stock_alert_qty": 5,
- "wholesale_details": [
- {
- "max": 20,
- "min": 11,
- "unit_price": 195.99
}, - {
- "max": 30,
- "min": 21,
- "unit_price": 190.99
}
], - "other_pricing": [
- {
- "unit_price": 14.87,
- "currency": "SGD"
}, - {
- "unit_price": 16.42,
- "currency": "AUD"
}
], - "other_wholesale_details": [
- {
- "wholesale_details": [
- {
- "unit_price": 13.87,
- "max": 50,
- "min": 1
}, - {
- "unit_price": 10.87,
- "max": 100,
- "min": 51
}
], - "currency": "SGD"
}
], - "sales_territory_settings": {
- "settings_type": "global",
- "countries": [ ]
}, - "delivery_method_ids": [
- "ee2dd500-a0ff-49f2-850a-2fc8431b06ed"
], - "currency": "MYR"
}
{- "request_id": "09b046f7-8fd8-424e-ad95-fa98061acf88",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "seller_id": "684814",
- "offer_id": "G1661160362663JS",
- "offer_type": "public",
- "delivery_type": [
- "instant_inventory"
], - "product_id": "5b31192f-a693-4fec-bf03-50cc0fba044d",
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_id": "9c2d4957-415c-4b21-8810-b9b43f596820",
- "region_id": "6ed86369-8a10-4106-b09b-6a66b774e0f8",
- "title": "iTunes Gift Card USD 250",
- "description": "",
- "status": "live",
- "currency": "MYR",
- "unit_price": 200.99,
- "min_qty": 1,
- "available_qty": 123,
- "api_qty": 123,
- "low_stock_alert_qty": 123,
- "offer_attributes": [
- {
- "attribute_group_id": "a1dcdd2b",
- "attribute_id": "9e66f41c"
}
], - "wholesale_details": [
- {
- "max": 20,
- "min": 11,
- "unit_price": 195.99
}, - {
- "max": 30,
- "min": 21,
- "unit_price": 190.99
}
], - "other_pricing": [
- {
- "unit_price": 14.87,
- "currency": "SGD"
}, - {
- "unit_price": 16.42,
- "currency": "AUD"
}
], - "other_wholesale_details": [
- {
- "wholesale_details": [
- {
- "unit_price": 13.87,
- "max": 50,
- "min": 1
}, - {
- "unit_price": 10.87,
- "max": 100,
- "min": 51
}
], - "currency": "SGD"
}
], - "sales_territory_settings": {
- "countries": [ ],
- "settings_type": "global"
}, - "delivery_method_ids": [
- "ee2dd500-a0ff-49f2-850a-2fc8431b06ed"
], - "delivery_speed": "instant",
- "created_at": 1661160362663,
- "updated_at": 1661496821684
}
}
Delete a specific offer based on offer id.
offer_id required | string Example: G1650341633714BW The unique identifier of an offer. |
{- "request_id": "b186c4e9-fe36-48f5-9545-937b0ab0d72f",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "success": true
}
}
Search for a list of offers.
object The search and filter query settings. | |
page_size | integer [ 1 .. 100 ] Specify the number of offers to return per page. Default: |
page | integer >= 1 Return a result of a page. |
{- "filter": {
- "brand_id": "6380b311-ec2a-4bd0-b0a3-e61445daabbf",
- "status": "live",
- "query": "Tal Rasha"
}, - "page_size": 1,
- "page": 1
}
{- "request_id": "ac12caf3-ca5c-45ed-93f4-7ab880855332",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "results": [
- {
- "offer_id": "G1669195856128DY",
- "seller_id": "1000000572",
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_id": "6380b311-ec2a-4bd0-b0a3-e61445daabbf",
- "region_id": "3d24cdb8-c56a-49d6-8389-44900e6fef15",
- "title": "Tal Rasha's Horadric Crest Helm",
- "description": "",
- "status": "live",
- "currency": "MYR",
- "unit_price": 30,
- "available_qty": 47,
- "created_at": 1669195972899,
- "updated_at": 1669262857010
}
]
}
}
{- "request_id": "3d12ca6c-0ea3-40c0-8a6e-c689b4d80fa8",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "order_id": "1660548283983RS00-1",
- "seller_store_name": "kylam",
- "seller_id": "684814",
- "buyer_id": "1000000208",
- "order_status": "delivering",
- "amount": 401.98,
- "unit_price": 200.99,
- "currency": "MYR",
- "purchased_qty": 2,
- "delivered_qty": 1,
- "refunded_qty": 0,
- "defected_qty": 0,
- "replacement_qty": 0,
- "created_at": 1660548290196,
- "updated_at": 1660548709352
}
}
Get delivery info based to specific order id.
Note: This API have a limit of 100 results per request. An after key will be return when result is more than the limit
order_id required | string Example: 1654240349966TEKP-1 The unique identifier of an order. |
after | string Example: after=Item#1670568841157TEST-1#D1671691755000 Retrieve next set of result. |
{- "request_id": "a1b452f9-04f5-4892-987a-e71badbe5b99",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "delivery_list": [
- {
- "order_id": "1670568841157TEST-1",
- "seller_id": "685064",
- "buyer_id": "684896",
- "offer_id": "G16704985465TEST",
- "purchased_qty": 1,
- "defected_qty": 0,
- "replacement_qty": 0,
- "refunded_qty": 0,
- "undelivered_qty": 1,
- "delivered_qty": 0,
- "delivery_summary": {
- "delivery_id": "D1671612731000",
- "delivery_mode": "normal",
- "delivery_method_code": "direct_top_up",
- "delivery_status": "in progress",
- "requested_qty": 1,
- "delivered_qty": 0,
- "requested_at": 1671612731000,
- "delivered_at": 0,
- "expired_at": 0,
- "case_id": "",
- "delivery_issues": [
- ""
]
}
}, - {
- "order_id": "1670568841157TEST-1",
- "seller_id": "685064",
- "buyer_id": "684896",
- "offer_id": "G16704985465TEST",
- "purchased_qty": 1,
- "defected_qty": 0,
- "replacement_qty": 0,
- "refunded_qty": 0,
- "undelivered_qty": 1,
- "delivered_qty": 0,
- "delivery_summary": {
- "delivery_id": "D1671691755000",
- "delivery_mode": "normal",
- "delivery_method_code": "direct_top_up",
- "delivery_status": "in progress",
- "requested_qty": 1,
- "delivered_qty": 0,
- "requested_at": 1671691755000,
- "delivered_at": 0,
- "expired_at": 0,
- "case_id": "",
- "delivery_issues": [
- ""
]
}
}, - {
- "order_id": "1670568841157TEST-1",
- "seller_id": "685064",
- "buyer_id": "684896",
- "offer_id": "G16704985465TEST",
- "purchased_qty": 1,
- "defected_qty": 0,
- "replacement_qty": 0,
- "refunded_qty": 0,
- "undelivered_qty": 1,
- "delivered_qty": 0,
- "delivery_summary": {
- "delivery_id": "D1671693034000",
- "delivery_mode": "normal",
- "delivery_method_code": "direct_top_up",
- "delivery_status": "delivered",
- "requested_qty": 1,
- "delivered_qty": 1,
- "requested_at": 1671693034000,
- "delivered_at": 1671693315000,
- "expired_at": 0,
- "case_id": "",
- "delivery_issues": [
- ""
]
}
}
], - "after": ""
}
}
Deliver Codes to specific order when seller received webhook for delivery.
order_id required | string Example: 1654240349966TEKP-1 The unique identifier of an order. |
delivery_id required | string The unique identifier of a delivery operation that was provided in order.api_delivery webhook. |
required | Array of objects [ 1 .. 100 ] items [ items ] Array of codes to be sent to buyer based on specific order_id |
{- "delivery_id": "D1655369534",
- "codes": [
- {
- "content": "jKYDpJ3IreMUyCS,05 May 2023",
- "content_type": "text/plain",
- "reference_id": "referenceid1"
}, - {
- "content": "QXDQzYDw30,05 May 2023",
- "content_type": "text/plain",
- "reference_id": "reference_id2"
}, - {
- "content": "lIjmeFXFDS,05 May 2023",
- "content_type": "text/plain",
- "reference_id": "reference_id2"
}
]
}
{- "request_id": "7542860a-d82d-4c59-b41f-ee39ea318552",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "delivery_id": "D1655369534"
}
}
Get the status of your delivery operation.
order_id required | string Example: 1654240349966TEKP-1 The unique identifier of an order. |
delivery_id required | string Example: D1650341633714 The unique identifier of delivery. |
{- "request_id": "f0e7857a-4d11-4115-98dc-d71e387299bc",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "order_id": "1637925438960TE5T-1",
- "seller_id": "600001",
- "buyer_id": "600002",
- "offer_id": "G1650423467624TE",
- "purchased_qty": 4,
- "defected_qty": 0,
- "replacement_qty": 0,
- "refunded_qty": 0,
- "undelivered_qty": 0,
- "delivered_qty": 4,
- "delivery_summary": {
- "delivery_id": "D1650341633714",
- "delivery_mode": "normal",
- "delivery_status": "delivered",
- "case_id": "",
- "requested_qty": 4,
- "delivered_qty": 4,
- "requested_at": 1661162789441,
- "delivered_at": 1661162265411,
- "expired_at": 1661220470000,
- "delivery_issues": [ ]
}
}
}
Update delivered quantity for manual delivery.
order_id required | string Example: 1654240349966TEKP-1 The unique identifier of an order. |
delivery_id required | string Example: D1650341633714 The unique identifier of delivery. |
delivered_qty required | integer Total quantity of item delivered by seller for this order. |
delivery_issue | string Enum: "incorrect_delivery_detail" "insufficient_stock" "others" Issue encountered when unable to fulfill the requested deliver quantity. |
delivered_at required | integer Timestamp in milliseconds when the code is delivered for this delivery. |
reference_id | string A reference identifier for this delivery. |
{- "delivered_qty": 1,
- "delivery_issue": "others",
- "delivered_at": 1671693315000,
- "reference_id": "1670568841157TEST_D1671693034000"
}
{- "request_id": "c6d8a1d9-b710-492d-84c0-cc47544c8453",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "order_id": "1670568841157TEST-1",
- "delivery_id": "D1671693034000",
- "delivered_qty": 1,
- "delivered_at": 1671693315000,
- "reference_id": "1670568841157TEST_D1671693034000"
}
}
Upload code to a specific offer's inventory based on offer id.
content required | string A digital code for the offer. You can get the code format from Get Offer API. |
content_type required | string Value: "text/plain" The content value type. |
reference_id required | string A reference identifier for the code. |
{- "content": "jKYDpJ3IreMUyCS,05 May 2023",
- "content_type": "text/plain",
- "reference_id": "referenceid1"
}
{- "request_id": "7542860a-d82d-4c59-b41f-ee39ea318552",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "offer_id": "G1650445167989US",
- "item_id": "ba8551d9-47e3-424a-a809-4f043059eefb"
}
}
View code's info of a specific offer's inventory based on offer id.
offer_id required | string Example: G1650341633714BW The unique identifier of an offer. |
item_id required | string <uuid> Example: 3430aa12-6e5e-4d22-ab75-8af4d44b2914 The unique identifier of an inventory items. |
{- "request_id": "1f01f339-0a53-467b-ba37-35df1ba9c003",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "offer_id": "G1650445167989US",
- "item_id": "ba8551d9-47e3-424a-a809-4f043059eefb",
- "expired_at": 1683244800000,
- "status": "active"
}
}
Delete code of a specific offer's inventory based on offer id and inventory_id.
offer_id required | string Example: G1650341633714BW The unique identifier of an offer. |
item_id required | string <uuid> Example: 3430aa12-6e5e-4d22-ab75-8af4d44b2914 The unique identifier of an inventory items. |
{- "request_id": "cfc5d786-d8f5-4ab6-b485-6c402746412b",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "offer_id": "G1650445167989US",
- "item_id": "cdf5d019-d368-42ab-beaf-52cc6a5b5d03",
- "success": true
}
}
{- "request_id": "f0e7857a-4d11-4115-98dc-d71e387299bc",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "user_id": "684814",
- "account_status": "active",
- "seller_status": "active",
- "selling_currencies": [
- "MYR"
]
}
}
Search webhook logs.
required | object The search and filter query settings. |
limit | integer Specifies the number of messages to return per page. |
sort_order | string Enum: "asc" "desc" The ordering of the records. |
after | string Marks the starting point of the search results to retrieve in the result set. |
{- "filter": {
- "event_sent_from": 1655641834093,
- "event_sent_to": 1655869732033
}, - "limit": 20,
- "sort_order": "asc"
}
{- "code": 20000001,
- "message": "",
- "warning": "",
- "request_id": "19951185-d16e-4ab5-968d-d1ce66b1b7df",
- "payload": {
- "results": [
- {
- "event_id": "ad7ade62-1981-4ce1-b280-983caef3a44b-1",
- "event_type": "order.confirmed",
- "http_status": 200,
- "http_request": {
- "event_type": "order.confirmed",
- "payload": {
- "amount": 1.6,
- "order_payment_status": "paid",
- "replacement_qty": 0,
- "buyer_id": "1000000423",
- "unit_price": 0.16,
- "commission_fee_rate": 10,
- "offer_id": "G1659345207570OY",
- "refunded_amount": 0,
- "purchased_qty": 10,
- "order_status": "verifying_payment",
- "offer_currency": "EUR",
- "delivered_qty": 0,
- "defected_qty": 0,
- "product_id": "5b31192f-a693-4fec-bf03-50cc0fba044d",
- "refunded_qty": 0,
- "checkout_currency": "SGD",
- "order_id": "1659694996896NH0Y-1",
- "commission_fee": 0.11,
- "order_created_at": 1659695002447,
- "seller_id": "1000000422",
- "offer_service_type": "Gift Cards"
}, - "id": "ad7ade62-1981-4ce1-b280-983caef3a44b-1",
- "event_happened_at": 1659695012145
}, - "response_time": 0,
- "event_sent_at": 1659695016249
}, - {
- "event_id": "59d6b795-0e87-4788-b793-6b2b94838c4d-1",
- "event_type": "order.api_delivery",
- "http_status": 200,
- "http_request": {
- "event_type": "order.api_delivery",
- "payload": {
- "total_delivered_qty": 0,
- "undelivered_qty": 10,
- "delivery_qty": 10,
- "delivery_id": "D1659695025419",
- "replacement_qty": 0,
- "buyer_id": "1000000423",
- "offer_id": "G1659345207570OY",
- "purchased_qty": 10,
- "defected_qty": 0,
- "case_id": "",
- "refunded_qty": 0,
- "order_id": "1659694996896NH0Y-1",
- "seller_id": "1000000422",
- "delivery_mode": "",
- "requested_at": 1659695025419
}, - "id": "59d6b795-0e87-4788-b793-6b2b94838c4d-1",
- "event_happened_at": 1659695025419
}, - "response_time": 1,
- "event_sent_at": 1659695027366
}
], - "after": "1659695025419"
}
}
Get list of all available services.
language | string Default: "en" Enum: "en" "zh-CN" "id" "zh-TW" Language |
{- "code": 20000001,
- "message": "",
- "warning": "",
- "request_id": "595285dc-9c43-4b9c-a1e6-0cd9aff5b084",
- "payload": {
- "service_list": [
- {
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "service_name": "Gift Cards",
- "delivery_method": "instant_code_delivery"
}
]
}
}
Get brands of a service.
service_id required | string <uuid> Example: 44b3148a-0dc8-4262-81d8-c762559f0d74 The unique identifier of a service. Note: This API have a limit of 1000 results per request |
language | string Default: "en" Enum: "en" "zh-CN" "id" "zh-TW" Language |
q | string Example: q=itunes Search brands by keyword. |
after | string <uuid> Example: after=ba683457-f9d0-4330-bea7-923ed300d2e5 Retrieve next set of brands. |
{- "code": 20000001,
- "message": "",
- "warning": "",
- "request_id": "595285dc-9c43-4b9c-a1e6-0cd9aff5b084",
- "payload": {
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_list": [
- {
- "brand_id": "8c42b2d4-6d2c-4188-931a-240d2f94183f",
- "brand_name": "Apple iTunes"
}, - {
- "brand_id": "lgc_game_25055",
- "brand_name": "PlayStation Network"
}
], - "after": "lgc_game_25055"
}
}
Get products of a brand.
service_id required | string <uuid> Example: service_id=44b3148a-0dc8-4262-81d8-c762559f0d74 The unique identifier of a service. |
brand_id required | string <uuid> Example: brand_id=8c42b2d4-6d2c-4188-931a-240d2f94183f The unique identifier of a brand. |
{- "code": 20000001,
- "message": "",
- "warning": "",
- "request_id": "5cd2b212-868f-4d0a-b05f-37e93a37529b",
- "payload": {
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_id": "8c42b2d4-6d2c-4188-931a-240d2f94183f",
- "product_list": [
- {
- "product_id": "814298ea-fd9f-4741-8134-f5fef5614714",
- "product_name": "Gift Cards > Apple iTunes > JP",
- "service_name": "Gift Cards",
- "brand_name": "Apple iTunes",
- "region_name": "JP"
}, - {
- "product_id": "3c0d0298-408d-43b4-b069-8a56d9d5ac08",
- "product_name": "Gift Cards > Apple iTunes > RU",
- "service_name": "Gift Cards",
- "brand_name": "Apple iTunes",
- "region_name": "RU"
}, - {
- "product_id": "4a610301-4e3a-4cc7-b242-35ebc1a521a7",
- "product_name": "Gift Cards > Apple iTunes > US",
- "service_name": "Gift Cards",
- "brand_name": "Apple iTunes",
- "region_name": "US"
}
]
}
}
Get attributes of a product.
product_id required | string <uuid> Example: 4a610301-4e3a-4cc7-b242-35ebc1a521a7 The unique identifier of a product. |
{- "request_id": "e48919cd-12be-4005-ba09-fe4004f08925",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "product_id": "c9bf2323-fa8d-4c88-acc8-87d2ced62b72",
- "attribute_group_id": "30258ae5-3143-441d-95a4-cd6b2d69b503",
- "attribute_list": [
- {
- "attribute_id": "e3c21690-d2c3-436e-9137-c554e1938ee8",
- "attribute_name": "Karma Koin USD100",
- "sub_attribute_list": [
- {
- "attribute_id": "e3c21690-d2c3-436e-9137-c554e1938ee8",
- "attribute_name": "Karma Koin USD100",
- "sub_attribute_list": [ ]
}
]
}, - {
- "attribute_id": "a4591035-5956-43b2-aabc-f6b9a7ce5bcf",
- "attribute_name": "Karma Koin USD50",
- "sub_attribute_list": [
- {
- "attribute_id": "a4591035-5956-43b2-aabc-f6b9a7ce5bcf",
- "attribute_name": "Karma Koin USD50",
- "sub_attribute_list": [ ]
}
]
}, - {
- "attribute_id": "5d3f8581-cea4-486b-ab71-c43a320afa7e",
- "attribute_name": "Karma Koin USD25",
- "sub_attribute_list": [
- {
- "attribute_id": "5d3f8581-cea4-486b-ab71-c43a320afa7e",
- "attribute_name": "Karma Koin USD25",
- "sub_attribute_list": [ ]
}
]
}
]
}
}
Create a new offer.
product_id required | string <uuid> The unique identifier of the product. |
min_qty required | integer >= 1 Minimum purchase quantity. |
api_qty required | int >= 0 The quantity of stock to sell in G2G via OpenAPI. |
low_stock_alert_qty required | int >= 0 When reach low_stock_alert_qty, will receive offer.low_stock webhook |
required | Array of objects[ items ] |
currency required | string Currency ISO code. Reference |
unit_price required | number <double> > 0 Unit price of an offer item. |
Array of objects [ 1 .. 3 ] items [ items ] | |
object Setting to allow or disallowed buyer from specific country to purchase the offer. Default global, no country restriction |
{- "product_id": "c9bf2323-fa8d-4c88-acc8-87d2ced62b72",
- "offer_attributes": [
- {
- "attribute_group_id": "30258ae5-3143-441d-95a4-cd6b2d69b503",
- "attribute_id": "e3c21690-d2c3-436e-9137-c554e1938ee8"
}
], - "unit_price": 200.99,
- "min_qty": 2,
- "api_qty": 100,
- "low_stock_alert_qty": 2,
- "wholesale_details": [
- {
- "max": 20,
- "min": 11,
- "unit_price": 195.99
}, - {
- "max": 30,
- "min": 21,
- "unit_price": 190.99
}
], - "sales_territory_settings": {
- "settings_type": "global",
- "countries": [ ]
}, - "currency": "MYR"
}
{- "request_id": "09b046f7-8fd8-424e-ad95-fa98061acf88",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "seller_id": "684814",
- "offer_id": "G1661160362663JS",
- "offer_type": "public",
- "delivery_type": [
- "instant_inventory"
], - "product_id": "5b31192f-a693-4fec-bf03-50cc0fba044d",
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_id": "9c2d4957-415c-4b21-8810-b9b43f596820",
- "region_id": "6ed86369-8a10-4106-b09b-6a66b774e0f8",
- "title": "iTunes Gift Card USD 250",
- "description": "",
- "status": "live",
- "currency": "MYR",
- "unit_price": 200.99,
- "min_qty": 1,
- "available_qty": 123,
- "api_qty": 123,
- "low_stock_alert_qty": 123,
- "offer_attributes": [
- {
- "attribute_group_id": "a1dcdd2b",
- "attribute_id": "9e66f41c"
}
], - "wholesale_details": [
- {
- "max": 20,
- "min": 11,
- "unit_price": 195.99
}, - {
- "max": 30,
- "min": 21,
- "unit_price": 190.99
}
], - "sales_territory_settings": {
- "countries": [ ],
- "settings_type": "global"
}, - "created_at": 1661160362663,
- "updated_at": 1661496821684
}
}
Get a specific offer based on offer id.
offer_id required | string Example: G1650341633714BW The unique identifier of an offer. |
{- "request_id": "793d2a29-42b2-456a-9fdc-788c59c80199",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "offer_id": "G1657548552630BT",
- "seller_id": "684814",
- "offer_type": "public",
- "delivery_type": [
- "instant_inventory"
], - "product_id": "c9bf2323-fa8d-4c88-acc8-87d2ced62b72",
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_id": "6380b311-ec2a-4bd0-b0a3-e61445daabbf",
- "region_id": "3d24cdb8-c56a-49d6-8389-44900e6fef15",
- "title": "Karma Coin 20 USD",
- "description": "",
- "status": "live",
- "currency": "MYR",
- "unit_price": 200.99,
- "min_qty": 1,
- "available_qty": 987,
- "api_qty": 997,
- "low_stock_alert_qty": 10,
- "offer_attributes": [
- {
- "attribute_group_id": "30258ae5-3143-441d-95a4-cd6b2d69b503",
- "attribute_id": "5d3f8581-cea4-486b-ab71-c43a320afa7e"
}
], - "wholesale_details": [
- {
- "max": 20,
- "min": 11,
- "unit_price": 195.99
}, - {
- "max": 30,
- "min": 21,
- "unit_price": 190.99
}
], - "sales_territory_settings": {
- "countries": [ ],
- "settings_type": "global"
}, - "code_label": "Serial Code,Expiry",
- "created_at": 1657548552630,
- "updated_at": 1661479426651
}
}
Update a specific offer based on offer id.
offer_id required | string Example: G1650341633714BW The unique identifier of an offer. |
min_qty | integer >= 1 Minimum purchase quantity. |
api_qty | int >= 0 The quantity of stock to sell in G2G via OpenAPI. |
low_stock_alert_qty | int >= 0 When reach low_stock_alert_qty, will receive offer.low_stock webhook |
Array of objects[ items ] | |
currency | string Currency ISO code. Reference |
unit_price | number <double> > 0 Unit price of an offer item. |
Array of objects [ 1 .. 3 ] items [ items ] | |
object Setting to allow or disallowed buyer from specific country to purchase the offer. Default global, no country restriction |
{- "offer_attributes": [
- {
- "attribute_group_id": "30258ae5-3143-441d-95a4-cd6b2d69b503",
- "attribute_id": "a4591035-5956-43b2-aabc-f6b9a7ce5bcf"
}
], - "unit_price": 300.99,
- "min_qty": 2,
- "api_qty": 50,
- "low_stock_alert_qty": 5,
- "wholesale_details": [
- {
- "max": 20,
- "min": 11,
- "unit_price": 195.99
}, - {
- "max": 30,
- "min": 21,
- "unit_price": 190.99
}
], - "sales_territory_settings": {
- "settings_type": "global",
- "countries": [ ]
}, - "currency": "MYR"
}
{- "request_id": "09b046f7-8fd8-424e-ad95-fa98061acf88",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "seller_id": "684814",
- "offer_id": "G1661160362663JS",
- "offer_type": "public",
- "delivery_type": [
- "instant_inventory"
], - "product_id": "5b31192f-a693-4fec-bf03-50cc0fba044d",
- "service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
- "brand_id": "9c2d4957-415c-4b21-8810-b9b43f596820",
- "region_id": "6ed86369-8a10-4106-b09b-6a66b774e0f8",
- "title": "iTunes Gift Card USD 250",
- "description": "",
- "status": "live",
- "currency": "MYR",
- "unit_price": 200.99,
- "min_qty": 1,
- "available_qty": 123,
- "api_qty": 123,
- "low_stock_alert_qty": 123,
- "offer_attributes": [
- {
- "attribute_group_id": "a1dcdd2b",
- "attribute_id": "9e66f41c"
}
], - "wholesale_details": [
- {
- "max": 20,
- "min": 11,
- "unit_price": 195.99
}, - {
- "max": 30,
- "min": 21,
- "unit_price": 190.99
}
], - "sales_territory_settings": {
- "countries": [ ],
- "settings_type": "global"
}, - "created_at": 1661160362663,
- "updated_at": 1661496821684
}
}
Delete a specific offer based on offer id.
offer_id required | string Example: G1650341633714BW The unique identifier of an offer. |
{- "request_id": "b186c4e9-fe36-48f5-9545-937b0ab0d72f",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "success": true
}
}
{- "request_id": "3d12ca6c-0ea3-40c0-8a6e-c689b4d80fa8",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "order_id": "1660548283983RS00-1",
- "seller_store_name": "kylam",
- "seller_id": "684814",
- "buyer_id": "1000000208",
- "order_status": "delivering",
- "amount": 401.98,
- "unit_price": 200.99,
- "currency": "MYR",
- "purchased_qty": 2,
- "delivered_qty": 1,
- "refunded_qty": 0,
- "defected_qty": 0,
- "replacement_qty": 0,
- "created_at": 1660548290196,
- "updated_at": 1660548709352
}
}
Deliver Codes to specific order when seller received webhook for delivery.
order_id required | string Example: 1654240349966TEKP-1 The unique identifier of an order. |
delivery_id required | string The unique identifier of a delivery operation that was provided in order.api_delivery webhook. |
required | Array of objects [ 1 .. 100 ] items [ items ] Array of codes to be sent to buyer based on specific order_id |
{- "delivery_id": "D1655369534",
- "codes": [
- {
- "content": "jKYDpJ3IreMUyCS,05 May 2023",
- "content_type": "text/plain",
- "reference_id": "referenceid1"
}, - {
- "content": "QXDQzYDw30,05 May 2023",
- "content_type": "text/plain",
- "reference_id": "reference_id2"
}, - {
- "content": "lIjmeFXFDS,05 May 2023",
- "content_type": "text/plain",
- "reference_id": "reference_id2"
}
]
}
{- "request_id": "7542860a-d82d-4c59-b41f-ee39ea318552",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "delivery_id": "D1655369534"
}
}
Get the status of your delivery operation.
order_id required | string Example: 1654240349966TEKP-1 The unique identifier of an order. |
delivery_id required | string Example: D1650341633714 The unique identifier of delivery. |
{- "request_id": "f0e7857a-4d11-4115-98dc-d71e387299bc",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "order_id": "1637925438960TE5T-1",
- "seller_id": "600001",
- "buyer_id": "600002",
- "offer_id": "G1650423467624TE",
- "purchased_qty": 4,
- "defected_qty": 0,
- "replacement_qty": 0,
- "refunded_qty": 0,
- "undelivered_qty": 0,
- "delivered_qty": 4,
- "delivery_summary": {
- "delivery_id": "D1650341633714",
- "delivery_mode": "normal",
- "delivery_status": "delivered",
- "case_id": "",
- "requested_qty": 4,
- "delivered_qty": 4,
- "requested_at": 1661162789441,
- "delivered_at": 1661162265411,
- "expired_at": 1661220470000,
- "delivery_issues": [ ]
}
}
}
Upload code to a specific offer's inventory based on offer id.
content required | string A digital code for the offer. You can get the code format from Get Offer API. |
content_type required | string Value: "text/plain" The content value type. |
reference_id required | string A reference identifier for the code. |
{- "content": "jKYDpJ3IreMUyCS,05 May 2023",
- "content_type": "text/plain",
- "reference_id": "referenceid1"
}
{- "request_id": "7542860a-d82d-4c59-b41f-ee39ea318552",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "offer_id": "G1650445167989US",
- "item_id": "ba8551d9-47e3-424a-a809-4f043059eefb"
}
}
View code's info of a specific offer's inventory based on offer id.
offer_id required | string Example: G1650341633714BW The unique identifier of an offer. |
item_id required | string <uuid> Example: 3430aa12-6e5e-4d22-ab75-8af4d44b2914 The unique identifier of an inventory items. |
{- "request_id": "1f01f339-0a53-467b-ba37-35df1ba9c003",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "offer_id": "G1650445167989US",
- "item_id": "ba8551d9-47e3-424a-a809-4f043059eefb",
- "expired_at": 1683244800000,
- "status": "active"
}
}
Delete code of a specific offer's inventory based on offer id and inventory_id.
offer_id required | string Example: G1650341633714BW The unique identifier of an offer. |
item_id required | string <uuid> Example: 3430aa12-6e5e-4d22-ab75-8af4d44b2914 The unique identifier of an inventory items. |
{- "request_id": "cfc5d786-d8f5-4ab6-b485-6c402746412b",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "offer_id": "G1650445167989US",
- "item_id": "cdf5d019-d368-42ab-beaf-52cc6a5b5d03",
- "success": true
}
}
{- "request_id": "f0e7857a-4d11-4115-98dc-d71e387299bc",
- "code": 20000001,
- "message": "",
- "warning": "",
- "payload": {
- "user_id": "684814",
- "account_status": "active",
- "seller_status": "active",
- "selling_currencies": [
- "MYR"
]
}
}
Search webhook logs.
required | object The search and filter query settings. |
limit | integer Specifies the number of messages to return per page. |
sort_order | string Enum: "asc" "desc" The ordering of the records. |
after | string Marks the starting point of the search results to retrieve in the result set. |
{- "filter": {
- "event_sent_from": 1655641834093,
- "event_sent_to": 1655869732033
}, - "limit": 20,
- "sort_order": "asc"
}
{- "code": 20000001,
- "message": "",
- "warning": "",
- "request_id": "19951185-d16e-4ab5-968d-d1ce66b1b7df",
- "payload": {
- "results": [
- {
- "event_id": "ad7ade62-1981-4ce1-b280-983caef3a44b-1",
- "event_type": "order.confirmed",
- "http_status": 200,
- "http_request": {
- "event_type": "order.confirmed",
- "payload": {
- "amount": 1.6,
- "order_payment_status": "paid",
- "replacement_qty": 0,
- "buyer_id": "1000000423",
- "unit_price": 0.16,
- "commission_fee_rate": 10,
- "offer_id": "G1659345207570OY",
- "refunded_amount": 0,
- "purchased_qty": 10,
- "order_status": "verifying_payment",
- "offer_currency": "EUR",
- "delivered_qty": 0,
- "defected_qty": 0,
- "product_id": "5b31192f-a693-4fec-bf03-50cc0fba044d",
- "refunded_qty": 0,
- "checkout_currency": "SGD",
- "order_id": "1659694996896NH0Y-1",
- "commission_fee": 0.11,
- "order_created_at": 1659695002447,
- "seller_id": "1000000422",
- "offer_service_type": "Gift Cards"
}, - "id": "ad7ade62-1981-4ce1-b280-983caef3a44b-1",
- "event_happened_at": 1659695012145
}, - "response_time": 0,
- "event_sent_at": 1659695016249
}, - {
- "event_id": "59d6b795-0e87-4788-b793-6b2b94838c4d-1",
- "event_type": "order.api_delivery",
- "http_status": 200,
- "http_request": {
- "event_type": "order.api_delivery",
- "payload": {
- "total_delivered_qty": 0,
- "undelivered_qty": 10,
- "delivery_qty": 10,
- "delivery_id": "D1659695025419",
- "replacement_qty": 0,
- "buyer_id": "1000000423",
- "offer_id": "G1659345207570OY",
- "purchased_qty": 10,
- "defected_qty": 0,
- "case_id": "",
- "refunded_qty": 0,
- "order_id": "1659694996896NH0Y-1",
- "seller_id": "1000000422",
- "delivery_mode": "",
- "requested_at": 1659695025419
}, - "id": "59d6b795-0e87-4788-b793-6b2b94838c4d-1",
- "event_happened_at": 1659695025419
}, - "response_time": 1,
- "event_sent_at": 1659695027366
}
], - "after": "1659695025419"
}
}
When you register for webhooks in the G2G Developers Center, G2G will send an HTTPS POST request to the configured webhook URL with the relevant data when an event happens.
Please note that:
When you receive a webhook, you must:
Login to https://www.g2g.com/.
On top right of the menu bar, click on your avatar, select API Integration.
Settings | Description |
---|---|
Developer contact | G2G will send an alert email to this contact when your system does not respond upon receiving the webhook message. |
Callback URL | G2G will send the webhook message to this URL. The secret token is mandatory. G2G will use it to create a hash signature that is passed along in the g2g-signature. You can generate secret token on your own or use the "Generate random secret token" provided by G2G. Please copy the secret key and keep it securely. |
Events | You must fill in the callback URL before configuring webhook events. G2G will send webhook message to your system for the events you selected. By selecting all events, all existing events and any future incoming events will also be selected. |
If your application does not respond with 200 status code, G2G will try to send the message to you again up to 5 additional attempt, by following the retry schedule:
Retry Attempt | Next Resend Interval (minute) |
---|---|
1 | 30 |
2 | 60 |
3 | 120 |
4 | 240 |
5 | 480 |
Whenever webhook was triggered by an event, a signature will be embeded in the header.
Header | Type | Description |
---|---|---|
g2g-signature | String | Signature generated by webhook URL, api_key, user_id and timestamp via HMAC-SHA256 hashing algorithm. Example: e318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2 |
g2g-timestamp | String | The timestamp in milliseconds when G2G send the message to you. Example: 1654576148000 |
import hashlib, hmac
webhook_secret_token = "gBW1wXgBNnA" # Your Webhook Secret Token
user_id = "100000" # Your User ID
timestamp = "1653278884000" # g2g-timestamp
webhook_url = "https://www.your_webhook_url.com"
canonical_string = webhook_url + user_id + str(timestamp);
signature = hmac.new(
key=bytes(webhook_secret_token.encode("utf8")),
msg=bytes(canonical_string.encode("utf8")),
digestmod=hashlib.sha256,
).hexdigest()
print(signature) # This value should match with g2g-signature, which is 645343db00f974f5dab1f9e9ed8d4846a265e150291009fe40bfbdf437cfa16a
The webhooks for different stage of orders
Event | Trigger |
---|---|
order.created | Buyer placed the order but not yet paid. |
order.confirmed | Buyer has made the payment and payment is confirmed. |
order.delivery_status | The result of your delivery request, it could be fully delivered / partial delivered / unfulfilled Note: If you are not subscribed to this event, you can use Get Delivery Status API to check your delivery status. |
order.api_delivery | Seller is ready to deliver codes via API. Note: Seller should start prepare deliver the codes when receive this event. Please refer to Deliver Code API to deliver codes |
order.cancelled | The payment of the order is unsuccessful and cancelled. |
order.completed | Buyer has confirmed order received. |
order.rollback_cancelled | A cancelled order is moved back to unpaid. |
order.rollback_completed | Buyer reported issue after confirmed receipt. |
order.case_opened | Buyer reported an issue of the order. Note: Seller should investigate the reported case from G2G resolution center when receive this event. |
The webhooks for offer
Event | Trigger |
---|---|
offer.low_stock | Seller's offer is below the low stock threshold. |
The webhook is triggered when buyer placed the order but not yet paid.
g2g-signature | string The signed signature for webhook payload verification |
g2g-timestamp | string The timestamp when post the webhook |
id | string The event ID of the request. |
event_happened_at | integer Timestamp in milliseconds when the event occured. |
event_type | string Value: "order.created" The type of the webhook event. |
object Request payload. |
{- "id": "341a6ae1-34da-486e-b984-91a6f44cea07",
- "event_happened_at": 1652090542890,
- "event_type": "order.created",
- "payload": {
- "order_id": "1637925438960TE5T-1",
- "order_status": "unpaid",
- "order_payment_status": "to_pay",
- "seller_id": "600001",
- "buyer_id": "600002",
- "offer_currency": "MYR",
- "checkout_currency": "MYR",
- "unit_price": 102.77,
- "amount": 1027.7,
- "refunded_amount": 0,
- "commission_fee": 0,
- "commission_fee_rate": 10,
- "offer_service_type": "Gift Card",
- "purchased_qty": 10,
- "delivered_qty": 0,
- "refunded_qty": 0,
- "defected_qty": 0,
- "replacement_qty": 0,
- "other_pricing": [
- {
- "currency": "SGD",
- "unit_price": 30.8
}
], - "product_id": "ade06d1e-7148-41f3-a501-52c324b5b82a",
- "offer_id": "G1650423467624TE",
- "order_created_at": 1652090542890
}
}
The webhook is triggered when buyer has made the payment and payment is confirmed.
g2g-signature | string The signed signature for webhook payload verification |
g2g-timestamp | string The timestamp when post the webhook |
id | string The event ID of the request. |
event_happened_at | integer Timestamp in milliseconds when the event occured. |
event_type | string Value: "order.confirmed" The type of the webhook event. |
object Request payload. |
{- "id": "341a6ae1-34da-486e-b984-91a6f44cea07",
- "event_happened_at": 1652090542890,
- "event_type": "order.confirmed",
- "payload": {
- "order_id": "1637925438960TE5T-1",
- "order_status": "paid",
- "order_payment_status": "preparing",
- "seller_id": "600001",
- "buyer_id": "600002",
- "offer_currency": "MYR",
- "checkout_currency": "MYR",
- "unit_price": 102.77,
- "amount": 1027.7,
- "refunded_amount": 0,
- "commission_fee": 0,
- "commission_fee_rate": 10,
- "offer_service_type": "Gift Card",
- "purchased_qty": 10,
- "delivered_qty": 0,
- "refunded_qty": 0,
- "defected_qty": 0,
- "replacement_qty": 0,
- "product_id": "ade06d1e-7148-41f3-a501-52c324b5b82a",
- "offer_id": "G1650423467624TE",
- "order_created_at": 1652090542890
}
}
The webhook is triggered when order item is delivered.
Note: If you are not subscribed to this event, you can use Get Delivery Status API to check your delivery status.
g2g-signature | string The signed signature for webhook payload verification |
g2g-timestamp | string The timestamp when post the webhook |
id | string The event ID of the request. |
event_happened_at | integer Timestamp in milliseconds when the event occured. |
event_type | string Value: "order.delivery_status" The type of the webhook event. |
object Request payload. |
{- "id": "341a6ae1-34da-486e-b984-91a6f44cea07",
- "event_happened_at": 1661162265411,
- "event_type": "order.delivery_status",
- "payload": {
- "order_id": "1660548283983RS00-1",
- "seller_id": "509206",
- "buyer_id": "509205",
- "offer_id": "G1657548552630BT",
- "purchased_qty": 2,
- "defected_qty": 0,
- "replacement_qty": 0,
- "refunded_qty": 0,
- "undelivered_qty": 0,
- "delivered_qty": 2,
- "delivery_summary": {
- "delivery_id": "D1661161704676",
- "delivery_mode": "normal",
- "case_id": "",
- "requested_qty": 2,
- "delivery_status": "delivered",
- "delivered_at": 1661162265411,
- "delivery_issues": [ ],
- "delivered_qty": 1
}
}
}
The webhook is triggered to notify seller to start deliver via API.
Note: Seller should start prepare deliver the codes when receive this event. Please refer to Deliver Code API to deliver codes
g2g-signature | string The signed signature for webhook payload verification |
g2g-timestamp | string The timestamp when post the webhook |
id | string The event ID of the request. |
event_happened_at | integer Timestamp in milliseconds when the event occured. |
event_type | string Value: "order.api_delivery" The type of the webhook event. |
object Request payload. |
{- "id": "45252cb8-5f79-4b31-a0d8-761760bd3e57-1",
- "event_happened_at": 1671693034000,
- "event_type": "order.api_delivery",
- "payload": {
- "order_id": "1670568841157TEST-1",
- "buyer_id": "684896",
- "seller_id": "685064",
- "offer_id": "G16704985465TEST",
- "purchased_qty": 1,
- "defected_qty": 0,
- "delivered_qty": 0,
- "refunded_qty": 0,
- "replacement_qty": 0,
- "undelivered_qty": 1,
- "delivery_summary": {
- "additional_info_list": [
- {
- "attribute_group_id": "22aeaf9b",
- "attribute_group_name": "Text",
- "attribute_id": "",
- "attribute_key": "additional_info_1",
- "attribute_value": "",
- "value": "hello from purchase info"
}, - {
- "attribute_group_id": "6fdb4ee9",
- "attribute_group_name": "Number",
- "attribute_id": "",
- "attribute_key": "additional_info_3",
- "attribute_value": "",
- "value": "101"
}
], - "case_id": "",
- "delivery_id": "D1671693034000",
- "delivery_method_code": "direct_top_up",
- "delivery_method_list": [
- {
- "attribute_group_id": "e03ad929",
- "attribute_group_name": "Dropdown",
- "attribute_id": "27725a29",
- "attribute_key": "delivery_info_1",
- "attribute_value": "Server A",
- "value": ""
}, - {
- "attribute_group_id": "22aeaf9b",
- "attribute_group_name": "Text",
- "attribute_id": "",
- "attribute_key": "delivery_info_2",
- "attribute_value": "",
- "value": "hello from delivery info"
}
], - "delivery_mode": "normal",
- "expired_at": 0,
- "requested_at": 1671693034000,
- "requested_qty": 1
}
}
}
The webhook is triggered when the payment of the order is unsuccessful and cancelled.
g2g-signature | string The signed signature for webhook payload verification |
g2g-timestamp | string The timestamp when post the webhook |
id | string The event ID of the request. |
event_happened_at | integer Timestamp in milliseconds when the event occured. |
event_type | string Value: "order.cancelled" The type of the webhook event. |
object Request payload. |
{- "id": "341a6ae1-34da-486e-b984-91a6f44cea07",
- "event_happened_at": 1652090542890,
- "event_type": "order.cancelled",
- "payload": {
- "order_id": "1637925438960TE5T-1",
- "order_status": "verification_failed",
- "order_payment_status": "paid",
- "seller_id": "600001",
- "buyer_id": "600002",
- "offer_currency": "MYR",
- "checkout_currency": "MYR",
- "unit_price": 102.77,
- "amount": 1027.7,
- "refunded_amount": 0,
- "commission_fee": 0,
- "commission_fee_rate": 10,
- "offer_service_type": "Gift Card",
- "purchased_qty": 10,
- "delivered_qty": 0,
- "refunded_qty": 0,
- "defected_qty": 0,
- "replacement_qty": 0,
- "product_id": "ade06d1e-7148-41f3-a501-52c324b5b82a",
- "offer_id": "G1650423467624TE",
- "order_created_at": 1652090542890
}
}
The webhook is triggered when order was refunded.
g2g-signature | string The signed signature for webhook payload verification |
g2g-timestamp | string The timestamp when post the webhook |
id | string The event ID of the request. |
event_happened_at | integer Timestamp in milliseconds when the event occured. |
event_type | string Value: "order.refunded" The type of the webhook event. |
object Request payload. |
{- "id": "a8d99337-ea80-40c8-8b75-6c4cc191668a-1",
- "event_happened_at": 1666017142604,
- "event_type": "order.refunded",
- "payload": {
- "order_id": "1666016734094A2YF-1",
- "order_status": "refunded",
- "order_payment_status": "paid",
- "seller_id": "684814",
- "buyer_id": "1000000207",
- "offer_currency": "MYR",
- "checkout_currency": "THB",
- "unit_price": 250.99,
- "amount": 250.99,
- "refunded_amount": 250.99,
- "commission_fee": 25.1,
- "commission_fee_rate": 10,
- "offer_service_type": "Gift Cards",
- "purchased_qty": 1,
- "delivered_qty": 0,
- "refunded_qty": 1,
- "defected_qty": 0,
- "replacement_qty": 0,
- "product_id": "c9bf2323-fa8d-4c88-acc8-87d2ced62b72",
- "offer_id": "G1658853067797LZ",
- "order_created_at": 1666016740439,
- "refund_info": {
- "refunded_qty": 1,
- "refunded_amount": 250.99,
- "refunded_currency": "MYR"
}
}
}
The webhook is triggered when an order is completed.
g2g-signature | string The signed signature for webhook payload verification |
g2g-timestamp | string The timestamp when post the webhook |
id | string The event ID of the request. |
event_happened_at | integer Timestamp in milliseconds when the event occured. |
event_type | string Value: "order.completed" The type of the webhook event. |
object Request payload. |
{- "id": "341a6ae1-34da-486e-b984-91a6f44cea07",
- "event_happened_at": 1652090542890,
- "event_type": "order.completed",
- "payload": {
- "order_id": "1637925438960TE5T-1",
- "order_status": "delivered",
- "order_payment_status": "paid",
- "seller_id": "600001",
- "buyer_id": "600002",
- "offer_currency": "MYR",
- "checkout_currency": "MYR",
- "unit_price": 102.77,
- "amount": 1027.7,
- "refunded_amount": 0,
- "commission_fee": 0,
- "commission_fee_rate": 10,
- "offer_service_type": "Gift Card",
- "purchased_qty": 10,
- "delivered_qty": 0,
- "refunded_qty": 0,
- "defected_qty": 0,
- "replacement_qty": 0,
- "product_id": "ade06d1e-7148-41f3-a501-52c324b5b82a",
- "offer_id": "G1650423467624TE",
- "order_created_at": 1652090542890
}
}
The webhook is triggered when a cancelled order is moved back to unpaid order.
g2g-signature | string The signed signature for webhook payload verification |
g2g-timestamp | string The timestamp when post the webhook |
id | string The event ID of the request. |
event_happened_at | integer Timestamp in milliseconds when the event occured. |
event_type | string Value: "order.rollback_cancelled" The type of the webhook event. |
object Request payload. |
{- "id": "341a6ae1-34da-486e-b984-91a6f44cea07",
- "event_happened_at": 1652090542890,
- "event_type": "order.rollback_cancelled",
- "payload": {
- "order_id": "1637925438960TE5T-1",
- "order_status": "unpaid",
- "order_payment_status": "to_pay",
- "seller_id": "600001",
- "buyer_id": "600002",
- "offer_currency": "MYR",
- "checkout_currency": "MYR",
- "unit_price": 102.77,
- "amount": 1027.7,
- "refunded_amount": 0,
- "commission_fee": 0,
- "commission_fee_rate": 10,
- "offer_service_type": "Gift Card",
- "purchased_qty": 10,
- "delivered_qty": 0,
- "refunded_qty": 0,
- "defected_qty": 0,
- "replacement_qty": 0,
- "product_id": "ade06d1e-7148-41f3-a501-52c324b5b82a",
- "offer_id": "G1650423467624TE",
- "order_created_at": 1652090542890
}
}
The webhook is triggered when a completed order is rollback to delivering.
g2g-signature | string The signed signature for webhook payload verification |
g2g-timestamp | string The timestamp when post the webhook |
id | string The event ID of the request. |
event_happened_at | integer Timestamp in milliseconds when the event occured. |
event_type | string Value: "order.rollback_completed" The type of the webhook event. |
object Request payload. |
{- "id": "341a6ae1-34da-486e-b984-91a6f44cea07",
- "event_happened_at": 1652090542890,
- "event_type": "order.rollback_completed",
- "payload": {
- "order_id": "1637925438960TE5T-1",
- "order_status": "delivering",
- "order_payment_status": "paid",
- "seller_id": "600001",
- "buyer_id": "600002",
- "offer_currency": "MYR",
- "checkout_currency": "MYR",
- "unit_price": 102.77,
- "amount": 1027.7,
- "refunded_amount": 0,
- "commission_fee": 0,
- "commission_fee_rate": 10,
- "offer_service_type": "Gift Card",
- "purchased_qty": 10,
- "delivered_qty": 0,
- "refunded_qty": 0,
- "defected_qty": 0,
- "replacement_qty": 0,
- "product_id": "ade06d1e-7148-41f3-a501-52c324b5b82a",
- "offer_id": "G1650423467624TE",
- "order_created_at": 1652090542890
}
}
The webhook is triggered when buyer reported an issue of the order.
Note: Seller should investigate the reported case from G2G resolution center when receive this event.
g2g-signature | string The signed signature for webhook payload verification |
g2g-timestamp | string The timestamp when post the webhook |
id | string The event ID of the request. |
event_happened_at | integer Timestamp in milliseconds when the event occured. |
event_type | string Value: "order.case_opened" The type of the webhook event. |
object Request payload. |
{- "id": "341a6ae1-34da-486e-b984-91a6f44cea07",
- "event_happened_at": 1652090542890,
- "event_type": "order.case_opened",
- "payload": {
- "order_id": "1637925438960VUT5-1",
- "case_id": "20220630053830",
- "buyer_id": "684896",
- "seller_id": "684064",
- "case_reported_at": 1656567510028,
- "report_case": "cancel",
- "report_reason": "code_not_working",
- "remark": "code not working",
- "report_qty": 1,
- "offer_id": "G1650423467624TE"
}
}
The webhook is triggered when seller's offer is below the low stock threshold.
g2g-signature | string The signed signature for webhook payload verification |
g2g-timestamp | string The timestamp when post the webhook |
id | string The event ID of the request. |
event_happened_at | integer Timestamp in milliseconds when the event occured. |
event_type | string Value: "offer.low_stock" The type of the webhook event. |
object Request payload. |
{- "id": "341a6ae1-34da-486e-b984-91a6f44cea07",
- "event_happened_at": 1654240354288,
- "event_type": "offer.low_stock",
- "payload": {
- "offer_id": "G1635123822274GO",
- "seller_id": "684064",
- "actual_qty": 2,
- "api_qty": 1,
- "available_qty": 2,
- "low_stock_alert_qty": 5
}
}
Product
Offer
Order
The required action of the migration consists in:
https://open-api.g2g.com/v1/services
{
"code": 20000001,
"message": "",
"warning": "",
"request_id": "595285dc-9c43-4b9c-a1e6-0cd9aff5b084",
"payload": {
"service_list": [
{
"service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
"service_name": "Gift Cards",
"delivery_method": "instant_code_delivery"
}
]
}
}
https://open-api.g2g.com/v2/services
{
"code": 20000001,
"message": "",
"warning": "",
"request_id": "595285dc-9c43-4b9c-a1e6-0cd9aff5b084",
"payload": {
"service_list": [
{
"service_id": "44b3148a-0dc8-4262-81d8-c762559f0d74",
"service_name": "Gift Cards",
"categories": [
{
"category_name": "Gift Cards",
"category_id": "f6fc99db-96d2-4158-a29f-663d9a2f6199"
},
{
"category_name": "Video Games",
"sub_categories": [
{
"category_name": "PC Platform",
"category_id": "2994a61d-3993-44ba-8190-e3daac599278"
},
{
"category_name": "PSN (Playstation) Platform",
"category_id": "96364cef-838f-49c0-9efb-0fa90dfa06d2"
},
{
"category_name": "Xbox Platform",
"category_id": "148255f6-4ab4-4af4-833d-4deedb4fd574"
},
{
"category_name": "Nintendo Switch Platform",
"category_id": "dc67a04b-3aa1-460c-aaa3-549ebecb3404"
}
]
}
]
}
]
}
}
order.created
webhook to support other_pricing infoGet Brands
api to support retrieve the next set of results with after
parameter.Get Brands
api results per request to 1000order.refunded
webhook is selected in API IntegrationUpdate Offer
api all request body parameter become optionalUpdate Offer
api to required to pass in at least one parameter in request bodyorder.api_delivery
webhook to include expired_at value in delivery summary section