Overview

This request allows you to trigger an already existing abandoned cart workflow. You will do this when you want to add a contact that adds an item to their cart and does not follow through on purchase a workflow.

All of the API methods used for ecommerce use their own API, which is different from the system’s standard API. The Store Hash and the Customer Hash is used rather a username and API key.

You will need to provide the Store Hash as the custom HTTP Header X-EV-Store-hash and Customer Hash as the custom HTTP Header X-EV-Customer-hash. You can see examples of this below.

You will also need to set the Content-Type HTTP header to application/json

The Method

API-Method
RESTPOSThttps://[Your URL] /servlet/e-commerce/abandoned-cart

Headers

Property TypeDescriptionDefaultRequired
x-ev-store-hashstringStore Hash, can be gotten from the Store pageYes
x-ev-customer-hashstringCustomer Hash, can be gotten from the stores page.Yes

Parameters

Property TypeDescriptionDefaultRequired
Contact Identifier (contact_email or contact_unique_id)stringThe contact that needs to be actioned, it could be one of either the contact _email or contact_unique_idYes
productsarrayArray of products that was abandoned that needs to be actioned.Yes
checkout_urlstringThe Store checkout URL that shows the cartNo
workflow_id integerIf you want to specify what Workflow to be triggered, you pass in the ID of the Workflow you want to add the contacts to. This can be found by hovering over the checkbox of the Workflow on the Workflow History page.No

Code Samples

Example Request

$client = new \GuzzleHttp\Client(['headers' => [
            'x-ev-store-hash' => '6361437b-7adf-402c-b4b0-9e4a3a1e5d85',
            'Content-Type' => 'application/json',
            'x-ev-customer-hash'      => '7URV2nrUrSHswsrE'
        ]]);
        $request_param = [
            'products'    => json_decode('[{
              "product_description": "Mandatory coherent internet solution",
              "product_name": "Mop Head - Cotton, 24 Oz",
              "product_price": 21,
              "product_quantity": 4,
              "product_sku": 412,
              "product_line_total": 100043.22,
              "product_special_price": 71,
              "product_url": "https://bbb.org/risus.xml",
              "product_gallery": ["https://source.unsplash.com/400x1300/?rap", "https://source.unsplash.com/400x300/?rap"]
            }]'),
            'contact_email' => '[email protected]'
        ];
        $request_data = json_encode($request_param);

        $response = $client->post('https://qa-za.everlytic.net/servlet/e-commerce/abandoned-cart', ['body' => $request_data]);

Example Response

{"status":"success"}