Adding product(s) to the cart
const url = 'https://myshop.com/shopgate/v1/carts/example/products';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '[{"productId":"10080466570","quantity":1,"properties":[{"type":"option","id":"01-input-field.greeting-card-text","value":"Happy Birthday, dad!"}],"metadata":{"additionalInfo":{"is_parent":false}}}]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Body
Section titled “Request Body”object
Example
10080466570Example
1object
Example
inputID of the property to which the selection belongs.
Example
01-input-field.greeting-card-textContent 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.
Example
Happy Birthday, dad!Holds additional information about a specific product of any type. The contents of the object can vary.
object
Example
{ "additionalInfo": { "is_parent": false }}object
Example
10080466570Example
1object
Example
inputID of the property to which the selection belongs.
Example
01-input-field.greeting-card-textContent 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.
Example
Happy Birthday, dad!Holds additional information about a specific product of any type. The contents of the object can vary.
object
Example
{ "additionalInfo": { "is_parent": false }}Responses
Section titled “Responses”object
Examplegenerated
{}object
Example
{ "message": "Invalid token: access token is invalid", "name": "invalid_token"}object
Example
{ "message": "Not found"}
