Files
medusa-store/docs/api/store/paths/carts.yaml
2022-12-22 17:09:49 +02:00

45 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-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/carts/postundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/carts/postundefined
tags:
- Cart
responses:
'200':
description: Successfully created a new Cart
content:
application/json:
schema:
type: object
properties:
cart:
$ref: ../components/schemas/Cart.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