fix: merge api

This commit is contained in:
Sebastian Rindom
2021-03-15 08:28:53 +01:00
35 changed files with 5117 additions and 2358 deletions
+439 -421
View File
@@ -121,6 +121,338 @@ paths:
properties:
exists:
type: boolean
'/customers/{id}/addresses':
post:
operationId: PostCustomersCustomerAddresses
summary: Add a Shipping Address
description: Adds a Shipping Address to a Customer's saved addresses.
parameters:
- in: path
name: id
required: true
description: The Customer id.
schema:
type: string
requestBody:
content:
application/json:
schema:
properties:
address:
description: The Address to add to the Customer.
anyOf:
- $ref: '#/components/schemas/address'
tags:
- Customer
responses:
'200':
description: A successful response
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
/customers:
post:
operationId: PostCustomers
summary: Create a Customer
description: Creates a Customer account.
parameters: []
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
requestBody:
content:
application/json:
schema:
type: object
required:
- email
- first_name
- last_name
- password
properties:
email:
type: string
description: The Customer's email address.
first_name:
type: string
description: The Customer's first name.
last_name:
type: string
description: The Customer's last name.
password:
type: string
description: The Customer's password for login.
phone:
type: string
description: The Customer's phone number.
'/customers/{id}/addresses/{address_id}':
delete:
operationId: DeleteCustomersCustomerAddressesAddress
summary: Delete an Address
description: Removes an Address from the Customer's saved addresse.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
- in: path
name: address_id
required: true
description: The id of the Address to remove.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
post:
operationId: PostCustomersCustomerAddressesAddress
summary: Update a Shipping Address
description: Updates a Customer's saved Shipping Address.
parameters:
- in: path
name: id
required: true
description: The Customer id.
schema:
type: string
- in: path
name: address_id
required: true
description: The id of the Address to update.
schema:
type: string
requestBody:
content:
application/json:
schema:
properties:
address:
description: The updated Address.
anyOf:
- $ref: '#/components/schemas/address'
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
'/customers/{id}':
get:
operationId: GetCustomersCustomer
summary: Retrieves a Customer
description: >-
Retrieves a Customer - the Customer must be logged in to retrieve their
details.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
post:
operationId: PostCustomersCustomer
summary: Update Customer details
description: Updates a Customer's saved details.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
requestBody:
content:
application/json:
schema:
properties:
first_name:
description: The Customer's first name.
type: string
last_name:
description: The Customer's last name.
type: string
password:
description: The Customer's password.
type: string
phone:
description: The Customer's phone number.
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
'/customers/{id}/payment-methods':
get:
operationId: GetCustomersCustomerPaymentMethods
summary: Retrieve saved payment methods
description: >-
Retrieves a list of a Customer's saved payment methods. Payment methods
are saved with Payment Providers and it is their responsibility to fetch
saved methods.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
payment_methods:
type: array
items:
properties:
provider_id:
type: string
description: >-
The id of the Payment Provider where the payment
method is saved.
data:
type: object
description: >-
The data needed for the Payment Provider to use the
saved payment method.
'/customers/{id}/orders':
get:
operationId: GetCustomersCustomerOrders
summary: Retrieve Customer Orders
description: Retrieves a list of a Customer's Orders.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
payment_methods:
type: array
items:
$ref: '#/components/schemas/order'
'/customers/{id}/password-token':
post:
operationId: PostCustomersCustomerPasswordToken
summary: Creates a reset password token
description: >-
Creates a reset password token to be used in a subsequent
/reset-password request. The password token should be sent out of band
e.g. via email and will not be returned.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
tags:
- Customer
responses:
'204':
description: OK
'/customers/{id}/reset-password':
post:
operationId: PostCustomersCustomerResetPassword
summary: Resets Customer password
description: >-
Resets a Customer's password using a password token created by a
previous /password-token request.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
requestBody:
content:
application/json:
schema:
type: object
required:
- email
- token
- password
properties:
email:
type: string
description: The Customer's email.
token:
type: string
description: The password token created by a /password-token request.
password:
type: string
description: The new password to set for the Customer.
'/carts/{id}/shipping-methods':
post:
operationId: PostCartsCartShippingMethod
@@ -237,6 +569,12 @@ paths:
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
tags:
- Cart
responses:
@@ -594,6 +932,9 @@ paths:
customer_id:
description: The id of the Customer to associate the Cart with.
type: string
context:
description: An optional object to provide context to the Cart.
type: object
tags:
- Cart
responses:
@@ -667,388 +1008,8 @@ paths:
description: The original value of the Gift Card.
balance:
description: The current balanace of the Gift Card
'/customers/{id}/addresses':
post:
operationId: PostCustomersCustomerAddresses
summary: Add a Shipping Address
description: Adds a Shipping Address to a Customer's saved addresses.
parameters:
- in: path
name: id
required: true
description: The Customer id.
schema:
type: string
requestBody:
content:
application/json:
schema:
properties:
address:
description: The Address to add to the Customer.
anyOf:
- $ref: '#/components/schemas/address'
tags:
- Customer
responses:
'200':
description: A successful response
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
/customers:
post:
operationId: PostCustomers
summary: Create a Customer
description: Creates a Customer account.
parameters: []
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
requestBody:
content:
application/json:
schema:
type: object
required:
- email
- first_name
- last_name
- password
properties:
email:
type: string
description: The Customer's email address.
first_name:
type: string
description: The Customer's first name.
last_name:
type: string
description: The Customer's last name.
password:
type: string
description: The Customer's password for login.
phone:
type: string
description: The Customer's phone number.
'/customers/{id}/addresses/{address_id}':
delete:
operationId: DeleteCustomersCustomerAddressesAddress
summary: Delete an Address
description: Removes an Address from the Customer's saved addresse.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
- in: path
name: address_id
required: true
description: The id of the Address to remove.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
post:
operationId: PostCustomersCustomerAddressesAddress
summary: Update a Shipping Address
description: Updates a Customer's saved Shipping Address.
parameters:
- in: path
name: id
required: true
description: The Customer id.
schema:
type: string
- in: path
name: address_id
required: true
description: The id of the Address to update.
schema:
type: string
requestBody:
content:
application/json:
schema:
properties:
address:
description: The updated Address.
anyOf:
- $ref: '#/components/schemas/address'
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
'/customers/{id}':
get:
operationId: GetCustomersCustomer
summary: Retrieves a Customer
description: >-
Retrieves a Customer - the Customer must be logged in to retrieve their
details.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
post:
operationId: PostCustomersCustomer
summary: Update Customer details
description: Updates a Customer's saved details.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
requestBody:
content:
application/json:
schema:
properties:
first_name:
description: The Customer's first name.
type: string
last_name:
description: The Customer's last name.
type: string
password:
description: The Customer's password.
type: string
phone:
description: The Customer's phone number.
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
'/customers/{id}/payment-methods':
get:
operationId: GetCustomersCustomerPaymentMethods
summary: Retrieve saved payment methods
description: >-
Retrieves a list of a Customer's saved payment methods. Payment methods
are saved with Payment Providers and it is their responsibility to fetch
saved methods.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
payment_methods:
type: array
items:
properties:
provider_id:
type: string
description: >-
The id of the Payment Provider where the payment
method is saved.
data:
type: object
description: >-
The data needed for the Payment Provider to use the
saved payment method.
'/customers/{id}/orders':
get:
operationId: GetCustomersCustomerOrders
summary: Retrieve Customer Orders
description: Retrieves a list of a Customer's Orders.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
payment_methods:
type: array
items:
$ref: '#/components/schemas/order'
'/customers/{id}/password-token':
post:
operationId: PostCustomersCustomerPasswordToken
summary: Creates a reset password token
description: >-
Creates a reset password token to be used in a subsequent
/reset-password request. The password token should be sent out of band
e.g. via email and will not be returned.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
tags:
- Customer
responses:
'204':
description: OK
'/customers/{id}/reset-password':
post:
operationId: PostCustomersCustomerResetPassword
summary: Resets Customer password
description: >-
Resets a Customer's password using a password token created by a
previous /password-token request.
parameters:
- in: path
name: id
required: true
description: The id of the Customer.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
requestBody:
content:
application/json:
schema:
type: object
required:
- email
- token
- password
properties:
email:
type: string
description: The Customer's email.
token:
type: string
description: The password token created by a /password-token request.
password:
type: string
description: The new password to set for the Customer.
'/products/{id}':
get:
operationId: GetProductsProduct
summary: Retrieves a Product
description: Retrieves a Product.
parameters:
- in: path
name: id
required: true
description: The id of the Product.
schema:
type: string
tags:
- Product
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
product:
$ref: '#/components/schemas/product'
/products:
get:
operationId: GetProducts
summary: List Products
description: Retrieves a list of Products.
tags:
- Product
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
count:
description: The total number of Products.
type: integer
offset:
description: The offset for pagination.
type: integer
limit:
description: 'The maxmimum number of Products to return,'
type: integer
products:
type: array
items:
$ref: '#/components/schemas/product'
region:
$ref: '#/components/schemas/region'
'/orders/cart/{cart_id}':
get:
operationId: GetOrdersOrderCartId
@@ -1129,44 +1090,20 @@ paths:
properties:
order:
$ref: '#/components/schemas/order'
/returns:
post:
operationId: PostReturns
summary: Create Return
description: Creates a Return for an Order.
requestBody:
content:
application/json:
schema:
properties:
order_id:
type: string
description: The id of the Order to create the Return from.
items:
description: The items to include in the Return.
type: array
items:
properties:
item_id:
description: The id of the Line Item from the Order.
type: string
quantity:
description: The quantity to return.
type: integer
return_shipping:
description: >-
If the Return is to be handled by the store operator the
Customer can choose a Return Shipping Method. Alternatvely
the Customer can handle the Return themselves.
type: object
properties:
option_id:
type: string
description: >-
The id of the Shipping Option to create the Shipping
Method from.
'/products/{id}':
get:
operationId: GetProductsProduct
summary: Retrieves a Product
description: Retrieves a Product.
parameters:
- in: path
name: id
required: true
description: The id of the Product.
schema:
type: string
tags:
- Return
- Product
responses:
'200':
description: OK
@@ -1174,8 +1111,35 @@ paths:
application/json:
schema:
properties:
return:
$ref: '#/components/schemas/return'
product:
$ref: '#/components/schemas/product'
/products:
get:
operationId: GetProducts
summary: List Products
description: Retrieves a list of Products.
tags:
- Product
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
count:
description: The total number of Products.
type: integer
offset:
description: The offset for pagination.
type: integer
limit:
description: 'The maxmimum number of Products to return,'
type: integer
products:
type: array
items:
$ref: '#/components/schemas/product'
'/regions/{id}':
get:
operationId: GetRegionsRegion
@@ -1226,12 +1190,66 @@ paths:
type: array
items:
$ref: '#/components/schemas/region'
/returns:
post:
operationId: PostReturns
summary: Create Return
description: Creates a Return for an Order.
requestBody:
content:
application/json:
schema:
properties:
order_id:
type: string
description: The id of the Order to create the Return from.
items:
description: The items to include in the Return.
type: array
items:
properties:
item_id:
description: The id of the Line Item from the Order.
type: string
quantity:
description: The quantity to return.
type: integer
return_shipping:
description: >-
If the Return is to be handled by the store operator the
Customer can choose a Return Shipping Method. Alternatvely
the Customer can handle the Return themselves.
type: object
properties:
option_id:
type: string
description: >-
The id of the Shipping Option to create the Shipping
Method from.
tags:
- Return
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
return:
$ref: '#/components/schemas/return'
/shipping-options:
get:
operationId: GetShippingOptions
summary: Retrieve Shipping Options
description: Retrieves a list of Shipping Options.
parameters:
- in: query
name: is_return
description: >-
Whether return Shipping Options should be included. By default all
Shipping Options are returned.
schema:
type: boolean
- in: query
name: product_ids
description: A comma separated list of Product ids to filter Shipping Options by.