Webhooks

Available webhooks

onCustomerUpdate

{
   "type": "customer.updated",
    "data": {
            "customerId": "32c764d9-ddd5-401f-ac13-a7fcba0982ff"
         }
}

onCustomerDeleted

{
   "type": "customer.deleted",
    "data": {
            "customerId": "32c764d9-ddd5-401f-ac13-a7fcba0982ff"
         }
}

onCustomerRegistered

{
   "type": "customer.registered",
   "data": {
       "customerId": "32c764d9-ddd5-401f-ac13-a7fcba0982ff",
       "data": {
           "firstName": "Jon",
           "lastName": "Doe",
           "gender": "not_disclosed",
           "email": "jdoe@example.com",
           "phone": 123456789,
           "levelAchievementDate": "2019-08-09T14:08:28+02:00",
           "createdAt": 1563363348,
            "address": {
               "street": "Streets",
               "address1": "12",
               "address2": "3",
               "postal": "41-222",
               "city": "Glasgow",
               "province": "Glasgow",
               "country": "GB"
           },
           "company": {
               "name": "Hydropol",
               "nip": "123"
           },
           "loyaltyCardNumber": "444555666",
           "labels": [
               {
                   "key": "labels_key",
                   "value": "5"
               }
           ],
           "agreement1": true,
           "agreement2": false,
           "agreement3": false,
           "levelId": "e82c96cf-32a3-43bd-9034-4df343e50000",
           "posId": "00000000-0000-474c-1111-b0dd880c07e3",
           "sellerId": "00000000-0000-474c-b092-b0dd880c07e4"
       }
   }
}

onCustomerDeactivated

{
   "type": "customer.deactivated",
   "data": {
       "customerId": "32c764d9-ddd5-401f-ac13-a7fcba0982ff"
   }
}

onCustomerLevelChangedAutomatically

{
   "type": "customer.level_changed_automatically",
   "data": {
       "customerId": "32c764d9-ddd5-401f-ac13-a7fcba0982ff",
       "levelId": "e82c96cf-32a3-43bd-9034-4df343e51111",
       "levelName": "level1",
       "levelMove": "up",
             "levelAchievementDate": "2019-08-09T14:08:28+02:00",
   }
}

onCustomerLevelChanged

{
   "type": "customer.level_changed",
   "data": {
       "customerId": "32c764d9-ddd5-401f-ac13-a7fcba0982ff",
       "levelId": "e82c96cf-32a3-43bd-9034-4df343e50000",
       "levelName": "level0",
             "levelAchievementDate": "2019-08-09T14:08:28+02:00",
   }
}

onTransactionRegistered

{
   "type": "transaction.registered",
   "data": {
       "transactionId": "cb4cc2f7-d897-4fe0-b5a6-9b67a91c0729",
       "transactionData": {
           "documentType": "sell",
           "documentNumber": "80",
           "purchasePlace": null,
           "purchaseDate": "2019-08-09T14:08:28+02:00"
       },
       "customerData": {
           "name": "Jon Doe",
           "email": "jdoe@example.com",
           "phone": null,
           "loyaltyCardNumber": null,
           "nip": "123",
           "address": {
               "street": "Bridges",
               "address1": "12",
               "address2": “3”,
               "postal": "41-222",
               "city": "New york",
               "province": "NY",
               "country": "EN"
           }
       },
       "items": [
           {
               "sku": {
                   "code": "sku1230"
               },
               "name": "product_name",
               "quantity": 1,
               "grossValue": 80,
               "category": "Women",
               "maker": "Exclusive",
               "labels": []
           }
       ],
       "posId": null
   }
}

onTransactionAssignedToCustomer

{
   "type": "transaction.assigned_to_customer",
   "data": {
       "transactionId": "cb4cc2f7-d897-4fe0-b5a6-9b67a91c0729",
       "customerId": "32c764d9-ddd5-401f-ac13-a7fcba0982ff",
       "grossValue": 80,
   }
}

onAccountAvailablePointsAmountChanged

{
   "type": "account.available_points_amount_changed",
   "data": {
       "customerId": "32c764d9-ddd5-401f-ac13-a7fcba0982ff",
       "amount": 125,
       "amountChange": 25,
       "amountChangeType": "add”,
       "pointsTransferId": "e82c96cf-32a3-43bd-9034-4df343e5f333",
       "expiresAt": "2022-01-30T23:59:59+01:00",
       "transactionId": "cb4cc2f7-d897-4fe0-b5a6-9b67a91c0729"
   }
}

onCampaignBought

{
   "type": "customer.bought_campaign",
   "createdAt": "2020-09-24T14:09:13+02:00",
   "data": {
       "storeCode": "DEFAULT",
       "customerId": "00000000-0000-474c-b092-b0dd880c07e1",
       "campaignId": "38e45c26-7c57-3962-9516-3704fa3eb776",
       "costInPoints": 1.0,
       "couponCode": "655"
   }
}

onExpiringPointsNotification

{
   "type": "account.expiring_points_notification"
   "createdAt": "2021-12-14T14:16:54+00:00",
   "data": {
          "customerId": "00000000-0000-474c-b092-b0dd880c07e1",
          "customerEmail": "jdoe@example.com",
          "customerPhone": "+123456789",
          "customerLoyaltyCardNumber": "0000",
          "customerFirstName": "Jane",
          "customerLastName": "Doe",
          "points": 100.0,
          "pointsWillExpire": "2021-11-16T22:59:59+01:00",
          "storeCode": "DEFAULT"
   }
}