Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
post:
|
|
operationId: PostCart
|
|
summary: Create a Cart
|
|
description: >
|
|
Create a Cart. Although optional, specifying the cart's region and sales
|
|
channel can affect the cart's pricing and
|
|
|
|
the products that can be added to the cart respectively. So, make sure to
|
|
set those early on and change them if necessary, such as when the customer
|
|
changes their region.
|
|
|
|
|
|
If a customer is logged in, the cart's customer ID and email will
|
|
automatically be set.
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas/StorePostCartReq.yaml
|
|
x-codegen:
|
|
method: create
|
|
x-codeSamples:
|
|
- lang: JavaScript
|
|
label: JS Client
|
|
source:
|
|
$ref: ../code_samples/JavaScript/store_carts/post.js
|
|
- lang: Shell
|
|
label: cURL
|
|
source:
|
|
$ref: ../code_samples/Shell/store_carts/post.sh
|
|
tags:
|
|
- Carts
|
|
responses:
|
|
'200':
|
|
description: Successfully created a new Cart
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas/StoreCartsRes.yaml
|
|
'400':
|
|
$ref: ../components/responses/400_error.yaml
|
|
'404':
|
|
$ref: ../components/responses/not_found_error.yaml
|
|
'409':
|
|
$ref: ../components/responses/invalid_state_error.yaml
|
|
'422':
|
|
$ref: ../components/responses/invalid_request_error.yaml
|
|
'500':
|
|
$ref: ../components/responses/500_error.yaml
|