Create a cart

Create a new cart linked to a store.

Request

POST https://api.nexway.store/carts/public

Request body

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

{
    "country": "string",
    "endUser": {
        "city": "string",
        "country": "string",
        "email": "string",
        "firstName": "string",
        "id": "string",
        "ip": "string",
        "lastName": "string",
        "locale": "string",
        "storeId": "string",
        "streetAddress": "string",
        "zipCode": "string"
    },
    "locale": "string",
    "products": {
        "<key>": {}
    },
    "storeId": "string"
}

Properties

Name Type Description Additional
country string

Country to the cart

endUser object EndUser Optional
endUser.city string

Address book city

Optional
endUser.country string

This is the country end user.

endUser.email string

This is the email end user.

endUser.firstName string

This is the first name end user.

Optional
endUser.id string

This is the reference id of the end user service.

Optional
endUser.ip string

This is the ip from the enduser (only IPv4 is supported)

Optional
endUser.lastName string

This is the last name end user.

Optional
endUser.locale string

Locale to the cart

endUser.storeId string

Store id

Optional
endUser.streetAddress string

Address book street address

endUser.zipCode string

Address book zipCode

locale string

Locale to the cart

products object

map of products id in the cart with its quantity

products.<key> map of object Optional
storeId string

This is the reference id of the store service.

Response

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

Status code Description Resource
201 Created

Success

success
401 Unauthorized

Unauthorized

403 Forbidden

Forbidden

404 Not Found

Not Found

500 Internal Server Error

Failure

Example

{
    "country": "FR",
    "endUser": {
        "city": "San Francisco",
        "country": "FR",
        "email": "nexway@nexway.com",
        "firstName": "endUserFirstName",
        "id": "82fc0517-358a-49a8-b5fb-8be1a0ced674",
        "ip": "37.128.127.255",
        "lastName": "endUseLastName",
        "locale": "fr-FR",
        "storeId": "a0253398-b0c5-4c2d-a15f-bd97ea4be608",
        "streetAddress": "236 8th street",
        "zipCode": "94103"
    },
    "locale": "fr-FR",
    "products": "\"products\":{\"82fc0517-358a-49a8-b5fb-8be1a0ced674\": {\"quantity\":\"2\"}}",
    "storeId": "82fc0517-358a-49a8-b5fb-8be1a0ced674"
}

Explore this API

cart

cart

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