Cart Settings
You can modify the cart expiry settings to set it to any number of days up to 365. Any existing carts default to the expiry of 7 days.
GET
Cart Settings
https://api.moltin.com/v2/settings/cart
Parameters
Headers
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token required to get access to the API. Grant type must be client_credentials . |
Request example
curl -X GET https://api.moltin.com/v2/settings/cart \
-H "Authorization: Bearer XXXX"
Response example
200 OK
{
"data": {
"type": "settings",
"cart_expiry_days": 7
}
}
PUT
Cart Settings
https://api.moltin.com/v2/settings/cart
Parameters
Headers
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token required to get access to the API. Grant type must be client_credentials . |
Body
Name | Required | Type | Description |
---|---|---|---|
type | Required | string | The type is settings . |
cart_expiry_days | Required | number | The number of days in which the cart will expire. |
Request example
curl -X PUT https://api.moltin.com/v2/settings/cart \
-H "Authorization: Bearer XXXX"
-d $'{
"data": {
type: "settings",
cart_expiry_days: 365
}
}'
Response example
200 OK
{
"data": {
"type": "settings",
"cart_expiry_days": 365
}
}
Response Codes
You might encounter the following response codes, depending on the scenario:
400 Bad Request
- The maximum expiry is 365. Must be less than or equal to 365.