docs: Change :id to {id} in OAS comments (#2015)

This commit is contained in:
Shahed Nasser
2022-08-08 17:35:13 +03:00
committed by GitHub
parent 1c6fcb2ede
commit cef081d2f2
21 changed files with 3163 additions and 2970 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -109,6 +109,60 @@ tags:
servers:
- url: 'https://api.medusa-commerce.com/admin'
paths:
/apps/authorizations:
post:
operationId: PostApps
summary: Generates a token for an application.
description: Generates a token for an application.
x-authenticated: true
requestBody:
content:
application/json:
schema:
required:
- application_name
- state
- code
properties:
application_name:
type: string
description: Name of the application for the token to be generated for.
state:
type: string
description: State of the application.
code:
type: string
description: The code for the generated token.
tags:
- App
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
apps:
$ref: '#/components/schemas/OAuth'
/apps:
get:
operationId: GetApps
summary: List applications
description: Retrieve a list of applications.
x-authenticated: true
tags:
- App
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
apps:
type: array
items:
$ref: '#/components/schemas/OAuth'
/auth:
post:
operationId: PostAuth
@@ -1297,209 +1351,6 @@ paths:
limit:
type: integer
description: The number of items per page
/customers:
post:
operationId: PostCustomers
summary: Create a Customer
description: Creates a Customer.
x-authenticated: true
requestBody:
content:
application/json:
schema:
required:
- email
- first_name
- last_name
- password
properties:
email:
type: string
description: The customer's email.
format: email
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.
format: password
phone:
type: string
description: The customer's phone number.
metadata:
description: >-
An optional set of key-value pairs to hold additional
information.
type: object
tags:
- Customer
responses:
'201':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
get:
operationId: GetCustomers
summary: List Customers
description: Retrieves a list of Customers.
x-authenticated: true
parameters:
- in: query
name: limit
description: The number of items to return.
schema:
type: integer
default: 50
- in: query
name: offset
description: The items to skip before result.
schema:
type: integer
default: 0
- in: query
name: expand
description: (Comma separated) Which fields should be expanded in each customer.
schema:
type: string
- in: query
name: q
description: 'a search term to search email, first_name, and last_name.'
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customers:
type: array
items:
$ref: '#/components/schemas/customer'
count:
type: integer
description: The total number of items available
offset:
type: integer
description: The number of items skipped before these items
limit:
type: integer
description: The number of items per page
'/customers/{id}':
get:
operationId: GetCustomersCustomer
summary: Retrieve a Customer
description: Retrieves a Customer.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Customer.
schema:
type: string
- in: query
name: expand
description: (Comma separated) Which fields should be expanded in the customer.
schema:
type: string
- in: query
name: fields
description: (Comma separated) Which fields should be included in 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 a Customer
description: Updates a Customer.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Customer.
schema:
type: string
- in: query
name: expand
description: (Comma separated) Which fields should be expanded in each customer.
schema:
type: string
- in: query
name: fields
description: (Comma separated) Which fields should be retrieved in each customer.
schema:
type: string
requestBody:
content:
application/json:
schema:
properties:
email:
type: string
description: The Customer's email.
format: email
first_name:
type: string
description: The Customer's first name.
last_name:
type: string
description: The Customer's last name.
phone:
type: string
description: The Customer's phone number.
password:
type: string
description: The Customer's password.
format: password
groups:
type: array
items:
required:
- id
properties:
id:
description: The ID of a customer group
type: string
description: A list of customer groups to which the customer belongs.
metadata:
description: >-
An optional set of key-value pairs to hold additional
information.
type: object
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
'/discounts/{id}/regions/{region_id}':
post:
operationId: PostDiscountsDiscountRegionsRegion
@@ -2414,49 +2265,85 @@ paths:
properties:
discount:
$ref: '#/components/schemas/discount'
/apps/authorizations:
/customers:
post:
operationId: PostApps
summary: Generates a token for an application.
description: Generates a token for an application.
operationId: PostCustomers
summary: Create a Customer
description: Creates a Customer.
x-authenticated: true
requestBody:
content:
application/json:
schema:
required:
- application_name
- state
- code
- email
- first_name
- last_name
- password
properties:
application_name:
email:
type: string
description: Name of the application for the token to be generated for.
state:
description: The customer's email.
format: email
first_name:
type: string
description: State of the application.
code:
description: The customer's first name.
last_name:
type: string
description: The code for the generated token.
description: The customer's last name.
password:
type: string
description: The customer's password.
format: password
phone:
type: string
description: The customer's phone number.
metadata:
description: >-
An optional set of key-value pairs to hold additional
information.
type: object
tags:
- App
- Customer
responses:
'200':
'201':
description: OK
content:
application/json:
schema:
properties:
apps:
$ref: '#/components/schemas/OAuth'
/apps:
customer:
$ref: '#/components/schemas/customer'
get:
operationId: GetApps
summary: List applications
description: Retrieve a list of applications.
operationId: GetCustomers
summary: List Customers
description: Retrieves a list of Customers.
x-authenticated: true
parameters:
- in: query
name: limit
description: The number of items to return.
schema:
type: integer
default: 50
- in: query
name: offset
description: The items to skip before result.
schema:
type: integer
default: 0
- in: query
name: expand
description: (Comma separated) Which fields should be expanded in each customer.
schema:
type: string
- in: query
name: q
description: 'a search term to search email, first_name, and last_name.'
schema:
type: string
tags:
- App
- Customer
responses:
'200':
description: OK
@@ -2464,10 +2351,123 @@ paths:
application/json:
schema:
properties:
apps:
customers:
type: array
items:
$ref: '#/components/schemas/OAuth'
$ref: '#/components/schemas/customer'
count:
type: integer
description: The total number of items available
offset:
type: integer
description: The number of items skipped before these items
limit:
type: integer
description: The number of items per page
'/customers/{id}':
get:
operationId: GetCustomersCustomer
summary: Retrieve a Customer
description: Retrieves a Customer.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Customer.
schema:
type: string
- in: query
name: expand
description: (Comma separated) Which fields should be expanded in the customer.
schema:
type: string
- in: query
name: fields
description: (Comma separated) Which fields should be included in 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 a Customer
description: Updates a Customer.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Customer.
schema:
type: string
- in: query
name: expand
description: (Comma separated) Which fields should be expanded in each customer.
schema:
type: string
- in: query
name: fields
description: (Comma separated) Which fields should be retrieved in each customer.
schema:
type: string
requestBody:
content:
application/json:
schema:
properties:
email:
type: string
description: The Customer's email.
format: email
first_name:
type: string
description: The Customer's first name.
last_name:
type: string
description: The Customer's last name.
phone:
type: string
description: The Customer's phone number.
password:
type: string
description: The Customer's password.
format: password
groups:
type: array
items:
required:
- id
properties:
id:
description: The ID of a customer group
type: string
description: A list of customer groups to which the customer belongs.
metadata:
description: >-
An optional set of key-value pairs to hold additional
information.
type: object
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
/draft-orders:
post:
operationId: PostDraftOrders
@@ -5657,13 +5657,19 @@ paths:
type: boolean
description: Whether or not the items were deleted.
default: true
'/price-lists/:id/products':
'/price-lists/{id}/products':
get:
operationId: GetPriceListsPriceListProducts
summary: List Product in a Price List
description: Retrieves a list of Product that are part of a Price List
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: ID of the price list.
schema:
type: string
- in: query
name: q
description: >-
@@ -9170,12 +9176,18 @@ paths:
limit:
type: integer
description: The number of items per page
'/tax-rates/:id/product-types/batch':
'/tax-rates/{id}/product-types/batch':
post:
operationId: PostTaxRatesTaxRateProductTypes
summary: Add Tax Rate to Product Types
description: Associates a Tax Rate with a list of Product Types
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
@@ -9225,6 +9237,12 @@ paths:
summary: Remove Tax Rate from Product Types
description: Removes a Tax Rate from a list of Product Types
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
@@ -9269,12 +9287,18 @@ paths:
properties:
tax_rate:
$ref: '#/components/schemas/tax_rate'
'/tax-rates/:id/products/batch':
'/tax-rates/{id}/products/batch':
post:
operationId: PostTaxRatesTaxRateProducts
summary: Add Tax Rate to Products
description: Associates a Tax Rate with a list of Products
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
@@ -9322,6 +9346,12 @@ paths:
summary: Removes Tax Rate from Products
description: Removes a Tax Rate from a list of Products
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
@@ -9366,12 +9396,18 @@ paths:
properties:
tax_rate:
$ref: '#/components/schemas/tax_rate'
'/tax-rates/:id/shipping-options/batch':
'/tax-rates/{id}/shipping-options/batch':
post:
operationId: PostTaxRatesTaxRateShippingOptions
summary: Add Tax Rate to Product Types
description: Associates a Tax Rate with a list of Shipping Options
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
@@ -9421,6 +9457,12 @@ paths:
summary: Removes a Tax Rate from Product Types
description: Removes a Tax Rate from a list of Product Types
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
@@ -9675,12 +9717,17 @@ paths:
type: boolean
description: Whether or not the items were deleted.
default: true
'/tax-rates/:id':
get:
operationId: GetTaxRatesTaxRate
summary: Get Tax Rate
description: Retrieves a TaxRate
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
@@ -9716,6 +9763,12 @@ paths:
summary: Update a Tax Rate
description: Updates a Tax Rate
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.

View File

@@ -109,6 +109,10 @@ tags:
servers:
- url: https://api.medusa-commerce.com/admin
paths:
/apps/authorizations:
$ref: paths/apps_authorizations.yaml
/apps:
$ref: paths/apps.yaml
/auth:
$ref: paths/auth.yaml
/batch-jobs/{id}/cancel:
@@ -133,10 +137,6 @@ paths:
$ref: paths/customer-groups_{id}.yaml
/customer-groups/{id}/customers:
$ref: paths/customer-groups_{id}_customers.yaml
/customers:
$ref: paths/customers.yaml
/customers/{id}:
$ref: paths/customers_{id}.yaml
/discounts/{id}/regions/{region_id}:
$ref: paths/discounts_{id}_regions_{region_id}.yaml
/discounts/{discount_id}/conditions:
@@ -153,10 +153,10 @@ paths:
$ref: paths/discounts_{id}_dynamic-codes_{code}.yaml
/discounts/code/{code}:
$ref: paths/discounts_code_{code}.yaml
/apps/authorizations:
$ref: paths/apps_authorizations.yaml
/apps:
$ref: paths/apps.yaml
/customers:
$ref: paths/customers.yaml
/customers/{id}:
$ref: paths/customers_{id}.yaml
/draft-orders:
$ref: paths/draft-orders.yaml
/draft-orders/{id}/line-items:
@@ -249,8 +249,8 @@ paths:
$ref: paths/price-lists_{id}_products_{product_id}_prices.yaml
/price-lists/{id}/variants/{variant_id}/prices:
$ref: paths/price-lists_{id}_variants_{variant_id}_prices.yaml
/price-lists/:id/products:
$ref: paths/price-lists_:id_products.yaml
/price-lists/{id}/products:
$ref: paths/price-lists_{id}_products.yaml
/product-tags:
$ref: paths/product-tags.yaml
/product-types:
@@ -327,18 +327,16 @@ paths:
$ref: paths/swaps_{id}.yaml
/swaps:
$ref: paths/swaps.yaml
/tax-rates/:id/product-types/batch:
$ref: paths/tax-rates_:id_product-types_batch.yaml
/tax-rates/:id/products/batch:
$ref: paths/tax-rates_:id_products_batch.yaml
/tax-rates/:id/shipping-options/batch:
$ref: paths/tax-rates_:id_shipping-options_batch.yaml
/tax-rates/{id}/product-types/batch:
$ref: paths/tax-rates_{id}_product-types_batch.yaml
/tax-rates/{id}/products/batch:
$ref: paths/tax-rates_{id}_products_batch.yaml
/tax-rates/{id}/shipping-options/batch:
$ref: paths/tax-rates_{id}_shipping-options_batch.yaml
/tax-rates:
$ref: paths/tax-rates.yaml
/tax-rates/{id}:
$ref: paths/tax-rates_{id}.yaml
/tax-rates/:id:
$ref: paths/tax-rates_:id.yaml
/uploads:
$ref: paths/uploads.yaml
/users:

View File

@@ -4,6 +4,12 @@ get:
description: Retrieves a list of Product that are part of a Price List
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: ID of the price list.
schema:
type: string
- in: query
name: q
description: >-

View File

@@ -1,102 +0,0 @@
get:
operationId: GetTaxRatesTaxRate
summary: Get Tax Rate
description: Retrieves a TaxRate
parameters:
- in: query
name: fields
description: Which fields should be included in the result.
style: form
explode: false
schema:
type: array
items:
type: string
- in: query
name: expand
description: Which fields should be expanded and retrieved in the result.
style: form
explode: false
schema:
type: array
items:
type: string
x-authenticated: true
tags:
- Tax Rate
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
tax_rate:
$ref: ../components/schemas/tax_rate.yaml
post:
operationId: PostTaxRatesTaxRate
summary: Update a Tax Rate
description: Updates a Tax Rate
parameters:
- in: query
name: fields
description: Which fields should be included in the result.
style: form
explode: false
schema:
type: array
items:
type: string
- in: query
name: expand
description: Which fields should be expanded and retrieved in the result.
style: form
explode: false
schema:
type: array
items:
type: string
x-authenticated: true
requestBody:
content:
application/json:
schema:
properties:
code:
type: string
description: A code to identify the tax type by
name:
type: string
description: A human friendly name for the tax
region_id:
type: string
description: The ID of the Region that the rate belongs to
rate:
type: number
description: The numeric rate to charge
products:
type: array
description: The IDs of the products associated with this tax rate
items:
type: string
shipping_options:
type: array
description: The IDs of the shipping options associated with this tax rate
items:
type: string
product_types:
type: array
description: The IDs of the types of products associated with this tax rate
items:
type: string
tags:
- Tax Rate
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
tax_rate:
$ref: ../components/schemas/tax_rate.yaml

View File

@@ -30,3 +30,117 @@ delete:
type: boolean
description: Whether or not the items were deleted.
default: true
get:
operationId: GetTaxRatesTaxRate
summary: Get Tax Rate
description: Retrieves a TaxRate
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
style: form
explode: false
schema:
type: array
items:
type: string
- in: query
name: expand
description: Which fields should be expanded and retrieved in the result.
style: form
explode: false
schema:
type: array
items:
type: string
x-authenticated: true
tags:
- Tax Rate
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
tax_rate:
$ref: ../components/schemas/tax_rate.yaml
post:
operationId: PostTaxRatesTaxRate
summary: Update a Tax Rate
description: Updates a Tax Rate
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
style: form
explode: false
schema:
type: array
items:
type: string
- in: query
name: expand
description: Which fields should be expanded and retrieved in the result.
style: form
explode: false
schema:
type: array
items:
type: string
x-authenticated: true
requestBody:
content:
application/json:
schema:
properties:
code:
type: string
description: A code to identify the tax type by
name:
type: string
description: A human friendly name for the tax
region_id:
type: string
description: The ID of the Region that the rate belongs to
rate:
type: number
description: The numeric rate to charge
products:
type: array
description: The IDs of the products associated with this tax rate
items:
type: string
shipping_options:
type: array
description: The IDs of the shipping options associated with this tax rate
items:
type: string
product_types:
type: array
description: The IDs of the types of products associated with this tax rate
items:
type: string
tags:
- Tax Rate
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
tax_rate:
$ref: ../components/schemas/tax_rate.yaml

View File

@@ -3,6 +3,12 @@ post:
summary: Add Tax Rate to Product Types
description: Associates a Tax Rate with a list of Product Types
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
@@ -50,6 +56,12 @@ delete:
summary: Remove Tax Rate from Product Types
description: Removes a Tax Rate from a list of Product Types
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.

View File

@@ -3,6 +3,12 @@ post:
summary: Add Tax Rate to Products
description: Associates a Tax Rate with a list of Products
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
@@ -50,6 +56,12 @@ delete:
summary: Removes Tax Rate from Products
description: Removes a Tax Rate from a list of Products
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.

View File

@@ -3,6 +3,12 @@ post:
summary: Add Tax Rate to Product Types
description: Associates a Tax Rate with a list of Shipping Options
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.
@@ -50,6 +56,12 @@ delete:
summary: Removes a Tax Rate from Product Types
description: Removes a Tax Rate from a list of Product Types
parameters:
- in: path
name: id
required: true
description: ID of the tax rate.
schema:
type: string
- in: query
name: fields
description: Which fields should be included in the result.

File diff suppressed because it is too large Load Diff

View File

@@ -270,6 +270,456 @@ paths:
properties:
gift_card:
$ref: '#/components/schemas/gift_card'
/customers/me/addresses:
post:
operationId: PostCustomersCustomerAddresses
summary: Add a Shipping Address
description: Adds a Shipping Address to a Customer's saved addresses.
x-authenticated: true
requestBody:
content:
application/json:
schema:
required:
- address
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.
requestBody:
content:
application/json:
schema:
required:
- first_name
- last_name
- email
- password
properties:
first_name:
description: The Customer's first name.
type: string
last_name:
description: The Customer's last name.
type: string
email:
description: The email of the customer.
type: string
format: email
password:
description: The Customer's password.
type: string
format: password
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'
'422':
description: A customer with the same email exists
content:
application/json:
schema:
properties:
code:
type: string
description: The error code
type:
type: string
description: The type of error
message:
type: string
description: Human-readable message with details about the error
example:
code: invalid_request_error
type: duplicate_error
message: >-
A customer with the given email already has an account. Log in
instead
'/customers/me/addresses/{address_id}':
delete:
operationId: DeleteCustomersCustomerAddressesAddress
summary: Delete an Address
description: Removes an Address from the Customer's saved addresses.
x-authenticated: true
parameters:
- 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.
x-authenticated: true
parameters:
- in: path
name: address_id
required: true
description: The id of the Address to update.
schema:
type: string
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/address'
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
/customers/me:
get:
operationId: GetCustomersCustomer
summary: Retrieves a Customer
description: >-
Retrieves a Customer - the Customer must be logged in to retrieve their
details.
x-authenticated: true
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.
x-authenticated: true
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
billing_address:
description: The Address to be used for billing purposes.
anyOf:
- $ref: '#/components/schemas/address'
description: The full billing address object
- type: string
description: The ID of an existing billing address
password:
description: The Customer's password.
type: string
phone:
description: The Customer's phone number.
type: string
email:
description: The email of the customer.
type: string
metadata:
description: Metadata about the customer.
type: object
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
/customers/me/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.
x-authenticated: true
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/me/orders:
get:
operationId: GetCustomersCustomerOrders
summary: Retrieve Customer Orders
description: Retrieves a list of a Customer's Orders.
x-authenticated: true
parameters:
- in: query
name: limit
description: How many orders to return.
schema:
type: integer
default: 10
- in: query
name: offset
description: The offset in the resulting orders.
schema:
type: integer
default: 0
- in: query
name: fields
description: >-
(Comma separated string) Which fields should be included in the
resulting orders.
schema:
type: string
- in: query
name: expand
description: >-
(Comma separated string) Which relations should be expanded in the
resulting orders.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
orders:
type: array
items:
$ref: '#/components/schemas/order'
count:
type: integer
description: The total number of items available
offset:
type: integer
description: The number of items skipped before these items
limit:
type: integer
description: The number of items per page
/customers/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.
requestBody:
content:
application/json:
schema:
required:
- email
properties:
email:
description: The email of the customer.
type: string
format: email
tags:
- Customer
responses:
'204':
description: OK
/customers/password-reset:
post:
operationId: PostCustomersResetPassword
summary: Resets Customer password
description: >-
Resets a Customer's password using a password token created by a
previous /password-token request.
requestBody:
content:
application/json:
schema:
required:
- email
- password
- token
properties:
email:
description: The email of the customer.
type: string
format: email
password:
description: The Customer's password.
type: string
format: password
token:
description: The reset password token
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
'/orders/cart/{cart_id}':
get:
operationId: GetOrdersOrderCartId
summary: Retrieves Order by Cart id
description: >-
Retrieves an Order by the id of the Cart that was used to create the
Order.
parameters:
- in: path
name: cart_id
required: true
description: The ID of Cart.
schema:
type: string
tags:
- Order
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
order:
$ref: '#/components/schemas/order'
'/orders/{id}':
get:
operationId: GetOrdersOrder
summary: Retrieves an Order
description: Retrieves an Order
parameters:
- in: path
name: id
required: true
description: The id of the Order.
schema:
type: string
tags:
- Order
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
order:
$ref: '#/components/schemas/order'
/orders:
get:
operationId: GetOrders
summary: Look Up an Order
description: Look up an order using filters.
parameters:
- in: query
name: display_id
required: true
description: The display id given to the Order.
schema:
type: number
- in: query
name: email
style: form
explode: false
description: The email associated with this order.
required: true
schema:
type: string
format: email
- in: query
name: shipping_address
style: form
explode: false
description: The shipping address associated with this order.
schema:
type: object
properties:
postal_code:
type: string
description: The postal code of the shipping address
tags:
- Order
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
order:
$ref: '#/components/schemas/order'
'/carts/{id}/shipping-methods':
post:
operationId: PostCartsCartShippingMethod
@@ -889,456 +1339,6 @@ paths:
provider_id:
type: string
description: The ID of the Payment Provider.
/customers/me/addresses:
post:
operationId: PostCustomersCustomerAddresses
summary: Add a Shipping Address
description: Adds a Shipping Address to a Customer's saved addresses.
x-authenticated: true
requestBody:
content:
application/json:
schema:
required:
- address
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.
requestBody:
content:
application/json:
schema:
required:
- first_name
- last_name
- email
- password
properties:
first_name:
description: The Customer's first name.
type: string
last_name:
description: The Customer's last name.
type: string
email:
description: The email of the customer.
type: string
format: email
password:
description: The Customer's password.
type: string
format: password
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'
'422':
description: A customer with the same email exists
content:
application/json:
schema:
properties:
code:
type: string
description: The error code
type:
type: string
description: The type of error
message:
type: string
description: Human-readable message with details about the error
example:
code: invalid_request_error
type: duplicate_error
message: >-
A customer with the given email already has an account. Log in
instead
'/customers/me/addresses/{address_id}':
delete:
operationId: DeleteCustomersCustomerAddressesAddress
summary: Delete an Address
description: Removes an Address from the Customer's saved addresses.
x-authenticated: true
parameters:
- 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.
x-authenticated: true
parameters:
- in: path
name: address_id
required: true
description: The id of the Address to update.
schema:
type: string
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/address'
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
/customers/me:
get:
operationId: GetCustomersCustomer
summary: Retrieves a Customer
description: >-
Retrieves a Customer - the Customer must be logged in to retrieve their
details.
x-authenticated: true
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.
x-authenticated: true
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
billing_address:
description: The Address to be used for billing purposes.
anyOf:
- $ref: '#/components/schemas/address'
description: The full billing address object
- type: string
description: The ID of an existing billing address
password:
description: The Customer's password.
type: string
phone:
description: The Customer's phone number.
type: string
email:
description: The email of the customer.
type: string
metadata:
description: Metadata about the customer.
type: object
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
/customers/me/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.
x-authenticated: true
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/me/orders:
get:
operationId: GetCustomersCustomerOrders
summary: Retrieve Customer Orders
description: Retrieves a list of a Customer's Orders.
x-authenticated: true
parameters:
- in: query
name: limit
description: How many orders to return.
schema:
type: integer
default: 10
- in: query
name: offset
description: The offset in the resulting orders.
schema:
type: integer
default: 0
- in: query
name: fields
description: >-
(Comma separated string) Which fields should be included in the
resulting orders.
schema:
type: string
- in: query
name: expand
description: >-
(Comma separated string) Which relations should be expanded in the
resulting orders.
schema:
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
orders:
type: array
items:
$ref: '#/components/schemas/order'
count:
type: integer
description: The total number of items available
offset:
type: integer
description: The number of items skipped before these items
limit:
type: integer
description: The number of items per page
/customers/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.
requestBody:
content:
application/json:
schema:
required:
- email
properties:
email:
description: The email of the customer.
type: string
format: email
tags:
- Customer
responses:
'204':
description: OK
/customers/password-reset:
post:
operationId: PostCustomersResetPassword
summary: Resets Customer password
description: >-
Resets a Customer's password using a password token created by a
previous /password-token request.
requestBody:
content:
application/json:
schema:
required:
- email
- password
- token
properties:
email:
description: The email of the customer.
type: string
format: email
password:
description: The Customer's password.
type: string
format: password
token:
description: The reset password token
type: string
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: '#/components/schemas/customer'
'/orders/cart/{cart_id}':
get:
operationId: GetOrdersOrderCartId
summary: Retrieves Order by Cart id
description: >-
Retrieves an Order by the id of the Cart that was used to create the
Order.
parameters:
- in: path
name: cart_id
required: true
description: The ID of Cart.
schema:
type: string
tags:
- Order
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
order:
$ref: '#/components/schemas/order'
'/orders/{id}':
get:
operationId: GetOrdersOrder
summary: Retrieves an Order
description: Retrieves an Order
parameters:
- in: path
name: id
required: true
description: The id of the Order.
schema:
type: string
tags:
- Order
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
order:
$ref: '#/components/schemas/order'
/orders:
get:
operationId: GetOrders
summary: Look Up an Order
description: Look up an order using filters.
parameters:
- in: query
name: display_id
required: true
description: The display id given to the Order.
schema:
type: number
- in: query
name: email
style: form
explode: false
description: The email associated with this order.
required: true
schema:
type: string
format: email
- in: query
name: shipping_address
style: form
explode: false
description: The shipping address associated with this order.
schema:
type: object
properties:
postal_code:
type: string
description: The postal code of the shipping address
tags:
- Order
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
order:
$ref: '#/components/schemas/order'
'/products/{id}':
get:
operationId: GetProductsProduct

View File

@@ -62,6 +62,28 @@ paths:
$ref: paths/collections.yaml
/gift-cards/{code}:
$ref: paths/gift-cards_{code}.yaml
/customers/me/addresses:
$ref: paths/customers_me_addresses.yaml
/customers:
$ref: paths/customers.yaml
/customers/me/addresses/{address_id}:
$ref: paths/customers_me_addresses_{address_id}.yaml
/customers/me:
$ref: paths/customers_me.yaml
/customers/me/payment-methods:
$ref: paths/customers_me_payment-methods.yaml
/customers/me/orders:
$ref: paths/customers_me_orders.yaml
/customers/password-token:
$ref: paths/customers_password-token.yaml
/customers/password-reset:
$ref: paths/customers_password-reset.yaml
/orders/cart/{cart_id}:
$ref: paths/orders_cart_{cart_id}.yaml
/orders/{id}:
$ref: paths/orders_{id}.yaml
/orders:
$ref: paths/orders.yaml
/carts/{id}/shipping-methods:
$ref: paths/carts_{id}_shipping-methods.yaml
/carts/{id}/taxes:
@@ -86,28 +108,6 @@ paths:
$ref: paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml
/carts/{id}/payment-session:
$ref: paths/carts_{id}_payment-session.yaml
/customers/me/addresses:
$ref: paths/customers_me_addresses.yaml
/customers:
$ref: paths/customers.yaml
/customers/me/addresses/{address_id}:
$ref: paths/customers_me_addresses_{address_id}.yaml
/customers/me:
$ref: paths/customers_me.yaml
/customers/me/payment-methods:
$ref: paths/customers_me_payment-methods.yaml
/customers/me/orders:
$ref: paths/customers_me_orders.yaml
/customers/password-token:
$ref: paths/customers_password-token.yaml
/customers/password-reset:
$ref: paths/customers_password-reset.yaml
/orders/cart/{cart_id}:
$ref: paths/orders_cart_{cart_id}.yaml
/orders/{id}:
$ref: paths/orders_{id}.yaml
/orders:
$ref: paths/orders.yaml
/products/{id}:
$ref: paths/products_{id}.yaml
/products:

View File

@@ -19,12 +19,13 @@ import { Type } from "class-transformer"
import { pickBy } from "lodash"
/**
* @oas [get] /price-lists/:id/products
* @oas [get] /price-lists/{id}/products
* operationId: "GetPriceListsPriceListProducts"
* summary: "List Product in a Price List"
* description: "Retrieves a list of Product that are part of a Price List"
* x-authenticated: true
* parameters:
* - (path) id=* {string} ID of the price list.
* - (query) q {string} Query used for searching product title and description, variant title and sku, and collection title.
* - (query) id {string} ID of the product to search for.
* - in: query

View File

@@ -1,17 +1,18 @@
import { IsArray, IsOptional } from "class-validator"
import { getRetrieveConfig, pickByConfig } from "./utils/get-query-config"
import { EntityManager } from "typeorm"
import { TaxRate } from "../../../.."
import { TaxRateService } from "../../../../services"
import { validator } from "../../../../utils/validator"
import { EntityManager } from "typeorm"
/**
* @oas [post] /tax-rates/:id/product-types/batch
* @oas [post] /tax-rates/{id}/product-types/batch
* operationId: "PostTaxRatesTaxRateProductTypes"
* summary: "Add Tax Rate to Product Types"
* description: "Associates a Tax Rate with a list of Product Types"
* parameters:
* - (path) id=* {string} ID of the tax rate.
* - in: query
* name: fields
* description: "Which fields should be included in the result."

View File

@@ -1,17 +1,18 @@
import { IsArray, IsOptional } from "class-validator"
import { getRetrieveConfig, pickByConfig } from "./utils/get-query-config"
import { EntityManager } from "typeorm"
import { TaxRate } from "../../../.."
import { TaxRateService } from "../../../../services"
import { validator } from "../../../../utils/validator"
import { EntityManager } from "typeorm"
/**
* @oas [post] /tax-rates/:id/products/batch
* @oas [post] /tax-rates/{id}/products/batch
* operationId: "PostTaxRatesTaxRateProducts"
* summary: "Add Tax Rate to Products"
* description: "Associates a Tax Rate with a list of Products"
* parameters:
* - (path) id=* {string} ID of the tax rate.
* - in: query
* name: fields
* description: "Which fields should be included in the result."

View File

@@ -1,17 +1,18 @@
import { IsArray, IsOptional } from "class-validator"
import { getRetrieveConfig, pickByConfig } from "./utils/get-query-config"
import { EntityManager } from "typeorm"
import { TaxRate } from "../../../.."
import { TaxRateService } from "../../../../services"
import { validator } from "../../../../utils/validator"
import { EntityManager } from "typeorm"
/**
* @oas [post] /tax-rates/:id/shipping-options/batch
* @oas [post] /tax-rates/{id}/shipping-options/batch
* operationId: "PostTaxRatesTaxRateShippingOptions"
* summary: "Add Tax Rate to Product Types"
* description: "Associates a Tax Rate with a list of Shipping Options"
* parameters:
* - (path) id=* {string} ID of the tax rate.
* - in: query
* name: fields
* description: "Which fields should be included in the result."

View File

@@ -6,11 +6,12 @@ import { TaxRateService } from "../../../../services"
import { validator } from "../../../../utils/validator"
/**
* @oas [get] /tax-rates/:id
* @oas [get] /tax-rates/{id}
* operationId: "GetTaxRatesTaxRate"
* summary: "Get Tax Rate"
* description: "Retrieves a TaxRate"
* parameters:
* - (path) id=* {string} ID of the tax rate.
* - in: query
* name: fields
* description: "Which fields should be included in the result."

View File

@@ -1,17 +1,18 @@
import { IsArray, IsOptional } from "class-validator"
import { getRetrieveConfig, pickByConfig } from "./utils/get-query-config"
import { EntityManager } from "typeorm"
import { TaxRate } from "../../../.."
import { TaxRateService } from "../../../../services"
import { validator } from "../../../../utils/validator"
import { EntityManager } from "typeorm"
/**
* @oas [delete] /tax-rates/:id/product-types/batch
* @oas [delete] /tax-rates/{id}/product-types/batch
* operationId: "DeleteTaxRatesTaxRateProductTypes"
* summary: "Remove Tax Rate from Product Types"
* description: "Removes a Tax Rate from a list of Product Types"
* parameters:
* - (path) id=* {string} ID of the tax rate.
* - in: query
* name: fields
* description: "Which fields should be included in the result."

View File

@@ -1,17 +1,18 @@
import { IsArray, IsOptional } from "class-validator"
import { getRetrieveConfig, pickByConfig } from "./utils/get-query-config"
import { EntityManager } from "typeorm"
import { TaxRate } from "../../../.."
import { TaxRateService } from "../../../../services"
import { validator } from "../../../../utils/validator"
import { EntityManager } from "typeorm"
/**
* @oas [delete] /tax-rates/:id/products/batch
* @oas [delete] /tax-rates/{id}/products/batch
* operationId: "DeleteTaxRatesTaxRateProducts"
* summary: "Removes Tax Rate from Products"
* description: "Removes a Tax Rate from a list of Products"
* parameters:
* - (path) id=* {string} ID of the tax rate.
* - in: query
* name: fields
* description: "Which fields should be included in the result."

View File

@@ -1,17 +1,18 @@
import { IsArray, IsOptional } from "class-validator"
import { getRetrieveConfig, pickByConfig } from "./utils/get-query-config"
import { EntityManager } from "typeorm"
import { TaxRate } from "../../../.."
import { TaxRateService } from "../../../../services"
import { validator } from "../../../../utils/validator"
import { EntityManager } from "typeorm"
/**
* @oas [delete] /tax-rates/:id/shipping-options/batch
* @oas [delete] /tax-rates/{id}/shipping-options/batch
* operationId: "DeleteTaxRatesTaxRateShippingOptions"
* summary: "Removes a Tax Rate from Product Types"
* description: "Removes a Tax Rate from a list of Product Types"
* parameters:
* - (path) id=* {string} ID of the tax rate.
* - in: query
* name: fields
* description: "Which fields should be included in the result."

View File

@@ -9,11 +9,12 @@ import { omit } from "lodash"
import { validator } from "../../../../utils/validator"
/**
* @oas [post] /tax-rates/:id
* @oas [post] /tax-rates/{id}
* operationId: "PostTaxRatesTaxRate"
* summary: "Update a Tax Rate"
* description: "Updates a Tax Rate"
* parameters:
* - (path) id=* {string} ID of the tax rate.
* - in: query
* name: fields
* description: "Which fields should be included in the result."