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"]
}
Parameter | Description | Example | Required |
---|---|---|---|
codes | Voucher codes you want to lock | ["35V7CN67FT","J9J6UID26U"] | mandatory |
host | Hostname | api.example.com | mandatory |
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"
]
Updated 8 months ago