Get a Cart

Get a Cart by reference

GET https://api.moltin.com/v2/carts/:reference

Path Parameters

NameTypeDescription

reference

string

A custom reference for this cart created by you

Query Parameters

NameTypeDescription

include

string

comma delimited string of entities that can be included - valid options: items

Headers

NameTypeDescription

X-MOLTIN-CURRENCY

string

Specifies the currency to be used for the products in the cart. Your site's default will be used if not specified

Authorization

string

The Bearer token to grant access to the API

{
    "data": {
        "id": "360acb59-3fb7-4150-8066-ea54e850015b",
        "type": "cart",
        "links": {
            "self": "https://api.moltin.com/carts/360acb59-3fb7-4150-8066-ea54e850015b"
        },
        "meta": {
            "display_price": {
                "with_tax": {
                    "amount": 0,
                    "currency": "",
                    "formatted": "0"
                },
                "without_tax": {
                    "amount": 0,
                    "currency": "",
                    "formatted": "0"
                }
            },
            "timestamps": {
                "created_at": "0001-01-01T00:00:00Z",
                "updated_at": "0001-01-01T00:00:00Z"
            }
        }
    }
}

You can easily get a new or existing cart by providing the unique cart reference in the request.

An empty cart will be returned for any carts that don't currently exist. See Get Cart Items for how the cart items object looks.

We don't handle creating cart references. You will need to create your own.

If you do not pass a X-MOLTIN-CURRENCY header specifying what currency you would like the cart retrieved in, it will be returned with values in your default currency.

Get a Cart by reference

GET https://api.moltin.com/v2/carts/:reference

Path Parameters

NameTypeDescription

reference

string

A custom reference for this cart created by you

Headers

NameTypeDescription

X-MOLTIN-CURRENCY

string

Specifies the currency to be used for the products in the cart. Your site's default will be used if not specified

Authorization

string

The Bearer token to grant access to the API

{
    "data": {
        "id": "360acb59-3fb7-4150-8066-ea54e850015b",
        "type": "cart",
        "links": {
            "self": "https://api.moltin.com/carts/360acb59-3fb7-4150-8066-ea54e850015b"
        },
        "meta": {
            "display_price": {
                "with_tax": {
                    "amount": 0,
                    "currency": "",
                    "formatted": "0"
                },
                "without_tax": {
                    "amount": 0,
                    "currency": "",
                    "formatted": "0"
                }
            },
            "timestamps": {
                "created_at": "0001-01-01T00:00:00Z",
                "updated_at": "0001-01-01T00:00:00Z"
            }
        }
    }
}
curl -X GET https://api.moltin.com/v2/carts/:reference \
     -H "Authorization: Bearer XXXX"

Last updated