Cart
Add Items to Cart
Cart
Add Items to Cart
Adds items to an existing cart using product or variant IDs.
POST
/
cart
curl --request POST \
--url https://client-request-service-staging-wghsjlqnoa-uw.a.run.app/cart \
--header 'Content-Type: application/json' \
--data '{
"items": {
"shopify_cart_items_input": [
{
"quantity": 1,
"product_id": "12376205435060",
"variant_id": "98765432109876"
}
]
},
"id": "<string>"
}'
{
"id": "<string>",
"cost": {
"is_estimated": true,
"subtotal": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"tax": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"shipping": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"total": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
}
},
"buyer_identity": {
"first_name": "<string>",
"last_name": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"city": "<string>",
"province_code": "<string>",
"country_code": "<string>",
"postal_code": "<string>",
"email": "<string>",
"phone": "<string>"
},
"stores": [
{
"store": "<string>",
"request_id": "<string>",
"cart_lines": [
{
"quantity": 123,
"variant": {
"id": "<string>",
"title": "<string>",
"marketplace": "<string>",
"description": "<string>",
"is_available": true,
"price": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
}
},
"product": {
"id": "<string>",
"title": "<string>",
"marketplace": "<string>",
"description": "<string>",
"is_available": true,
"price": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
}
}
}
],
"offer": {
"subtotal": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"margin": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"not_available_ids": [
"<string>"
],
"shipping_methods": [
{
"id": "<string>",
"label": "<string>",
"price": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"taxes": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"total": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
}
}
],
"selected_shipping_method": {
"id": "<string>",
"label": "<string>",
"price": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"taxes": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"total": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
}
}
},
"is_submitted": true
}
]
}
Body
application/json
Quantity of the product
Example:
1
Shopify product ID, required if variant_id
is not provided
Example:
"12376205435060"
Shopify variant ID, required if product_id
is not provided
Example:
"98765432109876"
The cart ID to which items are being added
Response
200
application/json
Successfully added items to cart
Unique identifier for the cart
curl --request POST \
--url https://client-request-service-staging-wghsjlqnoa-uw.a.run.app/cart \
--header 'Content-Type: application/json' \
--data '{
"items": {
"shopify_cart_items_input": [
{
"quantity": 1,
"product_id": "12376205435060",
"variant_id": "98765432109876"
}
]
},
"id": "<string>"
}'
{
"id": "<string>",
"cost": {
"is_estimated": true,
"subtotal": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"tax": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"shipping": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"total": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
}
},
"buyer_identity": {
"first_name": "<string>",
"last_name": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"city": "<string>",
"province_code": "<string>",
"country_code": "<string>",
"postal_code": "<string>",
"email": "<string>",
"phone": "<string>"
},
"stores": [
{
"store": "<string>",
"request_id": "<string>",
"cart_lines": [
{
"quantity": 123,
"variant": {
"id": "<string>",
"title": "<string>",
"marketplace": "<string>",
"description": "<string>",
"is_available": true,
"price": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
}
},
"product": {
"id": "<string>",
"title": "<string>",
"marketplace": "<string>",
"description": "<string>",
"is_available": true,
"price": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
}
}
}
],
"offer": {
"subtotal": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"margin": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"not_available_ids": [
"<string>"
],
"shipping_methods": [
{
"id": "<string>",
"label": "<string>",
"price": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"taxes": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"total": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
}
}
],
"selected_shipping_method": {
"id": "<string>",
"label": "<string>",
"price": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"taxes": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
},
"total": {
"value": 123,
"display_value": "<string>",
"currency": "<string>"
}
}
},
"is_submitted": true
}
]
}