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

Partially update a bulk voucher code

Partially updates a voucher code. Only the provided fields are changed; the business rules described under Update a bulk voucher code apply.

The most common use is toggling a single code between active and passive:

{ "status": "passive" }
patch
/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.

patch/bulk_voucher_codes/{id}/
PATCH /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?