Files
medusa-store/docs/api/store/paths/carts_{id}_complete.yaml
2023-01-19 10:06:17 +02:00

50 lines
1.7 KiB
YAML

post:
summary: Complete a Cart
operationId: PostCartsCartComplete
description: >-
Completes a cart. The following steps will be performed. Payment
authorization is attempted and if more work is required, we simply return
the cart for further updates. If payment is authorized and order is not yet
created, we make sure to do so. The completion of a cart can be performed
idempotently with a provided header `Idempotency-Key`. If not provided, we
will generate one for the request.
parameters:
- in: path
name: id
required: true
description: The Cart id.
schema:
type: string
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/carts_{id}_complete/postundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/carts_{id}_complete/postundefined
tags:
- Cart
responses:
'200':
description: >-
If a cart was successfully authorized, but requires further action from
the user the response body will contain the cart with an updated payment
session. If the Cart was successfully completed the response body will
contain the newly created Order.
content:
application/json:
schema:
$ref: ../components/schemas/StoreCompleteCartRes.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