fix: build openapi (#338)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -478,6 +478,9 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
usage_limit:
|
||||
type: number
|
||||
description: Maximum times the discount can be used
|
||||
metadata:
|
||||
description: >-
|
||||
An optional set of key-value pairs to hold additional
|
||||
@@ -695,6 +698,421 @@ paths:
|
||||
properties:
|
||||
discount:
|
||||
$ref: '#/components/schemas/discount'
|
||||
'/discounts/code/{code}':
|
||||
get:
|
||||
operationId: GetDiscountsDiscountCode
|
||||
summary: Retrieve a Discount by code
|
||||
description: Retrieves a Discount by its discount code
|
||||
parameters:
|
||||
- in: path
|
||||
name: code
|
||||
required: true
|
||||
description: The code of the Discount
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Discount
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
discount:
|
||||
$ref: '#/components/schemas/discount'
|
||||
/draft-orders:
|
||||
post:
|
||||
operationId: PostDraftOrders
|
||||
summary: Create a Draft Order
|
||||
description: Creates a Draft Order
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
status:
|
||||
description: The status of the draft order
|
||||
type: string
|
||||
email:
|
||||
description: The email of the customer of the draft order
|
||||
type: string
|
||||
billing_address:
|
||||
description: The Address to be used for billing purposes.
|
||||
anyOf:
|
||||
- $ref: '#/components/schemas/address'
|
||||
shipping_address:
|
||||
description: The Address to be used for shipping.
|
||||
anyOf:
|
||||
- $ref: '#/components/schemas/address'
|
||||
items:
|
||||
description: The Line Items that have been received.
|
||||
type: array
|
||||
items:
|
||||
properties:
|
||||
variant_id:
|
||||
description: >-
|
||||
The id of the Product Variant to generate the Line
|
||||
Item from.
|
||||
type: string
|
||||
unit_price:
|
||||
description: The potential custom price of the item.
|
||||
type: integer
|
||||
title:
|
||||
description: The potential custom title of the item.
|
||||
type: string
|
||||
quantity:
|
||||
description: The quantity of the Line Item.
|
||||
type: integer
|
||||
metadata:
|
||||
description: >-
|
||||
The optional key-value map with additional details
|
||||
about the Line Item.
|
||||
type: object
|
||||
region_id:
|
||||
description: The id of the region for the draft order
|
||||
type: string
|
||||
discounts:
|
||||
description: The discounts to add on the draft order
|
||||
type: array
|
||||
items:
|
||||
properties:
|
||||
code:
|
||||
description: The code of the discount to apply
|
||||
type: string
|
||||
customer_id:
|
||||
description: The id of the customer to add on the draft order
|
||||
type: string
|
||||
no_notification_order:
|
||||
description: >-
|
||||
An optional flag passed to the resulting order to determine
|
||||
use of notifications.
|
||||
type: boolean
|
||||
shipping_methods:
|
||||
description: The shipping methods for the draft order
|
||||
type: array
|
||||
items:
|
||||
properties:
|
||||
option_id:
|
||||
description: The id of the shipping option in use
|
||||
type: string
|
||||
data:
|
||||
description: >-
|
||||
The optional additional data needed for the shipping
|
||||
method
|
||||
type: object
|
||||
price:
|
||||
description: The potential custom price of the shipping
|
||||
type: integer
|
||||
metadata:
|
||||
description: >-
|
||||
The optional key-value map with additional details about the
|
||||
Draft Order.
|
||||
type: object
|
||||
tags:
|
||||
- Draft Order
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
draft_order:
|
||||
$ref: '#/components/schemas/draft-order'
|
||||
get:
|
||||
operationId: GetDraftOrders
|
||||
summary: List Draft Orders
|
||||
description: Retrieves an list of Draft Orders
|
||||
tags:
|
||||
- Draft Order
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
draft_order:
|
||||
$ref: '#/components/schemas/draft-order'
|
||||
'/draft-orders/{id}/line-items':
|
||||
post:
|
||||
operationId: PostDraftOrdersDraftOrderLineItems
|
||||
summary: Create a Line Item for Draft Order
|
||||
description: Creates a Line Item for the Draft Order
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
variant_id:
|
||||
description: >-
|
||||
The id of the Product Variant to generate the Line Item
|
||||
from.
|
||||
type: string
|
||||
unit_price:
|
||||
description: The potential custom price of the item.
|
||||
type: integer
|
||||
title:
|
||||
description: The potential custom title of the item.
|
||||
type: string
|
||||
quantity:
|
||||
description: The quantity of the Line Item.
|
||||
type: integer
|
||||
metadata:
|
||||
description: >-
|
||||
The optional key-value map with additional details about the
|
||||
Line Item.
|
||||
type: object
|
||||
tags:
|
||||
- Draft Order
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
draft_order:
|
||||
$ref: '#/components/schemas/draft-order'
|
||||
'/draft-orders/{id}':
|
||||
delete:
|
||||
operationId: DeleteDraftOrdersDraftOrder
|
||||
summary: Delete a Draft Order
|
||||
description: Deletes a Draft Order
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Draft Order.
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Draft Order
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The id of the deleted Draft Order.
|
||||
object:
|
||||
type: string
|
||||
description: The type of the object that was deleted.
|
||||
deleted:
|
||||
type: boolean
|
||||
get:
|
||||
operationId: GetDraftOrdersDraftOrder
|
||||
summary: Retrieve a Draft Order
|
||||
description: Retrieves a Draft Order.
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Draft Order.
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Draft Order
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
draft_order:
|
||||
$ref: '#/components/schemas/draft-order'
|
||||
'/draft-orders/{id}/line-items/{line_id}':
|
||||
delete:
|
||||
operationId: DeleteDraftOrdersDraftOrderLineItemsItem
|
||||
summary: Delete a Line Item
|
||||
description: Removes a Line Item from a Draft Order.
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Draft Order.
|
||||
schema:
|
||||
type: string
|
||||
- in: path
|
||||
name: line_id
|
||||
required: true
|
||||
description: The id of the Draft Order.
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Draft Order
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
draft_order:
|
||||
$ref: '#/components/schemas/draft-order'
|
||||
post:
|
||||
operationId: PostDraftOrdersDraftOrderLineItemsItem
|
||||
summary: Update a Line Item for a Draft Order
|
||||
description: Updates a Line Item for a Draft Order
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
unit_price:
|
||||
description: The potential custom price of the item.
|
||||
type: integer
|
||||
title:
|
||||
description: The potential custom title of the item.
|
||||
type: string
|
||||
quantity:
|
||||
description: The quantity of the Line Item.
|
||||
type: integer
|
||||
metadata:
|
||||
description: >-
|
||||
The optional key-value map with additional details about the
|
||||
Line Item.
|
||||
type: object
|
||||
tags:
|
||||
- Draft Order
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
draft_order:
|
||||
$ref: '#/components/schemas/draft-order'
|
||||
'/draft-orders/{id}/register-payment':
|
||||
post:
|
||||
summary: Registers a payment for a Draft Order
|
||||
operationId: PostDraftOrdersDraftOrderRegisterPayment
|
||||
description: Registers a payment for a Draft Order.
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The Draft Order id.
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Draft Order
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
draft_order:
|
||||
$ref: '#/components/schemas/draft-order'
|
||||
'/admin/draft-orders/{id}':
|
||||
post:
|
||||
operationId: PostDraftOrdersDraftOrder
|
||||
summary: Update a Draft Order"
|
||||
description: Updates a Draft Order.
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Draft Order.
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
region_id:
|
||||
type: string
|
||||
description: The id of the Region to create the Draft Order in.
|
||||
email:
|
||||
type: string
|
||||
description: An email to be used on the Draft Order.
|
||||
billing_address:
|
||||
description: The Address to be used for billing purposes.
|
||||
anyOf:
|
||||
- $ref: '#/components/schemas/address'
|
||||
shipping_address:
|
||||
description: The Address to be used for shipping.
|
||||
anyOf:
|
||||
- $ref: '#/components/schemas/address'
|
||||
discounts:
|
||||
description: An array of Discount codes to add to the Draft Order.
|
||||
type: array
|
||||
items:
|
||||
properties:
|
||||
code:
|
||||
description: The code that a Discount is identifed by.
|
||||
type: string
|
||||
no_notification_order:
|
||||
description: >-
|
||||
An optional flag passed to the resulting order to determine
|
||||
use of notifications.
|
||||
type: boolean
|
||||
customer_id:
|
||||
description: The id of the Customer to associate the Draft Order with.
|
||||
type: string
|
||||
tags:
|
||||
- Draft Order
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
draft_order:
|
||||
$ref: '#/components/schemas/draft-order'
|
||||
/notifications:
|
||||
get:
|
||||
operationId: GetNotifications
|
||||
summary: List Notifications
|
||||
description: Retrieves a list of Notifications.
|
||||
tags:
|
||||
- Notification
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
notifications:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/notification'
|
||||
'/notifications/{id}/resend':
|
||||
post:
|
||||
operationId: PostNotificationsNotificationResend
|
||||
summary: Resend Notification
|
||||
description: >-
|
||||
Resends a previously sent notifications, with the same data but
|
||||
optionally to a different address
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Notification
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Notification
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
notification:
|
||||
$ref: '#/components/schemas/notification'
|
||||
/gift-cards:
|
||||
post:
|
||||
operationId: PostGiftCards
|
||||
@@ -867,49 +1285,6 @@ paths:
|
||||
properties:
|
||||
gift_card:
|
||||
$ref: '#/components/schemas/gift_card'
|
||||
/notifications:
|
||||
get:
|
||||
operationId: GetNotifications
|
||||
summary: List Notifications
|
||||
description: Retrieves a list of Notifications.
|
||||
tags:
|
||||
- Notification
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
notifications:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/notification'
|
||||
'/notifications/{id}/resend':
|
||||
post:
|
||||
operationId: PostNotificationsNotificationResend
|
||||
summary: Resend Notification
|
||||
description: >-
|
||||
Resends a previously sent notifications, with the same data but
|
||||
optionally to a different address
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Notification
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Notification
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
notification:
|
||||
$ref: '#/components/schemas/notification'
|
||||
'/orders/{id}/shipping-methods':
|
||||
post:
|
||||
operationId: PostOrdersOrderShippingMethods
|
||||
@@ -1158,11 +1533,21 @@ paths:
|
||||
price:
|
||||
description: The price to charge for the Shipping Method
|
||||
type: integer
|
||||
shipping_address:
|
||||
type: object
|
||||
description: >-
|
||||
An optional shipping address to send the claim to. Defaults
|
||||
to the parent order's shipping address
|
||||
refund_amount:
|
||||
description: >-
|
||||
The amount to refund the Customer when the Claim type is
|
||||
`refund`.
|
||||
type: integer
|
||||
no_notification:
|
||||
description: >-
|
||||
If set to true no notification will be send related to this
|
||||
Claim.
|
||||
type: boolean
|
||||
metadata:
|
||||
description: >-
|
||||
An optional set of key-value pairs to hold additional
|
||||
@@ -1209,6 +1594,11 @@ paths:
|
||||
quantity:
|
||||
description: The quantity of the Line Item to fulfill.
|
||||
type: integer
|
||||
no_notification:
|
||||
description: >-
|
||||
If set to true no notification will be send related to this
|
||||
Swap.
|
||||
type: boolean
|
||||
metadata:
|
||||
description: >-
|
||||
An optional set of key-value pairs to hold additional
|
||||
@@ -1250,6 +1640,11 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
no_notification:
|
||||
description: >-
|
||||
If set to true no notification will be send related to this
|
||||
Shipment.
|
||||
type: boolean
|
||||
tags:
|
||||
- Order
|
||||
responses:
|
||||
@@ -1292,6 +1687,11 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
no_notification:
|
||||
description: >-
|
||||
If set to true no notification will be send related to this
|
||||
Claim.
|
||||
type: boolean
|
||||
tags:
|
||||
- Order
|
||||
responses:
|
||||
@@ -1356,6 +1756,11 @@ paths:
|
||||
quantity:
|
||||
description: The quantity of the Product Variant to ship.
|
||||
type: integer
|
||||
no_notification:
|
||||
description: >-
|
||||
If set to true no notification will be send related to this
|
||||
Swap.
|
||||
type: boolean
|
||||
tags:
|
||||
- Order
|
||||
responses:
|
||||
@@ -1424,6 +1829,11 @@ paths:
|
||||
An optional set of key-value pairs to hold additional
|
||||
information.
|
||||
type: object
|
||||
no_notification:
|
||||
description: >-
|
||||
If set to true no notification will be send related to this
|
||||
Claim.
|
||||
type: boolean
|
||||
tags:
|
||||
- Order
|
||||
responses:
|
||||
@@ -1463,6 +1873,11 @@ paths:
|
||||
An optional set of key-value pairs to hold additional
|
||||
information.
|
||||
type: object
|
||||
no_notification:
|
||||
description: >-
|
||||
If set to true no notification will be send related to this
|
||||
Claim.
|
||||
type: boolean
|
||||
tags:
|
||||
- Order
|
||||
responses:
|
||||
@@ -1547,54 +1962,6 @@ paths:
|
||||
properties:
|
||||
order:
|
||||
$ref: '#/components/schemas/order'
|
||||
'/orders/{id}/returns/{return_id}/receive':
|
||||
post:
|
||||
operationId: PostOrdersOrderReturnsReturnReceive
|
||||
summary: Receive a Return
|
||||
description: Registers a Return as received.
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Order.
|
||||
schema:
|
||||
type: string
|
||||
- in: path
|
||||
name: return_id
|
||||
required: true
|
||||
description: The id of the Return.
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
items:
|
||||
description: The Line Items that have been received.
|
||||
type: array
|
||||
items:
|
||||
properties:
|
||||
item_id:
|
||||
description: The id of the Line Item.
|
||||
type: string
|
||||
quantity:
|
||||
description: The quantity of the Line Item.
|
||||
type: integer
|
||||
refund:
|
||||
description: The amount to refund.
|
||||
type: integer
|
||||
tags:
|
||||
- Order
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
order:
|
||||
$ref: '#/components/schemas/order'
|
||||
'/orders/{id}/swaps/{swap_id}/receive':
|
||||
post:
|
||||
operationId: PostOrdersOrderSwapsSwapReceive
|
||||
@@ -1669,6 +2036,11 @@ paths:
|
||||
note:
|
||||
description: A not with additional details about the Refund.
|
||||
type: string
|
||||
no_notification:
|
||||
description: >-
|
||||
If set to true no notification will be send related to this
|
||||
Refund.
|
||||
type: boolean
|
||||
tags:
|
||||
- Order
|
||||
responses:
|
||||
@@ -1735,6 +2107,11 @@ paths:
|
||||
A flag to indicate if the Return should be registerd as
|
||||
received immediately.
|
||||
type: boolean
|
||||
no_notification:
|
||||
description: >-
|
||||
A flag to indicate if no notifications should be emitted
|
||||
related to the requested Return.
|
||||
type: boolean
|
||||
refund:
|
||||
description: The amount to refund.
|
||||
type: integer
|
||||
@@ -1826,6 +2203,11 @@ paths:
|
||||
price:
|
||||
description: The price to charge for the Shipping Method
|
||||
type: integer
|
||||
no_notification:
|
||||
description: >-
|
||||
If set to true no notification will be send related to this
|
||||
Swap.
|
||||
type: boolean
|
||||
metadata:
|
||||
description: >-
|
||||
An optional set of key-value pairs to hold additional
|
||||
@@ -1900,6 +2282,11 @@ paths:
|
||||
Purchasing Products with this flag set to `true` will result
|
||||
in a Gift Card being created.
|
||||
type: boolean
|
||||
discountable:
|
||||
description: >-
|
||||
A flag to indicate if discounts can be applied to the
|
||||
LineItems generated from this Product
|
||||
type: boolean
|
||||
images:
|
||||
description: Images of the Product.
|
||||
type: array
|
||||
@@ -2400,6 +2787,11 @@ paths:
|
||||
Purchasing Products with this flag set to `true` will result
|
||||
in a Gift Card being created.
|
||||
type: boolean
|
||||
discountable:
|
||||
description: >-
|
||||
A flag to indicate if discounts can be applied to the
|
||||
LineItems generated from this Product
|
||||
type: boolean
|
||||
images:
|
||||
description: Images of the Product.
|
||||
type: array
|
||||
@@ -3297,6 +3689,50 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/return'
|
||||
'/returns/{id}receive':
|
||||
post:
|
||||
operationId: PostReturnsReturnReceive
|
||||
summary: Receive a Return
|
||||
description: >-
|
||||
Registers a Return as received. Updates statuses on Orders and Swaps
|
||||
accordingly.
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Return.
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
items:
|
||||
description: The Line Items that have been received.
|
||||
type: array
|
||||
items:
|
||||
properties:
|
||||
item_id:
|
||||
description: The id of the Line Item.
|
||||
type: string
|
||||
quantity:
|
||||
description: The quantity of the Line Item.
|
||||
type: integer
|
||||
refund:
|
||||
description: The amount to refund.
|
||||
type: integer
|
||||
tags:
|
||||
- Return
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
return:
|
||||
$ref: '#/components/schemas/return'
|
||||
/shipping-options:
|
||||
post:
|
||||
operationId: PostShippingOptions
|
||||
@@ -3718,6 +4154,29 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/store'
|
||||
'/swaps/{id}':
|
||||
get:
|
||||
operationId: GetSwapsSwap
|
||||
summary: Retrieve a Swap
|
||||
description: Retrieves a Swap.
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Swap.
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Swap
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
swap:
|
||||
$ref: '#/components/schemas/swap'
|
||||
/swaps:
|
||||
get:
|
||||
operationId: GetSwaps
|
||||
@@ -4020,6 +4479,11 @@ components:
|
||||
deleted_at:
|
||||
type: string
|
||||
format: date-time
|
||||
no_notification:
|
||||
description: >-
|
||||
Flag for describing whether or not notifications related to this
|
||||
should be send.
|
||||
type: boolean
|
||||
metadata:
|
||||
type: object
|
||||
claim_tag:
|
||||
@@ -4167,9 +4631,6 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/product'
|
||||
usage_limit:
|
||||
description: The maximum number of times that a discount can be used.
|
||||
type: integer
|
||||
created_at:
|
||||
description: The date with timezone at which the resource was created.
|
||||
type: string
|
||||
@@ -4232,6 +4693,12 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/region'
|
||||
usage_limit:
|
||||
description: The maximum number of times that a discount can be used.
|
||||
type: integer
|
||||
usage_count:
|
||||
description: The number of times a discount has been used.
|
||||
type: integer
|
||||
created_at:
|
||||
description: The date with timezone at which the resource was created.
|
||||
type: string
|
||||
@@ -4247,6 +4714,51 @@ components:
|
||||
metadata:
|
||||
description: An optional key-value map with additional information.
|
||||
type: object
|
||||
draft-order:
|
||||
title: DraftOrder
|
||||
description: Represents a draft order
|
||||
x-resourceId: draft-order
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
enum:
|
||||
- open
|
||||
- completed
|
||||
display_id:
|
||||
type: string
|
||||
cart_id:
|
||||
type: string
|
||||
cart:
|
||||
anyOf:
|
||||
- $ref: '#/components/schemas/cart'
|
||||
order_id:
|
||||
type: string
|
||||
order:
|
||||
anyOf:
|
||||
- $ref: '#/components/schemas/order'
|
||||
canceled_at:
|
||||
type: string
|
||||
format: date-time
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
update_at:
|
||||
type: string
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
format: date-time
|
||||
completed_at:
|
||||
type: string
|
||||
format: date-time
|
||||
no_notification_order:
|
||||
type: boolean
|
||||
metadata:
|
||||
type: object
|
||||
idempotency_key:
|
||||
type: string
|
||||
fulfillment_item:
|
||||
title: Fulfillment Item
|
||||
description: >-
|
||||
@@ -4339,6 +4851,11 @@ components:
|
||||
description: The date with timezone at which the Fulfillment was shipped.
|
||||
type: string
|
||||
format: date-time
|
||||
no_notification:
|
||||
description: >-
|
||||
Flag for describing whether or not notifications related to this
|
||||
should be send.
|
||||
type: boolean
|
||||
canceled_at:
|
||||
description: The date with timezone at which the Fulfillment was canceled.
|
||||
type: string
|
||||
@@ -4865,6 +5382,13 @@ components:
|
||||
type: integer
|
||||
gift_card_total:
|
||||
type: integer
|
||||
paid_total:
|
||||
type: integer
|
||||
no_notification:
|
||||
description: >-
|
||||
Flag for describing whether or not notifications related to this
|
||||
should be send.
|
||||
type: boolean
|
||||
payment_provider:
|
||||
title: Payment Provider
|
||||
description: Represents a Payment Provider plugin and holds its installation status.
|
||||
@@ -5331,6 +5855,11 @@ components:
|
||||
Gift Cards will automatically generate a redeemable Gift Card code
|
||||
once they are purchased.
|
||||
type: boolean
|
||||
discountable:
|
||||
description: >-
|
||||
Whether the Product can be discounted. Discounts will not apply to
|
||||
Line Items of this Product when this flag is set to `false`.
|
||||
type: boolean
|
||||
images:
|
||||
description: Images of the Product
|
||||
type: array
|
||||
@@ -5670,6 +6199,11 @@ components:
|
||||
description: The date with timezone at which the resource was last updated.
|
||||
type: string
|
||||
format: date-time
|
||||
no_notification:
|
||||
description: >-
|
||||
When set to true, no notification will be sent related to this
|
||||
return.
|
||||
type: boolean
|
||||
metadata:
|
||||
description: An optional key-value map with additional information.
|
||||
type: object
|
||||
@@ -6030,6 +6564,9 @@ components:
|
||||
description: The date with timezone at which the resource was last updated.
|
||||
type: string
|
||||
format: date-time
|
||||
no_notification:
|
||||
description: 'If set to true, no notification will be sent related to this swap'
|
||||
type: boolean
|
||||
metadata:
|
||||
description: An optional key-value map with additional information.
|
||||
type: object
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,87 +40,6 @@ tags:
|
||||
servers:
|
||||
- url: 'https://api.medusa-commerce.com/store'
|
||||
paths:
|
||||
/auth:
|
||||
post:
|
||||
operationId: PostAuth
|
||||
summary: Authenticate Customer
|
||||
description: >-
|
||||
Logs a Customer in and authorizes them to view their details. Successful
|
||||
authentication will set a session cookie in the Customer's browser.
|
||||
parameters: []
|
||||
tags:
|
||||
- Auth
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
customer:
|
||||
$ref: '#/components/schemas/customer'
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- email
|
||||
- password
|
||||
properties:
|
||||
email:
|
||||
type: string
|
||||
description: The Customer's email.
|
||||
password:
|
||||
type: string
|
||||
description: The Customer's password.
|
||||
delete:
|
||||
operationId: DeleteAuth
|
||||
summary: Log out
|
||||
description: Destroys a Customer's authenticated session.
|
||||
tags:
|
||||
- Auth
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
get:
|
||||
operationId: GetAuth
|
||||
summary: Get Session
|
||||
description: Gets the currently logged in Customer.
|
||||
tags:
|
||||
- Auth
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
customer:
|
||||
$ref: '#/components/schemas/customer'
|
||||
'/auth/{email}':
|
||||
get:
|
||||
operationId: GetAuthEmail
|
||||
summary: Check if email has account
|
||||
description: Checks if a Customer with the given email has signed up.
|
||||
parameters:
|
||||
- in: path
|
||||
name: email
|
||||
required: true
|
||||
description: The Customer's email.
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Auth
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
exists:
|
||||
type: boolean
|
||||
'/carts/{id}/shipping-methods':
|
||||
post:
|
||||
operationId: PostCartsCartShippingMethod
|
||||
@@ -162,7 +81,7 @@ paths:
|
||||
process the fulfillment of the order. Look at the
|
||||
documentation for your installed fulfillment providers to
|
||||
find out what to send.
|
||||
'/carts/{id}/complete-cart':
|
||||
'/carts/{id}/complete':
|
||||
post:
|
||||
summary: Complete a Cart
|
||||
operationId: PostCartsCartComplete
|
||||
@@ -457,11 +376,9 @@ paths:
|
||||
cart:
|
||||
$ref: '#/components/schemas/cart'
|
||||
post:
|
||||
operationId: PostCartsCartPaymentSessionsSession
|
||||
summary: Refresh a Payment Session
|
||||
description: >-
|
||||
Refreshes a Payment Session to ensure that it is in sync with the Cart -
|
||||
this is usually not necessary.
|
||||
operationId: PostCartsCartPaymentSessionUpdate
|
||||
summary: Update a Payment Session
|
||||
description: Updates a Payment Session with additional data.
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
@@ -472,9 +389,7 @@ paths:
|
||||
- in: path
|
||||
name: provider_id
|
||||
required: true
|
||||
description: >-
|
||||
The id of the Payment Provider that created the Payment Session to
|
||||
be refreshed.
|
||||
description: The id of the payment provider.
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
@@ -488,6 +403,23 @@ paths:
|
||||
properties:
|
||||
cart:
|
||||
$ref: '#/components/schemas/cart'
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- provider_id
|
||||
- data
|
||||
properties:
|
||||
provider_id:
|
||||
type: string
|
||||
description: >-
|
||||
The id of the Payment Provider responsible for the Payment
|
||||
Session to update.
|
||||
data:
|
||||
type: object
|
||||
description: The data to update the payment session with.
|
||||
'/carts/{id}':
|
||||
get:
|
||||
operationId: GetCartsCart
|
||||
@@ -614,46 +546,6 @@ paths:
|
||||
properties:
|
||||
cart:
|
||||
$ref: '#/components/schemas/cart'
|
||||
'/carts/{id}/payment-session/update':
|
||||
post:
|
||||
operationId: PostCartsCartPaymentSessionUpdate
|
||||
summary: Update a Payment Session
|
||||
description: Updates a Payment Session with additional data.
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Cart.
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Cart
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
cart:
|
||||
$ref: '#/components/schemas/cart'
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- provider_id
|
||||
- data
|
||||
properties:
|
||||
provider_id:
|
||||
type: string
|
||||
description: >-
|
||||
The id of the Payment Provider responsible for the Payment
|
||||
Session to update.
|
||||
data:
|
||||
type: object
|
||||
description: The data to update the payment session with.
|
||||
'/customers/{id}/addresses':
|
||||
post:
|
||||
operationId: PostCustomersCustomerAddresses
|
||||
@@ -842,12 +734,19 @@ paths:
|
||||
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'
|
||||
password:
|
||||
description: The Customer's password.
|
||||
type: string
|
||||
phone:
|
||||
description: The Customer's phone number.
|
||||
type: string
|
||||
metadata:
|
||||
description: Metadata about the customer.
|
||||
type: object
|
||||
tags:
|
||||
- Customer
|
||||
responses:
|
||||
@@ -986,6 +885,87 @@ paths:
|
||||
password:
|
||||
type: string
|
||||
description: The new password to set for the Customer.
|
||||
/auth:
|
||||
post:
|
||||
operationId: PostAuth
|
||||
summary: Authenticate Customer
|
||||
description: >-
|
||||
Logs a Customer in and authorizes them to view their details. Successful
|
||||
authentication will set a session cookie in the Customer's browser.
|
||||
parameters: []
|
||||
tags:
|
||||
- Auth
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
customer:
|
||||
$ref: '#/components/schemas/customer'
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- email
|
||||
- password
|
||||
properties:
|
||||
email:
|
||||
type: string
|
||||
description: The Customer's email.
|
||||
password:
|
||||
type: string
|
||||
description: The Customer's password.
|
||||
delete:
|
||||
operationId: DeleteAuth
|
||||
summary: Log out
|
||||
description: Destroys a Customer's authenticated session.
|
||||
tags:
|
||||
- Auth
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
get:
|
||||
operationId: GetAuth
|
||||
summary: Get Session
|
||||
description: Gets the currently logged in Customer.
|
||||
tags:
|
||||
- Auth
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
customer:
|
||||
$ref: '#/components/schemas/customer'
|
||||
'/auth/{email}':
|
||||
get:
|
||||
operationId: GetAuthEmail
|
||||
summary: Check if email has account
|
||||
description: Checks if a Customer with the given email has signed up.
|
||||
parameters:
|
||||
- in: path
|
||||
name: email
|
||||
required: true
|
||||
description: The Customer's email.
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Auth
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
exists:
|
||||
type: boolean
|
||||
'/gift-cards/{code}':
|
||||
get:
|
||||
operationId: GetGiftCardsCode
|
||||
@@ -1147,47 +1127,6 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/product'
|
||||
'/return-reasons/{id}':
|
||||
get:
|
||||
operationId: GetReturnReasonsReason
|
||||
summary: Retrieve a Return Reason
|
||||
description: Retrieves a Return Reason.
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Return Reason.
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Return Reason
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
return_reason:
|
||||
$ref: '#/components/schemas/return_reason'
|
||||
/return-reasons:
|
||||
get:
|
||||
operationId: GetReturnReasons
|
||||
summary: List Return Reasons
|
||||
description: Retrieves a list of Return Reasons.
|
||||
tags:
|
||||
- Return Reason
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
return_reasons:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/return_reason'
|
||||
'/regions/{id}':
|
||||
get:
|
||||
operationId: GetRegionsRegion
|
||||
@@ -1238,6 +1177,47 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/region'
|
||||
'/return-reasons/{id}':
|
||||
get:
|
||||
operationId: GetReturnReasonsReason
|
||||
summary: Retrieve a Return Reason
|
||||
description: Retrieves a Return Reason.
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
description: The id of the Return Reason.
|
||||
schema:
|
||||
type: string
|
||||
tags:
|
||||
- Return Reason
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
return_reason:
|
||||
$ref: '#/components/schemas/return_reason'
|
||||
/return-reasons:
|
||||
get:
|
||||
operationId: GetReturnReasons
|
||||
summary: List Return Reasons
|
||||
description: Retrieves a list of Return Reasons.
|
||||
tags:
|
||||
- Return Reason
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
properties:
|
||||
return_reasons:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/return_reason'
|
||||
/returns:
|
||||
post:
|
||||
operationId: PostReturns
|
||||
@@ -1682,6 +1662,11 @@ components:
|
||||
deleted_at:
|
||||
type: string
|
||||
format: date-time
|
||||
no_notification:
|
||||
description: >-
|
||||
Flag for describing whether or not notifications related to this
|
||||
should be send.
|
||||
type: boolean
|
||||
metadata:
|
||||
type: object
|
||||
claim_tag:
|
||||
@@ -1829,9 +1814,6 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/product'
|
||||
usage_limit:
|
||||
description: The maximum number of times that a discount can be used.
|
||||
type: integer
|
||||
created_at:
|
||||
description: The date with timezone at which the resource was created.
|
||||
type: string
|
||||
@@ -1894,6 +1876,12 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/region'
|
||||
usage_limit:
|
||||
description: The maximum number of times that a discount can be used.
|
||||
type: integer
|
||||
usage_count:
|
||||
description: The number of times a discount has been used.
|
||||
type: integer
|
||||
created_at:
|
||||
description: The date with timezone at which the resource was created.
|
||||
type: string
|
||||
@@ -1909,6 +1897,51 @@ components:
|
||||
metadata:
|
||||
description: An optional key-value map with additional information.
|
||||
type: object
|
||||
draft-order:
|
||||
title: DraftOrder
|
||||
description: Represents a draft order
|
||||
x-resourceId: draft-order
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
enum:
|
||||
- open
|
||||
- completed
|
||||
display_id:
|
||||
type: string
|
||||
cart_id:
|
||||
type: string
|
||||
cart:
|
||||
anyOf:
|
||||
- $ref: '#/components/schemas/cart'
|
||||
order_id:
|
||||
type: string
|
||||
order:
|
||||
anyOf:
|
||||
- $ref: '#/components/schemas/order'
|
||||
canceled_at:
|
||||
type: string
|
||||
format: date-time
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
update_at:
|
||||
type: string
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
format: date-time
|
||||
completed_at:
|
||||
type: string
|
||||
format: date-time
|
||||
no_notification_order:
|
||||
type: boolean
|
||||
metadata:
|
||||
type: object
|
||||
idempotency_key:
|
||||
type: string
|
||||
fulfillment_item:
|
||||
title: Fulfillment Item
|
||||
description: >-
|
||||
@@ -2001,6 +2034,11 @@ components:
|
||||
description: The date with timezone at which the Fulfillment was shipped.
|
||||
type: string
|
||||
format: date-time
|
||||
no_notification:
|
||||
description: >-
|
||||
Flag for describing whether or not notifications related to this
|
||||
should be send.
|
||||
type: boolean
|
||||
canceled_at:
|
||||
description: The date with timezone at which the Fulfillment was canceled.
|
||||
type: string
|
||||
@@ -2527,6 +2565,13 @@ components:
|
||||
type: integer
|
||||
gift_card_total:
|
||||
type: integer
|
||||
paid_total:
|
||||
type: integer
|
||||
no_notification:
|
||||
description: >-
|
||||
Flag for describing whether or not notifications related to this
|
||||
should be send.
|
||||
type: boolean
|
||||
payment_provider:
|
||||
title: Payment Provider
|
||||
description: Represents a Payment Provider plugin and holds its installation status.
|
||||
@@ -2993,6 +3038,11 @@ components:
|
||||
Gift Cards will automatically generate a redeemable Gift Card code
|
||||
once they are purchased.
|
||||
type: boolean
|
||||
discountable:
|
||||
description: >-
|
||||
Whether the Product can be discounted. Discounts will not apply to
|
||||
Line Items of this Product when this flag is set to `false`.
|
||||
type: boolean
|
||||
images:
|
||||
description: Images of the Product
|
||||
type: array
|
||||
@@ -3332,6 +3382,11 @@ components:
|
||||
description: The date with timezone at which the resource was last updated.
|
||||
type: string
|
||||
format: date-time
|
||||
no_notification:
|
||||
description: >-
|
||||
When set to true, no notification will be sent related to this
|
||||
return.
|
||||
type: boolean
|
||||
metadata:
|
||||
description: An optional key-value map with additional information.
|
||||
type: object
|
||||
@@ -3692,6 +3747,9 @@ components:
|
||||
description: The date with timezone at which the resource was last updated.
|
||||
type: string
|
||||
format: date-time
|
||||
no_notification:
|
||||
description: 'If set to true, no notification will be sent related to this swap'
|
||||
type: boolean
|
||||
metadata:
|
||||
description: An optional key-value map with additional information.
|
||||
type: object
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defaultFields, defaultRelations } from "./"
|
||||
|
||||
/**
|
||||
* @oas [get] /discounts/code/{id}
|
||||
* @oas [get] /discounts/code/{code}
|
||||
* operationId: "GetDiscountsDiscountCode"
|
||||
* summary: "Retrieve a Discount by code"
|
||||
* description: "Retrieves a Discount by its discount code"
|
||||
|
||||
@@ -189,7 +189,7 @@ export class Product {
|
||||
* description: "Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased."
|
||||
* type: boolean
|
||||
* discountable:
|
||||
* description: "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`.
|
||||
* description: "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`."
|
||||
* type: boolean
|
||||
* images:
|
||||
* description: "Images of the Product"
|
||||
|
||||
@@ -14,6 +14,7 @@ swaggerInline(
|
||||
const oas = new OAS(gen);
|
||||
oas.validate((err, genObj) => {
|
||||
if (err) {
|
||||
console.log("Error in store");
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
@@ -41,6 +42,7 @@ swaggerInline(
|
||||
const oas = new OAS(gen);
|
||||
oas.validate((err, genObj) => {
|
||||
if (err) {
|
||||
console.log("Error in admin");
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user