chore(docs): Refactor API Reference (#1883)
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
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:
|
||||
properties:
|
||||
region_id:
|
||||
type: string
|
||||
description: The ID of the Region to create the Cart in.
|
||||
sales_channel_id:
|
||||
type: string
|
||||
description: >-
|
||||
[EXPERIMENTAL] The ID of the Sales channel to create the Cart
|
||||
in.
|
||||
country_code:
|
||||
type: string
|
||||
description: The 2 character ISO country code to create the Cart in.
|
||||
externalDocs:
|
||||
url: >-
|
||||
https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
|
||||
description: See a list of codes.
|
||||
items:
|
||||
description: >-
|
||||
An optional array of `variant_id`, `quantity` pairs to generate
|
||||
Line Items from.
|
||||
type: array
|
||||
items:
|
||||
required:
|
||||
- variant_id
|
||||
- quantity
|
||||
properties:
|
||||
variant_id:
|
||||
description: >-
|
||||
The id of the Product Variant to generate a Line Item
|
||||
from.
|
||||
type: string
|
||||
quantity:
|
||||
description: The quantity of the Product Variant to add
|
||||
type: integer
|
||||
context:
|
||||
description: >-
|
||||
An optional object to provide context to the Cart. The `context`
|
||||
field is automatically populated with `ip` and `user_agent`
|
||||
type: object
|
||||
example:
|
||||
ip: '::1'
|
||||
user_agent: Chrome
|
||||
tags:
|
||||
- Cart
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully created a new Cart
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
cart:
|
||||
$ref: ../components/schemas/cart.yaml
|
||||
Reference in New Issue
Block a user