Calculate quote totals based on address and shipping method

POST /V1/carts/{cartId}/totals-information

Calculate quote totals based on address and shipping method.

Path parameters

  • cartId integer Required

Body

  • addressInformation object Required

    Interface TotalsInformationInterface

    Hide addressInformation attributes Show addressInformation attributes object
    • address object Required

      Interface AddressInterface

      Hide address attributes Show address attributes object
      • id integer

        Id

      • region string Required

        Region name

      • region_id integer Required

        Region id

      • region_code string Required

        Region code

      • country_id string Required

        Country id

      • street array[string] Required

        Street

      • company string

        Company

      • telephone string Required

        Telephone number

      • fax string

        Fax number

      • postcode string Required

        Postcode

      • city string Required

        City name

      • firstname string Required

        First name

      • lastname string Required

        Last name

      • middlename string

        Middle name

      • prefix string

        Prefix

      • suffix string

        Suffix

      • vat_id string

        Vat id

      • customer_id integer

        Customer id

      • email string Required

        Billing/shipping email

      • same_as_billing integer

        Same as billing flag

      • customer_address_id integer

        Customer address id

      • save_in_address_book integer

        Save in address book flag

      • extension_attributes object

        ExtensionInterface class for @see \Magento\Quote\Api\Data\AddressInterface

        Hide extension_attributes attributes Show extension_attributes attributes object
        • discounts array[object]

          Rule discount Interface

          Rule discount Interface

          Hide discounts attributes Show discounts attributes object
          • discount_data object Required

            Discount Data Interface

            Hide discount_data attributes Show discount_data attributes object
            • amount number Required

              Amount

            • base_amount number Required

              Base Amount

            • original_amount number Required

              Original Amount

            • base_original_amount number Required

              Base Original Amount

          • rule_label string Required

            Rule Label

          • rule_i_d integer Required

            Rule ID

        • gift_registry_id integer
        • pickup_location_code string
      • custom_attributes array[object]

        Interface for custom attribute value.

        Interface for custom attribute value.

        Hide custom_attributes attributes Show custom_attributes attributes object
        • attribute_code string Required

          Attribute code

        • value string Required

          Attribute value

    • shipping_method_code string

      Shipping method code

    • shipping_carrier_code string

      Carrier code

    • extension_attributes object

      ExtensionInterface class for @see \Magento\Checkout\Api\Data\TotalsInformationInterface

    • custom_attributes array[object]

      Interface for custom attribute value.

      Interface for custom attribute value.

      Hide custom_attributes attributes Show custom_attributes attributes object
      • attribute_code string Required

        Attribute code

      • value string Required

        Attribute value

