Skip to content

Adding product(s) to the cart

POST
/carts/{cartId}/products
curl --request POST \
--url https://myshop.com/shopgate/v1/carts/example/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[ { "productId": "10080466570", "quantity": 1, "properties": [ { "type": "option", "id": "01-input-field.greeting-card-text", "value": "Happy Birthday, dad!" } ], "metadata": { "additionalInfo": { "is_parent": false } } } ]'

Adds one or multiple products to the cart. Cart rules are applied, if the shop supports them, and are set up for at least one product to be added (or already placed in the cart).

cartId
required
string
Array<object>
object
productId
string
Example
10080466570
quantity
number
Example
1
properties
Array<object>
object
type
required
string
Allowed values: option input
Example
input
id
required

ID of the property to which the selection belongs.

string
Example
01-input-field.greeting-card-text
value
required

Content depends on the property type. It’s either the value-id of a selected property value for options or the text that was entered for inputs.

string
Example
Happy Birthday, dad!
metadata

Holds additional information about a specific product of any type. The contents of the object can vary.

object
Example
{
"additionalInfo": {
"is_parent": false
}
}
Media typeapplication/json
object
Examplegenerated
{}
Media typeapplication/json
object
message
string
name
string
Example
{
"message": "Invalid token: access token is invalid",
"name": "invalid_token"
}
Media typeapplication/json
object
message
string
Example
{
"message": "Not found"
}