Skip to content

Cart Export Webhook

Michal7Cohen edited this page Dec 3, 2023 · 5 revisions

Overview

The Cart Export webhook provides customers with the ability to export cart item information to an external service for additional processing (backup, analysis, integration with third systems, etc.). The uStore Connect Enterprise store uses the Cart Export webhook to get a URL to the custom checkout page.

Read more:
Configuring the Cart Export webhook in uStore
Cart Export webhook sample application
Cart Export webhook sample application documentation

The following diagram shows the Cart Export webhook flow:

HTTP request to the webhook

uStore sends data to the webhook in JSON format and uses the URL from store setup, in the body of the HTTP POST request. The request should have the following headers:

  • Content-Type: application/json
  • X-Signature: hashing of the request body (the body needs to be hashed with the signatureKey using SHA-512 algorithm)

uStore hashes the body of the request and sends it in the X-Signature header, and expects the webhook to do the same for the body of the response.
The hashing is done with the signatureKey using SHA-512 algorithm.

Request body

{
  "user": {
    "id": "",
    "email": ""
  },
  "store": {
    "id": "",
    "name": ""
  },
  "list": {
    "id": "",
    "externalID": "",
    "modificationDate": "",
    "lastExportDate": "",
    "items": [
      {
        "ID": "",
        "product": {
          "ID": "",
          "name": "",
          "catalogNumber": ""
        },
        "nickname": "",
        "quantity": 0,
        "validations": [
          {
            "type": 0,
            "level": 0,
            "message": ""
          }
        ]
      }
    ]
  }
}

 
ValidationLevels:  
{  
Warning = 1,  
Error = 2,  
}  
 
 
ValidationTypes:  
{  
        InventoryExceeded = 1,  
        InventoryOutOfStock = 2,  
        InventoryDelayed = 3,  
        ProductNotAvailable = 4,  
        ProductComponentNotAvailable = 5,  
        MaxUnitsExceeded = 6,  
        MinUnitsNotReached = 7,  
        ProductUnitChanged = 8,  
        MaxUnitsExceededForOrder = 9,  
        RecipientListModelInvalid = 10,  
        DeliveryMethodInvalid = 11,  
        GdprFilesDeleted = 12,  
        ProductOptionsChanged = 13  
} 

HTTP response from the webhook

The response should have the following headers:

  • Content-Type: application/json
  • X-Signature: hashing of the response body (the body needs to be hashed with the signatureKey using SHA-512 algorithm)

Example of a response body

{  
  "externalID": "",  
  "externalUrl": "",  
  "redirectUrl": ""  
}  

ExternalID – ID from the POST request to match data between the request and the response.
ExternalUrl – URL that is shown after the shopper clicks the “Export” button.
RedirectUrl – URL for automatic response from uStore to the checkout page.

Clone this wiki locally