Add a product to a cart

Add a product to an existing cart.

Request

POST https://api.nexway.store/carts/public/{id}/addproduct

Path parameters

Parameter name Value Description Additional
id string

id

Required

Request body

The request body takes a complete ProductUpdate resource, containing the following writable properties:

{
    "products": {
        "<key>": {
            "quantity": "int32"
        }
    }
}

Properties

Name Type Description Additional
products object

map of products id in the cart with its quantity

products.<key> map of object ProductInput Optional
products.<key>.quantity int32

This is the product quantity.

Response

The following HTTP status codes may be returned, optionally with a response resource.

Status code Description Resource
200 OK

Success

Cart
401 Unauthorized

Unauthorized

403 Forbidden

Forbidden

404 Not Found

Not Found

500 Internal Server Error

Failure

Example

{
    "products": "\"products\":{\"82fc0517-358a-49a8-b5fb-8be1a0ced674\": {\"quantity\":\"2\"}}"
}

Explore this API

id

id

productUpdate

productUpdate

Request Content-Type
Response Content-Type
Try it out!