Notifications

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

Cas 1 : Voucher confirmation

When user will reserve a voucher in admin this endpoint will be called :

POST https://api.plateforme.com/notifications/jackpot/reserve?notificationKey=<maNotificationKey> avec

  • <maNotificationKey> : notificationKey sent in JWT
  • payload:
    {
    "id":"d9708add-6307-418b-a3fc-8c82aa11c9a9",    // Voucher's id
    "state":"RESERVED",                             // Voucher's state
    "value":110,                                    // Majored amount
    "initialAmount":150,                            // Initial amount
    "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)
    // Following fields are null since the voucher is not yet confirmed
    "url":null,                                     // PDF's url
    "confirmDate":null,                             // Voucher's confirmation date
    "sendDate":null,                                // Voucher's send date
    "paymentState":null,                            // Voucher's payment state
    "customTransactionId":null,                     // Platform's transaction id
    "backUrl":null,                                 // notification's url
    "walletOperationId":null                        // Funds transfer id
    }

    The endpoint should handle following actions :

    1. Identify user thanks to notificationKey
    2. Transfer from user's wallet to Jackpot's wallet (optional)
    3. Response STATUT 200 with a JSON body containing following fields :
      • email (Optionnal): end-user email, only if voucher is sent by Jackpot
      • backUrl : notificationUrl to sent back voucher to platform or for any update regarding voucher lifecycle
      • walletOperationId : (only if you operate with wallets)operationId of funds transfer between user's wallet and Jackpot's wallet (required)
      • customTransactionId : transaction id for platform (optional)
{
  email: 'email.utilisateur@mail.com',                  // User's email (Optionnal)
  walletOperationId: 'Transfer.Id',                     //  transfer funds operationId between user's wallet and Jackpot's wallet
  backUrl: 'https://api.plateforme.com/notifications',   // notificationUrl to sent back voucher to platform or for any update regarding coupon lifecycle, see [Notifications](notifications.md)
  customTransactionId: 'monIdDeTransaction'             // transaction id for platform
}

NOTE : you need to send at least email or backurl in order to allow voucher to be sent to user.

Jackpot then confirm voucher and prepare it.

Cas 2 : Voucher's availability confirmation

This endpoint is called when the voucher is confirmed

POST https://api.plateforme.com/notifications/jackpot/reserve?notificationKey=<maNotificationKey> with

  • <maNotificationKey> : notificationKey sent in jwt
  • payload:
    {
    "id":"d9708add-6307-418b-a3fc-8c82aa11c9a9",    // Voucher's id
    "state":"READY",                             // Voucher's state
    "value":110,                                    // Majored amount
    "initialAmount":150,                            // Initial amount
    "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)
    "url":"https://someurl",                                     // PDF's url
    "confirmDate":"2017-06-24T15:27:32.502Z",                             // Voucher's confirmation date
    "sendDate":"2017-06-24T17:27:32.502Z",                                // Voucher's send date
    "paymentState":"",                            // Voucher's payment state
    "customTransactionId":"1234",                     // Platform's transaction id
    "backUrl":"https://api.plateforme.com/notifications/jackpot/reserve",                                 // notification's url
    "walletOperationId":"12345",                        // fund transfer operation id
    }

The endpoint should handle following actions :

  1. Identify user thanks to notificationKey
  2. Send an email with to user with generated voucher
  3. Response STATUT 200 without body