Overview
CSV Feed
PHP SDK
API Integration
API For Partners
Shopping Carts
Returns the amount of abandoned and recovered shopping carts.
Method: GET
URL: https://api.retargeting.app/v1/partners-api/shopping-carts
Function parameters
Field | Type | Required | Description |
---|---|---|---|
rest_key | number or text | True | The REST API Key of the client. |
date_from | number | Optional (Required only if date_to parameter is given) | Unix Timestamp (Example: 1729590921). If not provided, default fallback is 30 days in the past from now. |
date_to | number | Optional | Unix Timestamp (Example: 1732182921). If not provided, default fallback is the current time. |
The interval between date_from and date_to parameters (if provided) must not exceed 30 days.
Your account status must be in one of the states: PAID, PAYMENT ERROR or ACCOUNT SUSPENDED.
If your account is Inactive or Closed the API call will not work.
The API call will respond with JSON format.
Example
<?php require_once "vendor/autoload.php"; $apiURL = "https://api.retargeting.app/v1/partners-api/shopping-carts"; $apiKey = "REST_KEY"; $client = new GuzzleHttp\Client(); $registerData = [ "rest_key" => $apiKey, ]; $request = $client->request("GET", $apiURL, ["query" => $registerData]);
If the API call succeeds, then the response will be as seen below:
{ status: "success", data: { abandoned: 8, recovered: 5 } }
If the API call fails, then the responses will be similar to the ones below:
When the rest_key parameter is invalid:
{ status: "error", message: "Incorrect rest key!" }
When the account is not active:
{ status: "error", message: "Your account is not active!" }
When the interval between date_from and date_to parameters is greater than 30 days:
{ status: "error", message: "Interval is greater than 30 days" }
When date_from parameter is not provided together with date_to parameter:
{ status: "fail", data: { validator: { date_from: [ "The date from field is required when date to is present." ] } } }
When something went wrong:
{ status: "error", message: "Something went wrong" }