For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update a bulk voucher code

Fully updates a voucher code. This is the operation used to activate or deactivate a code by setting its status to active or passive.

Business rules:

  • A code whose current status is used cannot be updated (promotion_100_5).

  • A user can hold at most one code per basket offer; re-assigning the code to a user who already holds one for the same offer is rejected (promotion_100_6).

put
/bulk_voucher_codes/{id}/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Path parameters
idintegerRequired

The unique identifier of the bulk voucher code.

Body

The payload accepted when creating or updating a bulk voucher code.

codestring · max: 32Required

The voucher code value. Must be unique across all bulk voucher codes.

basket_offerintegerRequired

Identifier of the parent basket offer.

statusstring · enumRequired

The lifecycle status of a voucher code.

  • active — the code can be redeemed; new codes always start here
  • passive — the code is disabled
  • used — the code has been redeemed and can no longer be updated
  • revoked — the code has been withdrawn
Possible values:
userinteger · nullableOptional

Identifier of the user the code is assigned to, when any. A user can hold at most one code per basket offer.

Responses
200

The updated voucher code.

application/json

A bulk voucher code as returned by the API.

pkintegerOptional

Unique voucher code identifier.

codestringOptional

The voucher code value.

basket_offerintegerOptional

Identifier of the parent basket offer.

statusstring · enumOptional

The lifecycle status of a voucher code.

  • active — the code can be redeemed; new codes always start here
  • passive — the code is disabled
  • used — the code has been redeemed and can no longer be updated
  • revoked — the code has been withdrawn
Possible values:
userinteger · nullableOptional

Identifier of the user the code is assigned to, when any.

user_emailstring · nullableOptional

Email address of the assigned user, when any.

put/bulk_voucher_codes/{id}/
PUT /api/remote/1/bulk_voucher_codes/{id}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 62

{
  "code": "text",
  "basket_offer": 1,
  "status": "active",
  "user": null
}
{
  "pk": 1041,
  "code": "KOTON9AB3FF76",
  "basket_offer": 35763,
  "status": "active",
  "user": 20518,
  "user_email": "customer@example.com"
}

Last updated

Was this helpful?