Files
medusa-store/docs/api/store/paths/carts.yaml
2023-02-09 09:50:55 +02:00

44 lines
1.3 KiB
YAML

post:
summary: Create a Cart
operationId: PostCart
description: >-
Creates a Cart within the given region and with the initial items. If no
`region_id` is provided the cart will be associated with the first Region
available. If no items are provided the cart will be empty after creation.
If a user is logged in the cart's customer id and email will 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/carts/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/carts/post.sh
tags:
- Cart
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