View Cart

This cURL request interacts with the Magento REST API to retrieve the details of the current customer's shopping cart.

GET {{Base_url}}/rest/V1/carts/mine

Allows the user to view the current state of their cart, including items, quantities, and totals

curl --location '{{Base_url}}/rest/V1/carts/mine' \
--header 'Authorization: Bearer eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjIyNjE4OSwidXR5cGlkIjozLCJpYXQiOjE3Mzc0NDE0MTcsImV4cCI6MTczNzQ0NTAxN30.xB_tImU6iGs2f8ehwgveJfdVvDG3nWzsunGh96HKXr8' \
--header 'Cookie: PHPSESSID=ahe98g76v38cnn70hiot92saio; private_content_version=5ab80b7def0c212f723edead3c971a19'

Responses

{
    "id": 615982,
    "created_at": "2025-01-21 06:22:47",
    "updated_at": "2025-01-21 13:06:09",
    "is_active": true,
    "is_virtual": false,
    "items": [
        {
            "item_id": 97337,
            "sku": "IFPZMB-RD0",
            "qty": 1,
            "name": "iFrogz Audio- Ear Pollution Plugz with Mic - Red",
            "price": 399,
            "product_type": "simple",
            "quote_id": "615982"
        }
    ],
    "items_count": 1,
    "items_qty": 1,
    "customer": {
        "id": 210027,
        "group_id": 1,
        "default_billing": "18102",
        "default_shipping": "18102",
        "created_at": "2024-05-28 08:16:06",
        "updated_at": "2025-01-21 13:00:40",
        "created_in": "Default Store View",
        "email": "qa@zrpl.co.in",
        "firstname": "qa",
        "lastname": "qa",
        "gender": 0,
        "store_id": 1,
        "website_id": 1,
        "addresses": [
            {
                "id": 18102,
                "customer_id": 210027,
                "region": {
                    "region_code": "AP",
                    "region": "Andhra Pradesh",
                    "region_id": 534
                },
                "region_id": 534,
                "country_id": "IN",
                "street": [
                    "hsr",
                    "banglore"
                ],
                "telephone": "7095078863",
                "postcode": "535101",
                "city": "VIZIANAGARAM",
                "firstname": "second",
                "lastname": "qa",
                "default_shipping": true,
                "default_billing": true
            },
            {
                "id": 18145,
                "customer_id": 210027,
                "region": {
                    "region_code": "KA",
                    "region": "Karnataka",
                    "region_id": 549
                },
                "region_id": 549,
                "country_id": "IN",
                "street": [
                    "test",
                    "qaqa"
                ],
                "telephone": "7095078863",
                "postcode": "560034",
                "city": "BENGALURU URBAN",
                "firstname": "Surya",
                "lastname": "qa"
            }
        ],
        "disable_auto_group_change": 0,
        "extension_attributes": {
            "is_subscribed": false
        },
        "custom_attributes": [
            {
                "attribute_code": "reward_balance",
                "value": "0"
            },
            {
                "attribute_code": "reward_amount",
                "value": "0"
            },
            {
                "attribute_code": "isautocreated",
                "value": "0"
            },
            {
                "attribute_code": "mobile_number",
                "value": "7095078863"
            },
            {
                "attribute_code": "monthly_purchase_cap",
                "value": "499"
            }
        ]
    },
    "billing_address": {
        "id": 1090269,
        "region": "Andhra Pradesh",
        "region_id": 534,
        "region_code": "AP",
        "country_id": "IN",
        "street": [
            "hsr",
            "banglore"
        ],
        "telephone": "7095078863",
        "postcode": "535101",
        "city": "VIZIANAGARAM",
        "firstname": "second",
        "lastname": "qa",
        "customer_id": 210027,
        "email": "qa@zrpl.co.in",
        "same_as_billing": 0,
        "customer_address_id": 18102,
        "save_in_address_book": 0
    },
    "orig_order_id": 0,
    "currency": {
        "global_currency_code": "INR",
        "base_currency_code": "INR",
        "store_currency_code": "INR",
        "quote_currency_code": "INR",
        "store_to_base_rate": 0,
        "store_to_quote_rate": 0,
        "base_to_global_rate": 1,
        "base_to_quote_rate": 1
    },
    "customer_is_guest": false,
    "customer_note_notify": true,
    "customer_tax_class_id": 3,
    "store_id": 1,
    "extension_attributes": {
        "shipping_assignments": [
            {
                "shipping": {
                    "address": {
                        "id": 1090270,
                        "region": null,
                        "region_id": null,
                        "region_code": null,
                        "country_id": null,
                        "street": [
                            ""
                        ],
                        "telephone": null,
                        "postcode": null,
                        "city": null,
                        "firstname": null,
                        "lastname": null,
                        "customer_id": 210027,
                        "email": "qa@zrpl.co.in",
                        "same_as_billing": 1,
                        "customer_address_id": 18102,
                        "save_in_address_book": 0
                    },
                    "method": null
                },
                "items": [
                    {
                        "item_id": 97337,
                        "sku": "IFPZMB-RD0",
                        "qty": 1,
                        "name": "iFrogz Audio- Ear Pollution Plugz with Mic - Red",
                        "price": 399,
                        "product_type": "simple",
                        "quote_id": "615982"
                    }
                ]
            }
        ]
    }
}

