Skip to main content

catalogs detail Items

Endpoint

GET https://{{host}}/api/v1/catalogs/:product_type/:product_code/items

Available Request Headers

KeyValue
Content-Typeapplication/json
x-api-key51f4b8ad3a4c9f0859253700436f0a343d05602761c306c4cb514215fdf33c5a

Available Request Query Params

NameValueType
product_typegame-voucherpath
product_codeMOBILE_LEGENDpath

Available Request Body

No body defined.


Sample Request and Response

success

Sample Request

Headers
KeyValue
Content-Typeapplication/json
x-api-key51f4b8ad3a4c9f0859253700436f0a343d05602761c306c4cb514215fdf33c5a
Params
NameValueType
product_typegame-voucherpath
product_codeMOBILE_LEGENDpath
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
KeyValue
Content-Typeapplication/json
x-api-key51f4b8ad3a4c9f0859253700436f0a343d05602761c306c4cb514215fdf33c5a
Params
NameValueType
product_typegame-voucherpath
product_codeMOBILE_LEGENDpath
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

HeaderRequiredDescription
x-api-keyYesClient API key issued by Snapcart

Path Parameters

NameTypeLengthRequiredDescription
product_codestring1–64YesGame 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)

FieldTypeDescription
idnumberInternal identifier for the item/variant.
item_codestringCode used in Payment body to purchase this variant. Stable identifier.
namestringDisplay name (may include bonus breakdown, e.g. “222 Diamonds (200 + 22 Bonus)”).
pricenumberUnit 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

  1. User selects an item_code (and provides required user input fields from the catalog detail endpoint if needed, e.g. userId, zoneId).
  2. Submit Payment:
    • Body includes product_code, item_code, and any dynamic user input fields.
  3. Poll Payment Status or wait for callback to confirm success/failure.

Best Practices

ConcernRecommendation
Stale pricingRefresh items list periodically (e.g. daily or when opening purchase modal).
Missing expected variantFallback gracefully (hide the option); do not hard-code item_code set.
SortingPrefer server order; if needed sort by ascending price client-side.
CachingUse short TTL; avoid stale bonus promotions.
ValidationOnly send item_code values returned by this endpoint.