catalogs detail Items
Endpoint
GET https://{{host}}/api/v1/catalogs/:product_type/:product_code/items
Available Request Headers
| Key | Value |
|---|---|
| Content-Type | application/json |
| x-api-key | 51f4b8ad3a4c9f0859253700436f0a343d05602761c306c4cb514215fdf33c5a |
Available Request Query Params
| Name | Value | Type |
|---|---|---|
| product_type | game-voucher | path |
| product_code | MOBILE_LEGEND | path |
Available Request Body
No body defined.
Sample Request and Response
success
Sample Request
Headers
| Key | Value |
|---|---|
| Content-Type | application/json |
| x-api-key | 51f4b8ad3a4c9f0859253700436f0a343d05602761c306c4cb514215fdf33c5a |
Params
| Name | Value | Type |
|---|---|---|
| product_type | game-voucher | path |
| product_code | MOBILE_LEGEND | path |
Body
No body defined.
Sample Response
{
"data": [
{
"id": 20513,
"item_code": "MOBILE_LEGEND_3_DIAMOND",
"name": "3 Diamonds",
"price": 1050
},
{
"id": 20515,
"item_code": "MOBILE_LEGEND_6_DIAMOND",
"name": "5 Diamonds",
"price": 2000
},
{
"id": 20553,
"item_code": "MOBILE_LEGEND_222_DIAMOND",
"name": "222 Diamonds (200 + 22 Bonus)",
"price": 10000
},
{
"id": 20556,
"item_code": "MOBILE_LEGEND_257_DIAMONDS",
"name": "257 Diamonds (234 + 23 Bonus)",
"price": 10000
}
],
"status_code": "200",
"status_message": "Transaction successful"
}
error
Sample Request
Headers
| Key | Value |
|---|---|
| Content-Type | application/json |
| x-api-key | 51f4b8ad3a4c9f0859253700436f0a343d05602761c306c4cb514215fdf33c5a |
Params
| Name | Value | Type |
|---|---|---|
| product_type | game-voucher | path |
| product_code | MOBILE_LEGEND | path |
Body
No body defined.
Sample Response
{
"data": null,
"status_code": "400",
"status_message": "Bad request",
"error": "Invalid response format"
}
Documentation
Retrieve purchasable item (variant) list for a single game voucher product. Use this endpoint to populate selectable denominations (e.g. Diamonds, UC) before calling Payment. Prices here are snapshot values; final charge is confirmed during Payment.
Endpoint
GET /api/v1/catalogs/game-voucher/:product_code/items
Headers
| Header | Required | Description |
|---|---|---|
| x-api-key | Yes | Client API key issued by Snapcart |
Path Parameters
| Name | Type | Length | Required | Description |
|---|---|---|---|---|
| product_code | string | 1–64 | Yes | Game voucher product code (e.g. MOBILE_LEGEND, PUBGMID). |
Query Parameters
(None)
Request Body
(None)
Sample Response (MOBILE_LEGEND)
{
"data": [
{
"id": 20513,
"item_code": "MOBILE_LEGEND_3_DIAMOND",
"name": "3 Diamonds",
"price": 1050
},
{
"id": 20515,
"item_code": "MOBILE_LEGEND_6_DIAMOND",
"name": "5 Diamonds",
"price": 2000
},
{
"id": 20553,
"item_code": "MOBILE_LEGEND_222_DIAMOND",
"name": "222 Diamonds (200 + 22 Bonus)",
"price": 10000
},
{
"id": 20556,
"item_code": "MOBILE_LEGEND_257_DIAMONDS",
"name": "257 Diamonds (234 + 23 Bonus)",
"price": 10000
}
],
"status_code": "200",
"status_message": "Transaction successful"
}
Sample Response (PUBGMID)
{
"data": [
{
"id": 19883,
"item_code": "PUBGMID_30UC",
"name": "30 UC",
"price": 7000
},
{
"id": 19885,
"item_code": "PUBGMID_60UC",
"name": "60 UC",
"price": 13305
}
],
"status_code": "200",
"status_message": "Transaction successful"
}
Field Definitions (Array Elements in data)
| Field | Type | Description |
|---|---|---|
| id | number | Internal identifier for the item/variant. |
| item_code | string | Code used in Payment body to purchase this variant. Stable identifier. |
| name | string | Display name (may include bonus breakdown, e.g. “222 Diamonds (200 + 22 Bonus)”). |
| price | number | Unit price (amount charged before any additional fee component, if applicable). |
Notes:
- price is a snapshot; if dynamic pricing or promotions occur, retrieve fresh data before Payment.
- item_code must be sent exactly as returned; do not transform or lowercase unless explicitly documented.
- Some products may return more or fewer items than examples above; treat the list as fully dynamic.
- Bonus composition (e.g. “234 + 23 Bonus”) is descriptive only; business logic should rely on item_code + price, not parsing the name.
- Additional fields may appear in future (e.g. currency, bonus_amount, active); ignore unknown keys safely.
Error Examples
Product Not Found:
{
"status_code": "404",
"status_message": "Product not found",
"error": "Inactive or invalid product_code"
}
Unauthorized:
{
"status_code": "401",
"status_message": "Unauthorized",
"error": "API key not found in request"
}
Rate Limited:
{
"status_code": "429",
"status_message": "Too many requests, please try again later",
"error": "Rate limit exceeded"
}
Response Variability
Different product_code values can yield:
- Different counts of items.
- Variant naming styles (plain, with bonus breakdown, localized naming).
- Potential future fields (e.g. “active”, “currency”, “promo_tag”).
Always iterate the returned array directly; never assume fixed positions or counts.
Next Step After Retrieving Items
- User selects an item_code (and provides required user input fields from the catalog detail endpoint if needed, e.g. userId, zoneId).
- Submit Payment:
- Body includes product_code, item_code, and any dynamic user input fields.
- Poll Payment Status or wait for callback to confirm success/failure.
Best Practices
| Concern | Recommendation |
|---|---|
| Stale pricing | Refresh items list periodically (e.g. daily or when opening purchase modal). |
| Missing expected variant | Fallback gracefully (hide the option); do not hard-code item_code set. |
| Sorting | Prefer server order; if needed sort by ascending price client-side. |
| Caching | Use short TTL; avoid stale bonus promotions. |
| Validation | Only send item_code values returned by this endpoint. |