84 lines
2.9 KiB
YAML
84 lines
2.9 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:
|
|
properties:
|
|
type:
|
|
type: string
|
|
description: The type of the data property.
|
|
enum:
|
|
- order
|
|
- cart
|
|
- swap
|
|
data:
|
|
type: object
|
|
description: >-
|
|
The data of the result object. Its type depends on the type
|
|
field.
|
|
oneOf:
|
|
- type: object
|
|
description: >-
|
|
Cart was successfully authorized and order was placed
|
|
successfully.
|
|
properties:
|
|
order:
|
|
$ref: ../components/schemas/order.yaml
|
|
- type: object
|
|
description: >-
|
|
Cart was successfully authorized but requires further
|
|
actions.
|
|
properties:
|
|
cart:
|
|
$ref: ../components/schemas/cart.yaml
|
|
- type: object
|
|
description: >-
|
|
When cart is used for a swap and it has been completed
|
|
successfully.
|
|
properties:
|
|
cart:
|
|
$ref: ../components/schemas/swap.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
|