Developers

Products

Markdown

Add codes

Adds codes to the stock of a digital product, and delivers the orders waiting for them.

POST/stores/{storeId}/v1/products/{id}/codes

Send 1 to 1,000 codes in one request, each up to 500 characters. Your app cannot read the codes back. A code that already exists refuses the whole request, so nothing is added by half. The store then delivers the orders waiting for codes.

Path parameters

idstringrequired

Headers

Idempotency-Keystringrequired

Request body

codesarray<string>required

Response

dataobjectrequired
product_idstring
addedinteger
availableinteger
executionobject
Who executed the request: the app, version, installation and store. Field names here are camelCase.
appIdstring (uuid)
versionIdstring (uuid)
installationIdstring (uuid)
storeIdstring (uuid)
requestIdstring (uuid)
generationinteger
routeEpochinteger
appAuthEpochinteger
grantRevisioninteger
metaobjectrequired
request_idstring (uuid)
The request ID; include it in any support request.

Errors

HTTPCodeMeaning
400IDEMPOTENCY_KEY_REQUIREDNo Idempotency-Key header.
404RESOURCE_NOT_FOUNDThe ID does not exist in this store.
409STORE_RULE_REFUSEDA code already exists or repeats in the request, or this product is not sold by codes.
422INVALID_INPUTToo many codes, a code that is too long, no usable code, or a physical product.
403SCOPE_REQUIREDThe token does not carry the required scope.

Shared codes are listed in Errors.

    ↑↓ moveEnter openEsc close