chore: updates API reference docs

This commit is contained in:
olivermrbl
2020-12-15 13:49:45 +01:00
parent 14585a7b32
commit 34e6c52745
16 changed files with 1149 additions and 423 deletions
+41 -18
View File
@@ -1,11 +1,34 @@
title: Carts
domain: store
routes:
- method: POST
path: /carts
- method: GET
path: /carts/:id
- method: POST
path: /carts/:id
- method: POST
path: /carts/:id/line-items
- method: POST
path: /carts/:id/line-items/:line_id
- method: DELETE
path: /carts/:id/line-items/:line_id
- method: POST
path: /carts/:id/payment-sessions
- method: DELETE
path: /carts/:id/payment-sessions/:provider_id
- method: POST
path: /carts/:id/payment-method
- method: POST
path: /carts/:id/shipping-methods
- method: DELETE
path: /carts/:id/discounts/:code
route: /carts
description: >
A Cart is the preliminary step to an Order. The Cart holds a collection of
items that the customer wishes to purchase, along with the customer's
preferred payment and shipping method.
endpoints:
preferred payment and shipping method.
endpoints:
- path: /
method: POST
title: Create a Cart
@@ -35,7 +58,7 @@ endpoints:
- path: /:id
method: POST
title: Update a Cart
params:
params:
- name: id
type: String
description: Id of the cart.
@@ -68,8 +91,8 @@ endpoints:
calling the endpoint with an array of discounts.
- path: /:id/line-items
method: POST
title: Add a Line Item to a Cart
params:
title: Add line item
params:
- name: id
type: String
body:
@@ -90,7 +113,7 @@ endpoints:
functionality.
- path: /:id/line-items/:line_id
method: POST
title: Update a Line Item
title: Update line item
params:
- name: id
type: String
@@ -108,7 +131,7 @@ endpoints:
the inventory level cannot fulfill the desired quantity.
- path: /:id/line-items/:line_id
method: DELETE
title: Remove a Line Item
title: Remove line item
params:
- name: id
type: String
@@ -120,8 +143,8 @@ endpoints:
Removes a the given line item from the cart.
- path: /:id/discounts/:code
method: DELETE
title: Remove a Discount Code
params:
title: Remove discount code
params:
- name: id
type: String
description: Id of the cart.
@@ -131,8 +154,8 @@ endpoints:
description: Removes a discount code from the cart.
- path: /:id/payment-sessions
method: POST
title: Initialize Payment Sessions for a Cart
params:
title: Create payment sessions
params:
- name: id
type: String
description: Id of the cart.
@@ -141,7 +164,7 @@ endpoints:
the cart. This is usually called when a customer proceeds to checkout.
- path: /:id/payment-sessions/:provider_id
method: DELETE
title: Delete a Payment Session
title: Delete payment session
params:
- name: id
type: String
@@ -156,12 +179,12 @@ endpoints:
reaches a state that cannot be recovered from.
- path: /:id/payment-method
method: POST
title: Set the Payment Method for a Cart
params:
title: Add payment method
params:
- name: id
type: String
description: Id of the cart.
body:
body:
- name: provider_id
type: String
required: true
@@ -182,12 +205,12 @@ endpoints:
payment.
- path: /:id/shipping-methods
method: POST
title: Add a Shipping Method to a Cart
title: Add shipping method
params:
- name: id
type: String
description: Id of the cart.
body:
body:
- name: option_id
type: String
required: true
@@ -199,7 +222,7 @@ endpoints:
fulfillment of the order. Look at the documentation for your installed
fulfillment providers to find out what to send.
description: >
Adds a shipping method to the cart.
Adds a shipping method to the cart.
response: |
{
"cart": {