Responses

  • 200

    200 Success.

    Hide response attributes Show response attributes object
    • grand_total number

      Grand total in quote currency

    • base_grand_total number

      Grand total in base currency

    • subtotal number

      Subtotal in quote currency

    • base_subtotal number

      Subtotal in base currency

    • discount_amount number

      Discount amount in quote currency

    • base_discount_amount number

      Discount amount in base currency

    • subtotal_with_discount number

      Subtotal in quote currency with applied discount

    • base_subtotal_with_discount number

      Subtotal in base currency with applied discount

    • shipping_amount number

      Shipping amount in quote currency

    • base_shipping_amount number

      Shipping amount in base currency

    • shipping_discount_amount number

      Shipping discount amount in quote currency

    • base_shipping_discount_amount number

      Shipping discount amount in base currency

    • tax_amount number

      Tax amount in quote currency

    • base_tax_amount number

      Tax amount in base currency

    • weee_tax_applied_amount number Required

      Item weee tax applied amount in quote currency.

    • shipping_tax_amount number

      Shipping tax amount in quote currency

    • base_shipping_tax_amount number

      Shipping tax amount in base currency

    • subtotal_incl_tax number

      Subtotal including tax in quote currency

    • base_subtotal_incl_tax number

      Subtotal including tax in base currency

    • shipping_incl_tax number

      Shipping including tax in quote currency

    • base_shipping_incl_tax number

      Shipping including tax in base currency

    • base_currency_code string

      Base currency code

    • quote_currency_code string

      Quote currency code

    • coupon_code string

      Applied coupon code

    • items_qty integer

      Items qty

    • items array[object]

      Interface TotalsItemInterface

      Interface TotalsItemInterface

      Hide items attributes Show items attributes object
      • item_id integer Required

        Item id

      • price number Required

        Item price in quote currency.

      • base_price number Required

        Item price in base currency.

      • qty number Required

        Item quantity.

      • row_total number Required

        Row total in quote currency.

      • base_row_total number Required

        Row total in base currency.

      • row_total_with_discount number

        Row total with discount in quote currency. Otherwise, null.

      • tax_amount number

        Tax amount in quote currency. Otherwise, null.

      • base_tax_amount number

        Tax amount in base currency. Otherwise, null.

      • tax_percent number

        Tax percent. Otherwise, null.

      • discount_amount number

        Discount amount in quote currency. Otherwise, null.

      • base_discount_amount number

        Discount amount in base currency. Otherwise, null.

      • discount_percent number

        Discount percent. Otherwise, null.

      • price_incl_tax number

        Price including tax in quote currency. Otherwise, null.

      • base_price_incl_tax number

        Price including tax in base currency. Otherwise, null.

      • row_total_incl_tax number

        Row total including tax in quote currency. Otherwise, null.

      • base_row_total_incl_tax number

        Row total including tax in base currency. Otherwise, null.

      • options string Required

        Item price in quote currency.

      • weee_tax_applied_amount number Required

        Item weee tax applied amount in quote currency.

      • weee_tax_applied string Required

        Item weee tax applied in quote currency.

      • extension_attributes object

        ExtensionInterface class for @see \Magento\Quote\Api\Data\TotalsItemInterface

        Hide extension_attributes attributes Show extension_attributes attributes object
        • negotiable_quote_item_totals object

          Extension attribute for quote item totals model.

          Hide negotiable_quote_item_totals attributes Show negotiable_quote_item_totals attributes object
          • cost number Required

            Cost for quote item.

          • catalog_price number Required

            Catalog price for quote item.

          • base_catalog_price number Required

            Catalog price for quote item in base currency.

          • catalog_price_incl_tax number Required

            Catalog price with included tax for quote item.

          • base_catalog_price_incl_tax number Required

            Catalog price with included tax for quote item in base currency.

          • cart_price number Required

            Cart price for quote item.

          • base_cart_price number Required

            Cart price for quote item in base currency.

          • cart_tax number Required

            Tax from catalog price for quote item.

          • base_cart_tax number Required

            Tax from catalog price for quote item in base currency.

          • cart_price_incl_tax number Required

            Cart price with included tax for quote item.

          • base_cart_price_incl_tax number Required

            Cart price with included tax for quote item in base currency.

          • extension_attributes object

            ExtensionInterface class for @see \Magento\NegotiableQuote\Api\Data\NegotiableQuoteItemTotalsInterface

        • sku string
        • manufacturer_name string
        • regular_price_incl_tax string
      • name string

        Product name. Otherwise, null.

    • total_segments array[object] Required

      Interface TotalsInterface

      Interface TotalsInterface

      Hide total_segments attributes Show total_segments attributes object
      • code string Required

        Code

      • title string

        Total title

      • value number Required

        Total value

      • area string

        Display area code.

      • extension_attributes object

        ExtensionInterface class for @see \Magento\Quote\Api\Data\TotalSegmentInterface

        Hide extension_attributes attributes Show extension_attributes attributes object
        • tax_grandtotal_details array[object]

          Interface GrandTotalDetailsInterface

          Interface GrandTotalDetailsInterface

          Hide tax_grandtotal_details attributes Show tax_grandtotal_details attributes object
          • amount number Required

            Tax amount value

          • rates array[object] Required

            Interface GrandTotalRatesInterface

            Interface GrandTotalRatesInterface

            Hide rates attributes Show rates attributes object
            • percent string Required

              Tax percentage value

            • title string Required

              Rate title

          • group_id integer Required

            Group identifier

        • gift_cards string
        • gw_order_id string
        • gw_item_ids array[string]
        • gw_allow_gift_receipt string
        • gw_add_card string
        • gw_price string
        • gw_base_price string
        • gw_items_price string
        • gw_items_base_price string
        • gw_card_price string
        • gw_card_base_price string
        • gw_base_tax_amount string
        • gw_tax_amount string
        • gw_items_base_tax_amount string
        • gw_items_tax_amount string
        • gw_card_base_tax_amount string
        • gw_card_tax_amount string
        • gw_price_incl_tax string
        • gw_base_price_incl_tax string
        • gw_card_price_incl_tax string
        • gw_card_base_price_incl_tax string
        • gw_items_price_incl_tax string
        • gw_items_base_price_incl_tax string
    • extension_attributes object

      ExtensionInterface class for @see \Magento\Quote\Api\Data\TotalsInterface

      Hide extension_attributes attributes Show extension_attributes attributes object
      • coupon_label string
      • negotiable_quote_totals object

        Extension attribute for quote totals model.

        Hide negotiable_quote_totals attributes Show negotiable_quote_totals attributes object
        • items_count integer Required

          The number of different items or products in the cart.

        • quote_status string Required

          Negotiable quote status.

        • created_at string Required

          The cart creation date and time.

        • updated_at string Required

          The cart last update date and time.

        • customer_group integer Required

          Customer group id.

        • base_to_quote_rate number Required

          Base currency to quote currency rate.

        • cost_total number Required

          Total cost for quote.

        • base_cost_total number Required

          Total cost for quote in base currency.

        • original_total number Required

          Original quote total.

        • base_original_total number Required

          Original quote total in base currency.

        • original_tax number Required

          Original tax amount for quote.

        • base_original_tax number Required

          Original tax amount for quote in base currency.

        • original_price_incl_tax number Required

          Original price with included tax for quote.

        • base_original_price_incl_tax number Required

          Original price with included tax for quote in base currency.

        • negotiated_price_type integer Required

          Negotiable quote type.

        • negotiated_price_value number Required

          Negotiable price value for quote.

      • base_customer_balance_amount number
      • customer_balance_amount number
      • coupon_codes array[string]
      • coupons_labels array[string]
      • reward_points_balance number
      • reward_currency_amount number
      • base_reward_currency_amount number
  • 401

    401 Unauthorized

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

  • default

    Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Error details

      Hide errors attributes Show errors attributes object
      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Error parameters item

        Hide parameters attributes Show parameters attributes object
        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Error parameters item

      Hide parameters attributes Show parameters attributes object
      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

