Skip to content

Payload branch "attributes"

The first "branch" of the payload is made of those informations that are relative to the cart/checkout/purchase only, and for some reason they cannot be easily grouped into other "scoped branch".

Let's review an example:

js
{
  "context": "...",
  "event": "...",
  "checkout_step": "...",
  "attributes": {
    "id": 298,
    "lang_id": "it",
    "availability_mode": "master",
    "currency": {
      "id": 1,
      "name": "Euro",
      "iso_code": "EUR"
    },
    "products_total_qty": 2,
    "total": "84.96",
    "total_cart_discount": "0",
    "total_discount": "0",
    "total_taxes": "15.32",
    "total_products": "539.95",
    "total_products_real": "84.96",
    "total_products_discount": "454.99",
    "total_shipment": "0",
    "total_payment": "0"
  },
  "products": [...],
  "carrier": {...},
  "payment": {...},
  "delivery": {...},
  "billing": {...},
  "user": {...},
  "engagements": {...}
}

Variables full details

Here you can find a detailed description of each variable or sub-branch:

VarTypeDescription
idintCurrent cart session id
lang_idstringISO-CODE of the user language
availability_modestringInternal logic for order splitting
currencyobjectThe currenct currency object;
see Object: "currency"
products_total_qtyintOverall total quantity of items in the cart
totalstringFinal total for the current cart
total_cart_discountstringAmount of the "cart_discount" for the current cart
total_discountstringAmount of the "discount" for the current cart
total_taxesstringTotal taxes for the current cart
total_productsstringTotal for all products (without reductions)
total_products_realstringTotal for all products (reductions applied)
total_products_discountstringTotal reduction applied to products
total_shipmentstringShipment extra charge
total_paymentstringPayment extra charge

Object: "currency"

This object holds informations about a currency, and it is always defined with these variables:

VarTypeDescription
idintUnique id
namestringTranslated description
iso_codestringUniversal ISO-CODE(3)

Released under the MIT License.