Skip to main content

Get Codes

Allows you to fetch codes that are ready for use within specific orders. As our system fulfills an order, codes will be progressively available for each individual product. You have the flexibility to fetch codes either partially as they become available or fully in a single request.

GET /v2/orders/{transactionId}/codes​

Request​

HTTP Headers​

To use this endpoint, the following headers are required for authentication:

HeaderTypeRequiredDescription
x-api-keyStringYesAPI key assigned to your account for accessing the service.
AuthorizationStringYesBearer token for authenticating the API request.

Path Parameters​

ParameterTypeRequiredDescription
transactionIdStringYesUnique identifier of the transaction to retrieve codes for.

Query Parameters​

Optionally, you can include the following parameters to filter the codes retrieval:

ParameterTypeRequiredDefault ValueDescription
skuStringNoNoneOptional filter by product SKU.
stockIdsStringNoNoneOptional filter by list of EZ stock identifiers.

Example Request​

GET /v2/orders/trans_1234567890/codes?sku=8PX-UF-Y5U&status=COMPLETED HTTP/1.1
Host: api.example.com
Content-Type: application/json
x-api-key: <API_KEY>
Authorization: Bearer <BEARER_ACCESS_TOKEN>

Response​

HTTP Status Codes​

Status CodeDescription
200OK - The codes associated with the specified order are returned successfully.
400Bad Request - The request was invalid, often due to incorrect path or query parameters.
404Not Found - The specified codes could not be found.
500Internal Server Error - An error occurred on the server side.

Schema​

PropertyTypeNullableDescription
requestIdStringNoUnique identifier assigned to each request for tracking purposes.
dataProductResponse[]NoList of product in the order.

ProductResponse​

PropertyTypeNullableDescription
skuStringNoThe SKU of the product.
quantityIntegerNoThe quantity of the product.
codesCodeResponseNoList of codes in the product.

CodeResponse​

PropertyTypeNullableDescription
stockIdIntegerNoThe unique identifier of the stock.
statusCodeStatusNoThe status of the code.
redeemCodeStringYesThe redeemable code for the product (can be null if not available).
pinCodeIntegerYesThe PIN code for the product (can be null if not available).

CodeStatus​

ValueTypeDescription
PROCESSINGStringThe code is currently being processed.
COMPLETEDStringThe code has been completed successfully.

Example 200 OK Response​

{
"requestId": "c4c7b997-79a5-4bde-9f17-47ad7eac9ed4",
"data": [
{
"sku": "8PX-UF-Y5U",
"quantity": 100,
"codes": [
{
"stockId": 1,
"status": "COMPLETED",
"redeemCode": "J72D-I83E-N87F-213E-B980-K915",
"pinCode": 1234
},
{
"stockId": 2,
"status": "PROCESSING",
"redeemCode": null,
"pinCode": null
}
]
}
]
}