This method is deprecated in favor of Webhooks.
See Webhook as the preferred way to get notifications about events happening during the voucher lifecycle.
You should set a notification URL in your backoffice in field reserveNotificationUrl
.
For example, if your endpoint is: https://api.plateforme.com/notifications/jackpot/reserve
When a voucher is reserved, Jackpot calls this endpoint:
POST https://api.plateforme.com/notifications/jackpot/reserve?notificationKey=<myNotificationKey>
with
<myNotificationKey>
: notificationKey sent in JWT{
"id":"d9708add-6307-418b-a3fc-8c82aa11c9a9", // Voucher's id
"state":"RESERVED", // Voucher's state
"value":110, // Voucher value
"price":150, // Voucher price
"reservationDate":"2017-06-24T15:27:32.502Z", // Reservation date
"validityDate":"2018-01-31T00:00:00.000Z", // Voucher's expiration date
"resaExpireDate":"2017-06-26T15:27:37.502Z", // Reservation's expiration date
"couponId":"AGYPMNVXPJ", // Human friendly id (for support)
}
You can identify the end-user who reserved the voucher using the notification key, which is the one you provided in the JWT.
If you agree with the voucher reservation the endpoint must reply with a 200 status code.
Jackpot then confirms voucher and edits it.
Jackpot calls this endpoint when the confirmed voucher is ready.
POST https://api.plateforme.com/notifications/jackpot/reserve?notificationKey=<myNotificationKey>
with
<myNotificationKey>
: notificationKey sent in jwt{
"id":"d9708add-6307-418b-a3fc-8c82aa11c9a9", // Voucher's id
"state":"READY", // Voucher's state
"value":110, // Voucher value
"price":150, // Voucher price
"reservationDate":"2017-06-24T15:27:32.502Z", // Reservation date
"validityDate":"2018-01-31T00:00:00.000Z", // Voucher's expiration date
"resaExpireDate":"2017-06-26T15:27:37.502Z", // Reservation's expiration date
"couponId":"AGYPMNVXPJ", // Human friendly id (for support)
"signedUrl":"https://someurl", // Signed URL to voucher PDF, valid for one hour
"confirmDate":"2017-06-24T15:27:32.502Z", // Voucher's confirmation date
"sendDate":"2017-06-24T17:27:32.502Z", // Voucher's send date
}
This endpoint must reply with a 200 status code.
Note that you should download the voucher PDF using the provided URL (NOTE : url is valid for an hour. If it has expired, you can get a new one via route “GET /v2/vouchers/{voucherId}/signedurl”)