Add Transaction

See the sample example of how a transaction can be added. Links to more detailed instructions can be found at the end of the article.

How this example works

In this example, we will create a sample transaction to trigger the previously created campaign.


Try yourself

  • Input the previous saved token and storeCode in the request header

  • Add a transaction Endpoint: POST /api/{storeCode}/transaction

    {
        "transaction": {
            "items": [
                {
                    "sku": "12AB",
                    "name": "Restaurant",
                    "quantity": 1,
                    "grossValue": 500,
                    "category": "dine"
                }
            ],
            "header": {
                "documentType": "sell",
                "documentNumber": "12345",
                "purchasePlace": "onsite",
                "purchasedAt": "2024-05-01T00:00:00", // add current time
                "labels": []
            },
            "customerData": {
                "email": "john.smith@example.com"
            }
        }
    }
  • This action should trigger CampaignEffectWasApplied webhook


Endpoints used


More resources

For a detailed overview and description of the creation and management of the transaction, please refer to these series of articles:

Last updated

Was this helpful?