POST /V1/carts/{cartId}/totals-information
curl \
 --request POST 'https://magento2.winkelstraat.mac/rest/all/V1/carts/{cartId}/totals-information' \
 --data '{"addressInformation":{"address":{"id":42,"region":"string","region_id":42,"region_code":"string","country_id":"string","street":["string"],"company":"string","telephone":"string","fax":"string","postcode":"string","city":"string","firstname":"string","lastname":"string","middlename":"string","prefix":"string","suffix":"string","vat_id":"string","customer_id":42,"email":"string","same_as_billing":42,"customer_address_id":42,"save_in_address_book":42,"extension_attributes":{"discounts":[{"discount_data":{"amount":42.0,"base_amount":42.0,"original_amount":42.0,"base_original_amount":42.0},"rule_label":"string","rule_i_d":42}],"gift_registry_id":42,"pickup_location_code":"string"},"custom_attributes":[{"attribute_code":"string","value":"string"}]},"shipping_method_code":"string","shipping_carrier_code":"string","extension_attributes":{},"custom_attributes":[{"attribute_code":"string","value":"string"}]}}'
Request examples
{
  "addressInformation": {
    "address": {
      "id": 42,
      "region": "string",
      "region_id": 42,
      "region_code": "string",
      "country_id": "string",
      "street": [
        "string"
      ],
      "company": "string",
      "telephone": "string",
      "fax": "string",
      "postcode": "string",
      "city": "string",
      "firstname": "string",
      "lastname": "string",
      "middlename": "string",
      "prefix": "string",
      "suffix": "string",
      "vat_id": "string",
      "customer_id": 42,
      "email": "string",
      "same_as_billing": 42,
      "customer_address_id": 42,
      "save_in_address_book": 42,
      "extension_attributes": {
        "discounts": [
          {
            "discount_data": {
              "amount": 42.0,
              "base_amount": 42.0,
              "original_amount": 42.0,
              "base_original_amount": 42.0
            },
            "rule_label": "string",
            "rule_i_d": 42
          }
        ],
        "gift_registry_id": 42,
        "pickup_location_code": "string"
      },
      "custom_attributes": [
        {
          "attribute_code": "string",
          "value": "string"
        }
      ]
    },
    "shipping_method_code": "string",
    "shipping_carrier_code": "string",
    "extension_attributes": {},
    "custom_attributes": [
      {
        "attribute_code": "string",
        "value": "string"
      }
    ]
  }
}
Response examples (200)
{
  "grand_total": 42.0,
  "base_grand_total": 42.0,
  "subtotal": 42.0,
  "base_subtotal": 42.0,
  "discount_amount": 42.0,
  "base_discount_amount": 42.0,
  "subtotal_with_discount": 42.0,
  "base_subtotal_with_discount": 42.0,
  "shipping_amount": 42.0,
  "base_shipping_amount": 42.0,
  "shipping_discount_amount": 42.0,
  "base_shipping_discount_amount": 42.0,
  "tax_amount": 42.0,
  "base_tax_amount": 42.0,
  "weee_tax_applied_amount": 42.0,
  "shipping_tax_amount": 42.0,
  "base_shipping_tax_amount": 42.0,
  "subtotal_incl_tax": 42.0,
  "base_subtotal_incl_tax": 42.0,
  "shipping_incl_tax": 42.0,
  "base_shipping_incl_tax": 42.0,
  "base_currency_code": "string",
  "quote_currency_code": "string",
  "coupon_code": "string",
  "items_qty": 42,
  "items": [
    {
      "item_id": 42,
      "price": 42.0,
      "base_price": 42.0,
      "qty": 42.0,
      "row_total": 42.0,
      "base_row_total": 42.0,
      "row_total_with_discount": 42.0,
      "tax_amount": 42.0,
      "base_tax_amount": 42.0,
      "tax_percent": 42.0,
      "discount_amount": 42.0,
      "base_discount_amount": 42.0,
      "discount_percent": 42.0,
      "price_incl_tax": 42.0,
      "base_price_incl_tax": 42.0,
      "row_total_incl_tax": 42.0,
      "base_row_total_incl_tax": 42.0,
      "options": "string",
      "weee_tax_applied_amount": 42.0,
      "weee_tax_applied": "string",
      "extension_attributes": {
        "negotiable_quote_item_totals": {
          "cost": 42.0,
          "catalog_price": 42.0,
          "base_catalog_price": 42.0,
          "catalog_price_incl_tax": 42.0,
          "base_catalog_price_incl_tax": 42.0,
          "cart_price": 42.0,
          "base_cart_price": 42.0,
          "cart_tax": 42.0,
          "base_cart_tax": 42.0,
          "cart_price_incl_tax": 42.0,
          "base_cart_price_incl_tax": 42.0,
          "extension_attributes": {}
        },
        "sku": "string",
        "manufacturer_name": "string",
        "regular_price_incl_tax": "string"
      },
      "name": "string"
    }
  ],
  "total_segments": [
    {
      "code": "string",
      "title": "string",
      "value": 42.0,
      "area": "string",
      "extension_attributes": {
        "tax_grandtotal_details": [
          {
            "amount": 42.0,
            "rates": [
              {
                "percent": "string",
                "title": "string"
              }
            ],
            "group_id": 42
          }
        ],
        "gift_cards": "string",
        "gw_order_id": "string",
        "gw_item_ids": [
          "string"
        ],
        "gw_allow_gift_receipt": "string",
        "gw_add_card": "string",
        "gw_price": "string",
        "gw_base_price": "string",
        "gw_items_price": "string",
        "gw_items_base_price": "string",
        "gw_card_price": "string",
        "gw_card_base_price": "string",
        "gw_base_tax_amount": "string",
        "gw_tax_amount": "string",
        "gw_items_base_tax_amount": "string",
        "gw_items_tax_amount": "string",
        "gw_card_base_tax_amount": "string",
        "gw_card_tax_amount": "string",
        "gw_price_incl_tax": "string",
        "gw_base_price_incl_tax": "string",
        "gw_card_price_incl_tax": "string",
        "gw_card_base_price_incl_tax": "string",
        "gw_items_price_incl_tax": "string",
        "gw_items_base_price_incl_tax": "string"
      }
    }
  ],
  "extension_attributes": {
    "coupon_label": "string",
    "negotiable_quote_totals": {
      "items_count": 42,
      "quote_status": "string",
      "created_at": "string",
      "updated_at": "string",
      "customer_group": 42,
      "base_to_quote_rate": 42.0,
      "cost_total": 42.0,
      "base_cost_total": 42.0,
      "original_total": 42.0,
      "base_original_total": 42.0,
      "original_tax": 42.0,
      "base_original_tax": 42.0,
      "original_price_incl_tax": 42.0,
      "base_original_price_incl_tax": 42.0,
      "negotiated_price_type": 42,
      "negotiated_price_value": 42.0
    },
    "base_customer_balance_amount": 42.0,
    "customer_balance_amount": 42.0,
    "coupon_codes": [
      "string"
    ],
    "coupons_labels": [
      "string"
    ],
    "reward_points_balance": 42.0,
    "reward_currency_amount": 42.0,
    "base_reward_currency_amount": 42.0
  }
}
Response examples (401)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (default)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}