diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3385da8a70..97fca34996 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -12,7 +12,7 @@ Thank you for considering contributing to Medusa! This document will outline how
1. Before you start working on a change please make sure that there is an issue for what you will be working on. You can either find and [existing issue](https://github.com/medusajs/medusa/issues) or [open a new issue](https://github.com/medusajs/medusa/issues/new) if none exists. Doing this makes sure that others can contribute with thoughts or suggest alternatives, ultimately making sure that we only add changes that make
-2. When you are ready to start working on a change you should first [fork the Medusa repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) and [branch out]](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-and-deleting-branches-within-your-repository) from the `develop` branch.
+2. When you are ready to start working on a change you should first [fork the Medusa repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) and [branch out](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-and-deleting-branches-within-your-repository) from the `develop` branch.
3. Make your changes.
4. [Open a pull request towards the develop branch in the Medusa repo](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork). Within a couple of days a Medusa team member will review, comment and eventually approve your PR.
diff --git a/README.md b/README.md
index 2a3aae82d3..62c86e2708 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,6 @@
Medusa Admin |
Website |
- Roadmap |
Blog |
LinkedIn |
Twitter |
@@ -69,8 +68,8 @@ Write-ups for all features will be made available in [Github discussions](https:
### Q1
- [x] Admin revamp
-- [ ] Tax API
-- [ ] Strategy pattern
+- [x] Tax API
+- [x] Strategy pattern
- [ ] Promotions API
- [ ] Bulk import / export
diff --git a/docs/api/admin-spec3-base.json b/docs/api/admin-spec3-base.json
index e0586ca4e1..f809364d5b 100644
--- a/docs/api/admin-spec3-base.json
+++ b/docs/api/admin-spec3-base.json
@@ -63,6 +63,10 @@
{
"name": "Product Variant",
"x-resourceId": "product_variant"
+ },
+ {
+ "name": "OAuth",
+ "x-resourceId": "OAuth"
}
],
"servers": [
diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml
index 7e0daf692e..f0967aa938 100644
--- a/docs/api/admin-spec3.yaml
+++ b/docs/api/admin-spec3.yaml
@@ -35,13 +35,67 @@ tags:
x-resourceId: swap
- name: Product Variant
x-resourceId: product_variant
+ - name: OAuth
+ x-resourceId: OAuth
servers:
- url: "https://api.medusa-commerce.com/admin"
paths:
+ /apps:
+ 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:
+ - Apps
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ apps:
+ $ref: "#/components/schemas/OAuth"
+ get:
+ operationId: GetApps
+ summary: List applications
+ description: Retrieve a list of applications.
+ x-authenticated: true
+ tags:
+ - Apps
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ collection:
+ $ref: "#/components/schemas/OAuth"
/auth:
post:
operationId: PostAuth
summary: Authenticate a User
+ x-authenticated: false
description: Logs a User in and authorizes them to manage Store settings.
parameters: []
tags:
@@ -73,6 +127,7 @@ paths:
get:
operationId: GetAuth
summary: Get Session
+ x-authenticated: true
description: Gets the currently logged in User.
tags:
- Auth
@@ -85,11 +140,77 @@ paths:
properties:
user:
$ref: "#/components/schemas/user"
+ "/collections/{id}/products/batch":
+ post:
+ operationId: PostProductsToCollection
+ summary: Updates products associated with a Product Collection
+ description: Updates products associated with a Product Collection
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Collection.
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ properties:
+ product_ids:
+ description: An array of Product IDs to add to the Product Collection.
+ type: array
+ items:
+ properties:
+ id:
+ description: The ID of a Product to add to the Product Collection.
+ type: string
+ tags:
+ - Collection
+ responses:
+ "200":
+ description: OK
+ delete:
+ operationId: DeleteProductsFromCollection
+ summary: Removes products associated with a Product Collection
+ description: Removes products associated with a Product Collection
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Collection.
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ properties:
+ product_ids:
+ description: >-
+ An array of Product IDs to remove from the Product
+ Collection.
+ type: array
+ items:
+ properties:
+ id:
+ description: >-
+ The ID of a Product to remove from the Product
+ Collection.
+ type: string
+ tags:
+ - Collection
+ responses:
+ "200":
+ description: OK
/collections:
post:
operationId: PostCollections
summary: Create a Product Collection
description: Creates a Product Collection.
+ x-authenticated: true
requestBody:
content:
application/json:
@@ -125,6 +246,49 @@ paths:
operationId: GetCollections
summary: List Product Collections
description: Retrieve a list of Product Collection.
+ x-authenticated: true
+ parameters:
+ - in: query
+ name: limit
+ description: The number of collections to return.
+ schema:
+ type: string
+ - in: query
+ name: offset
+ description: The offset of collections to return.
+ schema:
+ type: string
+ - in: query
+ name: title
+ description: The title of collections to return.
+ schema:
+ type: string
+ - in: query
+ name: handle
+ description: The handle of collections to return.
+ schema:
+ type: string
+ - in: query
+ name: deleted_at
+ description: >-
+ Date comparison for when resulting collections was deleted, i.e.
+ less than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: created_at
+ description: >-
+ Date comparison for when resulting collections was created, i.e.
+ less than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: updated_at
+ description: >-
+ Date comparison for when resulting collections was updated, i.e.
+ less than, greater than etc.
+ schema:
+ type: object
tags:
- Collection
responses:
@@ -141,6 +305,7 @@ paths:
operationId: DeleteCollectionsCollection
summary: Delete a Product Collection
description: Deletes a Product Collection.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -169,6 +334,7 @@ paths:
operationId: GetCollectionsCollection
summary: Retrieve a Product Collection
description: Retrieves a Product Collection.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -191,6 +357,7 @@ paths:
operationId: PostCollectionsCollection
summary: Update a Product Collection
description: Updates a Product Collection.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -227,11 +394,135 @@ paths:
properties:
collection:
$ref: "#/components/schemas/product_collection"
+ /customer-groups:
+ post:
+ operationId: PostCustomerGroups
+ summary: Create a CustomerGroup
+ description: Creates a CustomerGroup.
+ x-authenticated: true
+ parameters: []
+ tags:
+ - CustomerGroup
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ customer_group:
+ $ref: "#/components/schemas/customer_group"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ description: Name of the customer group
+ metadata:
+ type: object
+ description: Metadata for the customer.
+ "/customer-groups/{id}":
+ delete:
+ operationId: DeleteCustomerGroupsCustomerGroup
+ summary: Delete a CustomerGroup
+ description: Deletes a CustomerGroup.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Customer Group
+ schema:
+ type: string
+ tags:
+ - CustomerGroup
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ id:
+ type: string
+ description: The id of the deleted customer group.
+ object:
+ type: string
+ description: The type of the object that was deleted.
+ deleted:
+ type: boolean
+ post:
+ operationId: PostCustomerGroupsGroup
+ summary: Update a CustomerGroup
+ description: Update a CustomerGroup.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the customer group.
+ schema:
+ type: string
+ tags:
+ - CustomerGroup
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ customer_group:
+ $ref: "#/components/schemas/customer_group"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ description: Name of the customer group
+ metadata:
+ type: object
+ description: Metadata for the customer.
+ "/customer-group/{id}":
+ get:
+ operationId: GetCustomerGroupsGroup
+ summary: Retrieve a CustomerGroup
+ description: Retrieves a Customer Group.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Customer Group.
+ schema:
+ type: string
+ tags:
+ - CustomerGroup
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ customer_group:
+ $ref: "#/components/schemas/customer_group"
/customers:
post:
operationId: PostCustomers
summary: Create a Customer
description: Creates a Customer.
+ x-authenticated: true
parameters: []
tags:
- Customer
@@ -266,10 +557,14 @@ paths:
phone:
type: string
description: The Customer's phone number.
+ metadata:
+ type: object
+ description: Metadata for the customer.
get:
operationId: GetCustomers
summary: List Customers
description: Retrieves a list of Customers.
+ x-authenticated: true
tags:
- Customer
responses:
@@ -286,6 +581,7 @@ paths:
operationId: GetCustomersCustomer
summary: Retrieve a Customer
description: Retrieves a Customer.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -308,6 +604,7 @@ paths:
operationId: PostCustomersCustomer
summary: Update a Customer
description: Updates a Customer.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -332,8 +629,24 @@ paths:
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.
+ groups:
+ type: array
+ description: A list of customer groups to which the customer belongs.
+ items:
+ required:
+ - id
+ properties:
+ id:
+ description: The id of a customer group
+ type: string
+ metadata:
type: object
+ description: Metadata for the customer.
tags:
- Customer
responses:
@@ -350,6 +663,7 @@ paths:
operationId: PostDiscountsDiscountRegionsRegion
summary: Adds Region availability
description: Adds a Region to the list of Regions that a Discount can be used in.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -377,6 +691,7 @@ paths:
delete:
operationId: DeleteDiscountsDiscountRegionsRegion
summary: Remove Region availability
+ x-authenticated: true
description: >-
Removes a Region from the list of Regions that a Discount can be used
in.
@@ -406,11 +721,41 @@ paths:
$ref: "#/components/schemas/discount"
"/discounts/{id}/products/{product_id}":
post:
+ operationId: PostDiscountsDiscountProductsProduct
+ summary: Adds Product availability
+ description: Adds a Product to the list of Products that a Discount can be used for.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Discount.
+ schema:
+ type: string
+ - in: path
+ name: product_id
+ required: true
+ description: The id of the Product.
+ schema:
+ type: string
+ tags:
+ - Discount
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ discount:
+ $ref: "#/components/schemas/discount"
+ delete:
operationId: DeleteDiscountsDiscountProductsProduct
summary: Remove Product availability
description: >-
Removes a Product from the list of Products that a Discount can be used
for.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -439,12 +784,16 @@ paths:
post:
operationId: PostDiscounts
summary: Creates a Discount
+ x-authenticated: true
description: >-
Creates a Discount with a given set of rules that define how the
Discount behaves.
requestBody:
content:
application/json:
+ required:
+ - code
+ - rule
schema:
properties:
code:
@@ -505,7 +854,39 @@ paths:
get:
operationId: GetDiscounts
summary: List Discounts
+ x-authenticated: true
description: Retrieves a list of Discounts
+ parameters:
+ - in: query
+ name: q
+ description: Search query applied on results.
+ schema:
+ type: string
+ - in: query
+ name: is_dynamic
+ description: Return only dynamic discounts.
+ schema:
+ type: boolean
+ - in: query
+ name: is_disabled
+ description: Return only disabled discounts.
+ schema:
+ type: boolean
+ - in: query
+ name: limit
+ description: The number of items in the response
+ schema:
+ type: number
+ - in: query
+ name: offset
+ description: The offset of items in response
+ schema:
+ type: number
+ - in: query
+ name: expand
+ description: Comma separated list of relations to include in the results.
+ schema:
+ type: string
tags:
- Discount
responses:
@@ -524,6 +905,7 @@ paths:
description: >-
Creates a unique code that can map to a parent Discount. This is useful
if you want to automatically generate codes with the same behaviour.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -563,6 +945,7 @@ paths:
operationId: DeleteDiscountsDiscount
summary: Delete a Discount
description: Deletes a Discount.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -591,6 +974,7 @@ paths:
operationId: GetDiscountsDiscount
summary: Retrieve a Discount
description: Retrieves a Discount
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -615,6 +999,7 @@ paths:
description: >-
Updates a Discount with a given set of rules that define how the
Discount behaves.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -647,12 +1032,10 @@ paths:
Whether the Discount code is disabled on creation. You will
have to enable it later to make it available to Customers.
starts_at:
- type: string
- format: date-time
+ type: Date
description: The time at which the Discount should be available.
ends_at:
- type: string
- format: date-time
+ type: Date
description: >-
The time at which the Discount should no longer be
available.
@@ -663,6 +1046,9 @@ paths:
type: array
items:
type: string
+ metadata:
+ description: An object containing metadata of the discount
+ type: object
tags:
- Discount
responses:
@@ -679,6 +1065,7 @@ paths:
operationId: DeleteDiscountsDiscountDynamicCodesCode
summary: Delete a dynamic code
description: Deletes a dynamic code from a Discount.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -708,6 +1095,7 @@ paths:
operationId: GetDiscountsDiscountCode
summary: Retrieve a Discount by code
description: Retrieves a Discount by its discount code
+ x-authenticated: true
parameters:
- in: path
name: code
@@ -731,10 +1119,16 @@ paths:
operationId: PostDraftOrders
summary: Create a Draft Order
description: Creates a Draft Order
+ x-authenticated: true
requestBody:
content:
application/json:
schema:
+ required:
+ - email
+ - items
+ - region_id
+ - shipping_methods
properties:
status:
description: The status of the draft order
@@ -829,6 +1223,7 @@ paths:
operationId: GetDraftOrders
summary: List Draft Orders
description: Retrieves an list of Draft Orders
+ x-authenticated: true
tags:
- Draft Order
responses:
@@ -845,9 +1240,12 @@ paths:
operationId: PostDraftOrdersDraftOrderLineItems
summary: Create a Line Item for Draft Order
description: Creates a Line Item for the Draft Order
+ x-authenticated: true
requestBody:
content:
application/json:
+ required:
+ - quantity
schema:
properties:
variant_id:
@@ -885,6 +1283,7 @@ paths:
operationId: DeleteDraftOrdersDraftOrder
summary: Delete a Draft Order
description: Deletes a Draft Order
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -913,6 +1312,7 @@ paths:
operationId: GetDraftOrdersDraftOrder
summary: Retrieve a Draft Order
description: Retrieves a Draft Order.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -936,6 +1336,7 @@ paths:
operationId: DeleteDraftOrdersDraftOrderLineItemsItem
summary: Delete a Line Item
description: Removes a Line Item from a Draft Order.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -964,6 +1365,7 @@ paths:
operationId: PostDraftOrdersDraftOrderLineItemsItem
summary: Update a Line Item for a Draft Order
description: Updates a Line Item for a Draft Order
+ x-authenticated: true
requestBody:
content:
application/json:
@@ -999,6 +1401,7 @@ paths:
summary: Registers a payment for a Draft Order
operationId: PostDraftOrdersDraftOrderRegisterPayment
description: Registers a payment for a Draft Order.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1022,6 +1425,7 @@ paths:
operationId: PostDraftOrdersDraftOrder
summary: Update a Draft Order"
description: Updates a Draft Order.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1082,6 +1486,7 @@ paths:
description: >-
Creates a Gift Card that can redeemed by its unique code. The Gift Card
is only valid within 1 region.
+ x-authenticated: true
requestBody:
content:
application/json:
@@ -1128,6 +1533,7 @@ paths:
operationId: GetGiftCards
summary: List Gift Cards
description: Retrieves a list of Gift Cards.
+ x-authenticated: true
tags:
- Gift Card
responses:
@@ -1146,6 +1552,7 @@ paths:
operationId: DeleteGiftCardsGiftCard
summary: Delete a Gift Card
description: Deletes a Gift Card
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1174,6 +1581,7 @@ paths:
operationId: GetGiftCardsGiftCard
summary: Retrieve a Gift Card
description: Retrieves a Gift Card.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1198,6 +1606,7 @@ paths:
description: >-
Creates a Gift Card that can redeemed by its unique code. The Gift Card
is only valid within 1 region.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1247,11 +1656,129 @@ paths:
properties:
gift_card:
$ref: "#/components/schemas/gift_card"
+ /invites/accept:
+ post:
+ operationId: PostInvitesInviteAccept
+ summary: Accept an Invite
+ description: Accepts an Invite and creates a corresponding user
+ requestBody:
+ content:
+ application/json:
+ schema:
+ required:
+ - token
+ - user
+ properties:
+ token:
+ description: The invite token provided by the admin.
+ type: string
+ user:
+ description: The User to create.
+ type: object
+ required:
+ - first_name
+ - last_name
+ - password
+ properties:
+ first_name:
+ type: string
+ description: the first name of the User
+ last_name:
+ type: string
+ description: the last name of the User
+ password:
+ description: The desired password for the User
+ type: string
+ tags:
+ - Invites
+ responses:
+ "200":
+ description: OK
+ /invites:
+ post:
+ operationId: PostInvites
+ summary: Create an Invite
+ description: Creates an Invite and triggers an 'invite' created event
+ x-authenticated: true
+ requestBody:
+ content:
+ application/json:
+ schema:
+ required:
+ - user
+ - role
+ properties:
+ user:
+ description: The email for the user to be created.
+ type: string
+ role:
+ description: The role of the user to be created.
+ type: string
+ tags:
+ - Invites
+ responses:
+ "200":
+ description: OK
+ get:
+ operationId: GetInvites
+ summary: Lists all Invites
+ description: Lists all Invites
+ x-authenticated: true
+ tags:
+ - Invites
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ invites:
+ type: array
+ items:
+ $ref: "#/components/schemas/invite"
+ "/invites/{invite_id}":
+ delete:
+ operationId: DeleteInvitesInvite
+ summary: Create an Invite
+ description: Creates an Invite and triggers an 'invite' created event
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: invite_id
+ required: true
+ description: The id of the Invite
+ schema:
+ type: string
+ tags:
+ - Invites
+ responses:
+ "200":
+ description: OK
+ "/invites/{invite_id}/resend":
+ post:
+ operationId: PostInvitesInviteResend
+ summary: Resend an Invite
+ description: Resends an Invite by triggering the 'invite' created event again
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: invite_id
+ required: true
+ description: The id of the Invite
+ schema:
+ type: string
+ tags:
+ - Invites
+ responses:
+ "200":
+ description: OK
/notes:
post:
operationId: PostNotes
summary: Creates a Note
description: Creates a Note which can be associated with any resource as required.
+ x-authenticated: true
requestBody:
content:
application/json:
@@ -1280,7 +1807,30 @@ paths:
get:
operationId: GetNotes
summary: List Notes
+ x-authenticated: true
description: Retrieves a list of notes
+ parameters:
+ - in: path
+ name: limit
+ required: true
+ description: The number of notes to get
+ schema:
+ type: number
+ default: ""
+ - in: path
+ name: offset
+ required: true
+ description: The offset at which to get notes
+ schema:
+ type: number
+ default: ""
+ - in: path
+ name: resource_id
+ required: true
+ description: The id which the notes belongs to
+ schema:
+ type: string
+ default: ""
tags:
- Note
responses:
@@ -1299,6 +1849,7 @@ paths:
operationId: DeleteNotesNote
summary: Deletes a Note
description: Deletes a Note.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1322,9 +1873,10 @@ paths:
type: boolean
description: Whether or not the Note was deleted.
get:
- operationId: GetNoteNote
+ operationId: GetNotesNote
summary: Get Note
description: Retrieves a single note using its id
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1346,6 +1898,7 @@ paths:
post:
operationId: PostNotesNote
summary: Updates a Note
+ x-authenticated: true
description: Updates a Note associated with some resource
parameters:
- in: path
@@ -1358,6 +1911,8 @@ paths:
content:
application/json:
schema:
+ required:
+ - value
properties:
value:
type: string
@@ -1378,6 +1933,53 @@ paths:
operationId: GetNotifications
summary: List Notifications
description: Retrieves a list of Notifications.
+ x-authenticated: true
+ parameters:
+ - in: query
+ name: offset
+ description: >-
+ The number of notifications to skip before starting to collect the
+ notifications set
+ schema:
+ type: integer
+ default: 0
+ - in: query
+ name: limit
+ description: The number of notifications to return
+ schema:
+ type: integer
+ default: 50
+ - in: query
+ name: fields
+ description: The fields to include in the result set
+ schema:
+ type: string
+ - in: query
+ name: expand
+ description: The fields to populate
+ schema:
+ type: string
+ - in: query
+ name: event_name
+ schema:
+ type: string
+ - in: query
+ name: resource_type
+ schema:
+ type: string
+ - in: query
+ name: resource_id
+ schema:
+ type: string
+ - in: query
+ name: to
+ schema:
+ type: string
+ - in: query
+ name: include_resends
+ description: Whether the result set should include resent notifications or not
+ schema:
+ type: boolean
tags:
- Notification
responses:
@@ -1398,6 +2000,7 @@ paths:
description: >-
Resends a previously sent notifications, with the same data but
optionally to a different address
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1405,6 +2008,16 @@ paths:
description: The id of the Notification
schema:
type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ properties:
+ to:
+ description: >-
+ The address or user identifier that the Notification was
+ sent to
+ type: string
tags:
- Notification
responses:
@@ -1424,6 +2037,7 @@ paths:
Adds a Shipping Method to an Order. If another Shipping Method exists
with the same Shipping Profile, the previous Shipping Method will be
replaced.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1468,11 +2082,36 @@ paths:
The data required for the Shipping Option to create a
Shipping Method. This will depend on the Fulfillment
Provider.
+ "/orders/{id}/archive":
+ post:
+ operationId: PostOrdersOrderArchive
+ summary: Archive order
+ description: Archives the order with the given id.
+ x-authenticated: true
+ 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/{id}/claims/{claim_id}/cancel":
post:
operationId: PostOrdersClaimCancel
summary: Cancels a Claim
description: Cancels a Claim
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1502,6 +2141,7 @@ paths:
operationId: PostOrdersClaimFulfillmentsCancel
summary: Cancels a fulfilmment related to a Claim
description: Registers a Fulfillment as canceled.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1537,6 +2177,7 @@ paths:
operationId: PostOrdersSwapFulfillmentsCancel
summary: Cancels a fulfilmment related to a Swap
description: Registers a Fulfillment as canceled.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1572,6 +2213,7 @@ paths:
operationId: PostOrdersOrderFulfillmentsCancel
summary: Cancels a fulfilmment
description: Registers a Fulfillment as canceled.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1604,6 +2246,7 @@ paths:
Registers an Order as canceled. This triggers a flow that will cancel
any created Fulfillments and Payments, may fail if the Payment or
Fulfillment Provider is unable to cancel the Payment/Fulfillment.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1627,6 +2270,7 @@ paths:
operationId: PostOrdersSwapCancel
summary: Cancels a Swap
description: Cancels a Swap
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1656,6 +2300,31 @@ paths:
operationId: PostOrdersOrderCapture
summary: Capture an Order
description: Captures all the Payments associated with an Order.
+ x-authenticated: true
+ 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/{id}/complete":
+ post:
+ operationId: PostOrdersOrderComplete
+ summary: Complete an Order
+ description: Completes an Order
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1679,6 +2348,7 @@ paths:
operationId: PostOrdersOrderClaimsClaimShipments
summary: Create Claim Shipment
description: Registers a Claim Fulfillment as shipped.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1696,6 +2366,8 @@ paths:
content:
application/json:
schema:
+ required:
+ - fulfillment_id
properties:
fulfillment_id:
description: The id of the Fulfillment.
@@ -1721,6 +2393,7 @@ paths:
operationId: PostOrdersOrderClaims
summary: Create a Claim
description: Creates a Claim.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1732,6 +2405,9 @@ paths:
content:
application/json:
schema:
+ required:
+ - type
+ - claim_items
properties:
type:
description: >-
@@ -1859,6 +2535,7 @@ paths:
description: >-
Creates a Fulfillment of an Order - will notify Fulfillment Providers to
prepare a shipment.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1870,6 +2547,8 @@ paths:
content:
application/json:
schema:
+ required:
+ - items
properties:
items:
description: The Line Items to include in the Fulfillment.
@@ -1903,11 +2582,235 @@ paths:
properties:
order:
$ref: "#/components/schemas/order"
+ /orders:
+ post:
+ operationId: PostOrders
+ summary: Create an order
+ description: Creates and order
+ x-authenticated: true
+ requestBody:
+ content:
+ application/json:
+ required:
+ - email
+ - billing_address
+ - shipping_address
+ - items
+ - region
+ - customer_id
+ - payment_method
+ - shipping_method
+ schema:
+ properties:
+ status:
+ description: status of the order
+ type: string
+ email:
+ description: the email for the order
+ type: string
+ billing_address:
+ description: Billing address
+ anyOf:
+ - $ref: >-
+ #/components/schemas/address
+ shipping_address:
+ description: Shipping address
+ anyOf:
+ - $ref: >-
+ #/components/schemas/address
+ items:
+ description: The Line Items for the order
+ type: array
+ region:
+ description: Region where the order belongs
+ type: string
+ discounts:
+ description: Discounts applied to the order
+ type: array
+ customer_id:
+ description: id of the customer
+ type: string
+ payment_method:
+ description: payment method chosen for the order
+ type: object
+ required:
+ - provider_id
+ properties:
+ provider_id:
+ type: string
+ description: id of the payment provider
+ data:
+ description: Data relevant for the given payment method
+ type: object
+ shipping_method:
+ description: The Shipping Method used for shipping the order.
+ type: object
+ required:
+ - provider_id
+ - profile_id
+ - price
+ properties:
+ provider_id:
+ type: string
+ description: The id of the shipping provider.
+ profile_id:
+ type: string
+ description: The id of the shipping profile.
+ price:
+ type: integer
+ description: The price of the shipping.
+ data:
+ type: object
+ description: Data relevant to the specific shipping method.
+ items:
+ type: array
+ description: Items to ship
+ no_notification:
+ description: >-
+ A flag to indicate if no notifications should be emitted
+ related to the updated order.
+ type: boolean
+ tags:
+ - Order
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ order:
+ $ref: "#/components/schemas/order"
+ get:
+ operationId: GetOrders
+ summary: List Orders
+ description: Retrieves a list of Orders
+ x-authenticated: true
+ parameters:
+ - in: query
+ name: q
+ description: Query used for searching orders.
+ schema:
+ type: string
+ - in: query
+ name: id
+ description: Id of the order to search for.
+ schema:
+ type: string
+ - in: query
+ name: status
+ description: Status to search for.
+ schema:
+ type: "string[]"
+ - in: query
+ name: fulfillment_status
+ description: Fulfillment status to search for.
+ schema:
+ type: "string[]"
+ - in: query
+ name: payment_status
+ description: Payment status to search for.
+ schema:
+ type: "string[]"
+ - in: query
+ name: display_id
+ description: Display id to search for.
+ schema:
+ type: string
+ - in: query
+ name: cart_id
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: customer_id
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: email
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: region_id
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: currency_code
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: tax_rate
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: cancelled_at
+ description: >-
+ Date comparison for when resulting orders was cancelled, i.e. less
+ than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: created_at
+ description: >-
+ Date comparison for when resulting orders was created, i.e. less
+ than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: updated_at
+ description: >-
+ Date comparison for when resulting orders was updated, i.e. less
+ than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: offset
+ description: How many orders to skip in the result.
+ schema:
+ type: string
+ - in: query
+ name: limit
+ description: Limit the number of orders returned.
+ schema:
+ type: string
+ - in: query
+ name: expand
+ description: >-
+ (Comma separated) Which fields should be expanded in each order of
+ the result.
+ schema:
+ type: string
+ - in: query
+ name: fields
+ description: >-
+ (Comma separated) Which fields should be included in each order of
+ the result.
+ schema:
+ type: string
+ tags:
+ - Order
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ orders:
+ type: array
+ items:
+ $ref: "#/components/schemas/order"
"/orders/{id}/shipment":
post:
operationId: PostOrdersOrderShipment
summary: Create a Shipment
description: Registers a Fulfillment as shipped.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1919,6 +2822,8 @@ paths:
content:
application/json:
schema:
+ required:
+ - fulfillment_id
properties:
fulfillment_id:
description: The id of the Fulfillment.
@@ -1949,6 +2854,7 @@ paths:
operationId: PostOrdersOrderSwapsSwapShipments
summary: Create Swap Shipment
description: Registers a Swap Fulfillment as shipped.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -1966,6 +2872,8 @@ paths:
content:
application/json:
schema:
+ required:
+ - fulfillment_id
properties:
fulfillment_id:
description: The id of the Fulfillment.
@@ -1998,6 +2906,7 @@ paths:
description: >-
Creates a Swap. Swaps are used to handle Return of previously purchased
goods and Fulfillment of replacements simultaneously.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2009,11 +2918,16 @@ paths:
content:
application/json:
schema:
+ required:
+ - return_items
properties:
return_items:
description: The Line Items to return as part of the Swap.
type: array
items:
+ required:
+ - item_id
+ - quantity
properties:
item_id:
description: The id of the Line Item that will be claimed.
@@ -2037,6 +2951,9 @@ paths:
description: The new items to send to the Customer.
type: array
items:
+ required:
+ - variant_id
+ - quantity
properties:
variant_id:
description: The id of the Product Variant to ship.
@@ -2050,6 +2967,9 @@ paths:
Method from.
type: array
items:
+ required:
+ - option_id
+ - price
properties:
option_id:
description: >-
@@ -2083,6 +3003,7 @@ paths:
operationId: DeleteOrdersOrderMetadataKey
summary: Delete Metadata
description: Deletes a metadata key.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2112,6 +3033,7 @@ paths:
operationId: PostOrdersOrderClaimsClaimFulfillments
summary: Create a Claim Fulfillment
description: Creates a Fulfillment for a Claim.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2156,6 +3078,7 @@ paths:
operationId: PostOrdersOrderSwapsSwapFulfillments
summary: Create a Swap Fulfillment
description: Creates a Fulfillment for a Swap.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2200,6 +3123,7 @@ paths:
operationId: GetOrdersOrder
summary: Retrieve an Order
description: Retrieves an Order
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2218,11 +3142,78 @@ paths:
properties:
order:
$ref: "#/components/schemas/order"
- /orders:
- get:
- operationId: GetOrders
- summary: List Orders
- description: Retrieves a list of Orders
+ post:
+ operationId: PostOrdersOrder
+ summary: Update an order
+ description: Updates and order
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Order.
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ properties:
+ email:
+ description: the email for the order
+ type: string
+ billing_address:
+ description: Billing address
+ anyOf:
+ - $ref: >-
+ #/components/schemas/address shipping_address:
+ description: Shipping address anyOf: - $ref:
+ items:
+ description: The Line Items for the order
+ type: array
+ region:
+ description: Region where the order belongs
+ type: string
+ discounts:
+ description: Discounts applied to the order
+ type: array
+ customer_id:
+ description: id of the customer
+ type: string
+ payment_method:
+ description: null
+ type: object
+ properties:
+ provider_id:
+ type: string
+ description: id of the payment provider
+ data:
+ description: Data relevant for the given payment method
+ type: object
+ shipping_method:
+ description: The Shipping Method used for shipping the order.
+ type: object
+ properties:
+ provider_id:
+ type: string
+ description: The id of the shipping provider.
+ profile_id:
+ type: string
+ description: The id of the shipping profile.
+ price:
+ type: integer
+ description: The price of the shipping.
+ data:
+ type: object
+ description: Data relevant to the specific shipping method.
+ items:
+ type: array
+ description: Items to ship
+ no_notification:
+ description: >-
+ A flag to indicate if no notifications should be emitted
+ related to the updated order.
+ type: boolean
tags:
- Order
responses:
@@ -2232,10 +3223,8 @@ paths:
application/json:
schema:
properties:
- orders:
- type: array
- items:
- $ref: "#/components/schemas/order"
+ order:
+ $ref: "#/components/schemas/order"
"/orders/{id}/swaps/{swap_id}/process-payment":
post:
operationId: PostOrdersOrderSwapsSwapProcessPayment
@@ -2244,6 +3233,7 @@ paths:
When there are differences between the returned and shipped Products in
a Swap, the difference must be processed. Either a Refund will be issued
or a Payment will be captured.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2268,56 +3258,12 @@ paths:
properties:
order:
$ref: "#/components/schemas/order"
- "/orders/{id}/swaps/{swap_id}/receive":
- post:
- operationId: PostOrdersOrderSwapsSwapReceive
- summary: Receive a Swap
- description: Registers a Swap as received.
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Order.
- schema:
- type: string
- - in: path
- name: swap_id
- required: true
- description: The id of the Swap.
- 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
- tags:
- - Order
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- order:
- $ref: "#/components/schemas/order"
"/orders/{id}/refunds":
post:
operationId: PostOrdersOrderRefunds
summary: Create a Refund
description: Issues a Refund.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2365,6 +3311,7 @@ paths:
description: >-
Requests a Return. If applicable a return label will be created and
other plugins notified.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2376,6 +3323,8 @@ paths:
content:
application/json:
schema:
+ required:
+ - items
properties:
items:
description: The Line Items that will be returned.
@@ -2437,6 +3386,7 @@ paths:
operationId: PostOrdersOrderClaimsClaim
summary: Update a Claim
description: Updates a Claim.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2530,10 +3480,642 @@ paths:
properties:
order:
$ref: "#/components/schemas/order"
+ /product-tags:
+ get:
+ operationId: GetProductTags
+ summary: List Product Tags
+ description: Retrieve a list of Product Tags.
+ x-authenticated: true
+ parameters:
+ - in: query
+ name: limit
+ description: The number of tags to return.
+ schema:
+ type: string
+ - in: query
+ name: offset
+ description: The offset of tags to return.
+ schema:
+ type: string
+ - in: query
+ name: value
+ description: The value of tags to return.
+ schema:
+ type: string
+ - in: query
+ name: id
+ description: The id of tags to return.
+ schema:
+ type: string
+ - in: query
+ name: created_at
+ description: >-
+ Date comparison for when resulting tas was created, i.e. less than,
+ greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: updated_at
+ description: >-
+ Date comparison for when resulting tas was updated, i.e. less than,
+ greater than etc.
+ schema:
+ type: object
+ tags:
+ - Product Tag
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ tags:
+ $ref: "#/components/schemas/product_tag"
+ /product-types:
+ get:
+ operationId: GetProductTypes
+ summary: List Product Types
+ description: Retrieve a list of Product Types.
+ x-authenticated: true
+ parameters:
+ - in: query
+ name: limit
+ description: The number of types to return.
+ schema:
+ type: string
+ - in: query
+ name: offset
+ description: The offset of types to return.
+ schema:
+ type: string
+ - in: query
+ name: value
+ description: The value of types to return.
+ schema:
+ type: string
+ - in: query
+ name: id
+ description: The id of types to return.
+ schema:
+ type: string
+ - in: query
+ name: created_at
+ description: >-
+ Date comparison for when resulting tas was created, i.e. less than,
+ greater than etc.
+ schema:
+ type: datecomparisonoperator
+ - in: query
+ name: updated_at
+ description: >-
+ Date comparison for when resulting tas was updated, i.e. less than,
+ greater than etc.
+ schema:
+ type: datecomparisonoperator
+ tags:
+ - Product Tag
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ types:
+ $ref: "#/components/schemas/product_tag"
+ "/regions/{id}/countries":
+ post:
+ operationId: PostRegionsRegionCountries
+ summary: Add Country
+ description: Adds a Country to the list of Countries in a Region
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ required:
+ - country_code
+ properties:
+ country_code:
+ description: The 2 character ISO code for the Country.
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ region:
+ $ref: "#/components/schemas/region"
+ "/regions/{id}/fulfillment-providers":
+ post:
+ operationId: PostRegionsRegionFulfillmentProviders
+ summary: Add Fulfillment Provider
+ description: Adds a Fulfillment Provider to a Region
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ required:
+ - provider_id
+ schema:
+ properties:
+ provider_id:
+ description: The id of the Fulfillment Provider to add.
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ region:
+ $ref: "#/components/schemas/region"
+ "/regions/{id}/payment-providers":
+ post:
+ operationId: PostRegionsRegionPaymentProviders
+ summary: Add Payment Provider
+ description: Adds a Payment Provider to a Region
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ required:
+ - provider_id
+ schema:
+ properties:
+ provider_id:
+ description: The id of the Payment Provider to add.
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ region:
+ $ref: "#/components/schemas/region"
+ /regions:
+ post:
+ operationId: PostRegions
+ summary: Create a Region
+ description: Creates a Region
+ x-authenticated: true
+ requestBody:
+ content:
+ application/json:
+ required:
+ - name
+ - currency_code
+ - tax_rate
+ schema:
+ properties:
+ name:
+ description: The name of the Region
+ type: string
+ currency_code:
+ description: The 3 character ISO currency code to use for the Region.
+ type: string
+ tax_code:
+ description: An optional tax code the Region.
+ type: string
+ tax_rate:
+ description: The tax rate to use on Orders in the Region.
+ type: number
+ payment_providers:
+ description: >-
+ A list of Payment Providers that should be enabled for the
+ Region
+ type: array
+ items:
+ type: string
+ fulfillment_providers:
+ description: >-
+ A list of Fulfillment Providers that should be enabled for
+ the Region
+ type: array
+ items:
+ type: string
+ countries:
+ description: A list of countries that should be included in the Region.
+ type: array
+ items:
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ region:
+ $ref: "#/components/schemas/region"
+ get:
+ operationId: GetRegions
+ summary: List Regions
+ description: Retrieves a list of Regions.
+ x-authenticated: true
+ parameters:
+ - in: query
+ name: limit
+ schema:
+ type: integer
+ required: false
+ description: limit the number of regions in response
+ - in: query
+ name: offset
+ schema:
+ type: integer
+ required: false
+ description: Offset of regions in response (used for pagination)
+ - in: query
+ name: created_at
+ schema:
+ type: object
+ required: false
+ description: >-
+ Date comparison for when resulting region was created, i.e. less
+ than, greater than etc.
+ - in: query
+ name: updated_at
+ schema:
+ type: object
+ required: false
+ description: >-
+ Date comparison for when resulting region was updated, i.e. less
+ than, greater than etc.
+ - in: query
+ name: deleted_at
+ schema:
+ type: object
+ required: false
+ description: >-
+ Date comparison for when resulting region was deleted, i.e. less
+ than, greater than etc.
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ regions:
+ type: array
+ items:
+ $ref: "#/components/schemas/region"
+ "/regions/{id}/metadata/{key}":
+ delete:
+ operationId: DeleteRegionsRegionMetadataKey
+ summary: Delete Metadata
+ description: Deletes a metadata key.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ - in: path
+ name: key
+ required: true
+ description: The metadata key.
+ schema:
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ region:
+ $ref: "#/components/schemas/region"
+ "/regions/{id}":
+ delete:
+ operationId: DeleteRegionsRegion
+ summary: Delete a Region
+ description: Deletes a Region.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ id:
+ type: string
+ description: The id of the deleted Region.
+ object:
+ type: string
+ description: The type of the object that was deleted.
+ deleted:
+ type: boolean
+ get:
+ operationId: GetRegionsRegion
+ summary: Retrieve a Region
+ description: Retrieves a Region.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ region:
+ $ref: "#/components/schemas/region"
+ post:
+ operationId: PostRegionsRegion
+ summary: Update a Region
+ description: Updates a Region
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ properties:
+ name:
+ description: The name of the Region
+ type: string
+ currency_code:
+ description: The 3 character ISO currency code to use for the Region.
+ type: string
+ automatic_taxes:
+ description: >-
+ If true Medusa will automatically calculate taxes for carts
+ in this region. If false you have to manually call POST
+ /carts/:id/taxes.
+ type: boolean
+ gift_cards_taxable:
+ description: >-
+ Whether gift cards in this region should be applied sales
+ tax when purchasing a gift card
+ type: boolean
+ tax_provider_id:
+ description: >-
+ The id of the tax provider to use; if null the system tax
+ provider is used
+ type: string
+ tax_code:
+ description: An optional tax code the Region.
+ type: string
+ tax_rate:
+ description: The tax rate to use on Orders in the Region.
+ type: number
+ payment_providers:
+ description: >-
+ A list of Payment Providers that should be enabled for the
+ Region
+ type: array
+ items:
+ type: string
+ fulfillment_providers:
+ description: >-
+ A list of Fulfillment Providers that should be enabled for
+ the Region
+ type: array
+ items:
+ type: string
+ countries:
+ description: A list of countries that should be included in the Region.
+ type: array
+ items:
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ region:
+ $ref: "#/components/schemas/region"
+ "/regions/{id}/fulfillment-options":
+ get:
+ operationId: GetRegionsRegionFulfillmentOptions
+ summary: List Fulfillment Options available in the Region
+ description: Gathers all the fulfillment options available to in the Region.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ fulfillment_options:
+ type: array
+ items:
+ type: object
+ "/regions/{id}/countries/{country_code}":
+ delete:
+ operationId: PostRegionsRegionCountriesCountry
+ summary: Remove Country
+ x-authenticated: true
+ description: Removes a Country from the list of Countries in a Region
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ - in: path
+ name: country_code
+ required: true
+ description: The 2 character ISO code for the Country.
+ schema:
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ region:
+ $ref: "#/components/schemas/region"
+ "/regions/{id}/fulfillment-providers/{provider_id}":
+ delete:
+ operationId: PostRegionsRegionFulfillmentProvidersProvider
+ summary: Remove Fulfillment Provider
+ description: Removes a Fulfillment Provider.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ - in: path
+ name: provider_id
+ required: true
+ description: The id of the Fulfillment Provider.
+ schema:
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ region:
+ $ref: "#/components/schemas/region"
+ "/regions/{id}/payment-providers/{provider_id}":
+ delete:
+ operationId: PostRegionsRegionPaymentProvidersProvider
+ summary: Remove Payment Provider
+ description: Removes a Payment Provider.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: region_id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ - in: path
+ name: provider_id
+ required: true
+ description: The id of the Payment Provider.
+ schema:
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ region:
+ $ref: "#/components/schemas/region"
+ "/regions/{id}/metadata":
+ post:
+ operationId: PostRegionsRegionMetadata
+ summary: Set the metadata of a Region
+ description: Sets the metadata of a Region
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Region.
+ schema:
+ type: string
+ tags:
+ - Region
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ region:
+ $ref: "#/components/schemas/region"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - key
+ - value
+ properties:
+ key:
+ type: string
+ description: Key for the metadata value.
+ value:
+ type: string
+ description: The value that the key relates to.
"/products/{id}/options":
post:
operationId: PostProductsProductOptions
summary: Add an Option
+ x-authenticated: true
description: Adds a Product Option to a Product
parameters:
- in: path
@@ -2546,6 +4128,8 @@ paths:
content:
application/json:
schema:
+ required:
+ - title
properties:
title:
description: >-
@@ -2567,11 +4151,18 @@ paths:
post:
operationId: PostProducts
summary: Create a Product
+ x-authenticated: true
description: Creates a Product
requestBody:
content:
application/json:
+ required:
+ - title
+ - subtitle
+ - description
schema:
+ required:
+ - title
properties:
title:
description: The title of the Product
@@ -2771,6 +4362,108 @@ paths:
operationId: GetProducts
summary: List Product
description: Retrieves a list of Product
+ x-authenticated: true
+ parameters:
+ - in: query
+ name: q
+ description: Query used for searching products.
+ schema:
+ type: string
+ - in: query
+ name: id
+ description: Id of the product to search for.
+ schema:
+ type: string
+ - in: query
+ name: status
+ description: Status to search for.
+ schema:
+ type: array
+ - in: query
+ name: collection_id
+ description: Collection ids to search for.
+ schema:
+ type: array
+ - in: query
+ name: tags
+ description: Tags to search for.
+ schema:
+ type: array
+ - in: query
+ name: title
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: description
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: handle
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: is_giftcard
+ description: Search for giftcards using is_giftcard=true.
+ schema:
+ type: string
+ - in: query
+ name: type
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: order
+ description: to retrieve products in.
+ schema:
+ type: string
+ - in: query
+ name: deleted_at
+ description: >-
+ Date comparison for when resulting products was deleted, i.e. less
+ than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: created_at
+ description: >-
+ Date comparison for when resulting products was created, i.e. less
+ than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: updated_at
+ description: >-
+ Date comparison for when resulting products was updated, i.e. less
+ than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: offset
+ description: How many products to skip in the result.
+ schema:
+ type: string
+ - in: query
+ name: limit
+ description: Limit the number of products returned.
+ schema:
+ type: string
+ - in: query
+ name: expand
+ description: >-
+ (Comma separated) Which fields should be expanded in each product of
+ the result.
+ schema:
+ type: string
+ - in: query
+ name: fields
+ description: >-
+ (Comma separated) Which fields should be included in each product of
+ the result.
+ schema:
+ type: string
tags:
- Product
responses:
@@ -2800,6 +4493,7 @@ paths:
description: >-
Creates a Product Variant. Each Product Variant must have a unique
combination of Product Option Values.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2811,6 +4505,10 @@ paths:
content:
application/json:
schema:
+ required:
+ - title
+ - prices
+ - options
properties:
title:
description: The title to identify the Product Variant by.
@@ -2914,6 +4612,7 @@ paths:
operationId: GetProductsProductVariants
summary: List a Product's Product Variants
description: Retrieves a list of the Product Variants associated with a Product.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2943,6 +4642,7 @@ paths:
Option Values for the Product Option must be the same. You may, for
example, have to delete some of your variants prior to deleting the
Product Option
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2979,6 +4679,7 @@ paths:
operationId: PostProductsProductOptionsOption
summary: Update a Product Option.
description: Updates a Product Option
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -2995,6 +4696,8 @@ paths:
requestBody:
content:
application/json:
+ required:
+ - title
schema:
properties:
title:
@@ -3016,6 +4719,7 @@ paths:
operationId: DeleteProductsProduct
summary: Delete a Product
description: Deletes a Product and it's associated Product Variants.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -3044,6 +4748,7 @@ paths:
operationId: GetProductsProduct
summary: Retrieve a Product
description: Retrieves a Product.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -3066,6 +4771,7 @@ paths:
operationId: PostProductsProduct
summary: Update a Product
description: Updates a Product
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -3277,6 +4983,7 @@ paths:
operationId: DeleteProductsProductVariantsVariant
summary: Delete a Product Variant
description: Deletes a Product Variant.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -3311,6 +5018,7 @@ paths:
operationId: PostProductsProductVariantsVariant
summary: Update a Product Variant
description: Update a Product Variant.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -3432,6 +5140,7 @@ paths:
operationId: GetProductsTypes
summary: List Product Types
description: Retrieves a list of Product Types.
+ x-authenticated: true
tags:
- Product
responses:
@@ -3445,15 +5154,57 @@ paths:
type: array
items:
$ref: "#/components/schemas/product_type"
+ "/products/{id}/metadata":
+ post:
+ operationId: PostProductsProductMetadata
+ summary: Set Product metadata
+ description: Set metadata key/value pair for Product
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Product.
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ required:
+ - key
+ - value
+ properties:
+ key:
+ description: The metadata key
+ type: string
+ value:
+ description: The metadata value
+ type: string
+ tags:
+ - Product
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ product:
+ $ref: "#/components/schemas/product"
/return-reasons:
post:
operationId: PostReturnReasons
summary: Create a Return Reason
description: Creates a Return Reason
+ x-authenticated: true
requestBody:
content:
application/json:
schema:
+ required:
+ - label
+ - value
properties:
label:
description: The label to display to the Customer.
@@ -3463,6 +5214,9 @@ paths:
The value that the Return Reason will be identified by. Must
be unique.
type: string
+ parent_return_reason_id:
+ description: The id of the parent return reason.
+ type: string
description:
description: An optional description to for the Reason.
type: string
@@ -3486,6 +5240,7 @@ paths:
operationId: GetReturnReasons
summary: List Return Reasons
description: Retrieves a list of Return Reasons.
+ x-authenticated: true
tags:
- Return Reason
responses:
@@ -3499,11 +5254,12 @@ paths:
type: array
items:
$ref: "#/components/schemas/return_reason"
- "/return-reason/{id}":
+ "/return-reasons/{id}":
delete:
operationId: DeleteReturnReason
summary: Delete a return reason
description: Deletes a return reason.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -3528,11 +5284,11 @@ paths:
description: The type of the object that was deleted.
deleted:
type: boolean
- "/return-reasons/{id}":
get:
operationId: GetReturnReasonsReason
summary: Retrieve a Return Reason
description: Retrieves a Return Reason.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -3555,6 +5311,7 @@ paths:
operationId: PostReturnReasonsReason
summary: Update a Return Reason
description: Updates a Return Reason
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -3570,11 +5327,6 @@ paths:
label:
description: The label to display to the Customer.
type: string
- value:
- description: >-
- The value that the Return Reason will be identified by. Must
- be unique.
- type: string
description:
description: An optional description to for the Reason.
type: string
@@ -3594,418 +5346,6 @@ paths:
properties:
return_reason:
$ref: "#/components/schemas/return_reason"
- "/regions/{id}/countries":
- post:
- operationId: PostRegionsRegionCountries
- summary: Add Country
- description: Adds a Country to the list of Countries in a Region
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Region.
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- properties:
- country_code:
- description: The 2 character ISO code for the Country.
- type: string
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- region:
- $ref: "#/components/schemas/region"
- "/regions/{id}/fulfillment-providers":
- post:
- operationId: PostRegionsRegionFulfillmentProviders
- summary: Add Fulfillment Provider
- description: Adds a Fulfillment Provider to a Region
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Region.
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- properties:
- provider_id:
- description: The id of the Fulfillment Provider to add.
- type: string
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- region:
- $ref: "#/components/schemas/region"
- "/regions/{id}/payment-providers":
- post:
- operationId: PostRegionsRegionPaymentProviders
- summary: Add Payment Provider
- description: Adds a Payment Provider to a Region
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Region.
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- properties:
- provider_id:
- description: The id of the Payment Provider to add.
- type: string
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- region:
- $ref: "#/components/schemas/region"
- /regions:
- post:
- operationId: PostRegions
- summary: Create a Region
- description: Creates a Region
- requestBody:
- content:
- application/json:
- schema:
- properties:
- name:
- description: The name of the Region
- type: string
- currency_code:
- description: The 3 character ISO currency code to use for the Region.
- type: string
- tax_code:
- description: An optional tax code the Region.
- type: string
- tax_rate:
- description: The tax rate to use on Orders in the Region.
- type: number
- payment_providers:
- description: >-
- A list of Payment Providers that should be enabled for the
- Region
- type: array
- items:
- type: string
- fulfillment_providers:
- description: >-
- A list of Fulfillment Providers that should be enabled for
- the Region
- type: array
- items:
- type: string
- countries:
- description: A list of countries that should be included in the Region.
- type: array
- items:
- type: string
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- region:
- $ref: "#/components/schemas/region"
- get:
- operationId: GetRegions
- summary: List Regions
- description: Retrieves a list of Regions.
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- regions:
- type: array
- items:
- $ref: "#/components/schemas/region"
- "/regions/{id}/metadata/{key}":
- delete:
- operationId: DeleteRegionsRegionMetadataKey
- summary: Delete Metadata
- description: Deletes a metadata key.
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Region.
- schema:
- type: string
- - in: path
- name: key
- required: true
- description: The metadata key.
- schema:
- type: string
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- region:
- $ref: "#/components/schemas/region"
- "/regions/{id}":
- delete:
- operationId: DeleteRegionsRegion
- summary: Delete a Region
- description: Deletes a Region.
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Region.
- schema:
- type: string
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- id:
- type: string
- description: The id of the deleted Region.
- object:
- type: string
- description: The type of the object that was deleted.
- deleted:
- type: boolean
- get:
- operationId: GetRegionsRegion
- summary: Retrieve a Region
- description: Retrieves a Region.
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Region.
- schema:
- type: string
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- region:
- $ref: "#/components/schemas/region"
- post:
- operationId: PostRegionsRegion
- summary: Update a Region
- description: Updates a Region
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Region.
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- properties:
- name:
- description: The name of the Region
- type: string
- currency_code:
- description: The 3 character ISO currency code to use for the Region.
- type: string
- tax_code:
- description: An optional tax code the Region.
- type: string
- tax_rate:
- description: The tax rate to use on Orders in the Region.
- type: number
- payment_providers:
- description: >-
- A list of Payment Providers that should be enabled for the
- Region
- type: array
- items:
- type: string
- fulfillment_providers:
- description: >-
- A list of Fulfillment Providers that should be enabled for
- the Region
- type: array
- items:
- type: string
- countries:
- description: A list of countries that should be included in the Region.
- type: array
- items:
- type: string
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- region:
- $ref: "#/components/schemas/region"
- "/regions/{id}/fulfillment-options":
- get:
- operationId: GetRegionsRegionFulfillmentOptions
- summary: List Fulfillment Options available in the Region
- description: Gathers all the fulfillment options available to in the Region.
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Region.
- schema:
- type: string
- tags:
- - Product
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- fulfillment_options:
- type: array
- items:
- type: object
- "/regions/{id}/countries/{country_code}":
- delete:
- operationId: PostRegionsRegionCountriesCountry
- summary: Remove Country
- description: Removes a Country from the list of Countries in a Region
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Region.
- schema:
- type: string
- - in: path
- name: country_code
- required: true
- description: The 2 character ISO code for the Country.
- schema:
- type: string
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- region:
- $ref: "#/components/schemas/region"
- "/regions/{id}/fulfillment-providers/{provider_id}":
- delete:
- operationId: PostRegionsRegionFulfillmentProvidersProvider
- summary: Remove Fulfillment Provider
- description: Removes a Fulfillment Provider.
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Region.
- schema:
- type: string
- - in: path
- name: provider_id
- required: true
- description: The id of the Fulfillment Provider.
- schema:
- type: string
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- region:
- $ref: "#/components/schemas/region"
- "/regions/{id}/payment-providers/{provider_id}":
- delete:
- operationId: PostRegionsRegionPaymentProvidersProvider
- summary: Remove Payment Provider
- description: Removes a Payment Provider.
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Region.
- schema:
- type: string
- - in: path
- name: provider_id
- required: true
- description: The id of the Payment Provider.
- schema:
- type: string
- tags:
- - Region
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- region:
- $ref: "#/components/schemas/region"
"/returns/{id}/cancel":
post:
operationId: PostReturnsReturnCancel
@@ -4034,6 +5374,19 @@ paths:
operationId: GetReturns
summary: List Returns
description: Retrieves a list of Returns
+ parameters:
+ - in: path
+ name: limit
+ required: true
+ description: The upper limit for the amount of responses returned.
+ schema:
+ type: number
+ - in: path
+ name: offset
+ required: true
+ description: The offset of the list returned.
+ schema:
+ type: number
tags:
- Return
responses:
@@ -4065,6 +5418,8 @@ paths:
content:
application/json:
schema:
+ required:
+ - items
properties:
items:
description: The Line Items that have been received.
@@ -4096,6 +5451,7 @@ paths:
operationId: PostShippingOptions
summary: Create Shipping Option
description: Creates a Shipping Option
+ x-authenticated: true
requestBody:
content:
application/json:
@@ -4152,6 +5508,14 @@ paths:
is_return:
description: Whether the Shipping Option defines a return shipment.
type: boolean
+ admin_only:
+ description: "If true, the option can be used for draft orders"
+ type: boolean
+ metadata:
+ description: >-
+ An optional set of key-value pairs with additional
+ information.
+ type: object
tags:
- Shipping Option
responses:
@@ -4167,6 +5531,26 @@ paths:
operationId: GetShippingOptions
summary: List Shipping Options
description: Retrieves a list of Shipping Options.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: region_id
+ schema:
+ type: string
+ required: false
+ description: Region to fetch options from
+ - in: path
+ name: is_return
+ schema:
+ type: boolean
+ required: false
+ description: Flag for fetching return options
+ - in: path
+ name: admin_only
+ schema:
+ type: boolean
+ required: false
+ description: Flag for fetching admin specific options
tags:
- Shipping Option
responses:
@@ -4185,6 +5569,7 @@ paths:
operationId: DeleteShippingOptionsOption
summary: Delete a Shipping Option
description: Deletes a Shipping Option.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -4213,6 +5598,7 @@ paths:
operationId: GetShippingOptionsOption
summary: Retrieve a Shipping Option
description: Retrieves a Shipping Option.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -4235,6 +5621,7 @@ paths:
operationId: PostShippingOptionsOption
summary: Update Shipping Option
description: Updates a Shipping Option
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -4253,6 +5640,14 @@ paths:
amount:
description: The amount to charge for the Shipping Option.
type: integer
+ admin_only:
+ description: "If true, the option can be used for draft orders"
+ type: boolean
+ metadata:
+ description: >-
+ An optional set of key-value pairs with additional
+ information.
+ type: object
requirements:
description: >-
The requirements that must be satisfied for the Shipping
@@ -4285,10 +5680,13 @@ paths:
operationId: PostShippingProfiles
summary: Create a Shipping Profile
description: Creates a Shipping Profile
+ x-authenticated: true
requestBody:
content:
application/json:
schema:
+ required:
+ - name
properties:
name:
description: The name of the Shipping Profile
@@ -4308,6 +5706,7 @@ paths:
operationId: GetShippingProfiles
summary: List Shipping Profiles
description: Retrieves a list of Shipping Profile.
+ x-authenticated: true
tags:
- Shipping Profile
responses:
@@ -4326,6 +5725,7 @@ paths:
operationId: DeleteShippingProfilesProfile
summary: Delete a Shipping Profile
description: Deletes a Shipping Profile.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -4354,6 +5754,7 @@ paths:
operationId: GetShippingProfilesProfile
summary: Retrieve a Shipping Profile
description: Retrieves a Shipping Profile.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -4407,6 +5808,7 @@ paths:
operationId: PostStoreCurrenciesCode
summary: Add a Currency Code
description: Adds a Currency Code to the available currencies.
+ x-authenticated: true
parameters:
- in: path
name: code
@@ -4427,8 +5829,9 @@ paths:
$ref: "#/components/schemas/store"
delete:
operationId: DeleteStoreCurrenciesCode
- summary: Remvoe a Currency Code
+ summary: Remove a Currency Code
description: Removes a Currency Code from the available currencies.
+ x-authenticated: true
parameters:
- in: path
name: code
@@ -4452,6 +5855,7 @@ paths:
operationId: GetStore
summary: Retrieve Store details.
description: Retrieves the Store details
+ x-authenticated: true
tags:
- Store
responses:
@@ -4467,6 +5871,7 @@ paths:
operationId: PostStore
summary: Update Store details.
description: Updates the Store details
+ x-authenticated: true
requestBody:
content:
application/json:
@@ -4480,6 +5885,16 @@ paths:
A template for Swap links - use `{{cart_id}}` to insert the
Swap Cart id
type: string
+ payment_link_template:
+ description: >-
+ A template for payment links links - use `{{cart_id}}` to
+ insert the Cart id
+ type: string
+ invite_link_template:
+ description: >-
+ A template for invite links - use `{{invite_token}}` to
+ insert the invite token
+ type: string
default_currency_code:
description: The default currency code for the Store.
type: string
@@ -4499,6 +5914,7 @@ paths:
operationId: GetStorePaymentProviders
summary: Retrieve configured Payment Providers
description: Retrieves the configured Payment Providers
+ x-authenticated: true
tags:
- Store
responses:
@@ -4512,11 +5928,31 @@ paths:
type: array
items:
$ref: "#/components/schemas/store"
+ /store/tax-providers:
+ get:
+ operationId: GetStoreTaxProviders
+ summary: Retrieve configured Tax Providers
+ description: Retrieves the configured Tax Providers
+ x-authenticated: true
+ tags:
+ - Store
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ tax_providers:
+ type: array
+ items:
+ $ref: "#/components/schemas/store"
"/swaps/{id}":
get:
operationId: GetSwapsSwap
summary: Retrieve a Swap
description: Retrieves a Swap.
+ x-authenticated: true
parameters:
- in: path
name: id
@@ -4540,6 +5976,7 @@ paths:
operationId: GetSwaps
summary: List Swaps
description: Retrieves a list of Swaps.
+ x-authenticated: true
tags:
- Swap
responses:
@@ -4553,11 +5990,317 @@ paths:
type: array
items:
$ref: "#/components/schemas/swap"
+ "/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
+ x-authenticated: true
+ tags:
+ - Tax Rates
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ tax_rate:
+ type: array
+ items:
+ $ref: "#/components/schemas/tax_rate"
+ delete:
+ operationId: DeleteTaxRatesTaxRateProductTypes
+ summary: Remove Tax Rate from Product Types
+ description: Removes a Tax Rate from a list of Product Types
+ x-authenticated: true
+ tags:
+ - Tax Rates
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ tax_rate:
+ type: array
+ items:
+ $ref: "#/components/schemas/tax_rate"
+ "/tax-rates/:id/products/batch":
+ post:
+ operationId: PostTaxRatesTaxRateProducts
+ summary: Add Tax Rate to Products
+ description: Associates a Tax Rate with a list of Products
+ x-authenticated: true
+ tags:
+ - Tax Rates
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ tax_rate:
+ type: array
+ items:
+ $ref: "#/components/schemas/tax_rate"
+ delete:
+ operationId: DeleteTaxRatesTaxRateProducts
+ summary: Removes Tax Rate from Products
+ description: Removes a Tax Rate from a list of Products
+ x-authenticated: true
+ tags:
+ - Tax Rates
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ tax_rate:
+ type: array
+ items:
+ $ref: "#/components/schemas/tax_rate"
+ "/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 Product Types
+ x-authenticated: true
+ tags:
+ - Tax Rates
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ tax_rate:
+ type: array
+ items:
+ $ref: "#/components/schemas/tax_rate"
+ delete:
+ operationId: DeleteTaxRatesTaxRateShippingOptions
+ summary: Removes a Tax Rate from Product Types
+ description: Removes a Tax Rate from a list of Product Types
+ x-authenticated: true
+ tags:
+ - Tax Rates
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ tax_rate:
+ type: array
+ items:
+ $ref: "#/components/schemas/tax_rate"
+ /tax-rates:
+ post:
+ operationId: PostTaxRates
+ summary: Create a Tax Rate
+ description: Creates a Tax Rate
+ x-authenticated: true
+ tags:
+ - Tax Rates
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ tax_rate:
+ type: array
+ items:
+ $ref: "#/components/schemas/tax_rate"
+ get:
+ operationId: GetTaxRates
+ summary: List Tax Rates
+ description: Retrieves a list of TaxRates
+ x-authenticated: true
+ parameters:
+ - in: query
+ name: q
+ description: Query used for searching orders.
+ schema:
+ type: string
+ - in: query
+ name: id
+ description: Id of the order to search for.
+ schema:
+ type: string
+ - in: query
+ name: region_id
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: code
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: rate
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: created_at
+ description: >-
+ Date comparison for when resulting orders was created, i.e. less
+ than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: updated_at
+ description: >-
+ Date comparison for when resulting orders was updated, i.e. less
+ than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: offset
+ description: How many orders to skip in the result.
+ schema:
+ type: string
+ - in: query
+ name: limit
+ description: Limit the number of orders returned.
+ schema:
+ type: string
+ - in: query
+ name: fields
+ description: >-
+ (Comma separated) Which fields should be included in each order of
+ the result.
+ schema:
+ type: string
+ tags:
+ - Order
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ orders:
+ type: array
+ items:
+ $ref: "#/components/schemas/order"
+ "/tax-rates/{id}":
+ delete:
+ operationId: DeleteTaxRatesTaxRate
+ summary: Delete a Tax Rate
+ description: Deletes a Tax Rate
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Shipping Option.
+ schema:
+ type: string
+ tags:
+ - Tax Rates
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ id:
+ type: string
+ description: The id of the deleted Shipping Option.
+ object:
+ type: string
+ description: The type of the object that was deleted.
+ deleted:
+ type: boolean
+ "/tax-rates/:id":
+ get:
+ operationId: GetTaxRatesTaxRate
+ summary: Get Tax Rate
+ description: Retrieves a TaxRate
+ x-authenticated: true
+ tags:
+ - Tax Rates
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ tax_rate:
+ type: array
+ items:
+ $ref: "#/components/schemas/tax_rate"
+ post:
+ operationId: PostTaxRatesTaxRate
+ summary: Update a Tax Rate
+ description: Updates a Tax Rate
+ x-authenticated: true
+ tags:
+ - Tax Rates
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ tax_rate:
+ type: array
+ items:
+ $ref: "#/components/schemas/tax_rate"
+ /:
+ post:
+ operationId: PostUploads
+ summary: Uploads an array of files
+ description: >-
+ Uploads an array of files to the specific fileservice that is installed
+ in medusa.
+ x-authenticated: true
+ tags:
+ - Uploads
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties: uploads
/variants:
get:
operationId: GetVariants
summary: List Product Variants.
description: Retrieves a list of Product Variants
+ x-authenticated: true
+ parameters:
+ - in: query
+ name: q
+ description: Query used for searching variants.
+ schema:
+ type: string
+ - in: query
+ name: offset
+ description: How many variants to skip in the result.
+ schema:
+ type: string
+ - in: query
+ name: limit
+ description: Limit the number of variants returned.
+ schema:
+ type: string
tags:
- Product Variant
responses:
@@ -4571,6 +6314,194 @@ paths:
type: array
items:
$ref: "#/components/schemas/product_variant"
+ /users:
+ post:
+ operationId: PostUsers
+ summary: Create a User
+ description: Creates a User
+ x-authenticated: true
+ requestBody:
+ content:
+ application/json:
+ schema:
+ required:
+ - email
+ - password
+ properties:
+ email:
+ description: The Users email.
+ type: string
+ first_name:
+ description: The name of the User.
+ type: string
+ last_name:
+ description: The name of the User.
+ type: string
+ role:
+ description: Userrole assigned to the user.
+ type: string
+ password:
+ description: The Users password.
+ type: string
+ tags:
+ - Users
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ user:
+ $ref: "#/components/schemas/user"
+ get:
+ operationId: GetUsers
+ summary: Retrieve all users
+ description: Retrieves all users.
+ x-authenticated: true
+ tags:
+ - Users
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ users:
+ type: array
+ items:
+ $ref: "#/components/schemas/user"
+ "/users/{user_id}":
+ delete:
+ operationId: DeleteUsersUser
+ summary: Delete a User
+ description: Deletes a User
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: user_id
+ required: true
+ description: The id of the User.
+ schema:
+ type: string
+ tags:
+ - Users
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ id:
+ type: string
+ description: The id of the deleted Shipping Profile.
+ object:
+ type: string
+ description: The type of the object that was deleted.
+ deleted:
+ type: boolean
+ post:
+ operationId: PostUsersUser
+ summary: Update a User
+ description: Updates a User
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: user_id
+ required: true
+ description: The id of the User.
+ schema:
+ type: string
+ tags:
+ - Users
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ user:
+ $ref: "#/components/schemas/user"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ first_name:
+ type: string
+ description: The name of the User.
+ last_name:
+ type: string
+ description: The name of the User.
+ role:
+ type: string
+ description: "The role of the User(admin, member, developer)."
+ api_token:
+ type: string
+ description: The api_token of the User.
+ "/users/{id}":
+ get:
+ operationId: GetUsersUser
+ summary: Retrieve a User
+ description: Retrieves a User.
+ x-authenticated: true
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the User.
+ schema:
+ type: string
+ tags:
+ - Users
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ user:
+ $ref: "#/components/schemas/user"
+ /users/password-token:
+ post:
+ operationId: PostUsersUserPassword
+ summary: Set the password for a User.
+ description: Sets the password for a User given the correct token.
+ x-authenticated: true
+ requestBody:
+ content:
+ application/json:
+ schema:
+ required:
+ - email
+ - token
+ - password
+ properties:
+ email:
+ description: The Users email.
+ type: string
+ token:
+ description: The token generated from the 'password-token' endpoint.
+ type: string
+ password:
+ description: The Users new password.
+ type: string
+ tags:
+ - Users
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ user:
+ $ref: "#/components/schemas/user"
components:
schemas:
address:
@@ -4959,6 +6890,30 @@ components:
metadata:
description: An optional key-value map with additional information.
type: object
+ customer_group:
+ title: Customer Group
+ description: Represents a customer group
+ x-resourceId: customer_group
+ properties:
+ id:
+ type: string
+ name:
+ type: string
+ customers:
+ type: array
+ items:
+ type: object
+ created_at:
+ type: string
+ format: date-time
+ updated_at:
+ type: string
+ format: date-time
+ deleted_at:
+ type: string
+ format: date-time
+ metadata:
+ type: object
customer:
title: Customer
description: Represents a customer
@@ -5386,6 +7341,39 @@ components:
metadata:
description: An optional key-value map with additional information.
type: object
+ invite:
+ title: Invite
+ description: Represents an invite
+ x-resourceId: invite
+ properties:
+ id:
+ type: string
+ user_email:
+ type: string
+ role:
+ type: string
+ enum:
+ - admin
+ - member
+ - developer
+ accepted:
+ type: boolean
+ token:
+ type: string
+ expores_at:
+ type: string
+ format: date-time
+ created_at:
+ type: string
+ format: date-time
+ updated_at:
+ type: string
+ format: date-time
+ deleted_at:
+ type: string
+ format: date-time
+ metadata:
+ type: object
line_item:
title: Line Item
description: >-
@@ -5682,6 +7670,23 @@ components:
description: The date with timezone at which the resource was last updated.
type: string
format: date-time
+ OAuth:
+ title: OAuth
+ description: Represent an OAuth app
+ x-resourceId: OAuth
+ properties:
+ id:
+ type: string
+ display_name:
+ type: string
+ application_name:
+ type: string
+ install_url:
+ type: string
+ uninstall_url:
+ type: integer
+ data:
+ type: object
order:
title: Order
description: Represents an order
@@ -5726,7 +7731,7 @@ components:
currency_code:
type: string
tax_rate:
- type: integer
+ type: number
discounts:
type: array
items:
@@ -6110,6 +8115,62 @@ components:
metadata:
description: An optional key-value map with additional information.
type: object
+ product_tax_rate:
+ title: Product Tax Rate
+ description: >-
+ Associates a tax rate with a product to indicate that the product is
+ taxed in a certain way
+ x-resourceId: product_tax_rate
+ properties:
+ product_id:
+ description: The id of the Product
+ type: string
+ rate_id:
+ description: The id of the Tax Rate
+ type: string
+ created_at:
+ description: The date with timezone at which the resource was created.
+ type: string
+ format: date-time
+ updated_at:
+ description: The date with timezone at which the resource was last updated.
+ type: string
+ format: date-time
+ deleted_at:
+ description: The date with timezone at which the resource was deleted.
+ type: string
+ format: date-time
+ metadata:
+ description: An optional key-value map with additional information.
+ type: object
+ product_type_tax_rate:
+ title: Product Type Tax Rate
+ description: >-
+ Associates a tax rate with a product type to indicate that the product
+ type is taxed in a certain way
+ x-resourceId: product_type_tax_rate
+ properties:
+ product_type_id:
+ description: The id of the Product type
+ type: string
+ rate_id:
+ description: The id of the Tax Rate
+ type: string
+ created_at:
+ description: The date with timezone at which the resource was created.
+ type: string
+ format: date-time
+ updated_at:
+ description: The date with timezone at which the resource was last updated.
+ type: string
+ format: date-time
+ deleted_at:
+ description: The date with timezone at which the resource was deleted.
+ type: string
+ format: date-time
+ metadata:
+ description: An optional key-value map with additional information.
+ type: object
product_type:
title: Product Type
description: >-
@@ -6872,6 +8933,34 @@ components:
metadata:
description: An optional key-value map with additional information.
type: object
+ shipping_tax_rate:
+ title: Shipping Tax Rate
+ description: >-
+ Associates a tax rate with a shipping option to indicate that the
+ shipping option is taxed in a certain way
+ x-resourceId: shipping_tax_rate
+ properties:
+ shipping_option_id:
+ description: The id of the Shipping Option
+ type: string
+ rate_id:
+ description: The id of the Tax Rate
+ type: string
+ created_at:
+ description: The date with timezone at which the resource was created.
+ type: string
+ format: date-time
+ updated_at:
+ description: The date with timezone at which the resource was last updated.
+ type: string
+ format: date-time
+ deleted_at:
+ description: The date with timezone at which the resource was deleted.
+ type: string
+ format: date-time
+ metadata:
+ description: An optional key-value map with additional information.
+ type: object
store:
title: Store
description: "Holds settings for the Store, such as name, currencies, etc."
@@ -7021,6 +9110,86 @@ components:
metadata:
description: An optional key-value map with additional information.
type: object
+ tax_line:
+ title: Tax Line
+ description: Line item that specifies an amount of tax to add to a line item.
+ x-resourceId: tax_line
+ properties:
+ id:
+ description: The id of the Tax Line. This value will be prefixed by `tl_`.
+ type: string
+ code:
+ description: A code to identify the tax type by
+ type: string
+ name:
+ description: A human friendly name for the tax
+ type: string
+ rate:
+ description: The numeric rate to charge tax by
+ type: number
+ created_at:
+ description: The date with timezone at which the resource was created.
+ type: string
+ format: date-time
+ updated_at:
+ description: The date with timezone at which the resource was last updated.
+ type: string
+ format: date-time
+ metadata:
+ description: An optional key-value map with additional information.
+ type: object
+ tax_provider:
+ title: Tax Provider
+ description: The tax service used to calculate taxes
+ x-resourceId: tax_provider
+ properties:
+ id:
+ description: The id of the tax provider as given by the plugin.
+ type: string
+ is_installed:
+ description: >-
+ Whether the plugin is installed in the current version. Plugins that
+ are no longer installed are not deleted by will have this field set
+ to `false`.
+ type: boolean
+ tax_rate:
+ title: Tax Rate
+ description: >-
+ A Tax Rate can be used to associate a certain rate to charge on products
+ within a given Region
+ x-resourceId: line_item
+ properties:
+ id:
+ description: The id of the Tax Rate. This value will be prefixed by `txr_`.
+ type: string
+ rate:
+ description: The numeric rate to charge
+ type: number
+ code:
+ description: A code to identify the tax type by
+ type: string
+ name:
+ description: A human friendly name for the tax
+ type: string
+ region_id:
+ description: The id of the Region that the rate belongs to
+ type: string
+ created_at:
+ description: The date with timezone at which the resource was created.
+ type: string
+ format: date-time
+ updated_at:
+ description: The date with timezone at which the resource was last updated.
+ type: string
+ format: date-time
+ metadata:
+ description: An optional key-value map with additional information.
+ type: object
+ refundable:
+ description: >-
+ The amount that can be refunded from the given Line Item. Takes
+ taxes and discounts into consideration.
+ type: integer
tracking_link:
title: Tracking Link
description: >-
diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json
index ea00c44b90..b72d490f15 100644
--- a/docs/api/store-spec3.json
+++ b/docs/api/store-spec3.json
@@ -75,6 +75,89 @@
}
],
"paths": {
+ "/collections/{id}": {
+ "get": {
+ "operationId": "GetCollectionsCollection",
+ "summary": "Retrieve a Product Collection",
+ "description": "Retrieves a Product Collection.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "required": true,
+ "description": "The id of the Product Collection",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "tags": [
+ "Collection"
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "collection": {
+ "$ref": "#/components/schemas/product_collection"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/collections": {
+ "get": {
+ "operationId": "GetCollections",
+ "summary": "List Product Collections",
+ "description": "Retrieve a list of Product Collection.",
+ "parameters": [
+ {
+ "in": "query",
+ "name": "offset",
+ "description": "The number of collections to skip before starting to collect the collections set",
+ "schema": {
+ "type": "integer",
+ "default": 0
+ }
+ },
+ {
+ "in": "query",
+ "name": "limit",
+ "description": "The number of collections to return",
+ "schema": {
+ "type": "integer",
+ "default": 10
+ }
+ }
+ ],
+ "tags": [
+ "Collection"
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "collection": {
+ "$ref": "#/components/schemas/product_collection"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/auth": {
"post": {
"operationId": "PostAuth",
@@ -141,6 +224,7 @@
"operationId": "GetAuth",
"summary": "Get Session",
"description": "Gets the currently logged in Customer.",
+ "x-authenticated": true,
"tags": [
"Auth"
],
@@ -199,6 +283,508 @@
}
}
},
+ "/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.",
+ "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/me/addresses/{address_id}": {
+ "delete": {
+ "operationId": "DeleteCustomersCustomerAddressesAddress",
+ "summary": "Delete an Address",
+ "description": "Removes an Address from the Customer's saved addresse.",
+ "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": {
+ "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/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"
+ }
+ ]
+ },
+ "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 addresses to return.",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "description": "The offset in the resulting addresses.",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "in": "query",
+ "name": "fields",
+ "description": "(Comma separated string) Which fields should be included in the resulting addresses.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "expand",
+ "description": "(Comma separated string) Which relations should be expanded in the resulting addresses.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "tags": [
+ "Customer"
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "count": {
+ "description": "The total number of Orders.",
+ "type": "integer"
+ },
+ "offset": {
+ "description": "The offset for pagination.",
+ "type": "integer"
+ },
+ "limit": {
+ "description": "The maxmimum number of Orders to return,",
+ "type": "integer"
+ },
+ "orders": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/order"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/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.",
+ "parameters": [],
+ "tags": [
+ "Customer"
+ ],
+ "responses": {
+ "204": {
+ "description": "OK"
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "email"
+ ],
+ "properties": {
+ "email": {
+ "type": "string",
+ "description": "Email of the user whose password should be reset."
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/customers/reset-password": {
+ "post": {
+ "operationId": "PostCustomersResetPassword",
+ "summary": "Resets Customer password",
+ "description": "Resets a Customer's password using a password token created by a previous /password-token request.",
+ "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",
+ "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",
@@ -258,6 +844,48 @@
}
}
},
+ "/carts/{id}/taxes": {
+ "post": {
+ "summary": "Calculate Cart Taxes",
+ "operationId": "PostCartsCartTaxes",
+ "description": "Calculates taxes for a cart. Depending on the cart's region this may involve making 3rd party API calls to a Tax Provider service.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "required": true,
+ "description": "The Cart id.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "tags": [
+ "Cart"
+ ],
+ "responses": {
+ "200": {
+ "description": "A cart object with the tax_total field populated",
+ "content": {
+ "application/json": {
+ "schema": {
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "cart": {
+ "$ref": "#/components/schemas/cart"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/carts/{id}/complete": {
"post": {
"summary": "Complete a Cart",
@@ -299,6 +927,14 @@
"$ref": "#/components/schemas/cart"
}
}
+ },
+ {
+ "type": "object",
+ "properties": {
+ "cart": {
+ "$ref": "#/components/schemas/swap"
+ }
+ }
}
]
}
@@ -721,14 +1357,9 @@
"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."
@@ -777,6 +1408,52 @@
}
}
},
+ "/carts/{id}/payment-sessions/{provider_id}/refresh": {
+ "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.",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "required": true,
+ "description": "The id of the Cart.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "path",
+ "name": "provider_id",
+ "required": true,
+ "description": "The id of the Payment Provider that created the Payment Session to be refreshed.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "tags": [
+ "Cart"
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "cart": {
+ "$ref": "#/components/schemas/cart"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/carts/{id}/payment-session": {
"post": {
"operationId": "PostCartsCartPaymentSession",
@@ -834,7 +1511,7 @@
},
"/store/carts/{id}": {
"post": {
- "operationId": "PostCartsCart",
+ "operationId": "PostCartsCartPaymentMethodUpdate",
"summary": "Update a Cart\"",
"description": "Updates a Cart.",
"parameters": [
@@ -852,66 +1529,17 @@
"content": {
"application/json": {
"schema": {
+ "required": [
+ "provider_id"
+ ],
"properties": {
- "region_id": {
+ "provider_id": {
"type": "string",
- "description": "The id of the Region to create the Cart in."
+ "description": "The id of the Payment Provider."
},
- "country_code": {
- "type": "string",
- "description": "The 2 character ISO country code to create the Cart in."
- },
- "email": {
- "type": "string",
- "description": "An email to be used on the Cart."
- },
- "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"
- }
- ]
- },
- "gift_cards": {
- "description": "An array of Gift Card codes to add to the Cart.",
- "type": "array",
- "items": {
- "properties": {
- "code": {
- "description": "The code that a Gift Card is identified by.",
- "type": "string"
- }
- }
- }
- },
- "discounts": {
- "description": "An array of Discount codes to add to the Cart.",
- "type": "array",
- "items": {
- "properties": {
- "code": {
- "description": "The code that a Discount is identifed by.",
- "type": "string"
- }
- }
- }
- },
- "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"
+ "data": {
+ "type": "object",
+ "description": ""
}
}
}
@@ -939,518 +1567,6 @@
}
}
},
- "/collections/{id}": {
- "get": {
- "operationId": "GetCollectionsCollection",
- "summary": "Retrieve a Product Collection",
- "description": "Retrieves a Product Collection.",
- "parameters": [
- {
- "in": "path",
- "name": "id",
- "required": true,
- "description": "The id of the Product Collection",
- "schema": {
- "type": "string"
- }
- }
- ],
- "tags": [
- "Collection"
- ],
- "responses": {
- "200": {
- "description": "OK",
- "content": {
- "application/json": {
- "schema": {
- "properties": {
- "collection": {
- "$ref": "#/components/schemas/product_collection"
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "/collections": {
- "get": {
- "operationId": "GetCollections",
- "summary": "List Product Collections",
- "description": "Retrieve a list of Product Collection.",
- "tags": [
- "Collection"
- ],
- "responses": {
- "200": {
- "description": "OK",
- "content": {
- "application/json": {
- "schema": {
- "properties": {
- "collection": {
- "$ref": "#/components/schemas/product_collection"
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "/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"
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "/customers/me": {
- "get": {
- "operationId": "GetCustomersCustomer",
- "summary": "Retrieves a Customer",
- "description": "Retrieves a Customer - the Customer must be logged in to retrieve their details.",
- "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.",
- "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"
- }
- ]
- },
- "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.",
- "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.",
- "tags": [
- "Customer"
- ],
- "responses": {
- "200": {
- "description": "OK",
- "content": {
- "application/json": {
- "schema": {
- "properties": {
- "payment_methods": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/order"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "/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.",
- "tags": [
- "Customer"
- ],
- "responses": {
- "204": {
- "description": "OK"
- }
- }
- }
- },
- "/customers/reset-password": {
- "post": {
- "operationId": "PostCustomersResetPassword",
- "summary": "Resets Customer password",
- "description": "Resets a Customer's password using a password token created by a previous /password-token request.",
- "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",
- "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."
- }
- }
- }
- }
- }
- }
- }
- },
- "/customers/me/addresses/{address_id}": {
- "post": {
- "operationId": "PostCustomersCustomerAddressesAddress",
- "summary": "Update a Shipping Address",
- "description": "Updates a Customer's saved Shipping Address.",
- "parameters": [
- {
- "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"
- }
- }
- }
- }
- }
- }
- }
- }
- },
"/gift-cards/{code}": {
"get": {
"operationId": "GetGiftCardsCode",
@@ -1500,6 +1616,198 @@
}
}
},
+ "/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.",
+ "parameters": [
+ {
+ "in": "query",
+ "name": "q",
+ "description": "Query used for searching products.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "id",
+ "description": "Id of the product to search for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "collection_id",
+ "description": "Collection ids to search for.",
+ "schema": {
+ "type": "array"
+ }
+ },
+ {
+ "in": "query",
+ "name": "tags",
+ "description": "Tags to search for.",
+ "schema": {
+ "type": "array"
+ }
+ },
+ {
+ "in": "query",
+ "name": "title",
+ "description": "to search for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "description",
+ "description": "to search for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "handle",
+ "description": "to search for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "is_giftcard",
+ "description": "Search for giftcards using is_giftcard=true.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "type",
+ "description": "to search for.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "created_at",
+ "description": "Date comparison for when resulting products was created, i.e. less than, greater than etc.",
+ "schema": {
+ "type": "object"
+ }
+ },
+ {
+ "in": "query",
+ "name": "updated_at",
+ "description": "Date comparison for when resulting products was updated, i.e. less than, greater than etc.",
+ "schema": {
+ "type": "object"
+ }
+ },
+ {
+ "in": "query",
+ "name": "deleted_at",
+ "description": "Date comparison for when resulting products was deleted, i.e. less than, greater than etc.",
+ "schema": {
+ "type": "object"
+ }
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "description": "How many products to skip in the result.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "limit",
+ "description": "Limit the number of products returned.",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "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"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/orders/cart/{cart_id}": {
"get": {
"operationId": "GetOrdersOrderCartId",
@@ -1620,84 +1928,6 @@
}
}
},
- "/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"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
"/regions/{id}": {
"get": {
"operationId": "GetRegionsRegion",
@@ -1869,7 +2099,11 @@
"description": "The quantity to return.",
"type": "integer"
}
- }
+ },
+ "required": [
+ "item_id",
+ "quantity"
+ ]
}
},
"return_shipping": {
@@ -1880,9 +2114,16 @@
"type": "string",
"description": "The id of the Shipping Option to create the Shipping Method from."
}
- }
+ },
+ "required": [
+ "option_id"
+ ]
}
- }
+ },
+ "required": [
+ "order_id",
+ "items"
+ ]
}
}
}
@@ -2012,6 +2253,11 @@
"content": {
"application/json": {
"schema": {
+ "required": [
+ "order_id",
+ "return_items",
+ "additional_items"
+ ],
"properties": {
"order_id": {
"type": "string",
@@ -2021,6 +2267,10 @@
"description": "The items to include in the Return.",
"type": "array",
"items": {
+ "required": [
+ "item_id",
+ "quantity"
+ ],
"properties": {
"item_id": {
"description": "The id of the Line Item from the Order.",
@@ -2029,6 +2279,14 @@
"quantity": {
"description": "The quantity to return.",
"type": "integer"
+ },
+ "reason_id": {
+ "description": "The id of the reason of this return",
+ "type": "string"
+ },
+ "note_id": {
+ "description": "The id of the note",
+ "type": "string"
}
}
}
@@ -2041,6 +2299,10 @@
"description": "The items to exchange the returned items to.",
"type": "array",
"items": {
+ "required": [
+ "variant_id",
+ "quantity"
+ ],
"properties": {
"variant_id": {
"description": "The id of the Product Variant to send.",
@@ -2166,6 +2428,29 @@
"schema": {
"type": "string"
}
+ },
+ {
+ "in": "query",
+ "name": "expand",
+ "description": "A comma separated list of Product Variant relations to load.",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "schema": {
+ "type": "number"
+ }
+ },
+ {
+ "in": "query",
+ "name": "limit",
+ "description": "Maximum number of Product Variants to return.",
+ "schema": {
+ "type": "number"
+ }
}
],
"tags": [
@@ -2703,6 +2988,40 @@
}
}
},
+ "customer_group": {
+ "title": "Customer Group",
+ "description": "Represents a customer group",
+ "x-resourceId": "customer_group",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "customers": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ }
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "deleted_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "metadata": {
+ "type": "object"
+ }
+ }
+ },
"customer": {
"title": "Customer",
"description": "Represents a customer",
@@ -3226,6 +3545,52 @@
}
}
},
+ "invite": {
+ "title": "Invite",
+ "description": "Represents an invite",
+ "x-resourceId": "invite",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "user_email": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "admin",
+ "member",
+ "developer"
+ ]
+ },
+ "accepted": {
+ "type": "boolean"
+ },
+ "token": {
+ "type": "string"
+ },
+ "expores_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "deleted_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "metadata": {
+ "type": "object"
+ }
+ }
+ },
"line_item": {
"title": "Line Item",
"description": "Line Items represent purchasable units that can be added to a Cart for checkout. When Line Items are purchased they will get copied to the resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims.",
@@ -3563,6 +3928,31 @@
}
}
},
+ "OAuth": {
+ "title": "OAuth",
+ "description": "Represent an OAuth app",
+ "x-resourceId": "OAuth",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "display_name": {
+ "type": "string"
+ },
+ "application_name": {
+ "type": "string"
+ },
+ "install_url": {
+ "type": "string"
+ },
+ "uninstall_url": {
+ "type": "integer"
+ },
+ "data": {
+ "type": "object"
+ }
+ }
+ },
"order": {
"title": "Order",
"description": "Represents an order",
@@ -3617,7 +4007,7 @@
"type": "string"
},
"tax_rate": {
- "type": "integer"
+ "type": "number"
},
"discounts": {
"type": "array",
@@ -4083,6 +4473,74 @@
}
}
},
+ "product_tax_rate": {
+ "title": "Product Tax Rate",
+ "description": "Associates a tax rate with a product to indicate that the product is taxed in a certain way",
+ "x-resourceId": "product_tax_rate",
+ "properties": {
+ "product_id": {
+ "description": "The id of the Product",
+ "type": "string"
+ },
+ "rate_id": {
+ "description": "The id of the Tax Rate",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "The date with timezone at which the resource was created.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_at": {
+ "description": "The date with timezone at which the resource was last updated.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "deleted_at": {
+ "description": "The date with timezone at which the resource was deleted.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "metadata": {
+ "description": "An optional key-value map with additional information.",
+ "type": "object"
+ }
+ }
+ },
+ "product_type_tax_rate": {
+ "title": "Product Type Tax Rate",
+ "description": "Associates a tax rate with a product type to indicate that the product type is taxed in a certain way",
+ "x-resourceId": "product_type_tax_rate",
+ "properties": {
+ "product_type_id": {
+ "description": "The id of the Product type",
+ "type": "string"
+ },
+ "rate_id": {
+ "description": "The id of the Tax Rate",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "The date with timezone at which the resource was created.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_at": {
+ "description": "The date with timezone at which the resource was last updated.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "deleted_at": {
+ "description": "The date with timezone at which the resource was deleted.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "metadata": {
+ "description": "An optional key-value map with additional information.",
+ "type": "object"
+ }
+ }
+ },
"product_type": {
"title": "Product Type",
"description": "Product Type can be added to Products for filtering and reporting purposes.",
@@ -4873,6 +5331,40 @@
}
}
},
+ "shipping_tax_rate": {
+ "title": "Shipping Tax Rate",
+ "description": "Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way",
+ "x-resourceId": "shipping_tax_rate",
+ "properties": {
+ "shipping_option_id": {
+ "description": "The id of the Shipping Option",
+ "type": "string"
+ },
+ "rate_id": {
+ "description": "The id of the Tax Rate",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "The date with timezone at which the resource was created.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_at": {
+ "description": "The date with timezone at which the resource was last updated.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "deleted_at": {
+ "description": "The date with timezone at which the resource was deleted.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "metadata": {
+ "description": "An optional key-value map with additional information.",
+ "type": "object"
+ }
+ }
+ },
"store": {
"title": "Store",
"description": "Holds settings for the Store, such as name, currencies, etc.",
@@ -5044,6 +5536,103 @@
}
}
},
+ "tax_line": {
+ "title": "Tax Line",
+ "description": "Line item that specifies an amount of tax to add to a line item.",
+ "x-resourceId": "tax_line",
+ "properties": {
+ "id": {
+ "description": "The id of the Tax Line. This value will be prefixed by `tl_`.",
+ "type": "string"
+ },
+ "code": {
+ "description": "A code to identify the tax type by",
+ "type": "string"
+ },
+ "name": {
+ "description": "A human friendly name for the tax",
+ "type": "string"
+ },
+ "rate": {
+ "description": "The numeric rate to charge tax by",
+ "type": "number"
+ },
+ "created_at": {
+ "description": "The date with timezone at which the resource was created.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_at": {
+ "description": "The date with timezone at which the resource was last updated.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "metadata": {
+ "description": "An optional key-value map with additional information.",
+ "type": "object"
+ }
+ }
+ },
+ "tax_provider": {
+ "title": "Tax Provider",
+ "description": "The tax service used to calculate taxes",
+ "x-resourceId": "tax_provider",
+ "properties": {
+ "id": {
+ "description": "The id of the tax provider as given by the plugin.",
+ "type": "string"
+ },
+ "is_installed": {
+ "description": "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.",
+ "type": "boolean"
+ }
+ }
+ },
+ "tax_rate": {
+ "title": "Tax Rate",
+ "description": "A Tax Rate can be used to associate a certain rate to charge on products within a given Region",
+ "x-resourceId": "line_item",
+ "properties": {
+ "id": {
+ "description": "The id of the Tax Rate. This value will be prefixed by `txr_`.",
+ "type": "string"
+ },
+ "rate": {
+ "description": "The numeric rate to charge",
+ "type": "number"
+ },
+ "code": {
+ "description": "A code to identify the tax type by",
+ "type": "string"
+ },
+ "name": {
+ "description": "A human friendly name for the tax",
+ "type": "string"
+ },
+ "region_id": {
+ "description": "The id of the Region that the rate belongs to",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "The date with timezone at which the resource was created.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_at": {
+ "description": "The date with timezone at which the resource was last updated.",
+ "type": "string",
+ "format": "date-time"
+ },
+ "metadata": {
+ "description": "An optional key-value map with additional information.",
+ "type": "object"
+ },
+ "refundable": {
+ "description": "The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration.",
+ "type": "integer"
+ }
+ }
+ },
"tracking_link": {
"title": "Tracking Link",
"description": "Tracking Link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment.",
diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml
index a8b7148278..a9c4648621 100644
--- a/docs/api/store-spec3.yaml
+++ b/docs/api/store-spec3.yaml
@@ -38,7 +38,7 @@ tags:
- name: Product Variant
x-resourceId: product_variant
servers:
- - url: "https://api.medusa-commerce.com/store"
+ - url: 'https://api.medusa-commerce.com/store'
paths:
/auth:
post:
@@ -51,14 +51,14 @@ paths:
tags:
- Auth
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
customer:
- $ref: "#/components/schemas/customer"
+ $ref: '#/components/schemas/customer'
requestBody:
content:
application/json:
@@ -81,24 +81,25 @@ paths:
tags:
- Auth
responses:
- "200":
+ '200':
description: OK
get:
operationId: GetAuth
summary: Get Session
description: Gets the currently logged in Customer.
+ x-authenticated: true
tags:
- Auth
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
customer:
- $ref: "#/components/schemas/customer"
- "/auth/{email}":
+ $ref: '#/components/schemas/customer'
+ '/auth/{email}':
get:
operationId: GetAuthEmail
summary: Check if email has account
@@ -113,7 +114,7 @@ paths:
tags:
- Auth
responses:
- "200":
+ '200':
description: OK
content:
application/json:
@@ -121,7 +122,429 @@ paths:
properties:
exists:
type: boolean
- "/carts/{id}/shipping-methods":
+ '/collections/{id}':
+ get:
+ operationId: GetCollectionsCollection
+ summary: Retrieve a Product Collection
+ description: Retrieves a Product Collection.
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Product Collection
+ schema:
+ type: string
+ tags:
+ - Collection
+ responses:
+ '200':
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ collection:
+ $ref: '#/components/schemas/product_collection'
+ /collections:
+ get:
+ operationId: GetCollections
+ summary: List Product Collections
+ description: Retrieve a list of Product Collection.
+ parameters:
+ - in: query
+ name: offset
+ description: >-
+ The number of collections to skip before starting to collect the
+ collections set
+ schema:
+ type: integer
+ default: 0
+ - in: query
+ name: limit
+ description: The number of collections to return
+ schema:
+ type: integer
+ default: 10
+ tags:
+ - Collection
+ responses:
+ '200':
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ collection:
+ $ref: '#/components/schemas/product_collection'
+ /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.
+ 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/me/addresses/{address_id}':
+ delete:
+ operationId: DeleteCustomersCustomerAddressesAddress
+ summary: Delete an Address
+ description: Removes an Address from the Customer's saved addresse.
+ 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:
+ 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/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'
+ 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 addresses to return.
+ schema:
+ type: integer
+ - in: query
+ name: offset
+ description: The offset in the resulting addresses.
+ schema:
+ type: integer
+ - in: query
+ name: fields
+ description: >-
+ (Comma separated string) Which fields should be included in the
+ resulting addresses.
+ schema:
+ type: string
+ - in: query
+ name: expand
+ description: >-
+ (Comma separated string) Which relations should be expanded in the
+ resulting addresses.
+ schema:
+ type: string
+ tags:
+ - Customer
+ responses:
+ '200':
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ count:
+ description: The total number of Orders.
+ type: integer
+ offset:
+ description: The offset for pagination.
+ type: integer
+ limit:
+ description: 'The maxmimum number of Orders to return,'
+ type: integer
+ orders:
+ type: array
+ items:
+ $ref: '#/components/schemas/order'
+ /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.
+ parameters: []
+ tags:
+ - Customer
+ responses:
+ '204':
+ description: OK
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - email
+ properties:
+ email:
+ type: string
+ description: Email of the user whose password should be reset.
+ /customers/reset-password:
+ post:
+ operationId: PostCustomersResetPassword
+ summary: Resets Customer password
+ description: >-
+ Resets a Customer's password using a password token created by a
+ previous /password-token request.
+ 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
+ - 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.
+ '/gift-cards/{code}':
+ get:
+ operationId: GetGiftCardsCode
+ summary: Retrieve Gift Card by Code
+ description: Retrieves a Gift Card by its associated unqiue code.
+ parameters:
+ - in: path
+ name: code
+ required: true
+ description: The unique Gift Card code.
+ schema:
+ type: string
+ tags:
+ - Gift Card
+ responses:
+ '200':
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ id:
+ description: The id of the Gift Card
+ code:
+ description: The code of the Gift Card
+ value:
+ description: The original value of the Gift Card.
+ balance:
+ description: The current balanace of the Gift Card
+ region:
+ $ref: '#/components/schemas/region'
+ '/carts/{id}/shipping-methods':
post:
operationId: PostCartsCartShippingMethod
description: Adds a Shipping Method to the Cart.
@@ -136,14 +559,14 @@ paths:
schema:
type: string
responses:
- "200":
+ '200':
description: A successful response
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/cart"
+ $ref: '#/components/schemas/cart'
requestBody:
content:
application/json:
@@ -162,7 +585,34 @@ 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":
+ '/carts/{id}/taxes':
+ post:
+ summary: Calculate Cart Taxes
+ operationId: PostCartsCartTaxes
+ description: >-
+ Calculates taxes for a cart. Depending on the cart's region this may
+ involve making 3rd party API calls to a Tax Provider service.
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The Cart id.
+ schema:
+ type: string
+ tags:
+ - Cart
+ responses:
+ '200':
+ description: A cart object with the tax_total field populated
+ content:
+ application/json:
+ schema:
+ oneOf:
+ - type: object
+ properties:
+ cart:
+ $ref: '#/components/schemas/cart'
+ '/carts/{id}/complete':
post:
summary: Complete a Cart
operationId: PostCartsCartComplete
@@ -183,7 +633,7 @@ paths:
tags:
- Cart
responses:
- "200":
+ '200':
description: >-
If a cart was successfully authorized, but requires further action
from the user the response body will contain the cart with an
@@ -196,11 +646,15 @@ paths:
- type: object
properties:
order:
- $ref: "#/components/schemas/order"
+ $ref: '#/components/schemas/order'
- type: object
properties:
cart:
- $ref: "#/components/schemas/cart"
+ $ref: '#/components/schemas/cart'
+ - type: object
+ properties:
+ cart:
+ $ref: '#/components/schemas/swap'
/carts:
post:
summary: Create a Cart
@@ -246,15 +700,15 @@ paths:
tags:
- Cart
responses:
- "200":
+ '200':
description: Successfully created a new Cart
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/cart"
- "/carts/{id}/line-items":
+ $ref: '#/components/schemas/cart'
+ '/carts/{id}/line-items':
post:
operationId: PostCartsCartLineItems
summary: Add a Line Item
@@ -271,14 +725,14 @@ paths:
tags:
- Cart
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/cart"
+ $ref: '#/components/schemas/cart'
requestBody:
content:
application/json:
@@ -301,7 +755,7 @@ paths:
description: >-
An optional key-value map with additional details about the
Line Item.
- "/carts/{id}/payment-sessions":
+ '/carts/{id}/payment-sessions':
post:
operationId: PostCartsCartPaymentSessions
summary: Initialize Payment Sessions
@@ -318,15 +772,15 @@ paths:
tags:
- Cart
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/cart"
- "/carts/{id}/discounts/{code}":
+ $ref: '#/components/schemas/cart'
+ '/carts/{id}/discounts/{code}':
delete:
operationId: DeleteCartsCartDiscountsDiscount
description: Removes a Discount from a Cart.
@@ -347,15 +801,15 @@ paths:
tags:
- Cart
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/cart"
- "/carts/{id}/line-items/{line_id}":
+ $ref: '#/components/schemas/cart'
+ '/carts/{id}/line-items/{line_id}':
delete:
operationId: DeleteCartsCartLineItemsItem
summary: Delete a Line Item
@@ -376,14 +830,14 @@ paths:
tags:
- Cart
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/cart"
+ $ref: '#/components/schemas/cart'
post:
operationId: PostCartsCartLineItemsItem
summary: Update a Line Item
@@ -404,14 +858,14 @@ paths:
tags:
- Cart
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/cart"
+ $ref: '#/components/schemas/cart'
requestBody:
content:
application/json:
@@ -423,7 +877,7 @@ paths:
quantity:
type: integer
description: The quantity to set the Line Item to.
- "/carts/{id}/payment-sessions/{provider_id}":
+ '/carts/{id}/payment-sessions/{provider_id}':
delete:
operationId: DeleteCartsCartPaymentSessionsSession
summary: Delete a Payment Session
@@ -448,14 +902,14 @@ paths:
tags:
- Cart
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/cart"
+ $ref: '#/components/schemas/cart'
post:
operationId: PostCartsCartPaymentSessionUpdate
summary: Update a Payment Session
@@ -476,32 +930,26 @@ paths:
tags:
- Cart
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/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}":
+ '/carts/{id}':
get:
operationId: GetCartsCart
summary: Retrieve a Cart
@@ -516,15 +964,48 @@ paths:
tags:
- Cart
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/cart"
- "/carts/{id}/payment-session":
+ $ref: '#/components/schemas/cart'
+ '/carts/{id}/payment-sessions/{provider_id}/refresh':
+ 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.
+ parameters:
+ - in: path
+ name: id
+ required: true
+ description: The id of the Cart.
+ schema:
+ type: string
+ - in: path
+ name: provider_id
+ required: true
+ description: >-
+ The id of the Payment Provider that created the Payment Session to
+ be refreshed.
+ schema:
+ type: string
+ tags:
+ - Cart
+ responses:
+ '200':
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ cart:
+ $ref: '#/components/schemas/cart'
+ '/carts/{id}/payment-session':
post:
operationId: PostCartsCartPaymentSession
summary: Select a Payment Session
@@ -541,14 +1022,14 @@ paths:
tags:
- Cart
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/cart"
+ $ref: '#/components/schemas/cart'
requestBody:
content:
application/json:
@@ -560,9 +1041,9 @@ paths:
provider_id:
type: string
description: The id of the Payment Provider.
- "/store/carts/{id}":
+ '/store/carts/{id}':
post:
- operationId: PostCartsCart
+ operationId: PostCartsCartPaymentMethodUpdate
summary: Update a Cart"
description: Updates a Cart.
parameters:
@@ -576,424 +1057,27 @@ paths:
content:
application/json:
schema:
+ required:
+ - provider_id
properties:
- region_id:
+ provider_id:
type: string
- description: The id of the Region to create the Cart in.
- country_code:
- type: string
- description: The 2 character ISO country code to create the Cart in.
- email:
- type: string
- description: An email to be used on the Cart.
- 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"
- gift_cards:
- description: An array of Gift Card codes to add to the Cart.
- type: array
- items:
- properties:
- code:
- description: The code that a Gift Card is identified by.
- type: string
- discounts:
- description: An array of Discount codes to add to the Cart.
- type: array
- items:
- properties:
- code:
- description: The code that a Discount is identifed by.
- type: string
- 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.
+ description: The id of the Payment Provider.
+ data:
type: object
+ description: ''
tags:
- Cart
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
cart:
- $ref: "#/components/schemas/cart"
- "/collections/{id}":
- get:
- operationId: GetCollectionsCollection
- summary: Retrieve a Product Collection
- description: Retrieves a Product Collection.
- parameters:
- - in: path
- name: id
- required: true
- description: The id of the Product Collection
- schema:
- type: string
- tags:
- - Collection
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- collection:
- $ref: "#/components/schemas/product_collection"
- /collections:
- get:
- operationId: GetCollections
- summary: List Product Collections
- description: Retrieve a list of Product Collection.
- tags:
- - Collection
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- collection:
- $ref: "#/components/schemas/product_collection"
- "/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"
- /customers/me:
- get:
- operationId: GetCustomersCustomer
- summary: Retrieves a Customer
- description: >-
- Retrieves a Customer - the Customer must be logged in to retrieve their
- details.
- 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.
- 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"
- 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.
- 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.
- tags:
- - Customer
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- payment_methods:
- type: array
- items:
- $ref: "#/components/schemas/order"
- /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.
- tags:
- - Customer
- responses:
- "204":
- description: OK
- /customers/reset-password:
- post:
- operationId: PostCustomersResetPassword
- summary: Resets Customer password
- description: >-
- Resets a Customer's password using a password token created by a
- previous /password-token request.
- 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
- - 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.
- "/customers/me/addresses/{address_id}":
- post:
- operationId: PostCustomersCustomerAddressesAddress
- summary: Update a Shipping Address
- description: Updates a Customer's saved Shipping Address.
- parameters:
- - 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"
- "/gift-cards/{code}":
- get:
- operationId: GetGiftCardsCode
- summary: Retrieve Gift Card by Code
- description: Retrieves a Gift Card by its associated unqiue code.
- parameters:
- - in: path
- name: code
- required: true
- description: The unique Gift Card code.
- schema:
- type: string
- tags:
- - Gift Card
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- properties:
- id:
- description: The id of the Gift Card
- code:
- description: The code of the Gift Card
- value:
- description: The original value of the Gift Card.
- balance:
- description: The current balanace of the Gift Card
- region:
- $ref: "#/components/schemas/region"
- "/orders/cart/{cart_id}":
+ $ref: '#/components/schemas/cart'
+ '/orders/cart/{cart_id}':
get:
operationId: GetOrdersOrderCartId
summary: Retrieves Order by Cart id
@@ -1010,15 +1094,15 @@ paths:
tags:
- Order
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
order:
- $ref: "#/components/schemas/order"
- "/orders/{id}":
+ $ref: '#/components/schemas/order'
+ '/orders/{id}':
get:
operationId: GetOrdersOrder
summary: Retrieves an Order
@@ -1033,14 +1117,14 @@ paths:
tags:
- Order
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
customer:
- $ref: "#/components/schemas/customer"
+ $ref: '#/components/schemas/customer'
/orders:
get:
operationId: GetOrders
@@ -1065,15 +1149,15 @@ paths:
tags:
- Order
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
order:
- $ref: "#/components/schemas/order"
- "/products/{id}":
+ $ref: '#/components/schemas/order'
+ '/products/{id}':
get:
operationId: GetProductsProduct
summary: Retrieves a Product
@@ -1088,23 +1172,100 @@ paths:
tags:
- Product
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
product:
- $ref: "#/components/schemas/product"
+ $ref: '#/components/schemas/product'
/products:
get:
operationId: GetProducts
summary: List Products
description: Retrieves a list of Products.
+ parameters:
+ - in: query
+ name: q
+ description: Query used for searching products.
+ schema:
+ type: string
+ - in: query
+ name: id
+ description: Id of the product to search for.
+ schema:
+ type: string
+ - in: query
+ name: collection_id
+ description: Collection ids to search for.
+ schema:
+ type: array
+ - in: query
+ name: tags
+ description: Tags to search for.
+ schema:
+ type: array
+ - in: query
+ name: title
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: description
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: handle
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: is_giftcard
+ description: Search for giftcards using is_giftcard=true.
+ schema:
+ type: string
+ - in: query
+ name: type
+ description: to search for.
+ schema:
+ type: string
+ - in: query
+ name: created_at
+ description: >-
+ Date comparison for when resulting products was created, i.e. less
+ than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: updated_at
+ description: >-
+ Date comparison for when resulting products was updated, i.e. less
+ than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: deleted_at
+ description: >-
+ Date comparison for when resulting products was deleted, i.e. less
+ than, greater than etc.
+ schema:
+ type: object
+ - in: query
+ name: offset
+ description: How many products to skip in the result.
+ schema:
+ type: string
+ - in: query
+ name: limit
+ description: Limit the number of products returned.
+ schema:
+ type: string
tags:
- Product
responses:
- "200":
+ '200':
description: OK
content:
application/json:
@@ -1117,13 +1278,13 @@ paths:
description: The offset for pagination.
type: integer
limit:
- description: "The maxmimum number of Products to return,"
+ description: 'The maxmimum number of Products to return,'
type: integer
products:
type: array
items:
- $ref: "#/components/schemas/product"
- "/regions/{id}":
+ $ref: '#/components/schemas/product'
+ '/regions/{id}':
get:
operationId: GetRegionsRegion
summary: Retrieves a Region
@@ -1138,14 +1299,14 @@ paths:
tags:
- Region
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
region:
- $ref: "#/components/schemas/region"
+ $ref: '#/components/schemas/region'
/regions:
get:
operationId: GetRegions
@@ -1154,7 +1315,7 @@ paths:
tags:
- Region
responses:
- "200":
+ '200':
description: OK
content:
application/json:
@@ -1167,13 +1328,13 @@ paths:
description: The offset for pagination.
type: integer
limit:
- description: "The maxmimum number of regions to return,"
+ description: 'The maxmimum number of regions to return,'
type: integer
regions:
type: array
items:
- $ref: "#/components/schemas/region"
- "/return-reasons/{id}":
+ $ref: '#/components/schemas/region'
+ '/return-reasons/{id}':
get:
operationId: GetReturnReasonsReason
summary: Retrieve a Return Reason
@@ -1188,14 +1349,14 @@ paths:
tags:
- Return Reason
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
return_reason:
- $ref: "#/components/schemas/return_reason"
+ $ref: '#/components/schemas/return_reason'
/return-reasons:
get:
operationId: GetReturnReasons
@@ -1204,7 +1365,7 @@ paths:
tags:
- Return Reason
responses:
- "200":
+ '200':
description: OK
content:
application/json:
@@ -1213,7 +1374,62 @@ paths:
return_reasons:
type: array
items:
- $ref: "#/components/schemas/return_reason"
+ $ref: '#/components/schemas/return_reason'
+ /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
+ required:
+ - item_id
+ - quantity
+ 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.
+ required:
+ - option_id
+ required:
+ - order_id
+ - items
+ tags:
+ - Return
+ responses:
+ '200':
+ description: OK
+ content:
+ application/json:
+ schema:
+ properties:
+ return:
+ $ref: '#/components/schemas/return'
/shipping-options:
get:
operationId: GetShippingOptions
@@ -1240,7 +1456,7 @@ paths:
tags:
- Shipping Option
responses:
- "200":
+ '200':
description: OK
content:
application/json:
@@ -1249,8 +1465,8 @@ paths:
shipping_options:
type: array
items:
- $ref: "#/components/schemas/shipping_option"
- "/shipping-options/{cart_id}":
+ $ref: '#/components/schemas/shipping_option'
+ '/shipping-options/{cart_id}':
get:
operationId: GetShippingOptionsCartId
summary: Retrieve Shipping Options for Cart
@@ -1265,7 +1481,7 @@ paths:
tags:
- Shipping Option
responses:
- "200":
+ '200':
description: OK
content:
application/json:
@@ -1274,54 +1490,7 @@ paths:
shipping_options:
type: array
items:
- $ref: "#/components/schemas/shipping_option"
- /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"
+ $ref: '#/components/schemas/shipping_option'
/swaps:
post:
operationId: PostSwaps
@@ -1333,6 +1502,10 @@ paths:
content:
application/json:
schema:
+ required:
+ - order_id
+ - return_items
+ - additional_items
properties:
order_id:
type: string
@@ -1341,6 +1514,9 @@ paths:
description: The items to include in the Return.
type: array
items:
+ required:
+ - item_id
+ - quantity
properties:
item_id:
description: The id of the Line Item from the Order.
@@ -1348,6 +1524,12 @@ paths:
quantity:
description: The quantity to return.
type: integer
+ reason_id:
+ description: The id of the reason of this return
+ type: string
+ note_id:
+ description: The id of the note
+ type: string
return_shipping_option:
type: string
description: >-
@@ -1357,6 +1539,9 @@ paths:
description: The items to exchange the returned items to.
type: array
items:
+ required:
+ - variant_id
+ - quantity
properties:
variant_id:
description: The id of the Product Variant to send.
@@ -1367,15 +1552,15 @@ paths:
tags:
- Swap
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
swap:
- $ref: "#/components/schemas/swap"
- "/swaps/{cart_id}":
+ $ref: '#/components/schemas/swap'
+ '/swaps/{cart_id}':
get:
operationId: GetSwapsSwapCartId
summary: Retrieve Swap by Cart id
@@ -1390,15 +1575,15 @@ paths:
tags:
- Swap
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
swap:
- $ref: "#/components/schemas/swap"
- "/variants/{variant_id}":
+ $ref: '#/components/schemas/swap'
+ '/variants/{variant_id}':
get:
operationId: GetVariantsVariant
summary: Retrieve a Product Variant
@@ -1413,14 +1598,14 @@ paths:
tags:
- Product Variant
responses:
- "200":
+ '200':
description: OK
content:
application/json:
schema:
properties:
variant:
- $ref: "#/components/schemas/product_variant"
+ $ref: '#/components/schemas/product_variant'
/variants:
get:
operationId: GetVariants
@@ -1432,10 +1617,24 @@ paths:
description: A comma separated list of Product Variant ids to filter by.
schema:
type: string
+ - in: query
+ name: expand
+ description: A comma separated list of Product Variant relations to load.
+ schema:
+ type: string
+ - in: query
+ name: offset
+ schema:
+ type: number
+ - in: query
+ name: limit
+ description: Maximum number of Product Variants to return.
+ schema:
+ type: number
tags:
- Product Variant
responses:
- "200":
+ '200':
description: OK
content:
application/json:
@@ -1444,7 +1643,7 @@ paths:
variants:
type: array
items:
- $ref: "#/components/schemas/product_variant"
+ $ref: '#/components/schemas/product_variant'
components:
schemas:
address:
@@ -1471,7 +1670,7 @@ components:
country_code:
type: string
country:
- $ref: "#/components/schemas/country"
+ $ref: '#/components/schemas/country'
cart:
title: Cart
description: Represents a user cart
@@ -1484,43 +1683,43 @@ components:
billing_address_id:
type: string
billing_address:
- $ref: "#/components/schemas/address"
+ $ref: '#/components/schemas/address'
shipping_address_id:
type: string
shipping_address:
- $ref: "#/components/schemas/address"
+ $ref: '#/components/schemas/address'
items:
type: array
items:
- $ref: "#/components/schemas/line_item"
+ $ref: '#/components/schemas/line_item'
region_id:
type: string
region:
- $ref: "#/components/schemas/region"
+ $ref: '#/components/schemas/region'
discounts:
type: array
items:
- $ref: "#/components/schemas/region"
+ $ref: '#/components/schemas/region'
gift_cards:
type: array
items:
- $ref: "#/components/schemas/gift_card"
+ $ref: '#/components/schemas/gift_card'
customer_id:
type: string
customer:
- $ref: "#/components/schemas/customer"
+ $ref: '#/components/schemas/customer'
payment_session:
- $ref: "#/components/schemas/payment_session"
+ $ref: '#/components/schemas/payment_session'
payment_sessions:
type: array
items:
- $ref: "#/components/schemas/payment_session"
+ $ref: '#/components/schemas/payment_session'
payment:
- $ref: "#/components/schemas/payment"
+ $ref: '#/components/schemas/payment'
shipping_methods:
type: array
items:
- $ref: "#/components/schemas/shipping_method"
+ $ref: '#/components/schemas/shipping_method'
type:
type: string
enum:
@@ -1587,19 +1786,19 @@ components:
images:
type: array
items:
- $ref: "#/components/schemas/claim_image"
+ $ref: '#/components/schemas/claim_image'
claim_order_id:
type: string
item_id:
type: string
item:
description: The Line Item that the claim refers to
- $ref: "#/components/schemas/line_item"
+ $ref: '#/components/schemas/line_item'
variant_id:
type: string
variant:
description: The Product Variant that is claimed.
- $ref: "#/components/schemas/product_variant"
+ $ref: '#/components/schemas/product_variant'
reason:
description: The reason for the claim
type: string
@@ -1609,7 +1808,7 @@ components:
- production_failure
- other
note:
- description: "An optional note about the claim, for additional information"
+ description: 'An optional note about the claim, for additional information'
type: string
quantity:
description: >-
@@ -1620,7 +1819,7 @@ components:
description: User defined tags for easy filtering and grouping.
type: array
items:
- $ref: "#/components/schemas/claim_tag"
+ $ref: '#/components/schemas/claim_tag'
created_at:
type: string
format: date-time
@@ -1669,36 +1868,36 @@ components:
description: The items that have been claimed
type: array
items:
- $ref: "#/components/schemas/claim_item"
+ $ref: '#/components/schemas/claim_item'
additional_items:
description: >-
Refers to the new items to be shipped when the claim order has the
type `replace`
type: array
items:
- $ref: "#/components/schemas/line_item"
+ $ref: '#/components/schemas/line_item'
order_id:
description: The id of the order that the claim comes from.
type: string
return_order:
description: Holds information about the return if the claim is to be returned
- $ref: "#/components/schemas/return"
+ $ref: '#/components/schemas/return'
shipping_address_id:
description: The id of the address that the new items should be shipped to
type: string
shipping_address:
description: The address that the new items should be shipped to
- $ref: "#/components/schemas/address"
+ $ref: '#/components/schemas/address'
shipping_methods:
description: The shipping methods that the claim order will be shipped with.
type: array
items:
- $ref: "#/components/schemas/shipping_method"
+ $ref: '#/components/schemas/shipping_method'
fulfillments:
description: The fulfillments of the new items to be shipped
type: array
items:
- $ref: "#/components/schemas/fulfillment"
+ $ref: '#/components/schemas/fulfillment'
refund_amount:
description: The amount that will be refunded in conjunction with the claim
type: integer
@@ -1813,11 +2012,11 @@ components:
The id of the Shipping Option that the custom shipping option
overrides
anyOf:
- - $ref: "#/components/schemas/shipping_option"
+ - $ref: '#/components/schemas/shipping_option'
cart_id:
description: The id of the Cart that the custom shipping option is attached to
anyOf:
- - $ref: "#/components/schemas/cart"
+ - $ref: '#/components/schemas/cart'
created_at:
description: The date with timezone at which the resource was created.
type: string
@@ -1833,6 +2032,30 @@ components:
metadata:
description: An optional key-value map with additional information.
type: object
+ customer_group:
+ title: Customer Group
+ description: Represents a customer group
+ x-resourceId: customer_group
+ properties:
+ id:
+ type: string
+ name:
+ type: string
+ customers:
+ type: array
+ items:
+ type: object
+ created_at:
+ type: string
+ format: date-time
+ updated_at:
+ type: string
+ format: date-time
+ deleted_at:
+ type: string
+ format: date-time
+ metadata:
+ type: object
customer:
title: Customer
description: Represents a customer
@@ -1847,11 +2070,11 @@ components:
billing_address:
description: The Customer's billing address.
anyOf:
- - $ref: "#/components/schemas/address"
+ - $ref: '#/components/schemas/address'
shipping_addresses:
type: array
items:
- $ref: "#/components/schemas/address"
+ $ref: '#/components/schemas/address'
first_name:
type: string
last_name:
@@ -1909,7 +2132,7 @@ components:
description: A set of Products that the discount can be used for.
type: array
items:
- $ref: "#/components/schemas/product"
+ $ref: '#/components/schemas/product'
created_at:
description: The date with timezone at which the resource was created.
type: string
@@ -1948,7 +2171,7 @@ components:
rule:
description: The Discount Rule that governs the behaviour of the Discount
anyOf:
- - $ref: "#/components/schemas/discount_rule"
+ - $ref: '#/components/schemas/discount_rule'
is_disabled:
description: >-
Whether the Discount has been disabled. Disabled discounts cannot be
@@ -1971,7 +2194,7 @@ components:
description: The Regions in which the Discount can be used
type: array
items:
- $ref: "#/components/schemas/region"
+ $ref: '#/components/schemas/region'
usage_limit:
description: The maximum number of times that a discount can be used.
type: integer
@@ -2011,12 +2234,12 @@ components:
type: string
cart:
anyOf:
- - $ref: "#/components/schemas/cart"
+ - $ref: '#/components/schemas/cart'
order_id:
type: string
order:
anyOf:
- - $ref: "#/components/schemas/order"
+ - $ref: '#/components/schemas/order'
canceled_at:
type: string
format: date-time
@@ -2054,7 +2277,7 @@ components:
item:
description: The Line Item that the Fulfillment Item references.
anyOf:
- - $ref: "#/components/schemas/line_item"
+ - $ref: '#/components/schemas/line_item'
quantity:
description: The quantity of the Line Item that is included in the Fulfillment.
type: integer
@@ -2109,7 +2332,7 @@ components:
about how many of each Line Item has been fulfilled.
type: array
items:
- $ref: "#/components/schemas/fulfillment_item"
+ $ref: '#/components/schemas/fulfillment_item'
tracking_links:
description: >-
The Tracking Links that can be used to track the status of the
@@ -2117,7 +2340,7 @@ components:
Provider.
type: array
items:
- $ref: "#/components/schemas/tracking_link"
+ $ref: '#/components/schemas/tracking_link'
tracking_numbers:
deprecated: true
description: >-
@@ -2168,7 +2391,7 @@ components:
gift_card:
description: The Gift Card that was used in the transaction.
anyOf:
- - $ref: "#/components/schemas/gift_card"
+ - $ref: '#/components/schemas/gift_card'
order_id:
description: The id of the Order that the Gift Card was used to pay for.
type: string
@@ -2206,7 +2429,7 @@ components:
region:
description: The Region in which the Gift Card is available.
anyOf:
- - $ref: "#/components/schemas/region"
+ - $ref: '#/components/schemas/region'
order_id:
description: The id of the Order that the Gift Card was purchased in.
type: string
@@ -2260,6 +2483,39 @@ components:
metadata:
description: An optional key-value map with additional information.
type: object
+ invite:
+ title: Invite
+ description: Represents an invite
+ x-resourceId: invite
+ properties:
+ id:
+ type: string
+ user_email:
+ type: string
+ role:
+ type: string
+ enum:
+ - admin
+ - member
+ - developer
+ accepted:
+ type: boolean
+ token:
+ type: string
+ expores_at:
+ type: string
+ format: date-time
+ created_at:
+ type: string
+ format: date-time
+ updated_at:
+ type: string
+ format: date-time
+ deleted_at:
+ type: string
+ format: date-time
+ metadata:
+ type: object
line_item:
title: Line Item
description: >-
@@ -2321,7 +2577,7 @@ components:
variant:
description: The Product Variant contained in the Line Item.
anyOf:
- - $ref: "#/components/schemas/product_variant"
+ - $ref: '#/components/schemas/product_variant'
quantity:
description: The quantity of the content in the Line Item.
type: integer
@@ -2386,7 +2642,7 @@ components:
region:
description: The Region that the Money Amount is defined for.
anyOf:
- - $ref: "#/components/schemas/region"
+ - $ref: '#/components/schemas/region'
created_at:
description: The date with timezone at which the resource was created.
type: string
@@ -2422,7 +2678,7 @@ components:
author:
description: The author of the note.
anyOf:
- - $ref: "#/components/schemas/user"
+ - $ref: '#/components/schemas/user'
created_at:
description: The date with timezone at which the resource was created.
type: string
@@ -2481,7 +2737,7 @@ components:
customer:
description: The Customer that the Notification was sent to.
anyOf:
- - $ref: "#/components/schemas/customer"
+ - $ref: '#/components/schemas/customer'
to:
description: >-
The address that the Notification was sent to. This will usually be
@@ -2502,7 +2758,7 @@ components:
Notification.
type: array
items:
- $ref: "#/components/schemas/notification_resend"
+ $ref: '#/components/schemas/notification_resend'
provider_id:
description: The id of the Notification Provider that handles the Notification.
type: string
@@ -2556,6 +2812,23 @@ components:
description: The date with timezone at which the resource was last updated.
type: string
format: date-time
+ OAuth:
+ title: OAuth
+ description: Represent an OAuth app
+ x-resourceId: OAuth
+ properties:
+ id:
+ type: string
+ display_name:
+ type: string
+ application_name:
+ type: string
+ install_url:
+ type: string
+ uninstall_url:
+ type: integer
+ data:
+ type: object
order:
title: Order
description: Represents an order
@@ -2600,80 +2873,80 @@ components:
currency_code:
type: string
tax_rate:
- type: integer
+ type: number
discounts:
type: array
items:
- $ref: "#/components/schemas/discount"
+ $ref: '#/components/schemas/discount'
email:
type: string
billing_address_id:
type: string
billing_address:
anyOf:
- - $ref: "#/components/schemas/address"
+ - $ref: '#/components/schemas/address'
shipping_address_id:
type: string
shipping_address:
anyOf:
- - $ref: "#/components/schemas/address"
+ - $ref: '#/components/schemas/address'
items:
type: array
items:
- $ref: "#/components/schemas/line_item"
+ $ref: '#/components/schemas/line_item'
region_id:
type: string
region:
anyOf:
- - $ref: "#/components/schemas/region"
+ - $ref: '#/components/schemas/region'
gift_cards:
type: array
items:
- $ref: "#/components/schemas/gift_card"
+ $ref: '#/components/schemas/gift_card'
customer_id:
type: string
customer:
anyOf:
- - $ref: "#/components/schemas/customer"
+ - $ref: '#/components/schemas/customer'
payment_session:
anyOf:
- - $ref: "#/components/schemas/payment_session"
+ - $ref: '#/components/schemas/payment_session'
payment_sessions:
type: array
items:
- $ref: "#/components/schemas/payment_session"
+ $ref: '#/components/schemas/payment_session'
payments:
type: array
items:
- $ref: "#/components/schemas/payment"
+ $ref: '#/components/schemas/payment'
shipping_methods:
type: array
items:
- $ref: "#/components/schemas/shipping_method"
+ $ref: '#/components/schemas/shipping_method'
fulfillments:
type: array
items:
- $ref: "#/components/schemas/fulfillment"
+ $ref: '#/components/schemas/fulfillment'
returns:
type: array
items:
- $ref: "#/components/schemas/return"
+ $ref: '#/components/schemas/return'
claims:
type: array
items:
- $ref: "#/components/schemas/claim_order"
+ $ref: '#/components/schemas/claim_order'
refunds:
type: array
items:
- $ref: "#/components/schemas/refund"
+ $ref: '#/components/schemas/refund'
swaps:
type: array
items:
- $ref: "#/components/schemas/refund"
+ $ref: '#/components/schemas/refund'
gift_card_transactions:
type: array
items:
- $ref: "#/components/schemas/gift_card_transaction"
+ $ref: '#/components/schemas/gift_card_transaction'
canceled_at:
type: string
format: date-time
@@ -2939,7 +3212,7 @@ components:
description: The Product Option Values that are defined for the Product Option.
type: array
items:
- $ref: "#/components/schemas/product_option_value"
+ $ref: '#/components/schemas/product_option_value'
product_id:
description: The id of the Product that the Product Option is defined for.
type: string
@@ -2984,6 +3257,62 @@ components:
metadata:
description: An optional key-value map with additional information.
type: object
+ product_tax_rate:
+ title: Product Tax Rate
+ description: >-
+ Associates a tax rate with a product to indicate that the product is
+ taxed in a certain way
+ x-resourceId: product_tax_rate
+ properties:
+ product_id:
+ description: The id of the Product
+ type: string
+ rate_id:
+ description: The id of the Tax Rate
+ type: string
+ created_at:
+ description: The date with timezone at which the resource was created.
+ type: string
+ format: date-time
+ updated_at:
+ description: The date with timezone at which the resource was last updated.
+ type: string
+ format: date-time
+ deleted_at:
+ description: The date with timezone at which the resource was deleted.
+ type: string
+ format: date-time
+ metadata:
+ description: An optional key-value map with additional information.
+ type: object
+ product_type_tax_rate:
+ title: Product Type Tax Rate
+ description: >-
+ Associates a tax rate with a product type to indicate that the product
+ type is taxed in a certain way
+ x-resourceId: product_type_tax_rate
+ properties:
+ product_type_id:
+ description: The id of the Product type
+ type: string
+ rate_id:
+ description: The id of the Tax Rate
+ type: string
+ created_at:
+ description: The date with timezone at which the resource was created.
+ type: string
+ format: date-time
+ updated_at:
+ description: The date with timezone at which the resource was last updated.
+ type: string
+ format: date-time
+ deleted_at:
+ description: The date with timezone at which the resource was deleted.
+ type: string
+ format: date-time
+ metadata:
+ description: An optional key-value map with additional information.
+ type: object
product_type:
title: Product Type
description: >-
@@ -3043,7 +3372,7 @@ components:
Region.
type: array
items:
- $ref: "#/components/schemas/money_amount"
+ $ref: '#/components/schemas/money_amount'
sku:
description: >-
The unique stock keeping unit used to identify the Product Variant.
@@ -3124,7 +3453,7 @@ components:
description: The Product Option Values specified for the Product Variant.
type: array
items:
- $ref: "#/components/schemas/product_option_value"
+ $ref: '#/components/schemas/product_option_value'
created_at:
description: The date with timezone at which the resource was created.
type: string
@@ -3182,7 +3511,7 @@ components:
description: Images of the Product
type: array
items:
- $ref: "#/components/schemas/image"
+ $ref: '#/components/schemas/image'
thumbnail:
description: A URL to an image file that can be used to identify the Product.
type: string
@@ -3193,14 +3522,14 @@ components:
Option Values.
type: array
items:
- $ref: "#/components/schemas/product_option"
+ $ref: '#/components/schemas/product_option'
variants:
description: >-
The Product Variants that belong to the Product. Each will have a
unique combination of Product Option Values.
type: array
items:
- $ref: "#/components/schemas/product_variant"
+ $ref: '#/components/schemas/product_variant'
profile_id:
description: >-
The id of the Shipping Profile that the Product belongs to. Shipping
@@ -3254,16 +3583,16 @@ components:
type:
description: The Product Type of the Product (e.g. "Clothing")
anyOf:
- - $ref: "#/components/schemas/product_type"
+ - $ref: '#/components/schemas/product_type'
collection:
description: The Product Collection that the Product belongs to (e.g. "SS20")
anyOf:
- - $ref: "#/components/schemas/product_collection"
+ - $ref: '#/components/schemas/product_collection'
tags:
description: The Product Tags assigned to the Product.
type: array
items:
- $ref: "#/components/schemas/product_tag"
+ $ref: '#/components/schemas/product_tag'
created_at:
description: The date with timezone at which the resource was created.
type: string
@@ -3355,21 +3684,21 @@ components:
description: The countries that are included in the Region.
type: array
items:
- $ref: "#/components/schemas/country"
+ $ref: '#/components/schemas/country'
payment_providers:
description: >-
The Payment Providers that can be used to process Payments in the
Region.
type: array
items:
- $ref: "#/components/schemas/payment_provider"
+ $ref: '#/components/schemas/payment_provider'
fulfillment_providers:
description: >-
The Fulfillment Providers that can be used to fulfill orders in the
Region.
type: array
items:
- $ref: "#/components/schemas/fulfillment_provider"
+ $ref: '#/components/schemas/fulfillment_provider'
created_at:
description: The date with timezone at which the resource was created.
type: string
@@ -3401,7 +3730,7 @@ components:
item:
description: The Line Item that the Return Item references.
anyOf:
- - $ref: "#/components/schemas/line_item"
+ - $ref: '#/components/schemas/line_item'
quantity:
description: The quantity of the Line Item that is included in the Return.
type: integer
@@ -3419,7 +3748,7 @@ components:
reason:
description: The reason for returning the item.
anyOf:
- - $ref: "#/components/schemas/return_reason"
+ - $ref: '#/components/schemas/return_reason'
note:
description: An optional note with additional details about the Return.
type: string
@@ -3481,7 +3810,7 @@ components:
items:
description: >-
The Return Items that will be shipped back to the warehouse. type:
- array items: $ref:
+ array items: $ref:
swap_id:
description: The id of the Swap that the Return is a part of.
type: string
@@ -3496,7 +3825,7 @@ components:
The Shipping Method that will be used to send the Return back. Can
be null if the Customer facilitates the return shipment themselves.
anyOf:
- - $ref: "#/components/schemas/shipping_method"
+ - $ref: '#/components/schemas/shipping_method'
shipping_data:
description: >-
Data about the return shipment as provided by the Fulfilment
@@ -3547,7 +3876,7 @@ components:
shipping_option:
description: The Shipping Option that the Shipping Method is built from.
anyOf:
- - $ref: "#/components/schemas/shipping_option"
+ - $ref: '#/components/schemas/shipping_option'
order_id:
description: The id of the Order that the Shipping Method is used on.
type: string
@@ -3633,7 +3962,7 @@ components:
region:
description: The id of the Region that the Shipping Option belongs to.
anyOf:
- - $ref: "#/components/schemas/region"
+ - $ref: '#/components/schemas/region'
profile_id:
description: >-
The id of the Shipping Profile that the Shipping Option belongs to.
@@ -3671,7 +4000,7 @@ components:
be available for a Cart.
type: array
items:
- $ref: "#/components/schemas/shipping_option_requirement"
+ $ref: '#/components/schemas/shipping_option_requirement'
data:
description: >-
The data needed for the Fulfillment Provider to identify the
@@ -3722,7 +4051,7 @@ components:
description: The Products that the Shipping Profile defines Shipping Options for.
type: array
items:
- $ref: "#/components/schemas/product"
+ $ref: '#/components/schemas/product'
shipping_options:
description: >-
The Shipping Options that can be used to fulfill the Products in the
@@ -3730,7 +4059,35 @@ components:
type: array
items:
anyOf:
- - $ref: "#/components/schemas/shipping_option"
+ - $ref: '#/components/schemas/shipping_option'
+ created_at:
+ description: The date with timezone at which the resource was created.
+ type: string
+ format: date-time
+ updated_at:
+ description: The date with timezone at which the resource was last updated.
+ type: string
+ format: date-time
+ deleted_at:
+ description: The date with timezone at which the resource was deleted.
+ type: string
+ format: date-time
+ metadata:
+ description: An optional key-value map with additional information.
+ type: object
+ shipping_tax_rate:
+ title: Shipping Tax Rate
+ description: >-
+ Associates a tax rate with a shipping option to indicate that the
+ shipping option is taxed in a certain way
+ x-resourceId: shipping_tax_rate
+ properties:
+ shipping_option_id:
+ description: The id of the Shipping Option
+ type: string
+ rate_id:
+ description: The id of the Tax Rate
+ type: string
created_at:
description: The date with timezone at which the resource was created.
type: string
@@ -3748,7 +4105,7 @@ components:
type: object
store:
title: Store
- description: "Holds settings for the Store, such as name, currencies, etc."
+ description: 'Holds settings for the Store, such as name, currencies, etc.'
x-resourceId: store
properties:
id:
@@ -3766,7 +4123,7 @@ components:
description: The currencies that are enabled for the Store.
type: array
items:
- $ref: "#/components/schemas/currency"
+ $ref: '#/components/schemas/currency'
swap_link_template:
description: >-
A template to generate Swap links from use {{cart_id}} to include
@@ -3832,22 +4189,22 @@ components:
description: The new Line Items to ship to the Customer.
type: array
items:
- $ref: "#/components/schemas/line_item"
+ $ref: '#/components/schemas/line_item'
return_order:
description: The Return that is issued for the return part of the Swap.
anyOf:
- - $ref: "#/components/schemas/return"
+ - $ref: '#/components/schemas/return'
fulfillments:
description: The Fulfillments used to send the new Line Items.
type: array
items:
- $ref: "#/components/schemas/fulfillment"
+ $ref: '#/components/schemas/fulfillment'
payment:
description: >-
The Payment authorized when the Swap requires an additional amount
to be charged from the Customer.
anyOf:
- - $ref: "#/components/schemas/payment"
+ - $ref: '#/components/schemas/payment'
difference_due:
description: >-
The difference that is paid or refunded as a result of the Swap. May
@@ -3859,17 +4216,17 @@ components:
The Address to send the new Line Items to - in most cases this will
be the same as the shipping address on the Order.
anyOf:
- - $ref: "#/components/schemas/address"
+ - $ref: '#/components/schemas/address'
shipping_methods:
description: The Shipping Methods used to fulfill the addtional items purchased.
type: array
items:
- $ref: "#/components/schemas/shipping_method"
+ $ref: '#/components/schemas/shipping_method'
cart_id:
description: The id of the Cart that the Customer will use to confirm the Swap.
type: string
allow_backorder:
- description: "If true, swaps can be completed with items out of stock"
+ description: 'If true, swaps can be completed with items out of stock'
type: boolean
confirmed_at:
description: >-
@@ -3890,11 +4247,91 @@ components:
type: string
format: date-time
no_notification:
- description: "If set to true, no notification will be sent related to this swap"
+ 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
+ tax_line:
+ title: Tax Line
+ description: Line item that specifies an amount of tax to add to a line item.
+ x-resourceId: tax_line
+ properties:
+ id:
+ description: The id of the Tax Line. This value will be prefixed by `tl_`.
+ type: string
+ code:
+ description: A code to identify the tax type by
+ type: string
+ name:
+ description: A human friendly name for the tax
+ type: string
+ rate:
+ description: The numeric rate to charge tax by
+ type: number
+ created_at:
+ description: The date with timezone at which the resource was created.
+ type: string
+ format: date-time
+ updated_at:
+ description: The date with timezone at which the resource was last updated.
+ type: string
+ format: date-time
+ metadata:
+ description: An optional key-value map with additional information.
+ type: object
+ tax_provider:
+ title: Tax Provider
+ description: The tax service used to calculate taxes
+ x-resourceId: tax_provider
+ properties:
+ id:
+ description: The id of the tax provider as given by the plugin.
+ type: string
+ is_installed:
+ description: >-
+ Whether the plugin is installed in the current version. Plugins that
+ are no longer installed are not deleted by will have this field set
+ to `false`.
+ type: boolean
+ tax_rate:
+ title: Tax Rate
+ description: >-
+ A Tax Rate can be used to associate a certain rate to charge on products
+ within a given Region
+ x-resourceId: line_item
+ properties:
+ id:
+ description: The id of the Tax Rate. This value will be prefixed by `txr_`.
+ type: string
+ rate:
+ description: The numeric rate to charge
+ type: number
+ code:
+ description: A code to identify the tax type by
+ type: string
+ name:
+ description: A human friendly name for the tax
+ type: string
+ region_id:
+ description: The id of the Region that the rate belongs to
+ type: string
+ created_at:
+ description: The date with timezone at which the resource was created.
+ type: string
+ format: date-time
+ updated_at:
+ description: The date with timezone at which the resource was last updated.
+ type: string
+ format: date-time
+ metadata:
+ description: An optional key-value map with additional information.
+ type: object
+ refundable:
+ description: >-
+ The amount that can be refunded from the given Line Item. Takes
+ taxes and discounts into consideration.
+ type: integer
tracking_link:
title: Tracking Link
description: >-
@@ -3948,7 +4385,7 @@ components:
last_name:
description: The Customer's billing address.
anyOf:
- - $ref: "#/components/schemas/address"
+ - $ref: '#/components/schemas/address'
created_at:
type: string
format: date-time
diff --git a/docs/api/store/endpoints/products.yaml b/docs/api/store/endpoints/products.yaml
index 29251734b6..ea09aa34eb 100644
--- a/docs/api/store/endpoints/products.yaml
+++ b/docs/api/store/endpoints/products.yaml
@@ -7,7 +7,7 @@ routes:
path: /products/:id
route: /products
description: >
- A product represents the object, that are to be sold on the website. A product can have variants, that differ by e.g. size and color.
+ A product represents the object, that is to be sold on the website. A product can have variants, that differ by e.g. size and color.
endpoints:
- path: /:id
method: GET
diff --git a/docs/content/add-plugins/algolia.md b/docs/content/add-plugins/algolia.md
index 2c6522b76b..251703067f 100644
--- a/docs/content/add-plugins/algolia.md
+++ b/docs/content/add-plugins/algolia.md
@@ -61,7 +61,7 @@ And that's all! You've now enabled Algolia for your Medusa store engine. The plu
**Usage**
-This article will not go too much into depth about how the search functionality works under the hood when querying the API. We refer to the [previous article on MeiliSearch](https://www.medusa-commerce.com/post/meilisearch-and-medusa) if this is of your interest. In there, you will find a quick showcase using Postman as well as a thorough walkthrough of how you can display the results in your storefront using ReactJS (GatsbyJS).
+This article will not go too much into depth about how the search functionality works under the hood when querying the API. We refer to the [previous article on MeiliSearch](https://www.medusajs.com/post/meilisearch-and-medusa) if this is of your interest. In there, you will find a quick showcase using Postman as well as a thorough walkthrough of how you can display the results in your storefront using ReactJS (GatsbyJS).
Instead, to illustrate the power of our Search API and search engine plugins, we'll switch out a MeiliSearch plugin with our new Algolia plugin in a store with existing products. Upon restarting the server with the new configuration, your products will automatically be fed into Algolia and the search functionality in your frontend will remain unchanged.
diff --git a/docs/content/add-plugins/contentful.md b/docs/content/add-plugins/contentful.md
index 68055e4886..5903945b0b 100644
--- a/docs/content/add-plugins/contentful.md
+++ b/docs/content/add-plugins/contentful.md
@@ -27,7 +27,11 @@ If you want to jump straight to the code for this series you can checkout:
## Prerequisites
-> For a full guide to how to set up your development environment for Medusa please see [the tutorial](https://docs.medusa-commerce.com/tutorials/set-up-your-development-environment)
+:::note
+
+For a full guide to how to set up your development environment for Medusa please see [the tutorial](../tutorial/set-up-your-development-environment/)
+
+:::
In order to get you started with your Gatsby, Contentful, Medusa store you must complete a couple of installations:
@@ -136,7 +140,7 @@ module.exports = {
#### `/src`
-In the `/src` directory there are 4 special subdirectories that are added for you already. These special directories can be used to add custom functionality to your store. Custom functionality can include custom endpoints (configured in `/api`), custom business logic (configured in `/services`), pub/sub-like subscriptions for asyncrhonous integration tasks (configured in `/subscribers`) and finally loader functions to be called when your Medusa server starts up (configured in `/loaders`). If you want to learn more about how to add custom functionality you can checkout [the tutorial](https://docs.medusa-commerce.com/tutorials/adding-custom-functionality).
+In the `/src` directory there are 4 special subdirectories that are added for you already. These special directories can be used to add custom functionality to your store. Custom functionality can include custom endpoints (configured in `/api`), custom business logic (configured in `/services`), pub/sub-like subscriptions for asyncrhonous integration tasks (configured in `/subscribers`) and finally loader functions to be called when your Medusa server starts up (configured in `/loaders`). If you want to learn more about how to add custom functionality you can checkout [the tutorial](https://docs.medusajs.com/tutorials/adding-custom-functionality).
#### `/data`
diff --git a/docs/content/add-plugins/minio.md b/docs/content/add-plugins/minio.md
index 09c7a3e78c..48bf826508 100644
--- a/docs/content/add-plugins/minio.md
+++ b/docs/content/add-plugins/minio.md
@@ -4,7 +4,7 @@ In order to work with images in Medusa, you need a file service plugin responsib
### Before you start
-At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusa-commerce.com/tutorial/set-up-your-development-environment) for setting up your local environment.
+At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusajs.com/tutorial/set-up-your-development-environment) for setting up your local environment.
### Set up MinIO
diff --git a/docs/content/add-plugins/s3.md b/docs/content/add-plugins/s3.md
index 25755189fe..c448c55afe 100644
--- a/docs/content/add-plugins/s3.md
+++ b/docs/content/add-plugins/s3.md
@@ -4,7 +4,7 @@ In order to work with images in Medusa, you need a file service plugin responsib
### Before you start
-At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusa-commerce.com/tutorial/set-up-your-development-environment) for setting up your local environment.
+At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusajs.com/tutorial/set-up-your-development-environment) for setting up your local environment.
### Set up AWS
diff --git a/docs/content/add-plugins/segment.md b/docs/content/add-plugins/segment.md
index dcac28017a..37f1766a48 100644
--- a/docs/content/add-plugins/segment.md
+++ b/docs/content/add-plugins/segment.md
@@ -68,7 +68,7 @@ In many cases you will want to track other events that are specific to your stor
## Tracking custom events
-Building from the custom functionality that can be guided by [the tutorial](https://docs.medusa-commerce.com/tutorial/adding-custom-functionality) in Medusa docs, imagine that you want to track all welcome opt-ins.
+Building from the custom functionality that can be guided by [the tutorial](https://docs.medusajs.com/tutorial/adding-custom-functionality) in Medusa docs, imagine that you want to track all welcome opt-ins.
The `segmentService` exposes a `track` method that wraps [Segment's Track Spec](https://segment.com/docs/connections/spec/track/), allowing you to send events to the Segment from anywhere in your Medusa project.
diff --git a/docs/content/add-plugins/sendgrid.md b/docs/content/add-plugins/sendgrid.md
index 123d23aa54..2a08a165c3 100644
--- a/docs/content/add-plugins/sendgrid.md
+++ b/docs/content/add-plugins/sendgrid.md
@@ -2,6 +2,8 @@
[View plugin here](https://github.com/medusajs/medusa/tree/master/packages/medusa-plugin-sendgrid)
-
-https://user-images.githubusercontent.com/59018053/154807282-1e72671f-1936-411d-b914-e05c6597693a.mp4
-
+
+
+
diff --git a/docs/content/add-plugins/spaces.md b/docs/content/add-plugins/spaces.md
index 5996f460f9..c9952830aa 100644
--- a/docs/content/add-plugins/spaces.md
+++ b/docs/content/add-plugins/spaces.md
@@ -2,13 +2,15 @@
In order to work with images in Medusa, you need a file service plugin responsible for hosting. Following this guide will allow you to upload images to DigitalOcean Spaces.
-
-https://user-images.githubusercontent.com/59018053/154808767-7c030254-1879-41fd-a71c-b31c5508d8a4.mp4
-
+
+
+
### Before you start
-At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusa-commerce.com/tutorial/set-up-your-development-environment) for setting up your local environment.
+At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusajs.com/tutorial/set-up-your-development-environment) for setting up your local environment.
### Set up DigitalOcean
diff --git a/docs/content/add-plugins/strapi.md b/docs/content/add-plugins/strapi.md
index 21edadf365..637595a45d 100644
--- a/docs/content/add-plugins/strapi.md
+++ b/docs/content/add-plugins/strapi.md
@@ -18,7 +18,7 @@ Both projects are open-source, headless, and built with Node.js. They use a very
## Installation
-The following guide for setting up the plugin assumes, that you are familiar with both Strapi and Medusa. If this is not the case, visit the official [Medusa](https://docs.medusa-commerce.com/tutorial/set-up-your-development-environment) and [Strapi](https://strapi.io/documentation/developer-docs/latest/getting-started/introduction.html) documentation.
+The following guide for setting up the plugin assumes, that you are familiar with both Strapi and Medusa. If this is not the case, visit the official [Medusa](https://docs.medusajs.com/tutorial/set-up-your-development-environment) and [Strapi](https://strapi.io/documentation/developer-docs/latest/getting-started/introduction.html) documentation.
### Setting up Medusa
diff --git a/docs/content/add-plugins/stripe.md b/docs/content/add-plugins/stripe.md
index da24057875..0fb742204a 100644
--- a/docs/content/add-plugins/stripe.md
+++ b/docs/content/add-plugins/stripe.md
@@ -2,15 +2,18 @@
[View plugin here](https://github.com/medusajs/medusa/tree/master/packages/medusa-payment-stripe)
-
-https://user-images.githubusercontent.com/59018053/154807206-6fbda0a6-bf3e-4e39-9fc2-f11710afe0b9.mp4
+
+
+
### Introduction
Handling payments is at the core of every commerce system; it allows us to run our businesses. Consequently, a vast landscape of payment providers has developed, each with varying cost models, implementational specifications, and analytical capabilities.
-As a consequence, one might ask, which one(s) should I choose? Medusa makes exchanging enabled payment providers easy through its unified payment API. Here, one may select payment provider plugins already existing ([PayPal](https://docs.medusa-commerce.com/add-plugins/paypal), [Klarna](https://docs.medusa-commerce.com/add-plugins/klarna), and Stripe), or develop new ones.
+As a consequence, one might ask, which one(s) should I choose? Medusa makes exchanging enabled payment providers easy through its unified payment API. Here, one may select payment provider plugins already existing ([PayPal](https://docs.medusajs.com/add-plugins/paypal), [Klarna](https://docs.medusajs.com/add-plugins/klarna), and Stripe), or develop new ones.
Using the `medusa-payment-stripe` plugin, this guide will show you how to set up your Medusa project with Stripe as a payment provider.
@@ -18,7 +21,7 @@ Using the `medusa-payment-stripe` plugin, this guide will show you how to set up
### Prerequisites
-This guide assumes that you have set up a medusa project (See [this guide](https://docs.medusa-commerce.com/tutorial/creating-your-medusa-server)). Furthermore, this guide will be using the Gatsby starter as our storefront (See [this guide](https://docs.medusa-commerce.com/starters/gatsby-medusa-starter)) and the Admin panel to manage our store (See the github installation guide [here](https://github.com/medusajs/admin)).
+This guide assumes that you have set up a medusa project (See [this guide](https://docs.medusajs.com/tutorial/creating-your-medusa-server)). Furthermore, this guide will be using the Gatsby starter as our storefront (See [this guide](https://docs.medusajs.com/starters/gatsby-medusa-starter)) and the Admin panel to manage our store (See the github installation guide [here](https://github.com/medusajs/admin)).
### Installation
diff --git a/docs/content/advanced/backend/endpoints/add-admin.md b/docs/content/advanced/backend/endpoints/add-admin.md
new file mode 100644
index 0000000000..b04d18dcae
--- /dev/null
+++ b/docs/content/advanced/backend/endpoints/add-admin.md
@@ -0,0 +1,206 @@
+---
+title: Add Endpoint for Admin
+---
+
+# Add Endpoint for Admin
+
+In this document, you’ll learn how to add a custom endpoint in the Backend that you can use from the Admin.
+
+## Overview
+
+Custom endpoints reside under the `src/api` directory in your Medusa Backend. To define a new endpoint, you can add the file `index.js` under the `src/api` directory. This file should export a function that returns an Express router.
+
+Your endpoint can be under any path you wish. By Medusa’s conventions, all Admin REST APIs are prefixed by `/admin`. For example, the `/admin/products` lets you retrieve the products to display them on your Admin.
+
+## Implementation
+
+To create a new endpoint, start by creating a new file in `src/api` called `index.js`. At its basic format, `index.js` should look something like this:
+
+```js
+import { Router } from "express"
+
+export default () => {
+ const router = Router()
+
+ router.get("/admin/hello", (req, res) => {
+ res.json({
+ message: "Welcome to Your Store!"
+ })
+ })
+
+ return router
+}
+```
+
+This exports a function that returns an Express router. In that function, you can create one or more endpoints. In the example above, you create the endpoint `/admin/hello`.
+
+Now, if you run your server and send a request to `/admin/hello`, you will receive a JSON response message.
+
+> Custom endpoints are compiled into the `dist` directory of your Backend when you run your server using `medusa develop`, while it’s running, and when you run `npm run build`.
+
+## Accessing Endpoints from Admin
+
+If you’re customizing the admin dashboard or creating your own, you need to use the `cors` library. A `OPTIONS` request should be added for each route and handle the requests with the `cors` library.
+
+First, you need to import your Medusa’s configurations along with the `cors` library:
+
+```js
+import cors from "cors"
+import { projectConfig } from "../../medusa-config"
+```
+
+Then, create an object that will hold the CORS configurations:
+
+```js
+const corsOptions = {
+ origin: projectConfig.admin_cors.split(","),
+ credentials: true,
+}
+```
+
+Finally, for each route you add, create an `OPTIONS` request:
+
+```js
+router.options("/admin/hello", cors(corsOptions))
+router.get("/admin/hello", (req, res) => {
+ //...
+});
+```
+
+## Multiple Endpoints
+
+### Same File
+
+You can add more than one endpoints in `src/api/index.js`:
+
+```js
+router.get("/admin/hello", (req, res) => {
+ res.json({
+ message: "Welcome to Your Store!"
+ })
+})
+
+router.get("/admin/bye", (req, res) => {
+ res.json({
+ message: "Come back again!"
+ })
+})
+```
+
+### Multiple Files
+
+Alternatively, you can add multiple files for each endpoint or set of endpoints for readability and easy maintenance.
+
+To do that with the previous example, first, create the file `src/api/hello.js` with the following content:
+
+```js
+export default (router) => {
+ router.get("/admin/hello", (req, res) => {
+ res.json({
+ message: "Welcome to Your Store!"
+ })
+ })
+}
+```
+
+You export a function that receives an Express router as a parameter and adds the endpoint `admin/hello` to it.
+
+Next, create the file `src/api/bye.js` with the following content:
+
+```js
+export default (router) => {
+ router.get("/admin/bye", (req, res) => {
+ res.json({
+ message: "Come back again!"
+ })
+ })
+}
+```
+
+Again, you export a function that receives an Express router as a parameter and adds the endpoint `admin/bye` to it.
+
+Finally, in `src/api/index.js` import the two functions at the beginning of the file:
+
+```js
+import helloRoute from "./hello"
+import byeRoute from "./bye"
+```
+
+and in the exported function, call each of the functions passing them the Express router:
+
+```js
+export default () => {
+ const router = Router()
+
+ helloRoute(router)
+ byeRoute(router)
+
+ return router
+}
+```
+
+## Use Services
+
+Services in Medusa bundle a set of functionalities into one class. Then, you can use that class anywhere in your Backend. For example, you can use the `ProductService` to retrieve products or perform operations like creating or updating a product.
+
+You can retrieve any registered service in your endpoint using `req.scope.resolve` passing it the service’s registration name.
+
+Here’s an example of an endpoint that retrieves the count of products in your store:
+
+```js
+router.get('/admin/products/count', (req, res) => {
+ const productService = req.scope.resolve('productService')
+
+ productService
+ .count()
+ .then((count) => {
+ res.json({
+ count
+ })
+ })
+ })
+```
+
+The `productService` has a `count` method that returns a Promise. This Promise resolves to the count of the products. You return a JSON of the product count.
+
+## Protected Routes
+
+Protected routes are routes that should be accessible by logged-in users only.
+
+To make a route protected, first, import the `authenticate` middleware:
+
+```js
+import authenticate from '@medusajs/medusa/dist/api/middlewares/authenticate'
+```
+
+Then, add the middleware to your route:
+
+```js
+router.get('/store/products/count', authenticate(), (req, res) => {
+ //...
+})
+```
+
+Now, only authenticated users can access this endpoint.
+
+### Accessing Current User
+
+You can get the logged-in user ID using `req.user`:
+
+```js
+const id = req.user.userId
+```
+
+To get the user’s details, you can use the `userService`:
+
+```js
+const id = req.user.userId
+const userService = req.scope.resolve("userService")
+
+const user = await userService.retrieve(id)
+```
+
+## What’s Next 🚀
+
+- [Learn how to add an endpoint for the Storefront.](/advanced/backend/endpoints/add-storefront)
+- [Check out the API reference for all available endpoints.](https://docs.medusajs.com/api/admin)
diff --git a/docs/content/advanced/backend/endpoints/add-storefront.md b/docs/content/advanced/backend/endpoints/add-storefront.md
index 387fdc71f8..3fff09c195 100644
--- a/docs/content/advanced/backend/endpoints/add-storefront.md
+++ b/docs/content/advanced/backend/endpoints/add-storefront.md
@@ -173,4 +173,5 @@ const customer = await customerService.retrieve(id)
## What’s Next :rocket:
-- [Check out the API reference for all available endpoints.](https://docs.medusajs.com/api/store)
\ No newline at end of file
+- [Learn how to add an endpoint for the Admin.](/advanced/backend/endpoints/add-admin)
+- [Check out the API reference for all available endpoints.](https://docs.medusajs.com/api/store)
diff --git a/docs/content/advanced/backend/services/create-service.md b/docs/content/advanced/backend/services/create-service.md
new file mode 100644
index 0000000000..5615872889
--- /dev/null
+++ b/docs/content/advanced/backend/services/create-service.md
@@ -0,0 +1,107 @@
+---
+
+title: Create a Service
+
+---
+
+# Create a Service
+
+In this document, you’ll learn how you can create a service and use it across your Medusa server just like any of the core services.
+
+## Overview
+
+Services in Medusa represent bundled helper methods that you want to use across your server. By convention, they represent a certain entity or functionality in your server.
+
+For example, you can use Medusa’s `productService` to get the list of products, as well as perform other functionalities related to products. There’s also an `authService` that provides functionalities like authenticating customers and users.
+
+Custom services reside in the `src/services` directory of your Medusa Server installation. Each service should be a class that extends the `BaseService` class from `medusa-interfaces`.
+
+Each file you create in `src/services` should hold one service and export it.
+
+The file name is important as it determines the name of the service when you need to use it elsewhere. The name of the service will be registered as the camel-case version of the file name + `Service` at the end of the name.
+
+For example, if the file name is `hello.js`, the service will be registered as `helloService`. If the file name is `hello-world.js`, the service name will be registered as `helloWorldService`.
+
+The registration name of the service is important, as you’ll be referring to it when you want to get access to the service using dependency injection or in routes.
+
+## Implementation
+
+To create a service, you should create a JavaScript file in `src/services` to hold the service. The name of the file should be the registration name of the service without `Service` as it will be appended to it by default.
+
+For example, if you want to create a service `helloService`, create the file `hello.js` in `src/services` with the following content:
+
+```js
+import { BaseService } from "medusa-interfaces";
+
+class HelloService extends BaseService {
+ getMessage() {
+ return `Welcome to My Store!`
+ }
+}
+
+export default HelloService;
+```
+
+## Service Constructor
+
+As the service extends the `BaseService` class, all services in Medusa’s core, as well as all your custom services, will be available in your service’s constructor using dependency injection.
+
+So, if you want your service to use another service, simply add it as part of your constructor’s dependencies and set it to a field inside your service’s class:
+
+```js
+productService;
+
+constructor({ productService }) {
+ super();
+ this.productService = productService;
+}
+```
+
+Then, you can use that service anywhere in your custom service:
+
+```js
+async getProductCount() {
+ return await this.productService.count();
+}
+```
+
+## Using your Custom Service
+
+You can use your custom service throughout your Medusa server just like you would use any of the core services.
+
+### In a Service
+
+To use your custom service in another custom service, you can have easy access to it in the dependencies injected to the constructor of your service:
+
+```js
+constructor({ helloService }) {
+ super();
+ this.helloService = helloService;
+}
+```
+
+### In an Endpoint
+
+To use your custom service in an endpoint, you can use `req.scope.resolve` passing it the service’s registration name:
+
+```js
+const helloService = req.scope.resolve('helloService');
+
+res.json({
+ message: helloService.getMessage()
+})
+```
+
+### In a Subscriber
+
+To use your custom service in a subscriber, you can have easy access to it in the subscriber’s dependencies injected to the constructor of your subscriber:
+
+```js
+constructor({ helloService, eventBusService }) {
+ this.helloService = helloService;
+}
+```
+
+## What’s Next 🚀
+
+- [Learn How to Create an Endpoint.](/advanced/backend/endpoints/add-storefront)
diff --git a/docs/content/homepage.mdx b/docs/content/homepage.mdx
index 7f6b178b00..65950a1444 100644
--- a/docs/content/homepage.mdx
+++ b/docs/content/homepage.mdx
@@ -1,6 +1,6 @@
---
id: homepage
-title: Introduction
+title: Overview
description: 'What is Medusa?'
slug: /
hide_table_of_contents: true
@@ -15,6 +15,14 @@ Medusa is an open-source Shopify alternative.
It provides you with the primitives to create amazing digital commerce experiences.
+## Architecture overview
+
+Medusa is composed of 3 components: The headless backend, the admin dashboard, and the storefront.
+
+You can learn more about Medusa's architecture in [our introduction](/introduction).
+
+
+
diff --git a/docs/content/how-to/deploying-on-heroku.md b/docs/content/how-to/deploying-on-heroku.md
index ab6851d217..4f2dde1191 100644
--- a/docs/content/how-to/deploying-on-heroku.md
+++ b/docs/content/how-to/deploying-on-heroku.md
@@ -6,7 +6,11 @@ title: "Deploying on Heroku"
This is a guide for deploying a Medusa project on Heroku. Heroku is at PaaS that allows you to easily deploy your applications in the cloud.
-https://user-images.githubusercontent.com/59018053/154798681-37060f13-5248-47c5-97c5-81c06da301d4.mp4
+
+
+
> We assume, that you are currently running a local instance of Medusa. If not, check out our [Quickstart](https://docs.medusajs.com/quickstart/quick-start) or use `npx create-medusa-app` to set up your application in a matter of minutes. For the latter, see [this guide](https://docs.medusajs.com/how-to/create-medusa-app) for a small walkthrough.
diff --git a/docs/content/how-to/making-your-store-more-powerful-with-contentful.md b/docs/content/how-to/making-your-store-more-powerful-with-contentful.md
index b60a8a9ba7..9eced2a235 100644
--- a/docs/content/how-to/making-your-store-more-powerful-with-contentful.md
+++ b/docs/content/how-to/making-your-store-more-powerful-with-contentful.md
@@ -4,7 +4,7 @@ title: Making your store more powerful with Contentful
# Making your store more powerful with Contentful
-In [part 1](https://docs.medusajs.com/how-to/headless-ecommerce-store-with-gatsby-contentful-medusa/) of this series you have set up [Medusa](https://medusa-commerce.com) with Contentful as your CMS system and added a Gatsby storefront. In this part you will get a further introduction to Contentful and learn how [`medusa-plugin-contentful`](https://github.com/medusajs/medusa/tree/master/packages/medusa-plugin-contentful) can be leveraged to make your store more powerful. Apart from a front page, product pages and a checkout flow, most ecommerce stores also need miscalleneous pages like About and Contact pages. In this guide you will add a Rich Text content module to your Contentful space so that you can make this pages cool. You will also see how the content modules can be used to give your product pages more life.
+In [part 1](https://docs.medusajs.com/how-to/headless-ecommerce-store-with-gatsby-contentful-medusa/) of this series you have set up [Medusa](https://medusajs.com) with Contentful as your CMS system and added a Gatsby storefront. In this part you will get a further introduction to Contentful and learn how [`medusa-plugin-contentful`](https://github.com/medusajs/medusa/tree/master/packages/medusa-plugin-contentful) can be leveraged to make your store more powerful. Apart from a front page, product pages and a checkout flow, most ecommerce stores also need miscalleneous pages like About and Contact pages. In this guide you will add a Rich Text content module to your Contentful space so that you can make this pages cool. You will also see how the content modules can be used to give your product pages more life.
What you will do in this guide:
diff --git a/docs/content/how-to/uploading-images-to-minio.md b/docs/content/how-to/uploading-images-to-minio.md
index 180c7e0177..0bbb77a687 100644
--- a/docs/content/how-to/uploading-images-to-minio.md
+++ b/docs/content/how-to/uploading-images-to-minio.md
@@ -4,7 +4,7 @@ In order to work with images in Medusa, you need a file service plugin responsib
### Before you start
-At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusa-commerce.com/tutorial/set-up-your-development-environment) for setting up your local environment.
+At this point, you should have an instance of our store engine running. If not, we have a [full guide](https://docs.medusajs.com/tutorial/set-up-your-development-environment) for setting up your local environment.
### Set up MinIO
diff --git a/docs/content/introduction.md b/docs/content/introduction.md
new file mode 100644
index 0000000000..c86212baac
--- /dev/null
+++ b/docs/content/introduction.md
@@ -0,0 +1,29 @@
+---
+
+title: Introduction
+
+---
+
+## Architecture overview
+
+Medusa is composed of 3 components: The headless backend, the admin dashboard, and the storefront.
+
+
+
+### Headless Backend
+
+This is the main component that holds all the logic and data of the store. Your admin dashboard and storefront interact with the backend to retrieve, create, and modify data through REST APIs.
+
+Your Medusa server will include all functionalities related to your store’s checkout workflow. That includes cart management, shipping and payment providers, user management, and more. It also allows you to configure your store including your store’s region, tax rules, discounts, gift cards, and more.
+
+### Admin Dashboard
+
+The admin dashboard is accessible by store operators. Store operators can use the admin dashboard to view, create, and modify data such as orders and products.
+
+Medusa provides a beautiful [admin dashboard](https://demo.medusajs.com) that you can use right off the bat. Our admin dashboard provides a lot of functionalities to manage your store including Order management, product management, user management and more.
+
+ You can also create your own admin dashboard by utilizing the [Admin REST APIs](https://docs.medusajs.com/api/admin/auth).
+
+### Storefront
+
+Your customers use the Storefront to view products and make orders. Medusa provides 2 storefronts, one built with [Next.js](https://docs.medusajs.com/starters/nextjs-medusa-starter) and one with [Gatsby](https://docs.medusajs.com/starters/gatsby-medusa-starter). You are also free to create your own storefront using the [Storefront REST APIs](https://docs.medusajs.com/api/store/auth).
diff --git a/docs/content/starters/gatsby-medusa-starter.md b/docs/content/starters/gatsby-medusa-starter.md
index 302c06eaae..c60b29d3d4 100644
--- a/docs/content/starters/gatsby-medusa-starter.md
+++ b/docs/content/starters/gatsby-medusa-starter.md
@@ -35,9 +35,9 @@ Edit `src/pages/index.js` to see your site update in real-time!
**Learn more about Medusa**
-- [Website](https://www.medusa-commerce.com/)
+- [Website](https://www.medusajs.com/)
- [GitHub](https://github.com/medusajs)
-- [Documentation](https://docs.medusa-commerce.com/)
+- [Documentation](https://docs.medusajs.com/)
**Learn more about Gatsby**
diff --git a/docs/content/starters/nextjs-medusa-starter.md b/docs/content/starters/nextjs-medusa-starter.md
index b9d3e61619..9b5d9704f2 100644
--- a/docs/content/starters/nextjs-medusa-starter.md
+++ b/docs/content/starters/nextjs-medusa-starter.md
@@ -35,9 +35,9 @@ Edit `src/pages/index.js` to see your site update in real-time!
**Learn more about Medusa**
-- [Website](https://www.medusa-commerce.com/)
+- [Website](https://www.medusajs.com/)
- [GitHub](https://github.com/medusajs)
-- [Documentation](https://docs.medusa-commerce.com/)
+- [Documentation](https://docs.medusajs.com/)
**Learn more about Next.js**
diff --git a/docs/content/tutorial/0-set-up-your-development-environment.md b/docs/content/tutorial/0-set-up-your-development-environment.md
index fe0ff27c8e..6530ac18b8 100644
--- a/docs/content/tutorial/0-set-up-your-development-environment.md
+++ b/docs/content/tutorial/0-set-up-your-development-environment.md
@@ -111,7 +111,7 @@ It is not important which editor you use as long as you feel comfortable working
As the final step in this part of the tutorial you should create a Medusa Cloud account. Medusa Cloud is the platform that works with Medusa; the platform is where you view and manage your store, but is also a key part of the development process as you will be linking your local project to the platform so that you can manage your store while in development.
-[Sign up for Medusa Cloud](https://app.medusa-commerce.com) -->
+[Sign up for Medusa Cloud](https://app.medusajs.com) -->
## Summary
diff --git a/docs/content/tutorial/3-linking-your-local-project-with-medusa-cloud.md b/docs/content/tutorial/3-linking-your-local-project-with-medusa-cloud.md
index b21280186c..2438934c47 100644
--- a/docs/content/tutorial/3-linking-your-local-project-with-medusa-cloud.md
+++ b/docs/content/tutorial/3-linking-your-local-project-with-medusa-cloud.md
@@ -40,7 +40,7 @@ The `link` command will first check that you have authenticated your CLI which w
You should note that the `--develop` flag is optional for the `link` command. If provided it tells the CLI to start up your server after linking is completed; you may leave it out if you'd rather start your server separately.
-> Note: For local linking to work you must make sure to have your CORS settings configured correctly. This is done by adding `https://app.medusa-commerce.com` to your `cors_admin` config in `medusa-config.js`.
+> Note: For local linking to work you must make sure to have your CORS settings configured correctly. This is done by adding `https://app.medusajs.com` to your `cors_admin` config in `medusa-config.js`.
> Note: If you change the port that your local server is running on you will have to run `medusa link` again. `medusa link` uses your `PORT` environment variable to specify where Medusa Cloud should look for your local server.
diff --git a/packages/gatsby-source-medusa/README.md b/packages/gatsby-source-medusa/README.md
index 5cd1fb9977..aaf4e9d0d4 100644
--- a/packages/gatsby-source-medusa/README.md
+++ b/packages/gatsby-source-medusa/README.md
@@ -1,5 +1,5 @@