Lock value voucher

In order to lock value vouchers with Centili Vouchers API, you need to send HTTP PUT request with voucher codes in request body and Content-Type: application/json.

Before initiating a lock voucher request you will need to obtain an access token, with client vouchers and provided secret.

URL to which a request should be sent:

https://{host}/vouchers/v1/value/lock

PUT lock voucher request

https://{host}/vouchers/v1/value/lock HTTP/1.1
Host: {host}:443
Content-Type: application/json
Authorization:bearer token

{
     "codes": ["35V7CN67FT","J9J6UID26U"]
}
ParameterDescriptionExampleRequired
codesVoucher codes you want to lock["35V7CN67FT","J9J6UID26U"]mandatory
hostHostnameapi.example.commandatory

All vouchers must be in status INACTIVE in order to be locked. If any of the voucher codes are in a different status, none of them will be locked.

PUT lock voucher response

πŸ‘

200

Vouchers are locked

HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "code": "35V7CN67FT",
    "status": "LOCKED"
  },
  {
    "code": "J9J6UID26U",
    "status": "LOCKED"
  }
]

πŸ›‘

409

Some or all of the provided vouchers are in wrong state for locking (not in INACTIVE state)

HTTP/1.1 409 CONFLICT
Content-Type: application/json

[
  "errorCode": "INVALID_STATE",
  "errorMessage": "All vouchers must be INACTIVE in order to become LOCKED"
]