In-App Purchase Offer Codes
List all values for an in-app purchase offer code one-time use code
Read one-time-use redemption codes as JSON strings. The service decodes Apple’s CSV download into a paginated collection.
/purchase-code-batches/{purchaseCodeBatcheId}/valuesProposed · Extended read design · Adapter not implemented
Request
Routes are relative to your connection. Use a facade API key; the service manages Apple authentication.
BASE='https://asc.example.com/v1/connections/conn_example'
curl --fail-with-body "$BASE/purchase-code-batches/purchase_code_batche_123/values" \
-H "Authorization: Bearer $ASC_FACADE_KEY"const base = "https://asc.example.com/v1/connections/conn_example";
const response = await fetch(`${base}/purchase-code-batches/purchase_code_batche_123/values`, {
headers: { Authorization: `Bearer ${process.env.ASC_FACADE_KEY}` }
});
const body = await response.json();
if (!response.ok) {
throw new Error(body.error?.message ?? `HTTP ${response.status}`);
}
console.log(body);import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError
base = "https://asc.example.com/v1/connections/conn_example"
request = Request(
f"{base}/purchase-code-batches/purchase_code_batche_123/values",
headers={"Authorization": f"Bearer {os.environ['ASC_FACADE_KEY']}"},
)
try:
with urlopen(request) as response:
print(json.load(response))
except HTTPError as error:
detail = json.load(error)
raise RuntimeError(detail["error"]["message"]) from errorasc.example.com is a placeholder for your deployment. Examples use fictional IDs.
Path parameters
| Name | Type | Description |
|---|---|---|
| purchaseCodeBatcheId | string | The selected resource’s ID. |
Query parameters
| Name | Type | Description |
|---|---|---|
| limit | integer | Number of items per page, from 1 to 200. |
| cursor | string | Opaque nextCursor from a previous response. Keep the route, connection, filters, and ordering unchanged. |
Response
A page of plain redemption codes, with an opaque continuation cursor.
{
"items": [
"EXAMPLE-OFFER-CODE"
],
"nextCursor": null
}Illustrative response. Optional read fields may be absent or null; unknown enum values are preserved.
Response fields
| Name | Type | Description |
|---|---|---|
| items | string[] | The current page of redemption codes. |
| nextCursor | string | null | Opaque continuation token, or null when the collection is complete. Pass it back as cursor. |
Behavior
- Apple returns a CSV file for this endpoint. This JSON adapter is an extended proposal: parsing, header validation, download limits, and immutable snapshot pagination must be implemented before it can be used.
Pagination
Pass nextCursor back as cursor with the same filters and ordering. Stop when it is null. Each request returns one bounded page; the service never reports a capped or incomplete traversal as a complete collection.
Errors
| HTTP | Type | Description |
|---|---|---|
| 400 | invalid_query | Unsupported filter, sort, limit, or cursor. |
| 401 | unauthorized | Missing or invalid facade API key. |
| 403 | forbidden / upstream_forbidden | The caller or configured Apple key cannot read this resource. |
| 404 | resource_not_found | The requested resource, parent, or exact locale is absent or outside the caller’s scope. |
| 429 | rate_limited | A facade or Apple rate limit was reached. Respect Retry-After when returned. |
| 502–504 | upstream error | Apple authentication, response parsing, availability, or timeout failure; this is not an empty result. |
Apple mapping
Upstream route and translation
The adapter calls GET /v1/inAppPurchaseOfferCodeOneTimeUseCodes/{id}/values. Read Apple’s original endpoint ↗
This endpoint returns text/csv. The proposed adapter parses complete, validated records into JSON strings and pages an immutable decoded snapshot.
| Facade parameter | Type | Description |
|---|---|---|
| limit | query | Facade-owned pagination |
| cursor | query | Facade-owned pagination |
Reviewed 2026-10-14 · OpenAPI 4.5.1