Cart-Level Attributes:

  • id: The unique identifier for the cart (quote ID). Example: 615982.

  • created_at: Timestamp indicating when the cart was created. Example: 2025-01-21 06:22:47.

  • updated_at: Timestamp of the most recent update to the cart. Example: 2025-01-21 13:06:09.

  • is_active: Boolean value indicating if the cart is active. (true means the cart is still in use).

  • is_virtual: Indicates if the cart contains only virtual (non-physical) items. Example: false.

  • items: An array of items in the cart. Each item has attributes:

    • item_id: Unique identifier for the cart item. Example: 97337.

    • sku: Stock Keeping Unit, the unique product identifier. Example: IFPZMB-RD0.

    • qty: Quantity of the item in the cart. Example: 1.

    • name: Name of the product. Example: iFrogz Audio- Ear Pollution Plugz with Mic - Red.

    • price: Price of the product. Example: 399.

    • product_type: Type of product (e.g., simple indicates a standalone product).

    • quote_id: The quote ID to which this item belongs. Example: 615982.

  • items_count: Total number of distinct items in the cart. Example: 1.

  • items_qty: Total quantity of all items in the cart. Example: 1.


Customer Information (customer):

  • id: Unique identifier for the customer. Example: 210027.

  • group_id: The customer group ID (e.g., 1 for general customers).

  • default_billing and default_shipping: IDs of the default billing and shipping addresses. Example: 18102.

  • created_at and updated_at: Account creation and last update timestamps.

  • email: Customer's email address. Example: qa@zrpl.co.in.

  • firstname and lastname: Customer’s first and last names. Example: qa.

  • gender: Gender of the customer (e.g., 0 often means unspecified).

  • store_id and website_id: Identifiers for the store and website where the customer belongs. Example: 1.

  • addresses: An array of customer addresses:

    • id: Unique identifier for the address. Example: 18102 or 18145.

    • customer_id: The customer ID associated with this address.

    • region:

      • region_code: The region's code (e.g., AP for Andhra Pradesh or KA for Karnataka).

      • region: Full name of the region.

      • region_id: Numeric identifier for the region.

    • country_id: Country code. Example: IN (India).

    • street: An array containing the street address (can have multiple lines). Example: ["hsr", "banglore"].

    • telephone: Contact number. Example: 7095078863.

    • postcode: Postal code. Example: 535101.

    • city: Name of the city. Example: VIZIANAGARAM or BENGALURU URBAN.

    • firstname and lastname: First and last names associated with the address.

    • default_shipping and default_billing: Boolean values indicating if the address is set as default for shipping or billing.

  • extension_attributes.is_subscribed: Indicates if the customer is subscribed to newsletters. Example: false.

  • custom_attributes: Additional customer attributes:

    • reward_balance and reward_amount: Reward-related balances. Example: 0.

    • isautocreated: Indicates if the account was auto-created. Example: 0.

    • mobile_number: Customer’s mobile number. Example: 7095078863.

    • monthly_purchase_cap: Purchase limit. Example: 499.


Billing Address (billing_address):

  • id: Unique identifier for the billing address. Example: 1090269.

  • region: Region name. Example: Andhra Pradesh.

  • region_id and region_code: Numeric and code identifiers for the region. Example: 534 and AP.

  • country_id: Country code. Example: IN.

  • street: Street address (multi-line array). Example: ["hsr", "banglore"].

  • telephone: Contact number. Example: 7095078863.

  • postcode: Postal code. Example: 535101.

  • city: City name. Example: VIZIANAGARAM.

  • firstname and lastname: First and last names associated with the billing address.

  • customer_address_id: Reference to the customer’s address. Example: 18102.


Currency Information (currency):

  • global_currency_code: Global currency used. Example: INR.

  • base_currency_code: Base currency of the store. Example: INR.

  • quote_currency_code: Currency specific to the cart. Example: INR.

  • store_to_base_rate and store_to_quote_rate: Conversion rates (e.g., 1 indicates no conversion).

  • base_to_global_rate and base_to_quote_rate: Conversion rates between currencies. Example: 1.


Customer and Store Information:

  • customer_is_guest: Indicates if the customer is a guest (false means logged-in customer).

  • customer_note_notify: If true, the customer is notified when a note is added.

  • customer_tax_class_id: Tax class assigned to the customer. Example: 3.

  • store_id: Store ID where the cart is created. Example: 1.


Extension Attributes:

  • shipping_assignments: Details about shipping assignments:

    • shipping.address: Shipping address details.

      • same_as_billing: Indicates if the shipping address is the same as the billing address.

      • Other attributes (e.g., street, postcode, telephone) follow the same structure as the billing address.

    • shipping.method: The shipping method (null if not set).

    • items: Items associated with this shipping address.

{
    "message": "The consumer isn't authorized to access %resources.",
    "parameters": {
        "resources": "self"
    }
}

Last updated