View Categories

Cart Paid

3 min read

The Cart Paid API allows you to send bulk cart paid notifications to Releva. Any cart paid notifications submitted through this API will be live within 1 minute of receiving a successful response.

Do I need to call it? #

You need to call this in order to fully use Releva. Without implementing this, store revenue, attribution tracking, and order-based segmentation will not function.

Request Parameters #

You may perform requests to the API using the following curl equivalent:

curl -H 'Content-Type: application/json' -H 'Authorization: Bearer <secretKey>' -XPOST https://releva.ai/api/v0/carts -d'{
  "carts": [
    {
      "email": "user@email.com",
      "phoneNumber": "+359123",
      "orderId": "orderId1",
      "cartPaid": true,
      "products": [
        {
          "id": "1",
          "price": 10,
          "currency": "BGN",
          "quantity": 2,
          "custom": {
            "string": [
              {"key": "color", "values": ["red"]}
            ],
            "numeric": [
              {"key": "size", "values": [18]}
            ]
          }
        }
      ],
      "custom": {
        "string": [
          {"key": "city", "values": ["San Francisco"]}
        ],
        "numeric": [
          {"key": "rewardPoints", "values": [18]}
        ]
      },
      "timestamp": "YYYY-mm-ddT00:00:00.000Z"
    }
  ]
}'

The cart Object #

FieldTypeDescription
carts[].emailString (Optional)The email of the user who has placed the order. You need to pass an email, a phone number, or both.
carts[].phoneNumberString (Optional)The phone number of the user who has placed the order. Phone numbers must start with “+” followed by a sequence of numbers. Valid phone number: +49875345976. you need to pass an email, a phone number, or both.
carts[].orderIdStringA unique order ID that identifies the completed order once a cart has been checked out. If the cart is not checked out, this should not be set.
carts[].cartPaidBooleanTrue if the cart has been checked out, false otherwise.
carts[].customObject (Optional)The custom fields associated with thecart, for example the reward points gained for this order, and/or the order address. See custom for details.
carts[].timestampISO-8601 String (Optional)The date and time when this visitor created their order. We will use the current date and time if you don’t send this field.
carts[].companyIdString (Optional)The id of the company to associate this cart with.
carts[].acceptPrivacyPolicyBoolean (Optional)The consent of the user with our privacy policy.
carts[].products[]Array[Object]A list of products in the cart
carts[].products[].idStringThe id of the product in the cart.
carts[].products[].priceFloatThe unit price at which the product was purchased.
carts[].products[].quantityIntegerThe units purchased
carts[].products[].currencyISO-4217 StringThe currency of the product
carts[].products[].customObject (Optional)The custom fields associated with the product in the cart, for example the chosen size and color. See custom for details.

A successful response will return HTTP Status 202 with an empty resposne body ({}).

Response Format #

An error response will return a HTTP 4xx or 5xx status code and have the following structure:

{
  "message": "A description of the error and how to fix it, if it's a client error."
}