Skip to main content
POST
Add Cart Item

Authorizations

X-Authorization
string
header
required

Headers

X-Shop-Id
integer

The unique identifier of the shop associated with the draft return.

This header is not required, as the merchant's shop is identified by the API key present in the request.

X-Loop-Locale
string

The shopper's locale: a two-letter language code with an optional two-letter region, for example fr or fr-CA.

When the value is valid and product translations are enabled for the shop, the response includes translated product titles, variant titles and option names (translated_title, translated_variant_title, translated_options). Otherwise those fields are null or empty. A translated cart item title is stored when the item is added and does not change if the locale changes later.

Product translations use only this header. The language of the draft return (language_code) does not change them. Every endpoint that returns a draft return accepts the header.

Example:

"fr-CA"

Accept
enum<string>

Optional. Responses use Content-Type: application/prs.hal-forms+json.

Available options:
application/prs.hal-forms+json

Path Parameters

draft_return_id
integer
required

The unique identifier of the draft return.

Body

application/json
variant_id
integer
required

The unique identifier of the product variant to add.

quantity
integer

The quantity of the item to add.

Response

Successful response with draft return data.

The response uses Content-Type: application/prs.hal-forms+json and includes hypermedia controls in _links and _templates instead of the standard links array.

HAL _links object. Always includes self. Other keys are relation names corresponding to available actions for the current draft return state.

_templates
object

_templates object. Each key is a template/action name matching a relation in _links. Templates describe the method, fields, and constraints for the action.

client_application
object

Client-application header specification. Describes how the client should identify itself in subsequent requests.

draft_return
object

The draft return object.

context
object

Contextual data for building the return UI. Keys are omitted when their value is null.

errors
object[]

An array of error codes. In the event of a partial failure, the API will return all possible data as well as any error codes that were thrown.

See Error codes for a full list of possible errors.