diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index 891a86a516..4577d20245 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -108,100 +108,166 @@ tags: sessions. - name: App description: App endpoints that allow handling apps in Medusa. - x-resourceId: OAuth - name: Batch Job description: Batch Job endpoints that allow handling batch jobs in Medusa. - x-resourceId: batch_job - name: Claim description: Claim endpoints that allow handling claims in Medusa. - x-resourceId: claim_order - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Customer Group description: Customer Group endpoints that allow handling customer groups in Medusa. - x-resourceId: customer_group - name: Discount description: Discount endpoints that allow handling discounts in Medusa. - x-resourceId: discount - name: Discount Condition description: >- Discount Condition endpoints that allow handling discount conditions in Medusa. - x-resourceId: discount_condition - name: Draft Order description: Draft Order endpoints that allow handling draft orders in Medusa. - x-resourceId: draft-order - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Invite description: Invite endpoints that allow handling invites in Medusa. - x-resourceId: invite - name: Note description: Note endpoints that allow handling notes in Medusa. - x-resourceId: note - name: Notification description: Notification endpoints that allow handling notifications in Medusa. - x-resourceId: notification - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Price List description: Price List endpoints that allow handling price lists in Medusa. - x-resourceId: price_list - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Tag description: Product Tag endpoints that allow handling product tags in Medusa. - x-resourceId: product_tag - name: Product Type description: Product Types endpoints that allow handling product types in Medusa. - x-resourceId: product_type - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Sales Channel description: Sales Channel endpoints that allow handling sales channels in Medusa. - x-resourceId: sales_channel - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Shipping Profile description: >- Shipping Profile endpoints that allow handling shipping profiles in Medusa. - x-resourceId: shipping_profile - name: Store description: Store endpoints that allow handling stores in Medusa. - x-resourceId: store - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap - name: Tax Rate description: Tax Rate endpoints that allow handling tax rates in Medusa. - x-resourceId: tax_rate - name: Upload description: Upload endpoints that allow handling uploads in Medusa. - name: User description: User endpoints that allow handling users in Medusa. - x-resourceId: user servers: - url: 'https://api.medusa-commerce.com/admin' paths: + /apps/authorizations: + post: + operationId: PostApps + summary: Generate Token for App + description: Generates a token for an application. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostAppsReq' + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/apps/authorizations' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "application_name": "example", + "state": "ready", + "code": "token" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + apps: + $ref: '#/components/schemas/OAuth' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /apps: + get: + operationId: GetApps + summary: List Applications + description: Retrieve a list of applications. + x-authenticated: true + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/apps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + apps: + type: array + items: + $ref: '#/components/schemas/OAuth' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /auth: post: operationId: PostAuth @@ -259,7 +325,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -356,7 +422,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -419,7 +485,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -482,7 +548,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -505,42 +571,7 @@ paths: content: application/json: schema: - type: object - required: - - type - - context - properties: - type: - type: string - description: The type of batch job to start. - example: product-export - context: - type: object - description: >- - Additional infomration regarding the batch to be used for - processing. - example: - shape: - prices: - - region: null - currency_code: eur - dynamicImageColumnCount: 4 - dynamicOptionColumnCount: 2 - list_config: - skip: 0 - take: 50 - order: - created_at: DESC - relations: - - variants - - variant.prices - - images - dry_run: - type: boolean - description: >- - Set a batch job in dry_run mode to get some information on - what will be done without applying any modifications. - default: false + $ref: '#/components/schemas/AdminPostBatchesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -587,7 +618,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -880,7 +911,7 @@ paths: batch_jobs: type: array items: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' count: type: integer description: The total number of items available @@ -952,7 +983,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -982,16 +1013,7 @@ paths: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + $ref: '#/components/schemas/AdminPostProductsToCollectionReq' x-codeSamples: - lang: Shell label: cURL @@ -1022,7 +1044,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1051,18 +1073,7 @@ paths: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: >- - An array of Product IDs to remove from the Product - Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + $ref: '#/components/schemas/AdminDeleteProductsFromCollectionReq' x-codeSamples: - lang: Shell label: cURL @@ -1127,23 +1138,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCollectionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1189,7 +1184,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1347,7 +1342,7 @@ paths: collections: type: array items: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' count: type: integer description: The total number of items available @@ -1490,7 +1485,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1519,21 +1514,7 @@ paths: content: application/json: schema: - type: object - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCollectionsCollectionReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1579,7 +1560,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1662,7 +1643,7 @@ paths: currencies: type: array items: - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' count: type: integer description: The total number of items available @@ -1689,11 +1670,7 @@ paths: content: application/json: schema: - type: object - properties: - includes_tax: - type: boolean - description: '[EXPERIMENTAL] Tax included in prices of currency.' + $ref: '#/components/schemas/AdminPostCurrenciesCurrencyReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1736,7 +1713,7 @@ paths: type: object properties: currency: - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' '/customer-groups/{id}/customers/batch': post: operationId: PostCustomerGroupsGroupCustomersBatch @@ -1754,20 +1731,8 @@ paths: content: application/json: schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to add - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string + $ref: >- + #/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -1822,7 +1787,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -1851,20 +1816,8 @@ paths: content: application/json: schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to remove - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string + $ref: >- + #/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -1919,7 +1872,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -1984,7 +1937,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -2172,7 +2125,7 @@ paths: customer_groups: type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' count: type: integer description: The total number of items available @@ -2331,7 +2284,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -2360,14 +2313,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: Name of the customer group - type: string - metadata: - description: Metadata for the customer. - type: object + $ref: '#/components/schemas/AdminPostCustomerGroupsGroupReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2413,7 +2359,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -2478,7 +2424,7 @@ paths: customers: type: array items: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' count: type: integer description: The total number of items available @@ -2500,115 +2446,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /apps/authorizations: - post: - operationId: PostApps - summary: Generate Token for App - description: Generates a token for an application. - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - 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. - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/apps/authorizations' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "application_name": "example", - "state": "ready", - "code": "token" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - App - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - apps: - $ref: '#/components/schemas/OAuth' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /apps: - get: - operationId: GetApps - summary: List Applications - description: Retrieve a list of applications. - x-authenticated: true - x-codeSamples: - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/apps' \ - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - App - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - apps: - type: array - items: - $ref: '#/components/schemas/OAuth' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' /customers: post: operationId: PostCustomers @@ -2619,35 +2456,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - first_name - - last_name - - password - properties: - email: - type: string - description: The customer's email. - format: email - first_name: - type: string - description: The customer's first name. - last_name: - type: string - description: The customer's last name. - password: - type: string - description: The customer's password. - format: password - phone: - type: string - description: The customer's phone number. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCustomersReq' tags: - Customer x-codeSamples: @@ -2699,7 +2508,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2779,7 +2588,7 @@ paths: customers: type: array items: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' count: type: integer description: The total number of items available @@ -2861,7 +2670,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2900,40 +2709,7 @@ paths: content: application/json: schema: - type: object - properties: - email: - type: string - description: The Customer's email. - format: email - first_name: - type: string - description: The Customer's first name. - last_name: - type: string - description: The Customer's last name. - phone: - type: string - description: The Customer's phone number. - password: - type: string - description: The Customer's password. - format: password - groups: - type: array - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - description: A list of customer groups to which the customer belongs. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCustomersCustomerReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2979,7 +2755,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -3048,7 +2824,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3118,7 +2894,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3168,20 +2944,8 @@ paths: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be added to the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + #/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -3229,7 +2993,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3278,20 +3042,8 @@ paths: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be deleted from the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + #/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -3339,7 +3091,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3386,49 +3138,7 @@ paths: content: application/json: schema: - type: object - required: - - operator - properties: - operator: - description: Operator of the condition - type: string - enum: - - in - - not_in - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditions' x-codeSamples: - lang: JavaScript label: JS Client @@ -3476,7 +3186,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3512,144 +3222,7 @@ paths: content: application/json: schema: - type: object - required: - - code - - rule - - regions - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - is_dynamic: - type: boolean - description: >- - Whether the Discount should have multiple instances of - itself, each with a different code. This can be useful for - automatically generated codes that all have to follow a - common set of rules. - default: false - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - type - - value - - allocation - properties: - description: - type: string - description: A short description of the discount - type: - type: string - description: >- - The type of the Discount, can be `fixed` for discounts - that reduce the price by a fixed amount, `percentage` - for percentage reductions or `free_shipping` for - shipping vouchers. - enum: - - fixed - - percentage - - free_shipping - value: - type: number - description: >- - The value that the discount represents; this will depend - on the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, - and `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is - applied on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is - applied on product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is - applied on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will - have to enable it later to make it available to Customers. - default: false - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - usage_limit: - type: number - description: Maximum times the discount can be used - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostDiscountsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3670,7 +3243,7 @@ paths: value: 10, allocation: AllocationType.ITEM }, - regions: ['reg_XXXXXXXX'], + regions: ["reg_XXXXXXXX"], is_dynamic: false, is_disabled: false }) @@ -3695,7 +3268,7 @@ paths: "value": 10, "allocation": "item" }, - "regions": ['reg_XXXXXXXX'] + "regions": ["reg_XXXXXXXX"] }' security: - api_token: [] @@ -3711,7 +3284,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3826,7 +3399,7 @@ paths: discounts: type: array items: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' count: type: integer description: The total number of items available @@ -3910,7 +3483,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4024,7 +3597,7 @@ paths: default: true discount: description: The Discount to which the condition used to belong - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4103,7 +3676,7 @@ paths: type: object properties: discount_condition: - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' '400': $ref: '#/components/responses/400_error' '401': @@ -4155,41 +3728,8 @@ paths: content: application/json: schema: - type: object - properties: - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: >- + #/components/schemas/AdminPostDiscountsDiscountConditionsCondition x-codeSamples: - lang: JavaScript label: JS Client @@ -4240,7 +3780,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4384,7 +3924,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4429,122 +3969,7 @@ paths: content: application/json: schema: - type: object - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - id - properties: - id: - type: string - description: The ID of the Rule - description: - type: string - description: A short description of the discount - value: - type: number - description: >- - The value that the discount represents; this will depend - on the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, - and `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - id: - type: string - description: The ID of the Rule - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is - applied on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is - applied on product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is - applied on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - 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 - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - usage_limit: - type: number - description: Maximum times the discount can be used - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - metadata: - description: An object containing metadata of the discount - type: object + $ref: '#/components/schemas/AdminPostDiscountsDiscountReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4590,7 +4015,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4659,7 +4084,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4732,7 +4157,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4755,106 +4180,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - items - - region_id - - shipping_methods - properties: - status: - description: The status of the draft order - type: string - enum: - - open - - completed - email: - description: The email of the customer of the draft order - type: string - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - items: - description: The Line Items that have been received. - type: array - items: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line - Item from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details - about the Line Item. - type: object - region_id: - description: The ID of the region for the draft order - type: string - discounts: - description: The discounts to add on the draft order - type: array - items: - type: object - required: - - code - properties: - code: - description: The code of the discount to apply - type: string - customer_id: - description: The ID of the customer to add on the draft order - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - shipping_methods: - description: The shipping methods for the draft order - type: array - items: - type: object - required: - - option_id - properties: - option_id: - description: The ID of the shipping option in use - type: string - data: - description: >- - The optional additional data needed for the shipping - method - type: object - price: - description: The potential custom price of the shipping - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Draft Order. - type: object + $ref: '#/components/schemas/AdminPostDraftOrdersReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4922,7 +4248,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -4999,7 +4325,7 @@ paths: draft_orders: type: array items: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' count: type: integer description: The total number of items available @@ -5038,30 +4364,7 @@ paths: content: application/json: schema: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line Item - from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - default: Custom item - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -5107,7 +4410,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5241,7 +4544,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5311,7 +4614,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5346,22 +4649,8 @@ paths: content: application/json: schema: - type: object - properties: - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object + $ref: >- + #/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq x-codeSamples: - lang: JavaScript label: JS Client @@ -5408,7 +4697,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5471,7 +4760,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5501,51 +4790,7 @@ paths: content: application/json: schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Draft Order in. - country_code: - type: string - description: The 2 character ISO code for the Country. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Draft Order. - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - discounts: - description: An array of Discount codes to add to the Draft Order. - type: array - items: - type: object - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - customer_id: - description: The ID of the Customer to associate the Draft Order with. - type: string + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -5591,7 +4836,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5616,34 +4861,7 @@ paths: content: application/json: schema: - type: object - required: - - region_id - properties: - value: - type: integer - description: >- - The value (excluding VAT) that the Gift Card should - represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have - to enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: >- - The time at which the Gift Card should no longer be - available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostGiftCardsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -5689,7 +4907,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '401': @@ -5764,7 +4982,7 @@ paths: gift_cards: type: array items: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' count: type: integer description: The total number of items available @@ -5907,7 +5125,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '401': @@ -5938,32 +5156,7 @@ paths: content: application/json: schema: - type: object - properties: - balance: - type: integer - description: >- - The value (excluding VAT) that the Gift Card should - represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have - to enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: >- - The time at which the Gift Card should no longer be - available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostGiftCardsGiftCardReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6009,7 +5202,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '401': @@ -6031,32 +5224,7 @@ paths: content: application/json: schema: - type: object - 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 - format: password + $ref: '#/components/schemas/AdminPostInvitesInviteAcceptReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6132,22 +5300,7 @@ paths: content: application/json: schema: - type: object - required: - - user - - role - properties: - user: - description: The email for the user to be created. - type: string - format: email - role: - description: The role of the user to be created. - type: string - enum: - - admin - - member - - developer + $ref: '#/components/schemas/AdminPostInvitesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6249,7 +5402,7 @@ paths: invites: type: array items: - $ref: '#/components/schemas/invite' + $ref: '#/components/schemas/Invite' '400': $ref: '#/components/responses/400_error' '401': @@ -6404,21 +5557,7 @@ paths: content: application/json: schema: - type: object - required: - - resource_id - - resource_type - - value - properties: - resource_id: - type: string - description: The ID of the resource which the Note relates to. - resource_type: - type: string - description: The type of resource which the Note relates to. - value: - type: string - description: The content of the Note to create. + $ref: '#/components/schemas/AdminPostNotesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6468,7 +5607,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6541,7 +5680,7 @@ paths: notes: type: array items: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' count: type: integer description: The total number of items available @@ -6684,7 +5823,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6713,13 +5852,7 @@ paths: content: application/json: schema: - type: object - required: - - value - properties: - value: - type: string - description: The updated description of the Note. + $ref: '#/components/schemas/AdminPostNotesNoteReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6765,7 +5898,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6878,7 +6011,7 @@ paths: notifications: type: array items: - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' '400': $ref: '#/components/responses/400_error' '401': @@ -6910,13 +6043,7 @@ paths: content: application/json: schema: - type: object - properties: - to: - description: >- - A new address or user identifier that the Notification - should be sent to - type: string + $ref: '#/components/schemas/AdminPostNotificationsNotificationResendReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6954,7 +6081,7 @@ paths: type: object properties: notification: - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' '400': $ref: '#/components/responses/400_error' '401': @@ -6983,22 +6110,7 @@ paths: content: application/json: schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the variant ID to add - type: string - quantity: - description: The quantity to add - type: number - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsReq' x-authenticated: true x-codeSamples: - lang: JavaScript @@ -7012,8 +6124,8 @@ paths: // must be previously logged in or use api token medusa.admin.orderEdits.addLineItem(order_edit_id, { - variant_id, - quantity + variant_id, + quantity }) .then(({ order_edit }) => { @@ -7045,7 +6157,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7107,7 +6219,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7165,7 +6277,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7183,16 +6295,7 @@ paths: content: application/json: schema: - type: object - required: - - order_id - properties: - order_id: - description: The ID of the order to create the edit for. - type: string - internal_note: - description: An optional note to create for the order edit. - type: string + $ref: '#/components/schemas/AdminPostOrderEditsReq' x-authenticated: true x-codeSamples: - lang: JavaScript @@ -7235,7 +6338,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7323,7 +6426,7 @@ paths: properties: order_edits: type: array - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' count: type: integer description: The total number of items available @@ -7400,7 +6503,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7435,13 +6538,7 @@ paths: content: application/json: schema: - type: object - required: - - quantity - properties: - quantity: - description: The quantity to update - type: number + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -7485,7 +6582,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7686,7 +6783,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7715,11 +6812,7 @@ paths: content: application/json: schema: - type: object - properties: - internal_note: - description: An optional note to create or update for the order edit. - type: string + $ref: '#/components/schemas/AdminPostOrderEditsOrderEditReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -7764,7 +6857,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7826,7 +6919,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7898,7 +6991,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7986,7 +7079,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8056,7 +7149,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8133,7 +7226,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8210,7 +7303,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8280,7 +7373,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8346,7 +7439,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8416,7 +7509,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8479,7 +7572,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8542,7 +7635,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8578,18 +7671,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8636,7 +7718,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8666,126 +7748,7 @@ paths: content: application/json: schema: - type: object - required: - - type - - claim_items - properties: - type: - description: >- - The type of the Claim. This will determine how the Claim is - treated: `replace` Claims will result in a Fulfillment with - new items being created, while a `refund` Claim will refund - the amount paid for the claimed items. - type: string - enum: - - replace - - refund - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: string - images: - description: >- - A list of image URL's that will be associated with the - Claim - items: - type: string - return_shipping: - description: >- - Optional details for the Return Shipping Method, if the - items are to be sent back. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: >- - The new items to send to the Customer when the Claim type is - Replace. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - shipping_address: - type: object - description: >- - An optional shipping address to send the claim to. Defaults - to the parent order's shipping address - $ref: '#/components/schemas/address' - refund_amount: - description: >- - The amount to refund the Customer when the Claim type is - `refund`. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8843,7 +7806,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8875,34 +7838,7 @@ paths: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items to include in the Fulfillment. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of Line Item to fulfill. - type: string - quantity: - description: The quantity of the Line Item to fulfill. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderFulfillmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8958,7 +7894,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8988,23 +7924,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Shipment. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderShipmentReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9050,7 +7970,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9086,23 +8006,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be sent related to this - Claim. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9149,7 +8053,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9181,85 +8085,7 @@ paths: content: application/json: schema: - type: object - 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. - type: string - quantity: - description: The number of items that will be returned - type: integer - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - return_shipping: - description: How the Swap will be returned. - type: object - required: - - option_id - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - 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. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - custom_shipping_options: - description: >- - The custom shipping options to potentially create a Shipping - Method from. - type: array - items: - required: - - option_id - - price - properties: - option_id: - description: >- - The ID of the Shipping Option to override with a - custom price. - type: string - price: - description: The custom price of the Shipping Option. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - allow_backorder: - description: 'If true, swaps can be completed with items out of stock' - type: boolean - default: true + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9315,7 +8141,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9351,18 +8177,8 @@ paths: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + #/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -9401,7 +8217,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9437,18 +8253,8 @@ paths: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + #/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -9487,7 +8293,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9550,7 +8356,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9579,71 +8385,7 @@ paths: content: application/json: schema: - type: object - properties: - email: - description: the email for the order - type: string - billing_address: - description: Billing address - anyOf: - - $ref: '#/components/schemas/address_fields' - shipping_address: - description: Shipping address - anyOf: - - $ref: '#/components/schemas/address_fields' - items: - description: The Line Items for the order - type: array - items: - $ref: '#/components/schemas/line_item' - region: - description: ID of the region where the order belongs - type: string - discounts: - description: Discounts applied to the order - type: array - items: - $ref: '#/components/schemas/discount' - customer_id: - description: ID of the customer - type: string - payment_method: - description: payment method chosen for the order - 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 - items: - $ref: '#/components/schemas/line_item' - description: Items to ship - no_notification: - description: >- - A flag to indicate if no notifications should be emitted - related to the updated order. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9689,7 +8431,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9961,7 +8703,7 @@ paths: orders: type: array items: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' count: type: integer description: The total number of items available @@ -10043,7 +8785,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -10073,25 +8815,7 @@ paths: content: application/json: schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Refund. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderRefundsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10139,7 +8863,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -10171,61 +8895,7 @@ paths: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items that will be returned. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - return_shipping: - description: >- - The Shipping Method to be used to handle the return - shipment. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - note: - description: An optional note with information about the Return. - type: string - receive_now: - description: >- - A flag to indicate if the Return should be registerd as - received immediately. - type: boolean - default: false - no_notification: - description: >- - A flag to indicate if no notifications should be emitted - related to the requested Return. - type: boolean - refund: - description: The amount to refund. - type: integer + $ref: '#/components/schemas/AdminPostOrdersOrderReturnsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10282,7 +8952,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -10318,96 +8988,7 @@ paths: content: application/json: schema: - type: object - properties: - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - id - - images - - tags - properties: - id: - description: The ID of the Claim Item. - type: string - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: object - properties: - id: - type: string - description: Tag ID - value: - type: string - description: Tag value - images: - description: >- - A list of image URL's that will be associated with the - Claim - type: array - items: - type: object - properties: - id: - type: string - description: Image ID - url: - type: string - description: Image URL - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10453,7 +9034,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -10587,7 +9168,7 @@ paths: type: object properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -10616,18 +9197,7 @@ paths: content: application/json: schema: - type: object - properties: - description: - description: >- - An optional description to create or update the payment - collection. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminUpdatePaymentCollectionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10672,7 +9242,7 @@ paths: type: object properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -10734,7 +9304,7 @@ paths: type: object properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -10797,7 +9367,7 @@ paths: type: object properties: payment: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' '400': $ref: '#/components/responses/400_error' '401': @@ -10860,7 +9430,7 @@ paths: type: object properties: payment: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' '400': $ref: '#/components/responses/400_error' '401': @@ -10890,20 +9460,7 @@ paths: content: application/json: schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string + $ref: '#/components/schemas/AdminPostPaymentRefundsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10953,7 +9510,7 @@ paths: type: object properties: refund: - $ref: '#/components/schemas/refund' + $ref: '#/components/schemas/Refund' '400': $ref: '#/components/responses/400_error' '401': @@ -10983,50 +9540,7 @@ paths: content: application/json: schema: - type: object - properties: - prices: - description: The prices to update or add. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - override: - description: >- - If true the prices will replace all existing prices - associated with the Price List. - type: boolean + $ref: '#/components/schemas/AdminPostPriceListPricesPricesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11084,7 +9598,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11115,13 +9629,7 @@ paths: content: application/json: schema: - type: object - properties: - price_ids: - description: The price id's of the Money Amounts to delete. - type: array - items: - type: string + $ref: '#/components/schemas/AdminDeletePriceListPricesPricesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11205,88 +9713,7 @@ paths: content: application/json: schema: - type: object - required: - - name - - description - - type - - prices - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - variant_id: - description: The ID of the Variant for which the price is used. - type: string - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: '#/components/schemas/AdminPostPriceListsPriceListReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11352,7 +9779,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11550,7 +9977,7 @@ paths: price_lists: type: array items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' count: type: integer description: The total number of items available @@ -11693,7 +10120,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11722,86 +10149,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: '#/components/schemas/AdminPostPriceListsPriceListPriceListReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11847,7 +10195,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -12246,7 +10594,7 @@ paths: products: type: array items: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' count: type: integer description: The total number of items available @@ -12401,7 +10749,7 @@ paths: type: object properties: product_tags: - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' count: type: integer description: The total number of items available @@ -12556,7 +10904,7 @@ paths: type: object properties: product_types: - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' count: type: integer description: The total number of items available @@ -12595,15 +10943,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: >- - The title the Product Option will be identified by i.e. - "Size" - type: string + $ref: '#/components/schemas/AdminPostProductsProductOptionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -12649,7 +10989,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -12672,244 +11012,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - is_giftcard: - description: >- - A flag to indicate if the Product represents a Gift Card. - Purchasing Products with this flag set to `true` will result - in a Gift Card being created. - type: boolean - default: false - discountable: - description: >- - A flag to indicate if discounts can be applied to the - LineItems generated from this Product - type: boolean - default: true - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - default: draft - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: 'The value of the Tag, these will be upserted.' - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - options: - description: >- - The Options that the Product should have. These define on - which properties the Product's Product Variants will differ. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Option by. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out - of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for - this Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - region_id: - description: >- - The ID of the Region for which the price is - used. Only required if currency_code is not - provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id - is not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - value - properties: - value: - description: >- - The value to give for the Product Option at the - same index in the Product's `options` field. - type: string - weight: - description: The weight of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -12957,7 +11060,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13172,6 +11275,11 @@ paths: the result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -13211,7 +11319,7 @@ paths: products: type: array items: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' count: type: integer description: The total number of items available @@ -13252,117 +11360,7 @@ paths: content: application/json: schema: - type: object - required: - - title - - prices - - options - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: '#/components/schemas/AdminPostProductsProductVariantsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -13433,7 +11431,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13504,7 +11502,7 @@ paths: variants: type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' count: type: integer description: The total number of items available @@ -13597,7 +11595,7 @@ paths: description: Whether or not the items were deleted. default: true product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13632,13 +11630,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product Option - type: string + $ref: '#/components/schemas/AdminPostProductsProductOptionsOption' x-codeSamples: - lang: JavaScript label: JS Client @@ -13684,7 +11676,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13818,7 +11810,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13847,225 +11839,7 @@ paths: content: application/json: schema: - type: object - properties: - title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - discountable: - description: >- - A flag to indicate if discounts can be applied to the - LineItems generated from this Product - type: boolean - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: 'The value of the Tag, these will be upserted.' - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - properties: - id: - description: The ID of the Product Variant. - type: string - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out - of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for - this Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the Price. - type: string - region_id: - description: >- - The ID of the Region for which the price is - used. Only required if currency_code is not - provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id - is not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Option. - type: string - value: - description: >- - The value to give for the Product Option at the - same index in the Product's `options` field. - type: string - weight: - description: The wieght of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostProductsProductReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14112,7 +11886,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14192,7 +11966,7 @@ paths: description: Whether or not the items were deleted. default: true product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14227,114 +12001,7 @@ paths: content: application/json: schema: - type: object - required: - - prices - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The weight of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: '#/components/schemas/AdminPostProductsProductVariantsVariantReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14399,7 +12066,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14525,7 +12192,7 @@ paths: types: type: array items: - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' '400': $ref: '#/components/responses/400_error' '401': @@ -14555,17 +12222,7 @@ paths: content: application/json: schema: - type: object - required: - - key - - value - properties: - key: - description: The metadata key - type: string - value: - description: The metadata value - type: string + $ref: '#/components/schemas/AdminPostProductsProductMetadataReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14614,7 +12271,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14644,22 +12301,8 @@ paths: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: >- - The IDs of the sales channels to add to the publishable api - key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + #/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -14713,7 +12356,7 @@ paths: schema: properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14742,22 +12385,8 @@ paths: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: >- - The IDs of the sales channels to delete from the publishable - api key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + #/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -14811,7 +12440,7 @@ paths: schema: properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14833,13 +12462,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: A title for the publishable api key - type: string + $ref: '#/components/schemas/AdminPostPublishableApiKeysReq' x-authenticated: true x-codeSamples: - lang: JavaScript @@ -14879,7 +12502,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14962,7 +12585,7 @@ paths: properties: publishable_api_keys: type: array - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15086,7 +12709,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15112,6 +12735,11 @@ paths: description: The ID of the Publishable Api Key. schema: type: string + - in: query + name: q + description: Query used for searching sales channels' names and descriptions. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15150,7 +12778,7 @@ paths: sales_channels: type: array items: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -15215,7 +12843,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15245,11 +12873,8 @@ paths: content: application/json: schema: - type: object - properties: - title: - description: A title to update for the key. - type: string + $ref: >- + #/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq x-codeSamples: - lang: JavaScript label: JS Client @@ -15294,7 +12919,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15324,17 +12949,7 @@ paths: content: application/json: schema: - type: object - required: - - country_code - properties: - country_code: - description: The 2 character ISO code for the Country. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. + $ref: '#/components/schemas/AdminPostRegionsRegionCountriesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15380,7 +12995,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15410,13 +13025,8 @@ paths: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Fulfillment Provider to add. - type: string + $ref: >- + #/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq x-codeSamples: - lang: JavaScript label: JS Client @@ -15462,7 +13072,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15492,13 +13102,7 @@ paths: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Payment Provider to add. - type: string + $ref: '#/components/schemas/AdminPostRegionsRegionPaymentProvidersReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15544,7 +13148,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15567,56 +13171,7 @@ paths: content: application/json: schema: - type: object - required: - - name - - currency_code - - tax_rate - - payment_providers - - fulfillment_providers - - countries - 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 - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - 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 Provider IDs that should be enabled for - the Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled - for the Region - type: array - items: - type: string - countries: - description: >- - A list of countries' 2 ISO Characters that should be - included in the Region. - example: - - US - type: array - items: - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of region' - type: boolean + $ref: '#/components/schemas/AdminPostRegionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15684,7 +13239,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15780,7 +13335,7 @@ paths: regions: type: array items: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' count: type: integer description: The total number of items available @@ -15923,7 +13478,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15952,63 +13507,7 @@ paths: content: application/json: schema: - type: object - 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 - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - 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 - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of region' - type: boolean - payment_providers: - description: >- - A list of Payment Provider IDs that should be enabled for - the Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled - for the Region - type: array - items: - type: string - countries: - description: >- - A list of countries' 2 ISO Characters that should be - included in the Region. - type: array - items: - type: string + $ref: '#/components/schemas/AdminPostRegionsRegionReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16054,7 +13553,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16201,7 +13700,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16271,7 +13770,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16341,7 +13840,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16364,30 +13863,7 @@ paths: content: application/json: schema: - type: object - required: - - label - - value - properties: - 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 - 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 - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostReturnReasonsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16435,7 +13911,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16492,7 +13968,7 @@ paths: return_reasons: type: array items: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16626,7 +14102,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16655,24 +14131,7 @@ paths: content: application/json: schema: - type: object - properties: - 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 - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostReturnReasonsReasonReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16718,7 +14177,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16780,7 +14239,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -16850,7 +14309,7 @@ paths: returns: type: array items: - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' count: type: integer description: The total number of items available @@ -16890,27 +14349,7 @@ paths: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items that have been received. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - refund: - description: The amount to refund. - type: number + $ref: '#/components/schemas/AdminPostReturnsReturnReceiveReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16966,7 +14405,7 @@ paths: type: object properties: return: - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' '400': $ref: '#/components/responses/400_error' '401': @@ -16996,21 +14435,8 @@ paths: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: The IDs of the products to add to the Sales Channel - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the product + $ref: >- + #/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -17064,7 +14490,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17093,21 +14519,8 @@ paths: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: The IDs of the products to delete from the Sales Channel. - type: array - items: - type: object - required: - - id - properties: - id: - description: The ID of a product - type: string + $ref: >- + #/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -17161,7 +14574,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17184,19 +14597,7 @@ paths: content: application/json: schema: - type: object - required: - - name - properties: - name: - description: The name of the Sales Channel - type: string - description: - description: The description of the Sales Channel - type: string - is_disabled: - description: Whether the Sales Channel is disabled or not. - type: boolean + $ref: '#/components/schemas/AdminPostSalesChannelsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -17243,7 +14644,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17418,7 +14819,7 @@ paths: sales_channels: type: array items: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' count: type: integer description: The total number of items available @@ -17561,7 +14962,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17590,17 +14991,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - type: string - description: Name of the sales channel. - description: - type: string - description: Sales Channel description. - is_disabled: - type: boolean - description: Indication of if the sales channel is active. + $ref: '#/components/schemas/AdminPostSalesChannelsSalesChannelReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -17646,755 +15037,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /shipping-profiles: - post: - operationId: PostShippingProfiles - summary: Create a Shipping Profile - description: Creates a Shipping Profile - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - description: The name of the Shipping Profile - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingProfiles.create({ - name: 'Large Products' - }) - - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/shipping-profiles' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "name": "Large Products" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetShippingProfiles - summary: List Shipping Profiles - description: Retrieves a list of Shipping Profile. - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingProfiles.list() - - .then(({ shipping_profiles }) => { - console.log(shipping_profiles.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profiles: - type: array - items: - $ref: '#/components/schemas/shipping_profile' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/shipping-profiles/{id}': - delete: - operationId: DeleteShippingProfilesProfile - summary: Delete a Shipping Profile - description: Deletes a Shipping Profile. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Profile. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingProfiles.delete(profile_id) - - .then(({ id, object, deleted }) => { - console.log(id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/shipping-profiles/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Shipping Profile. - object: - type: string - description: The type of the object that was deleted. - default: shipping_profile - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetShippingProfilesProfile - summary: Get a Shipping Profile - description: Retrieves a Shipping Profile. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Profile. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingProfiles.retrieve(profile_id) - - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostShippingProfilesProfile - summary: Update a Shipping Profile - description: Updates a Shipping Profile - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Profile. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - name: - description: The name of the Shipping Profile - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingProfiles.update(shipping_profile_id, { - name: 'Large Products' - }) - - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/shipping-profiles/{id} \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "name": "Large Products" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/store/currencies/{code}': - post: - operationId: PostStoreCurrenciesCode - summary: Add a Currency Code - description: Adds a Currency Code to the available currencies. - x-authenticated: true - parameters: - - in: path - name: code - required: true - description: The 3 character ISO currency code. - schema: - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.store.addCurrency('eur') - - .then(({ store }) => { - console.log(store.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/store/currencies/eur' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Store - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - store: - $ref: '#/components/schemas/store' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - delete: - operationId: DeleteStoreCurrenciesCode - summary: Delete a Currency Code - description: Removes a Currency Code from the available currencies. - x-authenticated: true - parameters: - - in: path - name: code - required: true - description: The 3 character ISO currency code. - schema: - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.store.deleteCurrency('eur') - - .then(({ store }) => { - console.log(store.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/store/currencies/eur' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Store - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - store: - $ref: '#/components/schemas/store' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /store: - get: - operationId: GetStore - summary: Get Store details - description: Retrieves the Store details - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.store.retrieve() - - .then(({ store }) => { - console.log(store.id); - }); - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/store' \ - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Store - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - store: - $ref: '#/components/schemas/store' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostStore - summary: Update Store Details - description: Updates the Store details - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - properties: - name: - description: The name of the Store - type: string - swap_link_template: - description: >- - 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 - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - currencies: - description: Array of currencies in 2 character ISO code format. - type: array - items: - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.store.update({ - name: 'Medusa Store' - }) - - .then(({ store }) => { - console.log(store.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST 'https://medusa-url.com/admin/store' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "name": "Medusa Store" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Store - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - store: - $ref: '#/components/schemas/store' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /store/payment-providers: - get: - operationId: GetStorePaymentProviders - summary: List Payment Providers - description: Retrieves the configured Payment Providers - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.store.listPaymentProviders() - - .then(({ payment_providers }) => { - console.log(payment_providers.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/store/payment-providers' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Store - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - payment_providers: - type: array - items: - $ref: '#/components/schemas/payment_provider' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /store/tax-providers: - get: - operationId: GetStoreTaxProviders - summary: List Tax Providers - description: Retrieves the configured Tax Providers - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.store.listTaxProviders() - - .then(({ tax_providers }) => { - console.log(tax_providers.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/store/tax-providers' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Store - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - tax_providers: - type: array - items: - $ref: '#/components/schemas/tax_provider' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -18417,81 +15060,7 @@ paths: content: application/json: schema: - type: object - required: - - name - - region_id - - provider_id - - data - - price_type - properties: - name: - description: The name of the Shipping Option - type: string - region_id: - description: >- - The ID of the Region in which the Shipping Option will be - available. - type: string - provider_id: - description: >- - The ID of the Fulfillment Provider that handles the Shipping - Option. - type: string - profile_id: - description: >- - The ID of the Shipping Profile to add the Shipping Option - to. - type: number - data: - description: >- - The data needed for the Fulfillment Provider to handle - shipping with this Shipping Option. - type: object - price_type: - description: The type of the Shipping Option price. - type: string - enum: - - flat_rate - - calculated - amount: - description: The amount to charge for the Shipping Option. - type: integer - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. - type: array - items: - required: - - type - - amount - properties: - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - is_return: - description: Whether the Shipping Option defines a return shipment. - type: boolean - default: false - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - default: false - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + $ref: '#/components/schemas/AdminPostShippingOptionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -18546,7 +15115,7 @@ paths: type: object properties: shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '401': @@ -18619,7 +15188,7 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' count: type: integer description: The total number of items available @@ -18756,7 +15325,7 @@ paths: type: object properties: shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '401': @@ -18785,49 +15354,7 @@ paths: content: application/json: schema: - type: object - required: - - requirements - properties: - name: - description: The name of the Shipping Option - type: string - 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 - Option to be available. - type: array - items: - required: - - type - - amount - properties: - id: - description: The ID of the requirement - type: string - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + $ref: '#/components/schemas/AdminPostShippingOptionsOptionReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -18885,7 +15412,710 @@ paths: type: object properties: shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /shipping-profiles: + post: + operationId: PostShippingProfiles + summary: Create a Shipping Profile + description: Creates a Shipping Profile + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostShippingProfilesReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.create({ + name: 'Large Products' + }) + + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/shipping-profiles' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Large Products" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingProfiles + summary: List Shipping Profiles + description: Retrieves a list of Shipping Profile. + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.list() + + .then(({ shipping_profiles }) => { + console.log(shipping_profiles.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profiles: + type: array + items: + $ref: '#/components/schemas/ShippingProfile' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/shipping-profiles/{id}': + delete: + operationId: DeleteShippingProfilesProfile + summary: Delete a Shipping Profile + description: Deletes a Shipping Profile. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.delete(profile_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Shipping Profile. + object: + type: string + description: The type of the object that was deleted. + default: shipping_profile + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingProfilesProfile + summary: Get a Shipping Profile + description: Retrieves a Shipping Profile. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.retrieve(profile_id) + + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostShippingProfilesProfile + summary: Update a Shipping Profile + description: Updates a Shipping Profile + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostShippingProfilesProfileReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.update(shipping_profile_id, { + name: 'Large Products' + }) + + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/shipping-profiles/{id} \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Large Products" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/store/currencies/{code}': + post: + operationId: PostStoreCurrenciesCode + summary: Add a Currency Code + description: Adds a Currency Code to the available currencies. + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The 3 character ISO currency code. + schema: + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.addCurrency('eur') + + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/store/currencies/eur' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + store: + $ref: '#/components/schemas/Store' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteStoreCurrenciesCode + summary: Delete a Currency Code + description: Removes a Currency Code from the available currencies. + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The 3 character ISO currency code. + schema: + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.deleteCurrency('eur') + + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/store/currencies/eur' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + store: + $ref: '#/components/schemas/Store' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store: + get: + operationId: GetStore + summary: Get Store details + description: Retrieves the Store details + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.retrieve() + + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/store' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + store: + $ref: '#/components/schemas/Store' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostStore + summary: Update Store Details + description: Updates the Store details + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostStoreReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.update({ + name: 'Medusa Store' + }) + + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST 'https://medusa-url.com/admin/store' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Medusa Store" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + store: + $ref: '#/components/schemas/Store' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/payment-providers: + get: + operationId: GetStorePaymentProviders + summary: List Payment Providers + description: Retrieves the configured Payment Providers + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.listPaymentProviders() + + .then(({ payment_providers }) => { + console.log(payment_providers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/store/payment-providers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_providers: + type: array + items: + $ref: '#/components/schemas/PaymentProvider' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/tax-providers: + get: + operationId: GetStoreTaxProviders + summary: List Tax Providers + description: Retrieves the configured Tax Providers + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.listTaxProviders() + + .then(({ tax_providers }) => { + console.log(tax_providers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/store/tax-providers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + tax_providers: + type: array + items: + $ref: '#/components/schemas/TaxProvider' '400': $ref: '#/components/responses/400_error' '401': @@ -18948,7 +16178,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '401': @@ -19017,7 +16247,7 @@ paths: swaps: type: array items: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' count: type: integer description: The total number of items available @@ -19074,17 +16304,7 @@ paths: content: application/json: schema: - type: object - required: - - product_types - properties: - product_types: - type: array - description: >- - The IDs of the types of products to associate with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19134,7 +16354,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19181,17 +16401,7 @@ paths: content: application/json: schema: - type: object - required: - - product_types - properties: - product_types: - type: array - description: >- - The IDs of the types of products to remove association with - this tax rate - items: - type: string + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19241,7 +16451,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19289,15 +16499,7 @@ paths: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: The IDs of the products to associate with this tax rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19347,7 +16549,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19394,17 +16596,7 @@ paths: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: >- - The IDs of the products to remove association with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19454,7 +16646,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19502,17 +16694,7 @@ paths: content: application/json: schema: - type: object - required: - - shipping_options - properties: - shipping_options: - type: array - description: >- - The IDs of the shipping options to associate with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19563,7 +16745,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19610,17 +16792,8 @@ paths: content: application/json: schema: - type: object - required: - - shipping_options - properties: - shipping_options: - type: array - description: >- - The IDs of the shipping options to remove association with - this tax rate - items: - type: string + $ref: >- + #/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -19671,7 +16844,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19713,43 +16886,7 @@ paths: content: application/json: schema: - type: object - required: - - code - - name - - region_id - properties: - code: - type: string - description: A code to identify the tax type by - name: - type: string - description: A human friendly name for the tax - region_id: - type: string - description: The ID of the Region that the rate belongs to - rate: - type: number - description: The numeric rate to charge - products: - type: array - description: The IDs of the products associated with this tax rate - items: - type: string - shipping_options: - type: array - description: >- - The IDs of the shipping options associated with this tax - rate - items: - type: string - product_types: - type: array - description: >- - The IDs of the types of products associated with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19799,7 +16936,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19930,7 +17067,7 @@ paths: tax_rates: type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' count: type: integer description: The total number of items available @@ -20091,7 +17228,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -20138,39 +17275,7 @@ paths: content: application/json: schema: - type: object - properties: - code: - type: string - description: A code to identify the tax type by - name: - type: string - description: A human friendly name for the tax - region_id: - type: string - description: The ID of the Region that the rate belongs to - rate: - type: number - description: The numeric rate to charge - products: - type: array - description: The IDs of the products associated with this tax rate - items: - type: string - shipping_options: - type: array - description: >- - The IDs of the shipping options associated with this tax - rate - items: - type: string - product_types: - type: array - description: >- - The IDs of the types of products associated with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -20216,7 +17321,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -20399,32 +17504,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - password - properties: - email: - description: The Users email. - type: string - format: email - 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 - enum: - - admin - - member - - developer - password: - description: The Users password. - type: string - format: password + $ref: '#/components/schemas/AdminCreateUserRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20472,7 +17552,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20527,7 +17607,7 @@ paths: users: type: array items: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20661,7 +17741,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20690,29 +17770,7 @@ paths: content: application/json: schema: - type: object - properties: - 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 - enum: - - admin - - member - - developer - api_token: - description: The api token of the User. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminUpdateUserRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20758,7 +17816,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20781,14 +17839,7 @@ paths: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The Users email. - type: string - format: email + $ref: '#/components/schemas/AdminResetPasswordTokenRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20854,22 +17905,7 @@ paths: content: application/json: schema: - type: object - required: - - token - - password - properties: - email: - description: The Users email. - type: string - format: email - token: - description: The token generated from the 'password-token' endpoint. - type: string - password: - description: The Users new password. - type: string - format: password + $ref: '#/components/schemas/AdminResetPasswordRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20917,7 +17953,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -21067,7 +18103,7 @@ paths: variants: type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' count: type: integer description: The total number of items available @@ -21096,7 +18132,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: An unknown error occurred. @@ -21106,7 +18142,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: >- @@ -21118,7 +18154,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: invalid_request_error message: Discount with code TEST already exists. @@ -21128,7 +18164,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: message: Entity with id 1 was not found type: not_found @@ -21138,21 +18174,21 @@ components: application/json: schema: oneOf: - - $ref: '#/components/schemas/error' - - $ref: '#/components/schemas/multiple_errors' + - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/MultipleErrors' examples: not_allowed: $ref: '#/components/examples/not_allowed_error' invalid_data: $ref: '#/components/examples/invalid_data_error' - multiple_errors: + MultipleErrors: $ref: '#/components/examples/multiple_errors' 500_error: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' examples: database: $ref: '#/components/examples/database_error' @@ -21363,10 +18399,9 @@ components: Where `{sid}` is the value of `connect.sid` that you copied. schemas: - address_fields: + AddressFields: title: Address Fields description: Address fields used when creating/updating an address. - x-resourceId: address type: object properties: company: @@ -21418,10 +18453,9 @@ components: description: An optional key-value map with additional details example: car: white - address: + Address: title: Address description: An address. - x-resourceId: address type: object properties: id: @@ -21502,10 +18536,9 @@ components: description: An optional key-value map with additional details example: car: white - batch_job: + BatchJob: title: Batch Job description: A Batch Job. - x-resourceId: batch_job type: object required: - type @@ -21645,10 +18678,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - cart: + Cart: title: Cart description: Represents a user cart - x-resourceId: cart type: object properties: id: @@ -21665,19 +18697,19 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' region_id: type: string description: The region's ID @@ -21706,24 +18738,24 @@ components: type: object payment_session: description: The selected payment session in the cart. - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' type: type: string description: The cart's type. @@ -21823,10 +18855,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - claim_image: + ClaimImage: title: Claim Image description: Represents photo documentation of a claim. - x-resourceId: claim_image type: object required: - claim_item_id @@ -21865,12 +18896,11 @@ components: description: An optional key-value map with additional details example: car: white - claim_item: + ClaimItem: title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. - x-resourceId: claim_item type: object required: - claim_order_id @@ -21887,7 +18917,7 @@ components: type: array description: Available if the relation `images` is expanded. items: - $ref: '#/components/schemas/claim_image' + $ref: '#/components/schemas/ClaimImage' claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -21902,7 +18932,7 @@ components: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. type: string @@ -21934,7 +18964,7 @@ components: relation 'tags' is expanded. type: array items: - $ref: '#/components/schemas/claim_tag' + $ref: '#/components/schemas/ClaimTag' created_at: type: string description: The date with timezone at which the resource was created. @@ -21952,13 +18982,12 @@ components: description: An optional key-value map with additional details example: car: white - claim_order: + ClaimOrder: title: Claim Order description: >- Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. - x-resourceId: claim_order type: object required: - type @@ -21998,14 +19027,14 @@ components: description: The items that have been claimed type: array items: - $ref: '#/components/schemas/claim_item' + $ref: '#/components/schemas/ClaimItem' 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/LineItem' order_id: description: The ID of the order that the claim comes from. type: string @@ -22024,17 +19053,17 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $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/ShippingMethod' 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 @@ -22075,12 +19104,11 @@ components: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - claim_tag: + ClaimTag: title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. - x-resourceId: claim_tag type: object required: - value @@ -22110,10 +19138,9 @@ components: description: An optional key-value map with additional details example: car: white - country: + Country: title: Country description: Country details - x-resourceId: country type: object required: - iso_2 @@ -22165,10 +19192,9 @@ components: region: description: A region object. Available if the relation `region` is expanded. type: object - currency: + Currency: title: Currency description: Currency - x-resourceId: currency type: object required: - code @@ -22198,13 +19224,12 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean - custom_shipping_option: + CustomShippingOption: title: Custom Shipping Option description: >- Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option - x-resourceId: custom_shipping_option type: object required: - price @@ -22260,10 +19285,9 @@ components: [EXPERIMENTAL] Indicates if the custom shipping option price include tax type: boolean - customer_group: + CustomerGroup: title: Customer Group description: Represents a customer group - x-resourceId: customer_group type: object required: - name @@ -22290,7 +19314,7 @@ components: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' created_at: type: string description: The date with timezone at which the resource was created. @@ -22308,10 +19332,9 @@ components: description: An optional key-value map with additional details example: car: white - customer: + Customer: title: Customer description: Represents a customer - x-resourceId: customer type: object required: - email @@ -22338,12 +19361,12 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' phone: type: string description: The customer's phone number @@ -22364,7 +19387,7 @@ components: relation `groups` is expanded. type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' created_at: type: string description: The date with timezone at which the resource was created. @@ -22382,10 +19405,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_customer_group: + DiscountConditionCustomerGroup: title: Product Tag Discount Condition description: Associates a discount condition with a customer group - x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -22401,10 +19423,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22418,10 +19440,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_collection: + DiscountConditionProductCollection: title: Product Collection Discount Condition description: Associates a discount condition with a product collection - x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -22437,10 +19458,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22454,10 +19475,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_tag: + DiscountConditionProductTag: title: Product Tag Discount Condition description: Associates a discount condition with a product tag - x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -22473,10 +19493,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22490,10 +19510,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_type: + DiscountConditionProductType: title: Product Type Discount Condition description: Associates a discount condition with a product type - x-resourceId: discount_condition_product type: object required: - product_type_id @@ -22509,10 +19528,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22526,10 +19545,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product: + DiscountConditionProduct: title: Product Discount Condition description: Associates a discount condition with a product - x-resourceId: discount_condition_product type: object required: - product_id @@ -22545,10 +19563,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22562,10 +19580,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition: + DiscountCondition: title: Discount Condition description: Holds rule conditions for when a discount is applicable - x-resourceId: discount_condition type: object required: - type @@ -22597,7 +19614,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' products: description: >- products associated with this condition if type = products. @@ -22658,12 +19675,11 @@ components: description: An optional key-value map with additional details example: car: white - discount_rule: + DiscountRule: title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. - x-resourceId: discount_rule type: object required: - type @@ -22726,12 +19742,11 @@ components: description: An optional key-value map with additional details example: car: white - discount: + Discount: title: Discount description: >- Represents a discount that can be applied to a cart for promotional purposes. - x-resourceId: discount type: object required: - code @@ -22759,7 +19774,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -22774,7 +19789,7 @@ components: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. type: string @@ -22821,10 +19836,9 @@ components: description: An optional key-value map with additional details example: car: white - draft-order: + DraftOrder: title: DraftOrder description: Represents a draft order - x-resourceId: draft-order type: object properties: id: @@ -22894,12 +19908,11 @@ components: description: An optional key-value map with additional details example: car: white - fulfillment_item: + FulfillmentItem: title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. - x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -22921,17 +19934,16 @@ components: type: object item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer example: 1 - fulfillment_provider: + FulfillmentProvider: title: Fulfillment Provider description: >- Represents a fulfillment provider plugin and holds its installation status. - x-resourceId: fulfillment_provider type: object properties: id: @@ -22945,7 +19957,7 @@ components: to `false`. type: boolean example: true - fulfillment: + Fulfillment: title: Fulfillment description: >- Fulfillments are created once store operators can prepare the purchased @@ -22955,7 +19967,6 @@ components: partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. - x-resourceId: fulfillment type: object required: - provider_id @@ -22995,7 +20006,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' items: description: >- The Fulfillment Items in the Fulfillment - these hold information @@ -23003,7 +20014,7 @@ components: the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_item' + $ref: '#/components/schemas/FulfillmentItem' tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -23011,7 +20022,7 @@ components: Provider. Available if the relation `tracking_links` is expanded. type: array items: - $ref: '#/components/schemas/tracking_link' + $ref: '#/components/schemas/TrackingLink' tracking_numbers: deprecated: true description: >- @@ -23066,12 +20077,11 @@ components: description: An optional key-value map with additional details example: car: white - gift_card_transaction: + GiftCardTransaction: title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order - x-resourceId: gift_card_transaction type: object required: - gift_card_id @@ -23113,12 +20123,11 @@ components: description: The tax rate of the transaction type: number example: 0 - gift_card: + GiftCard: title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. - x-resourceId: gift_card type: object required: - code @@ -23168,6 +20177,10 @@ components: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. @@ -23185,12 +20198,11 @@ components: description: An optional key-value map with additional details example: car: white - idempotency_key: + IdempotencyKey: title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. - x-resourceId: idempotency_key type: object required: - idempotency_key @@ -23242,10 +20254,9 @@ components: type: string description: Where to continue from. default: started - image: + Image: title: Image description: Images holds a reference to a URL at which the image file can be found. - x-resourceId: image type: object required: - url @@ -23275,10 +20286,9 @@ components: description: An optional key-value map with additional details example: car: white - invite: + Invite: title: Invite description: Represents an invite - x-resourceId: invite type: object required: - user_email @@ -23327,10 +20337,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_adjustment: + LineItemAdjustment: title: Line Item Adjustment - description: Represents an Line Item Adjustment - x-resourceId: line_item_adjustment + description: Represents a Line Item Adjustment type: object required: - item_id @@ -23347,7 +20356,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' description: type: string description: The line item's adjustment description @@ -23358,7 +20367,7 @@ components: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' amount: type: number description: The adjustment amount @@ -23368,10 +20377,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_tax_line: + LineItemTaxLine: title: Line Item Tax Line - description: Represents an Line Item Tax Line - x-resourceId: line_item_tax_line + description: Represents a Line Item Tax Line type: object required: - item_id @@ -23388,7 +20396,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' code: description: A code to identify the tax type by type: string @@ -23414,7 +20422,7 @@ components: description: An optional key-value map with additional details example: car: white - line_item: + LineItem: title: Line Item description: >- Line Items represent purchasable units that can be added to a Cart for @@ -23422,7 +20430,6 @@ components: resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. - x-resourceId: line_item type: object required: - title @@ -23467,12 +20474,12 @@ components: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: '#/components/schemas/line_item_tax_line' + $ref: '#/components/schemas/LineItemTaxLine' adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: '#/components/schemas/line_item_adjustment' + $ref: '#/components/schemas/LineItemAdjustment' title: description: >- The title of the Line Item, this should be easily identifiable by @@ -23608,7 +20615,7 @@ components: description: An optional key-value map with additional details example: car: white - money_amount: + MoneyAmount: title: Money Amount description: >- Money Amounts represents an amount that a given Product Variant can be @@ -23617,7 +20624,6 @@ components: fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. - x-resourceId: money_amount type: object required: - currency_code @@ -23636,7 +20642,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to @@ -23661,7 +20667,7 @@ components: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' variant_id: description: The id of the Product Variant contained in the Line Item. type: string @@ -23695,13 +20701,12 @@ components: description: An optional key-value map with additional details example: car: white - note: + Note: title: Note description: >- Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. - x-resourceId: note type: object required: - value @@ -23730,7 +20735,7 @@ components: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' created_at: type: string description: The date with timezone at which the resource was created. @@ -23748,12 +20753,11 @@ components: description: An optional key-value map with additional details example: car: white - notification_provider: + NotificationProvider: title: Notification Provider description: >- Represents a notification provider plugin and holds its installation status. - x-resourceId: notification_provider type: object required: - id @@ -23769,14 +20773,13 @@ components: to `false`. type: boolean default: true - notification: + Notification: title: Notification description: >- Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. - x-resourceId: notification type: object required: - resource_type @@ -23825,14 +20828,14 @@ components: Notification. type: array items: - $ref: '#/components/schemas/notification_resend' + $ref: '#/components/schemas/NotificationResend' provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -23841,10 +20844,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - notification_resend: + NotificationResend: title: Notification Resend description: A resend of a Notification. - x-resourceId: notification_resend type: object properties: id: @@ -23889,14 +20891,14 @@ components: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -23908,7 +20910,6 @@ components: OAuth: title: OAuth description: Represent an OAuth app - x-resourceId: OAuth type: object required: - id @@ -23939,10 +20940,9 @@ components: type: object description: Any data necessary to the app. example: {} - order_edit: + OrderEdit: title: Order Edit description: Order edit keeps track of order items changes. - x-resourceId: order_edit type: object required: - order_id @@ -23960,12 +20960,12 @@ components: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: '#/components/schemas/order_item_change' + $ref: '#/components/schemas/OrderItemChange' internal_note: description: An optional note with additional details about the order edit. type: string @@ -24052,14 +21052,14 @@ components: type: array description: Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' created_at: type: string description: The date with timezone at which the resource was created. @@ -24068,10 +21068,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - order_item_change: + OrderItemChange: title: Order Item Change description: Represents an order edit item change - x-resourceId: order_item_change type: object required: - type @@ -24094,21 +21093,21 @@ components: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' created_at: type: string description: The date with timezone at which the resource was created. @@ -24126,10 +21125,9 @@ components: description: An optional key-value map with additional details example: car: white - order: + Order: title: Order description: Represents an order - x-resourceId: order type: object required: - customer_id @@ -24205,14 +21203,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' region_id: type: string description: The region's ID @@ -24229,7 +21227,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The order's tax rate type: number @@ -24256,21 +21254,21 @@ components: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' returns: type: array description: >- @@ -24318,21 +21316,21 @@ components: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: '#/components/schemas/gift_card_transaction' + $ref: '#/components/schemas/GiftCardTransaction' canceled_at: type: string description: The date the order was canceled on. @@ -24405,10 +21403,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - payment_collection: + PaymentCollection: title: Payment Collection description: Payment Collection - x-resourceId: payment_collection type: object required: - type @@ -24451,7 +21448,7 @@ components: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' currency_code: description: The 3 character ISO code for the currency. type: string @@ -24461,17 +21458,17 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' created_by: type: string description: The ID of the user that created the payment collection. @@ -24492,10 +21489,9 @@ components: description: An optional key-value map with additional details example: car: white - payment_provider: + PaymentProvider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. - x-resourceId: payment_provider type: object required: - id @@ -24511,7 +21507,7 @@ components: to `false`. type: boolean default: true - payment_session: + PaymentSession: title: Payment Session description: >- Payment Sessions are created when a Customer initilizes the checkout @@ -24520,7 +21516,6 @@ components: communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. - x-resourceId: payment_session type: object required: - cart_id @@ -24589,12 +21584,11 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - payment: + Payment: title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. - x-resourceId: payment type: object required: - amount @@ -24638,7 +21632,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount_refunded: description: >- The amount of the original Payment amount that has been refunded @@ -24687,12 +21681,11 @@ components: description: An optional key-value map with additional details example: car: white - price_list: + PriceList: title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. - x-resourceId: price_list type: object required: - name @@ -24749,8 +21742,8 @@ components: type: array items: oneOf: - - $ref: '#/components/schemas/money_amount' - - $ref: '#/components/schemas/customer_group' + - $ref: '#/components/schemas/MoneyAmount' + - $ref: '#/components/schemas/CustomerGroup' includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean @@ -24766,10 +21759,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - product_collection: + ProductCollection: title: Product Collection description: Product Collections represents a group of Products that are related. - x-resourceId: product_collection type: object required: - title @@ -24813,13 +21805,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option_value: + ProductOptionValue: title: Product Option Value description: >- A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. - x-resourceId: product_option_value type: object required: - value @@ -24845,7 +21836,7 @@ components: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variant_id: description: >- The ID of the Product Variant that the Product Option Value is @@ -24854,7 +21845,7 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' created_at: type: string description: The date with timezone at which the resource was created. @@ -24872,13 +21863,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option: + ProductOption: title: Product Option description: >- Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. - x-resourceId: product_option type: object required: - title @@ -24898,7 +21888,7 @@ components: Available if the relation `values` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' product_id: description: The ID of the Product that the Product Option is defined for. type: string @@ -24923,10 +21913,9 @@ components: description: An optional key-value map with additional details example: car: white - product_tag: + ProductTag: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. - x-resourceId: product_tag type: object required: - value @@ -24956,12 +21945,11 @@ components: description: An optional key-value map with additional details example: car: white - product_tax_rate: + ProductTaxRate: 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 type: object required: - product_id @@ -24973,14 +21961,14 @@ components: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -24994,12 +21982,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type_tax_rate: + ProductTypeTaxRate: 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 type: object required: - product_type_id @@ -25011,14 +21998,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' rate_id: description: The id of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -25032,12 +22019,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type: + ProductType: title: Product Type description: >- Product Type can be added to Products for filtering and reporting purposes. - x-resourceId: product_type type: object required: - value @@ -25067,14 +22053,13 @@ components: description: An optional key-value map with additional details example: car: white - product_variant: + ProductVariant: title: Product Variant description: >- Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. - x-resourceId: product_variant type: object required: - title @@ -25105,7 +22090,7 @@ components: Region. Available if the relation `prices` is expanded. type: array items: - $ref: '#/components/schemas/money_amount' + $ref: '#/components/schemas/MoneyAmount' sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -25207,7 +22192,7 @@ components: Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' created_at: type: string description: The date with timezone at which the resource was created. @@ -25225,10 +22210,9 @@ components: description: An optional key-value map with additional details example: car: white - product_variant_prices_fields: + ProductVariantPricesFields: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. - x-resourceId: product_variant_prices_fields type: object properties: original_price: @@ -25266,13 +22250,12 @@ components: code: type: string description: The code of the tax rate - product: + Product: title: Product description: >- Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. - x-resourceId: product type: object required: - title @@ -25323,7 +22306,7 @@ components: expanded. 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 @@ -25335,7 +22318,7 @@ components: Option Values. Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variants: description: >- The Product Variants that belong to the Product. Each will have a @@ -25343,7 +22326,7 @@ components: relation `variants` is expanded. type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -25353,7 +22336,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -25421,14 +22404,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' tags: description: >- The Product Tags assigned to the Product. Available if the relation `tags` is expanded. type: array items: - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discountable: description: >- Whether the Product can be discounted. Discounts will not apply to @@ -25464,10 +22447,9 @@ components: description: An optional key-value map with additional details example: car: white - publishable_api_key_sales_channel: + PublishableApiKeySalesChannel: title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels - x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: @@ -25478,12 +22460,11 @@ components: type: string description: The publishable API key's ID example: pak_01G1G5V21KADXNGH29BJMAJ4B4 - publishable_api_key: + PublishableApiKey: title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. - x-resourceId: publishable_api_key type: object properties: id: @@ -25520,13 +22501,12 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - refund: + Refund: title: Refund description: >- Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. - x-resourceId: refund type: object required: - order_id @@ -25586,14 +22566,13 @@ components: description: An optional key-value map with additional details example: car: white - region: + Region: title: Region description: >- Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. - x-resourceId: region type: object required: - name @@ -25619,7 +22598,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -25630,7 +22609,7 @@ components: relation `tax_rates` is expanded. type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' tax_code: description: >- The tax code used on purchases in the Region. This may be used by @@ -25651,28 +22630,28 @@ components: relation `countries` is expanded. type: array items: - $ref: '#/components/schemas/country' + $ref: '#/components/schemas/Country' tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: '#/components/schemas/tax_provider' + $ref: '#/components/schemas/TaxProvider' payment_providers: description: >- The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/payment_provider' + $ref: '#/components/schemas/PaymentProvider' fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean @@ -25693,12 +22672,11 @@ components: description: An optional key-value map with additional details example: car: white - return_item: + ReturnItem: title: Return Item description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. - x-resourceId: return_item type: object required: - return_id @@ -25710,14 +22688,14 @@ components: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -25742,7 +22720,7 @@ components: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' note: description: An optional note with additional details about the Return. type: string @@ -25752,12 +22730,11 @@ components: description: An optional key-value map with additional details example: car: white - return_reason: + ReturnReason: title: Return Reason description: >- A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. - x-resourceId: return_reason type: object required: - value @@ -25785,10 +22762,10 @@ components: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' created_at: type: string description: The date with timezone at which the resource was created. @@ -25806,13 +22783,12 @@ components: description: An optional key-value map with additional details example: car: white - return: + Return: title: Return description: >- Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. - x-resourceId: return type: object required: - refund_amount @@ -25836,7 +22812,7 @@ components: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/return_item' + $ref: '#/components/schemas/ReturnItem' swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -25867,7 +22843,7 @@ components: Available if the relation `shipping_method` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -25910,10 +22886,9 @@ components: description: An optional key-value map with additional details example: car: white - sales_channel: + SalesChannel: title: Sales Channel description: A Sales Channel - x-resourceId: sales_channel type: object required: - name @@ -25946,10 +22921,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_method_tax_line: + ShippingMethodTaxLine: title: Shipping Method Tax Line description: Shipping Method Tax Line - x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -25966,7 +22940,7 @@ components: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' code: description: A code to identify the tax type by type: string @@ -25992,14 +22966,13 @@ components: description: An optional key-value map with additional details example: car: white - shipping_method: + ShippingMethod: title: Shipping Method description: >- Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. - x-resourceId: shipping_method type: object required: - shipping_option_id @@ -26017,7 +22990,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -26061,7 +23034,7 @@ components: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: '#/components/schemas/shipping_method_tax_line' + $ref: '#/components/schemas/ShippingMethodTaxLine' price: description: >- The amount to charge for the Shipping Method. The currency of the @@ -26079,12 +23052,11 @@ components: includes_tax: description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' type: boolean - shipping_option_requirement: + ShippingOptionRequirement: title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. - x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -26103,7 +23075,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' type: description: >- The type of the requirement, this defines how the value will be @@ -26124,7 +23096,7 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_option: + ShippingOption: title: Shipping Option description: >- Shipping Options represent a way in which an Order or Return can be @@ -26133,7 +23105,6 @@ components: Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. - x-resourceId: shipping_option type: object required: - name @@ -26168,7 +23139,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -26177,7 +23148,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' price_type: description: >- The type of pricing calculation that is used when creatin Shipping @@ -26208,7 +23179,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option_requirement' + $ref: '#/components/schemas/ShippingOptionRequirement' data: description: >- The data needed for the Fulfillment Provider to identify the @@ -26235,12 +23206,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_profile: + ShippingProfile: title: Shipping Profile description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. - x-resourceId: shipping_profile type: object required: - name @@ -26281,7 +23251,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' created_at: type: string description: The date with timezone at which the resource was created. @@ -26299,12 +23269,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_tax_rate: + ShippingTaxRate: 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 type: object required: - shipping_option_id @@ -26316,14 +23285,14 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -26337,10 +23306,9 @@ components: description: An optional key-value map with additional details example: car: white - staged_job: + StagedJob: title: Staged Job description: A staged job resource - x-resourceId: staged_job type: object required: - event_name @@ -26357,10 +23325,9 @@ components: description: Data necessary for the job type: object example: {} - store: + Store: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' - x-resourceId: store type: object properties: id: @@ -26380,14 +23347,14 @@ components: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' currencies: description: >- The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. 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 @@ -26418,7 +23385,7 @@ components: description: An optional key-value map with additional details example: car: white - swap: + Swap: title: Swap description: >- Swaps can be created when a Customer wishes to exchange Products that @@ -26428,7 +23395,6 @@ components: for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. - x-resourceId: swap type: object required: - fulfillment_status @@ -26480,7 +23446,7 @@ components: relation `additional_items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' return_order: description: >- A return order object. The Return that is issued for the return part @@ -26492,13 +23458,13 @@ components: relation `fulfillments` is expanded. 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. Available if the relation `payment` is expanded. - $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 @@ -26514,14 +23480,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_methods: description: >- The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string @@ -26573,10 +23539,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_line: + TaxLine: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. - x-resourceId: tax_line type: object required: - rate @@ -26611,10 +23576,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_provider: + TaxProvider: title: Tax Provider description: The tax service used to calculate taxes - x-resourceId: tax_provider type: object properties: id: @@ -26628,12 +23592,11 @@ components: to `false`. type: boolean default: true - tax_rate: + TaxRate: 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 type: object required: - name @@ -26711,13 +23674,12 @@ components: description: An optional key-value map with additional details example: car: white - tracking_link: + TrackingLink: 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. - x-resourceId: tracking_link type: object required: - tracking_number @@ -26741,7 +23703,7 @@ components: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' idempotency_key: type: string description: >- @@ -26768,10 +23730,9 @@ components: description: An optional key-value map with additional details example: car: white - user: + User: title: User description: Represents a User who can manage store settings. - x-resourceId: user type: object required: - email @@ -26813,24 +23774,22 @@ components: description: An optional key-value map with additional details example: car: white - multiple_errors: + MultipleErrors: title: Multiple Errors - x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' message: type: string default: >- Provided request body contains errors. Please check the data and retry the request - error: + Error: title: Response Error - x-resourceId: error type: object properties: code: @@ -26842,3 +23801,3002 @@ components: type: type: string description: A slug indicating the type of the error. + AdminPostAppsReq: + type: object + 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. + AdminPostAuthReq: + type: object + required: + - email + - password + properties: + email: + type: string + description: The User's email. + format: email + password: + type: string + description: The User's password. + format: password + AdminPostBatchesReq: + type: object + required: + - type + - context + properties: + type: + type: string + description: The type of batch job to start. + example: product-export + context: + type: object + description: >- + Additional infomration regarding the batch to be used for + processing. + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + type: boolean + description: >- + Set a batch job in dry_run mode to get some information on what will + be done without applying any modifications. + default: false + AdminPostProductsToCollectionReq: + type: object + required: + - product_ids + properties: + product_ids: + description: An array of Product IDs to add to the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + AdminPostCollectionsReq: + type: object + required: + - title + properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided we will + kebab-case the title. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminDeleteProductsFromCollectionReq: + type: object + required: + - product_ids + properties: + product_ids: + description: An array of Product IDs to remove from the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + AdminPostCollectionsCollectionReq: + type: object + properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided we will + kebab-case the title. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostCurrenciesCurrencyReq: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' + AdminPostCustomerGroupsGroupCustomersBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminDeleteCustomerGroupsGroupCustomerBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to remove + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminPostCustomerGroupsGroupReq: + type: object + properties: + name: + description: Name of the customer group + type: string + metadata: + description: Metadata for the customer. + type: object + AdminPostCustomersReq: + type: object + required: + - email + - first_name + - last_name + - password + properties: + email: + type: string + description: The customer's email. + format: email + first_name: + type: string + description: The customer's first name. + last_name: + type: string + description: The customer's last name. + password: + type: string + description: The customer's password. + format: password + phone: + type: string + description: The customer's phone number. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostCustomersCustomerReq: + type: object + properties: + email: + type: string + description: The Customer's email. + format: email + first_name: + type: string + description: The Customer's first name. + last_name: + type: string + description: The Customer's last name. + phone: + type: string + description: The Customer's phone number. + password: + type: string + description: The Customer's password. + format: password + groups: + type: array + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + description: A list of customer groups to which the customer belongs. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + AdminPostDiscountsDiscountConditions: + type: object + required: + - operator + properties: + operator: + description: Operator of the condition + type: string + enum: + - in + - not_in + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on product + types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied on + product collections. + items: + type: string + product_tags: + type: array + description: list of product tag IDs if the condition is applied on product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on customer + groups. + items: + type: string + AdminPostDiscountsReq: + type: object + required: + - code + - rule + - regions + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + is_dynamic: + type: boolean + description: >- + Whether the Discount should have multiple instances of itself, each + with a different code. This can be useful for automatically + generated codes that all have to follow a common set of rules. + default: false + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - type + - value + - allocation + properties: + description: + type: string + description: A short description of the discount + type: + type: string + description: >- + The type of the Discount, can be `fixed` for discounts that + reduce the price by a fixed amount, `percentage` for percentage + reductions or `free_shipping` for shipping vouchers. + enum: + - fixed + - percentage + - free_shipping + value: + type: number + description: >- + The value that the discount represents; this will depend on the + type of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: >- + A set of conditions that can be used to limit when the discount + can be used. Only one of `products`, `product_types`, + `product_collections`, `product_tags`, and `customer_groups` + should be provided. + items: + type: object + required: + - operator + properties: + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: >- + list of product IDs if the condition is applied on + products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on + product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied + on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is applied on + product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on + customer groups. + items: + type: string + is_disabled: + type: boolean + description: >- + Whether the Discount code is disabled on creation. You will have to + enable it later to make it available to Customers. + default: false + starts_at: + type: string + format: date-time + description: The time at which the Discount should be available. + ends_at: + type: string + format: date-time + description: The time at which the Discount should no longer be available. + valid_duration: + type: string + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + regions: + description: >- + A list of Region ids representing the Regions in which the Discount + can be used. + type: array + items: + type: string + usage_limit: + type: number + description: Maximum times the discount can be used + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminDeleteDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + AdminPostDiscountsDiscountConditionsCondition: + type: object + properties: + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on product + types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied on + product collections. + items: + type: string + product_tags: + type: array + description: list of product tag IDs if the condition is applied on product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on customer + groups. + items: + type: string + AdminPostDiscountsDiscountReq: + type: object + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - id + properties: + id: + type: string + description: The ID of the Rule + description: + type: string + description: A short description of the discount + value: + type: number + description: >- + The value that the discount represents; this will depend on the + type of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: >- + A set of conditions that can be used to limit when the discount + can be used. Only one of `products`, `product_types`, + `product_collections`, `product_tags`, and `customer_groups` + should be provided. + items: + type: object + required: + - operator + properties: + id: + type: string + description: The ID of the Rule + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: >- + list of product IDs if the condition is applied on + products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on + product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied + on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is applied on + product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on + customer groups. + items: + type: string + is_disabled: + type: boolean + description: >- + 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 + description: The time at which the Discount should be available. + ends_at: + type: string + format: date-time + description: The time at which the Discount should no longer be available. + valid_duration: + type: string + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + usage_limit: + type: number + description: Maximum times the discount can be used + regions: + description: >- + A list of Region ids representing the Regions in which the Discount + can be used. + type: array + items: + type: string + metadata: + description: An object containing metadata of the discount + type: object + AdminPostDraftOrdersReq: + type: object + required: + - email + - region_id + - shipping_methods + properties: + status: + description: The status of the draft order + type: string + enum: + - open + - completed + email: + description: The email of the customer of the draft order + type: string + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - type: string + items: + description: The Line Items that have been received. + type: array + items: + type: object + required: + - quantity + properties: + variant_id: + description: The ID of the Product Variant to generate the Line Item from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the + Line Item. + type: object + region_id: + description: The ID of the region for the draft order + type: string + discounts: + description: The discounts to add on the draft order + type: array + items: + type: object + required: + - code + properties: + code: + description: The code of the discount to apply + type: string + customer_id: + description: The ID of the customer to add on the draft order + type: string + no_notification_order: + description: >- + An optional flag passed to the resulting order to determine use of + notifications. + type: boolean + shipping_methods: + description: The shipping methods for the draft order + type: array + items: + type: object + required: + - option_id + properties: + option_id: + description: The ID of the shipping option in use + type: string + data: + description: The optional additional data needed for the shipping method + type: object + price: + description: The potential custom price of the shipping + type: integer + metadata: + description: >- + The optional key-value map with additional details about the Draft + Order. + type: object + AdminPostDraftOrdersDraftOrderLineItemsReq: + type: object + required: + - quantity + properties: + variant_id: + description: The ID of the Product Variant to generate the Line Item from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + default: Custom item + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the Line + Item. + type: object + AdminPostDraftOrdersDraftOrderReq: + type: object + properties: + region_id: + type: string + description: The ID of the Region to create the Draft Order in. + country_code: + type: string + description: The 2 character ISO code for the Country. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + email: + type: string + description: An email to be used on the Draft Order. + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - type: string + discounts: + description: An array of Discount codes to add to the Draft Order. + type: array + items: + type: object + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + no_notification_order: + description: >- + An optional flag passed to the resulting order to determine use of + notifications. + type: boolean + customer_id: + description: The ID of the Customer to associate the Draft Order with. + type: string + AdminPostDraftOrdersDraftOrderLineItemsItemReq: + type: object + properties: + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the Line + Item. + type: object + AdminPostGiftCardsReq: + type: object + required: + - region_id + properties: + value: + type: integer + description: The value (excluding VAT) that the Gift Card should represent. + is_disabled: + type: boolean + description: >- + Whether the Gift Card is disabled on creation. You will have to + enable it later to make it available to Customers. + ends_at: + type: string + format: date-time + description: The time at which the Gift Card should no longer be available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostGiftCardsGiftCardReq: + type: object + properties: + balance: + type: integer + description: The value (excluding VAT) that the Gift Card should represent. + is_disabled: + type: boolean + description: >- + Whether the Gift Card is disabled on creation. You will have to + enable it later to make it available to Customers. + ends_at: + type: string + format: date-time + description: The time at which the Gift Card should no longer be available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostInvitesInviteAcceptReq: + type: object + 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 + format: password + AdminPostInvitesReq: + type: object + required: + - user + - role + properties: + user: + description: The email for the user to be created. + type: string + format: email + role: + description: The role of the user to be created. + type: string + enum: + - admin + - member + - developer + AdminPostNotesReq: + type: object + required: + - resource_id + - resource_type + - value + properties: + resource_id: + type: string + description: The ID of the resource which the Note relates to. + resource_type: + type: string + description: The type of resource which the Note relates to. + value: + type: string + description: The content of the Note to create. + AdminPostNotesNoteReq: + type: object + required: + - value + properties: + value: + type: string + description: The updated description of the Note. + AdminPostNotificationsNotificationResendReq: + type: object + properties: + to: + description: >- + A new address or user identifier that the Notification should be + sent to + type: string + AdminPostOrderEditsEditLineItemsReq: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the variant ID to add + type: string + quantity: + description: The quantity to add + type: number + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrderEditsReq: + type: object + required: + - order_id + properties: + order_id: + description: The ID of the order to create the edit for. + type: string + internal_note: + description: An optional note to create for the order edit. + type: string + AdminPostOrderEditsEditLineItemsLineItemReq: + type: object + required: + - quantity + properties: + quantity: + description: The quantity to update + type: number + AdminPostOrderEditsOrderEditReq: + type: object + properties: + internal_note: + description: An optional note to create or update for the order edit. + type: string + AdminPostOrdersOrderClaimsClaimShipmentsReq: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + AdminPostOrdersOrderClaimsReq: + type: object + required: + - type + - claim_items + properties: + type: + description: >- + The type of the Claim. This will determine how the Claim is treated: + `replace` Claims will result in a Fulfillment with new items being + created, while a `refund` Claim will refund the amount paid for the + claimed items. + type: string + enum: + - replace + - refund + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: A list of image URL's that will be associated with the Claim + items: + type: string + return_shipping: + description: >- + Optional details for the Return Shipping Method, if the items are to + be sent back. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: >- + The new items to send to the Customer when the Claim type is + Replace. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + shipping_address: + type: object + description: >- + An optional shipping address to send the claim to. Defaults to the + parent order's shipping address + $ref: '#/components/schemas/Address' + refund_amount: + description: The amount to refund the Customer when the Claim type is `refund`. + type: integer + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderFulfillmentsReq: + type: object + required: + - items + properties: + items: + description: The Line Items to include in the Fulfillment. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderShipmentReq: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: >- + If set to true no notification will be send related to this + Shipment. + type: boolean + AdminPostOrdersOrderSwapsSwapShipmentsReq: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: If set to true no notification will be sent related to this Claim. + type: boolean + AdminPostOrdersOrderSwapsReq: + type: object + 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. + type: string + quantity: + description: The number of items that will be returned + type: integer + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + return_shipping: + description: How the Swap will be returned. + type: object + required: + - option_id + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + 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. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + custom_shipping_options: + description: >- + The custom shipping options to potentially create a Shipping Method + from. + type: array + items: + required: + - option_id + - price + properties: + option_id: + description: The ID of the Shipping Option to override with a custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + allow_backorder: + description: 'If true, swaps can be completed with items out of stock' + type: boolean + default: true + AdminPostOrdersOrderClaimsClaimFulfillmentsReq: + type: object + properties: + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + AdminPostOrdersOrderSwapsSwapFulfillmentsReq: + type: object + properties: + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + AdminPostOrdersOrderRefundsReq: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + no_notification: + description: If set to true no notification will be send related to this Refund. + type: boolean + AdminPostOrdersOrderReturnsReq: + type: object + required: + - items + properties: + items: + description: The Line Items that will be returned. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + return_shipping: + description: The Shipping Method to be used to handle the return shipment. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + note: + description: An optional note with information about the Return. + type: string + receive_now: + description: >- + A flag to indicate if the Return should be registerd as received + immediately. + type: boolean + default: false + no_notification: + description: >- + A flag to indicate if no notifications should be emitted related to + the requested Return. + type: boolean + refund: + description: The amount to refund. + type: integer + AdminPostOrdersOrderClaimsClaimReq: + type: object + properties: + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - id + - images + - tags + properties: + id: + description: The ID of the Claim Item. + type: string + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: object + properties: + id: + type: string + description: Tag ID + value: + type: string + description: Tag value + images: + description: A list of image URL's that will be associated with the Claim + type: array + items: + type: object + properties: + id: + type: string + description: Image ID + url: + type: string + description: Image URL + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderReq: + type: object + properties: + email: + description: the email for the order + type: string + billing_address: + description: Billing address + anyOf: + - $ref: '#/components/schemas/AddressFields' + shipping_address: + description: Shipping address + anyOf: + - $ref: '#/components/schemas/AddressFields' + items: + description: The Line Items for the order + type: array + items: + $ref: '#/components/schemas/LineItem' + region: + description: ID of the region where the order belongs + type: string + discounts: + description: Discounts applied to the order + type: array + items: + $ref: '#/components/schemas/Discount' + customer_id: + description: ID of the customer + type: string + payment_method: + description: payment method chosen for the order + 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 + items: + $ref: '#/components/schemas/LineItem' + description: Items to ship + no_notification: + description: >- + A flag to indicate if no notifications should be emitted related to + the updated order. + type: boolean + AdminUpdatePaymentCollectionsReq: + type: object + properties: + description: + description: An optional description to create or update the payment collection. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostPaymentRefundsReq: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + AdminPostPriceListPricesPricesReq: + type: object + properties: + prices: + description: The prices to update or add. + type: array + items: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + override: + description: >- + If true the prices will replace all existing prices associated with + the Price List. + type: boolean + AdminPostPriceListsPriceListReq: + type: object + required: + - name + - description + - type + - prices + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + required: + - amount + - variant_id + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + variant_id: + description: The ID of the Variant for which the price is used. + type: string + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminDeletePriceListPricesPricesReq: + type: object + properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string + AdminPostPriceListsPriceListPriceListReq: + type: object + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminPostProductsProductOptionsReq: + type: object + required: + - title + properties: + title: + description: The title the Product Option will be identified by i.e. "Size" + type: string + AdminPostProductsReq: + type: object + required: + - title + properties: + title: + description: The title of the Product + type: string + subtitle: + description: The subtitle of the Product + type: string + description: + description: A description of the Product. + type: string + is_giftcard: + description: >- + A flag to indicate if the Product represents a Gift Card. Purchasing + Products with this flag set to `true` will result in a Gift Card + being created. + type: boolean + default: false + discountable: + description: >- + A flag to indicate if discounts can be applied to the LineItems + generated from this Product + type: boolean + default: true + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. + type: string + handle: + description: A unique handle to identify the Product by. + type: string + status: + description: The status of the product. + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. + type: array + items: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + options: + description: >- + The Options that the Product should have. These define on which + properties the Product's Product Variants will differ. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Option by. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - value + properties: + value: + description: >- + The value to give for the Product Option at the same + index in the Product's `options` field. + type: string + weight: + description: The weight of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostProductsProductVariantsReq: + type: object + required: + - title + - prices + - options + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + AdminPostProductsProductMetadataReq: + type: object + required: + - key + - value + properties: + key: + description: The metadata key + type: string + value: + description: The metadata value + type: string + AdminPostProductsProductOptionsOption: + type: object + required: + - title + properties: + title: + description: The title of the Product Option + type: string + AdminPostProductsProductReq: + type: object + properties: + title: + description: The title of the Product + type: string + subtitle: + description: The subtitle of the Product + type: string + description: + description: A description of the Product. + type: string + discountable: + description: >- + A flag to indicate if discounts can be applied to the LineItems + generated from this Product + type: boolean + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. + type: string + handle: + description: A unique handle to identify the Product by. + type: string + status: + description: The status of the product. + type: string + enum: + - draft + - proposed + - published + - rejected + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. + type: array + items: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + properties: + id: + description: The ID of the Product Variant. + type: string + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the Price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Option. + type: string + value: + description: >- + The value to give for the Product Option at the same + index in the Product's `options` field. + type: string + weight: + description: The wieght of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostProductsProductVariantsVariantReq: + type: object + required: + - prices + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The weight of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + AdminPostPublishableApiKeySalesChannelsBatchReq: + type: object + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: The IDs of the sales channels to add to the publishable api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + AdminPostPublishableApiKeysReq: + type: object + required: + - title + properties: + title: + description: A title for the publishable api key + type: string + AdminDeletePublishableApiKeySalesChannelsBatchReq: + type: object + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: The IDs of the sales channels to delete from the publishable api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + AdminPostPublishableApiKeysPublishableApiKeyReq: + type: object + properties: + title: + description: A title to update for the key. + type: string + AdminPostRegionsRegionCountriesReq: + type: object + required: + - country_code + properties: + country_code: + description: The 2 character ISO code for the Country. + type: string + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + AdminPostRegionsRegionFulfillmentProvidersReq: + type: object + required: + - provider_id + properties: + provider_id: + description: The ID of the Fulfillment Provider to add. + type: string + AdminPostRegionsRegionPaymentProvidersReq: + type: object + required: + - provider_id + properties: + provider_id: + description: The ID of the Payment Provider to add. + type: string + AdminPostRegionsReq: + type: object + required: + - name + - currency_code + - tax_rate + - payment_providers + - fulfillment_providers + - countries + 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 + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + 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 Provider IDs that should be enabled for the Region + type: array + items: + type: string + fulfillment_providers: + description: >- + A list of Fulfillment Provider IDs that should be enabled for the + Region + type: array + items: + type: string + countries: + description: >- + A list of countries' 2 ISO Characters that should be included in the + Region. + example: + - US + type: array + items: + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of region' + type: boolean + AdminPostRegionsRegionReq: + type: object + 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 + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + 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 + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of region' + type: boolean + payment_providers: + description: A list of Payment Provider IDs that should be enabled for the Region + type: array + items: + type: string + fulfillment_providers: + description: >- + A list of Fulfillment Provider IDs that should be enabled for the + Region + type: array + items: + type: string + countries: + description: >- + A list of countries' 2 ISO Characters that should be included in the + Region. + type: array + items: + type: string + AdminPostReturnReasonsReq: + type: object + required: + - label + - value + properties: + 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 + 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 + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostReturnReasonsReasonReq: + type: object + properties: + 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 + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostReturnsReturnReceiveReq: + type: object + required: + - items + properties: + items: + description: The Line Items that have been received. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: number + AdminPostSalesChannelsChannelProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to add to the Sales Channel + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the product + AdminPostSalesChannelsReq: + type: object + required: + - name + properties: + name: + description: The name of the Sales Channel + type: string + description: + description: The description of the Sales Channel + type: string + is_disabled: + description: Whether the Sales Channel is disabled or not. + type: boolean + AdminDeleteSalesChannelsChannelProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to delete from the Sales Channel. + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of a product + type: string + AdminPostSalesChannelsSalesChannelReq: + type: object + properties: + name: + type: string + description: Name of the sales channel. + description: + type: string + description: Sales Channel description. + is_disabled: + type: boolean + description: Indication of if the sales channel is active. + AdminPostShippingOptionsReq: + type: object + required: + - name + - region_id + - provider_id + - data + - price_type + properties: + name: + description: The name of the Shipping Option + type: string + region_id: + description: The ID of the Region in which the Shipping Option will be available. + type: string + provider_id: + description: The ID of the Fulfillment Provider that handles the Shipping Option. + type: string + profile_id: + description: The ID of the Shipping Profile to add the Shipping Option to. + type: number + data: + description: >- + The data needed for the Fulfillment Provider to handle shipping with + this Shipping Option. + type: object + price_type: + description: The type of the Shipping Option price. + type: string + enum: + - flat_rate + - calculated + amount: + description: The amount to charge for the Shipping Option. + type: integer + requirements: + description: >- + The requirements that must be satisfied for the Shipping Option to + be available. + type: array + items: + required: + - type + - amount + properties: + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + is_return: + description: Whether the Shipping Option defines a return shipment. + type: boolean + default: false + admin_only: + description: 'If true, the option can be used for draft orders' + type: boolean + default: false + metadata: + description: An optional set of key-value pairs with additional information. + type: object + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + AdminPostShippingOptionsOptionReq: + type: object + required: + - requirements + properties: + name: + description: The name of the Shipping Option + type: string + 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 Option to + be available. + type: array + items: + required: + - type + - amount + properties: + id: + description: The ID of the requirement + type: string + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + AdminPostShippingProfilesReq: + type: object + required: + - name + properties: + name: + description: The name of the Shipping Profile + type: string + AdminPostShippingProfilesProfileReq: + type: object + properties: + name: + description: The name of the Shipping Profile + type: string + AdminPostStoreReq: + type: object + properties: + name: + description: The name of the Store + type: string + swap_link_template: + description: >- + 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 + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currencies: + description: Array of currencies in 2 character ISO code format. + type: array + items: + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostTaxRatesTaxRateProductTypesReq: + type: object + required: + - product_types + properties: + product_types: + type: array + description: The IDs of the types of products to associate with this tax rate + items: + type: string + AdminPostTaxRatesTaxRateProductsReq: + type: object + required: + - products + properties: + products: + type: array + description: The IDs of the products to associate with this tax rate + items: + type: string + AdminPostTaxRatesTaxRateShippingOptionsReq: + type: object + required: + - shipping_options + properties: + shipping_options: + type: array + description: The IDs of the shipping options to associate with this tax rate + items: + type: string + AdminPostTaxRatesReq: + type: object + required: + - code + - name + - region_id + properties: + code: + type: string + description: A code to identify the tax type by + name: + type: string + description: A human friendly name for the tax + region_id: + type: string + description: The ID of the Region that the rate belongs to + rate: + type: number + description: The numeric rate to charge + products: + type: array + description: The IDs of the products associated with this tax rate + items: + type: string + shipping_options: + type: array + description: The IDs of the shipping options associated with this tax rate + items: + type: string + product_types: + type: array + description: The IDs of the types of products associated with this tax rate + items: + type: string + AdminDeleteTaxRatesTaxRateProductTypesReq: + type: object + required: + - product_types + properties: + product_types: + type: array + description: >- + The IDs of the types of products to remove association with this tax + rate + items: + type: string + AdminDeleteTaxRatesTaxRateProductsReq: + type: object + required: + - products + properties: + products: + type: array + description: The IDs of the products to remove association with this tax rate + items: + type: string + AdminDeleteTaxRatesTaxRateShippingOptionsReq: + type: object + required: + - shipping_options + properties: + shipping_options: + type: array + description: >- + The IDs of the shipping options to remove association with this tax + rate + items: + type: string + AdminPostTaxRatesTaxRateReq: + type: object + properties: + code: + type: string + description: A code to identify the tax type by + name: + type: string + description: A human friendly name for the tax + region_id: + type: string + description: The ID of the Region that the rate belongs to + rate: + type: number + description: The numeric rate to charge + products: + type: array + description: The IDs of the products associated with this tax rate + items: + type: string + shipping_options: + type: array + description: The IDs of the shipping options associated with this tax rate + items: + type: string + product_types: + type: array + description: The IDs of the types of products associated with this tax rate + items: + type: string + AdminDeleteUploadsReq: + type: object + required: + - file_key + properties: + file_key: + description: key of the file to delete + type: string + AdminPostUploadsDownloadUrlReq: + type: object + required: + - file_key + properties: + file_key: + description: key of the file to obtain the download link for + type: string + AdminCreateUserRequest: + type: object + required: + - email + - password + properties: + email: + description: The Users email. + type: string + format: email + 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 + enum: + - admin + - member + - developer + password: + description: The Users password. + type: string + format: password + AdminResetPasswordTokenRequest: + type: object + required: + - email + properties: + email: + description: The Users email. + type: string + format: email + AdminResetPasswordRequest: + type: object + required: + - token + - password + properties: + email: + description: The Users email. + type: string + format: email + token: + description: The token generated from the 'password-token' endpoint. + type: string + password: + description: The Users new password. + type: string + format: password + AdminUpdateUserRequest: + type: object + properties: + 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 + enum: + - admin + - member + - developer + api_token: + description: The api token of the User. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index f715e780af..4577d20245 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -108,100 +108,166 @@ tags: sessions. - name: App description: App endpoints that allow handling apps in Medusa. - x-resourceId: OAuth - name: Batch Job description: Batch Job endpoints that allow handling batch jobs in Medusa. - x-resourceId: batch_job - name: Claim description: Claim endpoints that allow handling claims in Medusa. - x-resourceId: claim_order - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Customer Group description: Customer Group endpoints that allow handling customer groups in Medusa. - x-resourceId: customer_group - name: Discount description: Discount endpoints that allow handling discounts in Medusa. - x-resourceId: discount - name: Discount Condition description: >- Discount Condition endpoints that allow handling discount conditions in Medusa. - x-resourceId: discount_condition - name: Draft Order description: Draft Order endpoints that allow handling draft orders in Medusa. - x-resourceId: draft-order - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Invite description: Invite endpoints that allow handling invites in Medusa. - x-resourceId: invite - name: Note description: Note endpoints that allow handling notes in Medusa. - x-resourceId: note - name: Notification description: Notification endpoints that allow handling notifications in Medusa. - x-resourceId: notification - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Price List description: Price List endpoints that allow handling price lists in Medusa. - x-resourceId: price_list - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Tag description: Product Tag endpoints that allow handling product tags in Medusa. - x-resourceId: product_tag - name: Product Type description: Product Types endpoints that allow handling product types in Medusa. - x-resourceId: product_type - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Sales Channel description: Sales Channel endpoints that allow handling sales channels in Medusa. - x-resourceId: sales_channel - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Shipping Profile description: >- Shipping Profile endpoints that allow handling shipping profiles in Medusa. - x-resourceId: shipping_profile - name: Store description: Store endpoints that allow handling stores in Medusa. - x-resourceId: store - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap - name: Tax Rate description: Tax Rate endpoints that allow handling tax rates in Medusa. - x-resourceId: tax_rate - name: Upload description: Upload endpoints that allow handling uploads in Medusa. - name: User description: User endpoints that allow handling users in Medusa. - x-resourceId: user servers: - url: 'https://api.medusa-commerce.com/admin' paths: + /apps/authorizations: + post: + operationId: PostApps + summary: Generate Token for App + description: Generates a token for an application. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostAppsReq' + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/apps/authorizations' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "application_name": "example", + "state": "ready", + "code": "token" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + apps: + $ref: '#/components/schemas/OAuth' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /apps: + get: + operationId: GetApps + summary: List Applications + description: Retrieve a list of applications. + x-authenticated: true + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/apps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + apps: + type: array + items: + $ref: '#/components/schemas/OAuth' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /auth: post: operationId: PostAuth @@ -259,7 +325,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -356,7 +422,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -369,151 +435,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /currencies: - get: - operationId: GetCurrencies - summary: List Currency - description: Retrieves a list of Currency - x-authenticated: true - parameters: - - in: query - name: code - description: Code of the currency to search for. - schema: - type: string - - in: query - name: includes_tax - description: Search for tax inclusive currencies. - schema: - type: boolean - - in: query - name: order - description: order to retrieve products in. - schema: - type: string - - in: query - name: offset - description: How many products to skip in the result. - schema: - type: number - default: '0' - - in: query - name: limit - description: Limit the number of products returned. - schema: - type: number - default: '20' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.list() - - .then(({ currencies, count, offset, limit }) => { - console.log(currencies.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies' \ - - --header 'Authorization: Bearer {api_token}' - tags: - - Currency - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - currencies: - type: array - items: - $ref: '#/components/schemas/currency' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '/currencies/{code}': - post: - operationId: PostCurrenciesCurrency - summary: Update a Currency - description: Update a Currency - x-authenticated: true - parameters: - - in: path - name: code - required: true - description: The code of the Currency. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - includes_tax: - type: boolean - description: '[EXPERIMENTAL] Tax included in prices of currency.' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.update(code, { - includes_tax: true - }) - - .then(({ currency }) => { - console.log(currency.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies/{code}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "includes_tax": true - }' - tags: - - Currency - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - currency: - $ref: '#/components/schemas/currency' '/batch-jobs/{id}/cancel': post: operationId: PostBatchJobsBatchJobCancel @@ -564,7 +485,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -627,7 +548,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -650,42 +571,7 @@ paths: content: application/json: schema: - type: object - required: - - type - - context - properties: - type: - type: string - description: The type of batch job to start. - example: product-export - context: - type: object - description: >- - Additional infomration regarding the batch to be used for - processing. - example: - shape: - prices: - - region: null - currency_code: eur - dynamicImageColumnCount: 4 - dynamicOptionColumnCount: 2 - list_config: - skip: 0 - take: 50 - order: - created_at: DESC - relations: - - variants - - variant.prices - - images - dry_run: - type: boolean - description: >- - Set a batch job in dry_run mode to get some information on - what will be done without applying any modifications. - default: false + $ref: '#/components/schemas/AdminPostBatchesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -732,7 +618,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -1025,7 +911,7 @@ paths: batch_jobs: type: array items: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' count: type: integer description: The total number of items available @@ -1097,7 +983,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -1127,16 +1013,7 @@ paths: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + $ref: '#/components/schemas/AdminPostProductsToCollectionReq' x-codeSamples: - lang: Shell label: cURL @@ -1167,7 +1044,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1196,18 +1073,7 @@ paths: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: >- - An array of Product IDs to remove from the Product - Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + $ref: '#/components/schemas/AdminDeleteProductsFromCollectionReq' x-codeSamples: - lang: Shell label: cURL @@ -1272,23 +1138,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCollectionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1334,7 +1184,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1492,7 +1342,7 @@ paths: collections: type: array items: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' count: type: integer description: The total number of items available @@ -1635,7 +1485,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1664,21 +1514,7 @@ paths: content: application/json: schema: - type: object - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCollectionsCollectionReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1724,7 +1560,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1737,6 +1573,147 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /currencies: + get: + operationId: GetCurrencies + summary: List Currency + description: Retrieves a list of Currency + x-authenticated: true + parameters: + - in: query + name: code + description: Code of the currency to search for. + schema: + type: string + - in: query + name: includes_tax + description: Search for tax inclusive currencies. + schema: + type: boolean + - in: query + name: order + description: order to retrieve products in. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: number + default: '20' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.list() + + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies' \ + + --header 'Authorization: Bearer {api_token}' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currencies: + type: array + items: + $ref: '#/components/schemas/Currency' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '/currencies/{code}': + post: + operationId: PostCurrenciesCurrency + summary: Update a Currency + description: Update a Currency + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Currency. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCurrenciesCurrencyReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.update(code, { + includes_tax: true + }) + + .then(({ currency }) => { + console.log(currency.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies/{code}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "includes_tax": true + }' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currency: + $ref: '#/components/schemas/Currency' '/customer-groups/{id}/customers/batch': post: operationId: PostCustomerGroupsGroupCustomersBatch @@ -1754,20 +1731,8 @@ paths: content: application/json: schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to add - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string + $ref: >- + #/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -1822,7 +1787,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -1851,20 +1816,8 @@ paths: content: application/json: schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to remove - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string + $ref: >- + #/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -1919,7 +1872,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -1984,7 +1937,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -2172,7 +2125,7 @@ paths: customer_groups: type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' count: type: integer description: The total number of items available @@ -2331,7 +2284,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -2360,14 +2313,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: Name of the customer group - type: string - metadata: - description: Metadata for the customer. - type: object + $ref: '#/components/schemas/AdminPostCustomerGroupsGroupReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2413,7 +2359,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -2478,7 +2424,7 @@ paths: customers: type: array items: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' count: type: integer description: The total number of items available @@ -2500,115 +2446,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /apps/authorizations: - post: - operationId: PostApps - summary: Generate Token for App - description: Generates a token for an application. - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - 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. - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/apps/authorizations' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "application_name": "example", - "state": "ready", - "code": "token" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - App - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - apps: - $ref: '#/components/schemas/OAuth' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /apps: - get: - operationId: GetApps - summary: List Applications - description: Retrieve a list of applications. - x-authenticated: true - x-codeSamples: - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/apps' \ - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - App - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - apps: - type: array - items: - $ref: '#/components/schemas/OAuth' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' /customers: post: operationId: PostCustomers @@ -2619,35 +2456,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - first_name - - last_name - - password - properties: - email: - type: string - description: The customer's email. - format: email - first_name: - type: string - description: The customer's first name. - last_name: - type: string - description: The customer's last name. - password: - type: string - description: The customer's password. - format: password - phone: - type: string - description: The customer's phone number. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCustomersReq' tags: - Customer x-codeSamples: @@ -2699,7 +2508,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2779,7 +2588,7 @@ paths: customers: type: array items: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' count: type: integer description: The total number of items available @@ -2861,7 +2670,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2900,40 +2709,7 @@ paths: content: application/json: schema: - type: object - properties: - email: - type: string - description: The Customer's email. - format: email - first_name: - type: string - description: The Customer's first name. - last_name: - type: string - description: The Customer's last name. - phone: - type: string - description: The Customer's phone number. - password: - type: string - description: The Customer's password. - format: password - groups: - type: array - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - description: A list of customer groups to which the customer belongs. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCustomersCustomerReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2979,866 +2755,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /draft-orders: - post: - operationId: PostDraftOrders - summary: Create a Draft Order - description: Creates a Draft Order - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - items - - region_id - - shipping_methods - properties: - status: - description: The status of the draft order - type: string - enum: - - open - - completed - email: - description: The email of the customer of the draft order - type: string - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - items: - description: The Line Items that have been received. - type: array - items: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line - Item from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details - about the Line Item. - type: object - region_id: - description: The ID of the region for the draft order - type: string - discounts: - description: The discounts to add on the draft order - type: array - items: - type: object - required: - - code - properties: - code: - description: The code of the discount to apply - type: string - customer_id: - description: The ID of the customer to add on the draft order - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - shipping_methods: - description: The shipping methods for the draft order - type: array - items: - type: object - required: - - option_id - properties: - option_id: - description: The ID of the shipping option in use - type: string - data: - description: >- - The optional additional data needed for the shipping - method - type: object - price: - description: The potential custom price of the shipping - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Draft Order. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.draftOrders.create({ - email: 'user@example.com', - region_id, - items: [ - { - quantity: 1 - } - ], - shipping_methods: [ - { - option_id - } - ], - }) - - .then(({ draft_order }) => { - console.log(draft_order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "email": "user@example.com", - "region_id": "{region_id}" - "items": [ - { - "quantity": 1 - } - ], - "shipping_methods": [ - { - "option_id": "{option_id}" - } - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetDraftOrders - summary: List Draft Orders - description: Retrieves an list of Draft Orders - x-authenticated: true - parameters: - - in: query - name: offset - description: The number of items to skip before the results. - schema: - type: number - default: '0' - - in: query - name: limit - description: Limit the number of items returned. - schema: - type: number - default: '50' - - in: query - name: q - description: >- - a search term to search emails in carts associated with draft orders - and display IDs of draft orders - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.draftOrders.list() - - .then(({ draft_orders, limit, offset, count }) => { - console.log(draft_orders.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/draft-orders' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_orders: - type: array - items: - $ref: '#/components/schemas/draft-order' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/draft-orders/{id}/line-items': - post: - operationId: PostDraftOrdersDraftOrderLineItems - summary: Create a Line Item - description: Creates a Line Item for the Draft Order - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line Item - from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - default: Custom item - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.draftOrders.addLineItem(draft_order_id, { - quantity: 1 - }) - - .then(({ draft_order }) => { - console.log(draft_order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "quantity": 1 - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/draft-orders/{id}': - delete: - operationId: DeleteDraftOrdersDraftOrder - summary: Delete a Draft Order - description: Deletes a Draft Order - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.draftOrders.delete(draft_order_id) - - .then(({ id, object, deleted }) => { - console.log(id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/draft-orders/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Draft Order. - object: - type: string - description: The type of the object that was deleted. - default: draft-order - deleted: - type: boolean - description: Whether the draft order was deleted successfully or not. - default: true - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetDraftOrdersDraftOrder - summary: Get a Draft Order - description: Retrieves a Draft Order. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.draftOrders.retrieve(draft_order_id) - - .then(({ draft_order }) => { - console.log(draft_order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/draft-orders/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/draft-orders/{id}/line-items/{line_id}': - delete: - operationId: DeleteDraftOrdersDraftOrderLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Draft Order. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - - in: path - name: line_id - required: true - description: The ID of the Draft Order. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.draftOrders.removeLineItem(draft_order_id, item_id) - - .then(({ draft_order }) => { - console.log(draft_order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' - \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostDraftOrdersDraftOrderLineItemsItem - summary: Update a Line Item - description: Updates a Line Item for a Draft Order - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - - in: path - name: line_id - required: true - description: The ID of the Line Item. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, { - quantity: 1 - }) - - .then(({ draft_order }) => { - console.log(draft_order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "quantity": 1 - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/draft-orders/{id}/pay': - post: - summary: Registers a Payment - operationId: PostDraftOrdersDraftOrderRegisterPayment - description: Registers a payment for a Draft Order. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The Draft Order id. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.draftOrders.markPaid(draft_order_id) - - .then(({ order }) => { - console.log(order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/admin/draft-orders/{id}': - post: - operationId: PostDraftOrdersDraftOrder - summary: Update a Draft Order - description: Updates a Draft Order. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Draft Order in. - country_code: - type: string - description: The 2 character ISO code for the Country. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Draft Order. - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - discounts: - description: An array of Discount codes to add to the Draft Order. - type: array - items: - type: object - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - customer_id: - description: The ID of the Customer to associate the Draft Order with. - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.draftOrders.update(draft_order_id, { - email: "user@example.com" - }) - - .then(({ draft_order }) => { - console.log(draft_order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "email": "user@example.com" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -3907,7 +2824,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3977,7 +2894,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4027,20 +2944,8 @@ paths: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be added to the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + #/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -4088,7 +2993,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4137,20 +3042,8 @@ paths: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be deleted from the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + #/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -4198,7 +3091,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4245,49 +3138,7 @@ paths: content: application/json: schema: - type: object - required: - - operator - properties: - operator: - description: Operator of the condition - type: string - enum: - - in - - not_in - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditions' x-codeSamples: - lang: JavaScript label: JS Client @@ -4335,7 +3186,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4371,144 +3222,7 @@ paths: content: application/json: schema: - type: object - required: - - code - - rule - - regions - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - is_dynamic: - type: boolean - description: >- - Whether the Discount should have multiple instances of - itself, each with a different code. This can be useful for - automatically generated codes that all have to follow a - common set of rules. - default: false - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - type - - value - - allocation - properties: - description: - type: string - description: A short description of the discount - type: - type: string - description: >- - The type of the Discount, can be `fixed` for discounts - that reduce the price by a fixed amount, `percentage` - for percentage reductions or `free_shipping` for - shipping vouchers. - enum: - - fixed - - percentage - - free_shipping - value: - type: number - description: >- - The value that the discount represents; this will depend - on the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, - and `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is - applied on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is - applied on product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is - applied on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will - have to enable it later to make it available to Customers. - default: false - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - usage_limit: - type: number - description: Maximum times the discount can be used - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostDiscountsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4529,7 +3243,7 @@ paths: value: 10, allocation: AllocationType.ITEM }, - regions: ['reg_XXXXXXXX'], + regions: ["reg_XXXXXXXX"], is_dynamic: false, is_disabled: false }) @@ -4554,7 +3268,7 @@ paths: "value": 10, "allocation": "item" }, - "regions": ['reg_XXXXXXXX'] + "regions": ["reg_XXXXXXXX"] }' security: - api_token: [] @@ -4570,7 +3284,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4685,7 +3399,7 @@ paths: discounts: type: array items: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' count: type: integer description: The total number of items available @@ -4769,7 +3483,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4883,7 +3597,7 @@ paths: default: true discount: description: The Discount to which the condition used to belong - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4962,7 +3676,7 @@ paths: type: object properties: discount_condition: - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' '400': $ref: '#/components/responses/400_error' '401': @@ -5014,41 +3728,8 @@ paths: content: application/json: schema: - type: object - properties: - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: >- + #/components/schemas/AdminPostDiscountsDiscountConditionsCondition x-codeSamples: - lang: JavaScript label: JS Client @@ -5099,7 +3780,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5243,7 +3924,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5288,122 +3969,7 @@ paths: content: application/json: schema: - type: object - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - id - properties: - id: - type: string - description: The ID of the Rule - description: - type: string - description: A short description of the discount - value: - type: number - description: >- - The value that the discount represents; this will depend - on the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, - and `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - id: - type: string - description: The ID of the Rule - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is - applied on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is - applied on product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is - applied on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - 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 - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - usage_limit: - type: number - description: Maximum times the discount can be used - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - metadata: - description: An object containing metadata of the discount - type: object + $ref: '#/components/schemas/AdminPostDiscountsDiscountReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -5449,7 +4015,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5518,7 +4084,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5591,7 +4157,686 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /draft-orders: + post: + operationId: PostDraftOrders + summary: Create a Draft Order + description: Creates a Draft Order + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.create({ + email: 'user@example.com', + region_id, + items: [ + { + quantity: 1 + } + ], + shipping_methods: [ + { + option_id + } + ], + }) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com", + "region_id": "{region_id}" + "items": [ + { + "quantity": 1 + } + ], + "shipping_methods": [ + { + "option_id": "{option_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDraftOrders + summary: List Draft Orders + description: Retrieves an list of Draft Orders + x-authenticated: true + parameters: + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of items returned. + schema: + type: number + default: '50' + - in: query + name: q + description: >- + a search term to search emails in carts associated with draft orders + and display IDs of draft orders + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.list() + + .then(({ draft_orders, limit, offset, count }) => { + console.log(draft_orders.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/draft-orders' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_orders: + type: array + items: + $ref: '#/components/schemas/DraftOrder' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/draft-orders/{id}/line-items': + post: + operationId: PostDraftOrdersDraftOrderLineItems + summary: Create a Line Item + description: Creates a Line Item for the Draft Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.addLineItem(draft_order_id, { + quantity: 1 + }) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "quantity": 1 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/draft-orders/{id}': + delete: + operationId: DeleteDraftOrdersDraftOrder + summary: Delete a Draft Order + description: Deletes a Draft Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.delete(draft_order_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/draft-orders/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Draft Order. + object: + type: string + description: The type of the object that was deleted. + default: draft-order + deleted: + type: boolean + description: Whether the draft order was deleted successfully or not. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDraftOrdersDraftOrder + summary: Get a Draft Order + description: Retrieves a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.retrieve(draft_order_id) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/draft-orders/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/draft-orders/{id}/line-items/{line_id}': + delete: + operationId: DeleteDraftOrdersDraftOrderLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + - in: path + name: line_id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.removeLineItem(draft_order_id, item_id) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostDraftOrdersDraftOrderLineItemsItem + summary: Update a Line Item + description: Updates a Line Item for a Draft Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + - in: path + name: line_id + required: true + description: The ID of the Line Item. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, { + quantity: 1 + }) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "quantity": 1 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/draft-orders/{id}/pay': + post: + summary: Registers a Payment + operationId: PostDraftOrdersDraftOrderRegisterPayment + description: Registers a payment for a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The Draft Order id. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.markPaid(draft_order_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/admin/draft-orders/{id}': + post: + operationId: PostDraftOrdersDraftOrder + summary: Update a Draft Order + description: Updates a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.update(draft_order_id, { + email: "user@example.com" + }) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5616,34 +4861,7 @@ paths: content: application/json: schema: - type: object - required: - - region_id - properties: - value: - type: integer - description: >- - The value (excluding VAT) that the Gift Card should - represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have - to enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: >- - The time at which the Gift Card should no longer be - available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostGiftCardsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -5689,7 +4907,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '401': @@ -5764,7 +4982,7 @@ paths: gift_cards: type: array items: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' count: type: integer description: The total number of items available @@ -5907,7 +5125,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '401': @@ -5938,32 +5156,7 @@ paths: content: application/json: schema: - type: object - properties: - balance: - type: integer - description: >- - The value (excluding VAT) that the Gift Card should - represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have - to enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: >- - The time at which the Gift Card should no longer be - available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostGiftCardsGiftCardReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6009,7 +5202,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '401': @@ -6031,32 +5224,7 @@ paths: content: application/json: schema: - type: object - 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 - format: password + $ref: '#/components/schemas/AdminPostInvitesInviteAcceptReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6132,22 +5300,7 @@ paths: content: application/json: schema: - type: object - required: - - user - - role - properties: - user: - description: The email for the user to be created. - type: string - format: email - role: - description: The role of the user to be created. - type: string - enum: - - admin - - member - - developer + $ref: '#/components/schemas/AdminPostInvitesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6249,7 +5402,7 @@ paths: invites: type: array items: - $ref: '#/components/schemas/invite' + $ref: '#/components/schemas/Invite' '400': $ref: '#/components/responses/400_error' '401': @@ -6404,21 +5557,7 @@ paths: content: application/json: schema: - type: object - required: - - resource_id - - resource_type - - value - properties: - resource_id: - type: string - description: The ID of the resource which the Note relates to. - resource_type: - type: string - description: The type of resource which the Note relates to. - value: - type: string - description: The content of the Note to create. + $ref: '#/components/schemas/AdminPostNotesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6468,7 +5607,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6541,7 +5680,7 @@ paths: notes: type: array items: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' count: type: integer description: The total number of items available @@ -6684,7 +5823,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6713,13 +5852,7 @@ paths: content: application/json: schema: - type: object - required: - - value - properties: - value: - type: string - description: The updated description of the Note. + $ref: '#/components/schemas/AdminPostNotesNoteReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6765,7 +5898,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6878,7 +6011,7 @@ paths: notifications: type: array items: - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' '400': $ref: '#/components/responses/400_error' '401': @@ -6910,13 +6043,7 @@ paths: content: application/json: schema: - type: object - properties: - to: - description: >- - A new address or user identifier that the Notification - should be sent to - type: string + $ref: '#/components/schemas/AdminPostNotificationsNotificationResendReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6954,7 +6081,7 @@ paths: type: object properties: notification: - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' '400': $ref: '#/components/responses/400_error' '401': @@ -6967,6 +6094,840 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/order-edits/{id}/items': + post: + operationId: PostOrderEditsEditLineItems + summary: Add an line item to an order (edit) + description: Create an OrderEdit LineItem. + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsReq' + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.addLineItem(order_edit_id, { + variant_id, + quantity + }) + + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/items' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", + "quantity": 3 }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/cancel': + post: + operationId: PostOrderEditsOrderEditCancel + summary: Cancel an OrderEdit + description: Cancels an OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.cancel(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/confirm': + post: + operationId: PostOrderEditsOrderEditConfirm + summary: Confirms an OrderEdit + description: Confirms an OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the order edit. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.confirm(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /order-edits: + post: + operationId: PostOrderEdits + summary: Create an OrderEdit + description: Creates an OrderEdit. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsReq' + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.create({ order_id }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ "order_id": "my_order_id", "internal_note": + "my_optional_note" }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetOrderEdits + summary: List OrderEdits + description: List OrderEdits. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching order edit internal note. + schema: + type: string + - in: query + name: order_id + description: List order edits by order id. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.list() + .then(({ order_edits, count, limit, offset }) => { + console.log(order_edits.length) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/order-edits' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edits: + type: array + $ref: '#/components/schemas/OrderEdit' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/items/{item_id}': + delete: + operationId: DeleteOrderEditsOrderEditLineItemsLineItem + summary: Delete line items from an order edit and create change item + description: Delete line items from an order edit and create change item + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete from. + schema: + type: string + - in: path + name: item_id + required: true + description: The ID of the order edit item to delete from order. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrderEditsEditLineItemsLineItem + summary: Create or update the order edit change holding the line item changes + description: Create or update the order edit change holding the line item changes + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to update. + schema: + type: string + - in: path + name: item_id + required: true + description: The ID of the order edit item to update. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, + { + quantity: 5 + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ "quantity": 5 }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/changes/{change_id}': + delete: + operationId: DeleteOrderEditsOrderEditItemChange + summary: Delete an Order Edit Item Change + description: Deletes an Order Edit Item Change + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete. + schema: + type: string + - in: path + name: change_id + required: true + description: The ID of the Order Edit Item Change to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.deleteItemChange(order_edit_id, + item_change_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Order Edit Item Change. + object: + type: string + description: The type of the object that was deleted. + format: item_change + deleted: + type: boolean + description: Whether or not the Order Edit Item Change was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '/order-edits/{id}': + delete: + operationId: DeleteOrderEditsOrderEdit + summary: Delete an Order Edit + description: Deletes an Order Edit + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.delete(order_edit_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/order-edits/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Order Edit. + object: + type: string + description: The type of the object that was deleted. + format: order_edit + deleted: + type: boolean + description: Whether or not the Order Edit was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetOrderEditsOrderEdit + summary: Retrieve an OrderEdit + description: Retrieves a OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.retrieve(orderEditId) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/order-edits/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrderEditsOrderEdit + summary: Updates an OrderEdit + description: Updates a OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsOrderEditReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.update(order_edit_id, { + internal_note: "internal reason XY" + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "internal_note": "internal reason XY" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/request': + post: + operationId: PostOrderEditsOrderEditRequest + summary: Request order edit confirmation + description: Request customer confirmation of an Order Edit + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to request confirmation from. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.requestConfirmation(order_edit_id) + .then({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/request' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' '/orders/{id}/shipping-methods': post: operationId: PostOrdersOrderShippingMethods @@ -7030,7 +6991,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7118,7 +7079,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7188,7 +7149,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7265,7 +7226,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7342,7 +7303,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7412,7 +7373,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7478,7 +7439,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7548,7 +7509,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7611,7 +7572,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7674,7 +7635,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7710,18 +7671,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -7768,7 +7718,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7798,126 +7748,7 @@ paths: content: application/json: schema: - type: object - required: - - type - - claim_items - properties: - type: - description: >- - The type of the Claim. This will determine how the Claim is - treated: `replace` Claims will result in a Fulfillment with - new items being created, while a `refund` Claim will refund - the amount paid for the claimed items. - type: string - enum: - - replace - - refund - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: string - images: - description: >- - A list of image URL's that will be associated with the - Claim - items: - type: string - return_shipping: - description: >- - Optional details for the Return Shipping Method, if the - items are to be sent back. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: >- - The new items to send to the Customer when the Claim type is - Replace. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - shipping_address: - type: object - description: >- - An optional shipping address to send the claim to. Defaults - to the parent order's shipping address - $ref: '#/components/schemas/address' - refund_amount: - description: >- - The amount to refund the Customer when the Claim type is - `refund`. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -7975,7 +7806,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8007,34 +7838,7 @@ paths: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items to include in the Fulfillment. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of Line Item to fulfill. - type: string - quantity: - description: The quantity of the Line Item to fulfill. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderFulfillmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8090,7 +7894,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8120,23 +7924,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Shipment. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderShipmentReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8182,7 +7970,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8218,23 +8006,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be sent related to this - Claim. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8281,7 +8053,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8313,85 +8085,7 @@ paths: content: application/json: schema: - type: object - 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. - type: string - quantity: - description: The number of items that will be returned - type: integer - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - return_shipping: - description: How the Swap will be returned. - type: object - required: - - option_id - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - 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. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - custom_shipping_options: - description: >- - The custom shipping options to potentially create a Shipping - Method from. - type: array - items: - required: - - option_id - - price - properties: - option_id: - description: >- - The ID of the Shipping Option to override with a - custom price. - type: string - price: - description: The custom price of the Shipping Option. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - allow_backorder: - description: 'If true, swaps can be completed with items out of stock' - type: boolean - default: true + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8447,7 +8141,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8483,18 +8177,8 @@ paths: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + #/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -8533,7 +8217,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8569,18 +8253,8 @@ paths: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + #/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -8619,7 +8293,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8682,7 +8356,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8711,71 +8385,7 @@ paths: content: application/json: schema: - type: object - properties: - email: - description: the email for the order - type: string - billing_address: - description: Billing address - anyOf: - - $ref: '#/components/schemas/address_fields' - shipping_address: - description: Shipping address - anyOf: - - $ref: '#/components/schemas/address_fields' - items: - description: The Line Items for the order - type: array - items: - $ref: '#/components/schemas/line_item' - region: - description: ID of the region where the order belongs - type: string - discounts: - description: Discounts applied to the order - type: array - items: - $ref: '#/components/schemas/discount' - customer_id: - description: ID of the customer - type: string - payment_method: - description: payment method chosen for the order - 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 - items: - $ref: '#/components/schemas/line_item' - description: Items to ship - no_notification: - description: >- - A flag to indicate if no notifications should be emitted - related to the updated order. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8821,7 +8431,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9093,7 +8703,7 @@ paths: orders: type: array items: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' count: type: integer description: The total number of items available @@ -9175,7 +8785,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9205,25 +8815,7 @@ paths: content: application/json: schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Refund. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderRefundsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9271,7 +8863,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9303,61 +8895,7 @@ paths: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items that will be returned. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - return_shipping: - description: >- - The Shipping Method to be used to handle the return - shipment. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - note: - description: An optional note with information about the Return. - type: string - receive_now: - description: >- - A flag to indicate if the Return should be registerd as - received immediately. - type: boolean - default: false - no_notification: - description: >- - A flag to indicate if no notifications should be emitted - related to the requested Return. - type: boolean - refund: - description: The amount to refund. - type: integer + $ref: '#/components/schemas/AdminPostOrdersOrderReturnsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9414,7 +8952,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9450,96 +8988,7 @@ paths: content: application/json: schema: - type: object - properties: - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - id - - images - - tags - properties: - id: - description: The ID of the Claim Item. - type: string - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: object - properties: - id: - type: string - description: Tag ID - value: - type: string - description: Tag value - images: - description: >- - A list of image URL's that will be associated with the - Claim - type: array - items: - type: object - properties: - id: - type: string - description: Image ID - url: - type: string - description: Image URL - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9585,7 +9034,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9598,874 +9047,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/items': - post: - operationId: PostOrderEditsEditLineItems - summary: Add an line item to an order (edit) - description: Create an OrderEdit LineItem. - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the variant ID to add - type: string - quantity: - description: The quantity to add - type: number - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.addLineItem(order_edit_id, { - variant_id, - quantity - }) - - .then(({ order_edit }) => { - console.log(order_edit.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/items' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", - "quantity": 3 }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/order-edits/{id}/cancel': - post: - operationId: PostOrderEditsOrderEditCancel - summary: Cancel an OrderEdit - description: Cancels an OrderEdit. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the OrderEdit. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.cancel(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '500': - $ref: '#/components/responses/500_error' - '/order-edits/{id}/confirm': - post: - operationId: PostOrderEditsOrderEditConfirm - summary: Confirms an OrderEdit - description: Confirms an OrderEdit. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the order edit. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.confirm(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '500': - $ref: '#/components/responses/500_error' - /order-edits: - post: - operationId: PostOrderEdits - summary: Create an OrderEdit - description: Creates an OrderEdit. - requestBody: - content: - application/json: - schema: - type: object - required: - - order_id - properties: - order_id: - description: The ID of the order to create the edit for. - type: string - internal_note: - description: An optional note to create for the order edit. - type: string - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.create({ order_id }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ "order_id": "my_order_id", "internal_note": - "my_optional_note" }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetOrderEdits - summary: List OrderEdits - description: List OrderEdits. - x-authenticated: true - parameters: - - in: query - name: q - description: Query used for searching order edit internal note. - schema: - type: string - - in: query - name: order_id - description: List order edits by order id. - schema: - type: string - - in: query - name: limit - description: The number of items in the response - schema: - type: number - default: '20' - - in: query - name: offset - description: The offset of items in response - schema: - type: number - default: '0' - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.list() - .then(({ order_edits, count, limit, offset }) => { - console.log(order_edits.length) - }) - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/order-edits' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edits: - type: array - $ref: '#/components/schemas/order_edit' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/order-edits/{id}/items/{item_id}': - delete: - operationId: DeleteOrderEditsOrderEditLineItemsLineItem - summary: Delete line items from an order edit and create change item - description: Delete line items from an order edit and create change item - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to delete from. - schema: - type: string - - in: path - name: item_id - required: true - description: The ID of the order edit item to delete from order. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostOrderEditsEditLineItemsLineItem - summary: Create or update the order edit change holding the line item changes - description: Create or update the order edit change holding the line item changes - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to update. - schema: - type: string - - in: path - name: item_id - required: true - description: The ID of the order edit item to update. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - description: The quantity to update - type: number - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, - { - quantity: 5 - }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ "quantity": 5 }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/order-edits/{id}/changes/{change_id}': - delete: - operationId: DeleteOrderEditsOrderEditItemChange - summary: Delete an Order Edit Item Change - description: Deletes an Order Edit Item Change - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to delete. - schema: - type: string - - in: path - name: change_id - required: true - description: The ID of the Order Edit Item Change to delete. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.deleteItemChange(order_edit_id, - item_change_id) - .then(({ id, object, deleted }) => { - console.log(id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' - \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Order Edit Item Change. - object: - type: string - description: The type of the object that was deleted. - format: item_change - deleted: - type: boolean - description: Whether or not the Order Edit Item Change was deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - '/order-edits/{id}': - delete: - operationId: DeleteOrderEditsOrderEdit - summary: Delete an Order Edit - description: Deletes an Order Edit - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to delete. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.delete(order_edit_id) - .then(({ id, object, deleted }) => { - console.log(id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Order Edit. - object: - type: string - description: The type of the object that was deleted. - format: order_edit - deleted: - type: boolean - description: Whether or not the Order Edit was deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - get: - operationId: GetOrderEditsOrderEdit - summary: Retrieve an OrderEdit - description: Retrieves a OrderEdit. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the OrderEdit. - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.retrieve(orderEditId) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/order-edits/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostOrderEditsOrderEdit - summary: Updates an OrderEdit - description: Updates a OrderEdit. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the OrderEdit. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - internal_note: - description: An optional note to create or update for the order edit. - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.update(order_edit_id, { - internal_note: "internal reason XY" - }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "internal_note": "internal reason XY" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/order-edits/{id}/request': - post: - operationId: PostOrderEditsOrderEditRequest - summary: Request order edit confirmation - description: Request customer confirmation of an Order Edit - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to request confirmation from. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.orderEdits.requestConfirmation(order_edit_id) - .then({ order_edit }) => { - console.log(order_edit.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/request' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '500': - $ref: '#/components/responses/500_error' '/payment-collections/{id}': delete: operationId: DeletePaymentCollectionsPaymentCollection @@ -10587,7 +9168,7 @@ paths: type: object properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -10616,18 +9197,7 @@ paths: content: application/json: schema: - type: object - properties: - description: - description: >- - An optional description to create or update the payment - collection. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminUpdatePaymentCollectionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10672,7 +9242,7 @@ paths: type: object properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -10734,7 +9304,7 @@ paths: type: object properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -10797,7 +9367,7 @@ paths: type: object properties: payment: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' '400': $ref: '#/components/responses/400_error' '401': @@ -10860,7 +9430,7 @@ paths: type: object properties: payment: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' '400': $ref: '#/components/responses/400_error' '401': @@ -10890,20 +9460,7 @@ paths: content: application/json: schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string + $ref: '#/components/schemas/AdminPostPaymentRefundsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10953,7 +9510,7 @@ paths: type: object properties: refund: - $ref: '#/components/schemas/refund' + $ref: '#/components/schemas/Refund' '400': $ref: '#/components/responses/400_error' '401': @@ -10983,50 +9540,7 @@ paths: content: application/json: schema: - type: object - properties: - prices: - description: The prices to update or add. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - override: - description: >- - If true the prices will replace all existing prices - associated with the Price List. - type: boolean + $ref: '#/components/schemas/AdminPostPriceListPricesPricesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11084,7 +9598,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11115,13 +9629,7 @@ paths: content: application/json: schema: - type: object - properties: - price_ids: - description: The price id's of the Money Amounts to delete. - type: array - items: - type: string + $ref: '#/components/schemas/AdminDeletePriceListPricesPricesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11205,88 +9713,7 @@ paths: content: application/json: schema: - type: object - required: - - name - - description - - type - - prices - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - variant_id: - description: The ID of the Variant for which the price is used. - type: string - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: '#/components/schemas/AdminPostPriceListsPriceListReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11352,7 +9779,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11550,7 +9977,7 @@ paths: price_lists: type: array items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' count: type: integer description: The total number of items available @@ -11693,7 +10120,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11722,86 +10149,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: '#/components/schemas/AdminPostPriceListsPriceListPriceListReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11847,7 +10195,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -12246,7 +10594,7 @@ paths: products: type: array items: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' count: type: integer description: The total number of items available @@ -12401,7 +10749,7 @@ paths: type: object properties: product_tags: - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' count: type: integer description: The total number of items available @@ -12556,7 +10904,7 @@ paths: type: object properties: product_types: - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' count: type: integer description: The total number of items available @@ -12595,15 +10943,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: >- - The title the Product Option will be identified by i.e. - "Size" - type: string + $ref: '#/components/schemas/AdminPostProductsProductOptionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -12649,7 +10989,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -12672,244 +11012,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - is_giftcard: - description: >- - A flag to indicate if the Product represents a Gift Card. - Purchasing Products with this flag set to `true` will result - in a Gift Card being created. - type: boolean - default: false - discountable: - description: >- - A flag to indicate if discounts can be applied to the - LineItems generated from this Product - type: boolean - default: true - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - default: draft - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: 'The value of the Tag, these will be upserted.' - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - options: - description: >- - The Options that the Product should have. These define on - which properties the Product's Product Variants will differ. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Option by. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out - of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for - this Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - region_id: - description: >- - The ID of the Region for which the price is - used. Only required if currency_code is not - provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id - is not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - value - properties: - value: - description: >- - The value to give for the Product Option at the - same index in the Product's `options` field. - type: string - weight: - description: The weight of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -12957,7 +11060,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13172,6 +11275,11 @@ paths: the result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -13211,7 +11319,7 @@ paths: products: type: array items: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' count: type: integer description: The total number of items available @@ -13252,117 +11360,7 @@ paths: content: application/json: schema: - type: object - required: - - title - - prices - - options - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: '#/components/schemas/AdminPostProductsProductVariantsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -13433,7 +11431,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13504,7 +11502,7 @@ paths: variants: type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' count: type: integer description: The total number of items available @@ -13597,7 +11595,7 @@ paths: description: Whether or not the items were deleted. default: true product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13632,13 +11630,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product Option - type: string + $ref: '#/components/schemas/AdminPostProductsProductOptionsOption' x-codeSamples: - lang: JavaScript label: JS Client @@ -13684,7 +11676,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13818,7 +11810,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13847,225 +11839,7 @@ paths: content: application/json: schema: - type: object - properties: - title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - discountable: - description: >- - A flag to indicate if discounts can be applied to the - LineItems generated from this Product - type: boolean - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: 'The value of the Tag, these will be upserted.' - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - properties: - id: - description: The ID of the Product Variant. - type: string - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out - of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for - this Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the Price. - type: string - region_id: - description: >- - The ID of the Region for which the price is - used. Only required if currency_code is not - provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id - is not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Option. - type: string - value: - description: >- - The value to give for the Product Option at the - same index in the Product's `options` field. - type: string - weight: - description: The wieght of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostProductsProductReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14112,7 +11886,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14192,7 +11966,7 @@ paths: description: Whether or not the items were deleted. default: true product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14227,114 +12001,7 @@ paths: content: application/json: schema: - type: object - required: - - prices - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The weight of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: '#/components/schemas/AdminPostProductsProductVariantsVariantReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14399,7 +12066,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14525,7 +12192,7 @@ paths: types: type: array items: - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' '400': $ref: '#/components/responses/400_error' '401': @@ -14555,17 +12222,7 @@ paths: content: application/json: schema: - type: object - required: - - key - - value - properties: - key: - description: The metadata key - type: string - value: - description: The metadata value - type: string + $ref: '#/components/schemas/AdminPostProductsProductMetadataReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14614,7 +12271,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14644,22 +12301,8 @@ paths: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: >- - The IDs of the sales channels to add to the publishable api - key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + #/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -14713,7 +12356,7 @@ paths: schema: properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14742,22 +12385,8 @@ paths: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: >- - The IDs of the sales channels to delete from the publishable - api key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + #/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -14811,7 +12440,7 @@ paths: schema: properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14833,13 +12462,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: A title for the publishable api key - type: string + $ref: '#/components/schemas/AdminPostPublishableApiKeysReq' x-authenticated: true x-codeSamples: - lang: JavaScript @@ -14879,7 +12502,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14962,7 +12585,7 @@ paths: properties: publishable_api_keys: type: array - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15086,7 +12709,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15112,6 +12735,11 @@ paths: description: The ID of the Publishable Api Key. schema: type: string + - in: query + name: q + description: Query used for searching sales channels' names and descriptions. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -15150,7 +12778,7 @@ paths: sales_channels: type: array items: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -15215,7 +12843,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15245,11 +12873,8 @@ paths: content: application/json: schema: - type: object - properties: - title: - description: A title to update for the key. - type: string + $ref: >- + #/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq x-codeSamples: - lang: JavaScript label: JS Client @@ -15294,7 +12919,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15324,17 +12949,7 @@ paths: content: application/json: schema: - type: object - required: - - country_code - properties: - country_code: - description: The 2 character ISO code for the Country. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. + $ref: '#/components/schemas/AdminPostRegionsRegionCountriesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15380,7 +12995,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15410,13 +13025,8 @@ paths: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Fulfillment Provider to add. - type: string + $ref: >- + #/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq x-codeSamples: - lang: JavaScript label: JS Client @@ -15462,7 +13072,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15492,13 +13102,7 @@ paths: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Payment Provider to add. - type: string + $ref: '#/components/schemas/AdminPostRegionsRegionPaymentProvidersReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15544,7 +13148,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15567,56 +13171,7 @@ paths: content: application/json: schema: - type: object - required: - - name - - currency_code - - tax_rate - - payment_providers - - fulfillment_providers - - countries - 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 - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - 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 Provider IDs that should be enabled for - the Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled - for the Region - type: array - items: - type: string - countries: - description: >- - A list of countries' 2 ISO Characters that should be - included in the Region. - example: - - US - type: array - items: - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of region' - type: boolean + $ref: '#/components/schemas/AdminPostRegionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15684,7 +13239,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15780,7 +13335,7 @@ paths: regions: type: array items: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' count: type: integer description: The total number of items available @@ -15923,7 +13478,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15952,63 +13507,7 @@ paths: content: application/json: schema: - type: object - 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 - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - 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 - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of region' - type: boolean - payment_providers: - description: >- - A list of Payment Provider IDs that should be enabled for - the Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled - for the Region - type: array - items: - type: string - countries: - description: >- - A list of countries' 2 ISO Characters that should be - included in the Region. - type: array - items: - type: string + $ref: '#/components/schemas/AdminPostRegionsRegionReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16054,7 +13553,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16201,7 +13700,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16271,7 +13770,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16341,7 +13840,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16364,30 +13863,7 @@ paths: content: application/json: schema: - type: object - required: - - label - - value - properties: - 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 - 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 - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostReturnReasonsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16435,7 +13911,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16492,7 +13968,7 @@ paths: return_reasons: type: array items: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16626,7 +14102,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16655,24 +14131,7 @@ paths: content: application/json: schema: - type: object - properties: - 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 - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostReturnReasonsReasonReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16718,7 +14177,235 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/returns/{id}/cancel': + post: + operationId: PostReturnsReturnCancel + summary: Cancel a Return + description: Registers a Return as canceled. + parameters: + - in: path + name: id + required: true + description: The ID of the Return. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returns.cancel(return_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/returns/{id}/cancel' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /returns: + get: + operationId: GetReturns + summary: List Returns + description: Retrieves a list of Returns + parameters: + - in: query + name: limit + description: The upper limit for the amount of responses returned. + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returns.list() + + .then(({ returns, limit, offset, count }) => { + console.log(returns.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET 'https://medusa-url.com/admin/returns' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + returns: + type: array + items: + $ref: '#/components/schemas/Return' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/returns/{id}/receive': + post: + operationId: PostReturnsReturnReceive + summary: Receive a Return + description: >- + Registers a Return as received. Updates statuses on Orders and Swaps + accordingly. + parameters: + - in: path + name: id + required: true + description: The ID of the Return. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReturnsReturnReceiveReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returns.receive(return_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then((data) => { + console.log(data.return.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/returns/{id}/receive' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "items": [ + { + "item_id": "asafg", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + return: + $ref: '#/components/schemas/Return' '400': $ref: '#/components/responses/400_error' '401': @@ -16748,21 +14435,8 @@ paths: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: The IDs of the products to add to the Sales Channel - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the product + $ref: >- + #/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -16816,7 +14490,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -16845,21 +14519,8 @@ paths: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: The IDs of the products to delete from the Sales Channel. - type: array - items: - type: object - required: - - id - properties: - id: - description: The ID of a product - type: string + $ref: >- + #/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -16913,7 +14574,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -16936,19 +14597,7 @@ paths: content: application/json: schema: - type: object - required: - - name - properties: - name: - description: The name of the Sales Channel - type: string - description: - description: The description of the Sales Channel - type: string - is_disabled: - description: Whether the Sales Channel is disabled or not. - type: boolean + $ref: '#/components/schemas/AdminPostSalesChannelsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16995,7 +14644,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17170,7 +14819,7 @@ paths: sales_channels: type: array items: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' count: type: integer description: The total number of items available @@ -17313,7 +14962,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17342,17 +14991,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - type: string - description: Name of the sales channel. - description: - type: string - description: Sales Channel description. - is_disabled: - type: boolean - description: Indication of if the sales channel is active. + $ref: '#/components/schemas/AdminPostSalesChannelsSalesChannelReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -17398,255 +15037,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/returns/{id}/cancel': - post: - operationId: PostReturnsReturnCancel - summary: Cancel a Return - description: Registers a Return as canceled. - parameters: - - in: path - name: id - required: true - description: The ID of the Return. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.returns.cancel(return_id) - - .then(({ order }) => { - console.log(order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/returns/{id}/cancel' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Return - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order: - $ref: '#/components/schemas/order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /returns: - get: - operationId: GetReturns - summary: List Returns - description: Retrieves a list of Returns - parameters: - - in: query - name: limit - description: The upper limit for the amount of responses returned. - schema: - type: number - default: '50' - - in: query - name: offset - description: The offset of the list returned. - schema: - type: number - default: '0' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.returns.list() - - .then(({ returns, limit, offset, count }) => { - console.log(returns.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET 'https://medusa-url.com/admin/returns' - \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Return - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - returns: - type: array - items: - $ref: '#/components/schemas/return' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/returns/{id}/receive': - post: - operationId: PostReturnsReturnReceive - summary: Receive a Return - description: >- - Registers a Return as received. Updates statuses on Orders and Swaps - accordingly. - parameters: - - in: path - name: id - required: true - description: The ID of the Return. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - items - properties: - items: - description: The Line Items that have been received. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - refund: - description: The amount to refund. - type: number - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.returns.receive(return_id, { - items: [ - { - item_id, - quantity: 1 - } - ] - }) - - .then((data) => { - console.log(data.return.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/returns/{id}/receive' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "items": [ - { - "item_id": "asafg", - "quantity": 1 - } - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Return - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - return: - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17669,81 +15060,7 @@ paths: content: application/json: schema: - type: object - required: - - name - - region_id - - provider_id - - data - - price_type - properties: - name: - description: The name of the Shipping Option - type: string - region_id: - description: >- - The ID of the Region in which the Shipping Option will be - available. - type: string - provider_id: - description: >- - The ID of the Fulfillment Provider that handles the Shipping - Option. - type: string - profile_id: - description: >- - The ID of the Shipping Profile to add the Shipping Option - to. - type: number - data: - description: >- - The data needed for the Fulfillment Provider to handle - shipping with this Shipping Option. - type: object - price_type: - description: The type of the Shipping Option price. - type: string - enum: - - flat_rate - - calculated - amount: - description: The amount to charge for the Shipping Option. - type: integer - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. - type: array - items: - required: - - type - - amount - properties: - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - is_return: - description: Whether the Shipping Option defines a return shipment. - type: boolean - default: false - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - default: false - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + $ref: '#/components/schemas/AdminPostShippingOptionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -17798,7 +15115,7 @@ paths: type: object properties: shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '401': @@ -17871,7 +15188,7 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' count: type: integer description: The total number of items available @@ -18008,7 +15325,7 @@ paths: type: object properties: shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '401': @@ -18037,49 +15354,7 @@ paths: content: application/json: schema: - type: object - required: - - requirements - properties: - name: - description: The name of the Shipping Option - type: string - 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 - Option to be available. - type: array - items: - required: - - type - - amount - properties: - id: - description: The ID of the requirement - type: string - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + $ref: '#/components/schemas/AdminPostShippingOptionsOptionReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -18137,7 +15412,7 @@ paths: type: object properties: shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '401': @@ -18160,13 +15435,7 @@ paths: content: application/json: schema: - type: object - required: - - name - properties: - name: - description: The name of the Shipping Profile - type: string + $ref: '#/components/schemas/AdminPostShippingProfilesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -18212,7 +15481,7 @@ paths: type: object properties: shipping_profile: - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' '400': $ref: '#/components/responses/400_error' '401': @@ -18269,7 +15538,7 @@ paths: shipping_profiles: type: array items: - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' '400': $ref: '#/components/responses/400_error' '401': @@ -18403,7 +15672,7 @@ paths: type: object properties: shipping_profile: - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' '400': $ref: '#/components/responses/400_error' '401': @@ -18431,11 +15700,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: The name of the Shipping Profile - type: string + $ref: '#/components/schemas/AdminPostShippingProfilesProfileReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -18481,7 +15746,7 @@ paths: type: object properties: shipping_profile: - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' '400': $ref: '#/components/responses/400_error' '401': @@ -18547,7 +15812,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18612,7 +15877,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18666,7 +15931,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18688,42 +15953,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: The name of the Store - type: string - swap_link_template: - description: >- - 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 - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - currencies: - description: Array of currencies in 2 character ISO code format. - type: array - items: - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostStoreReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -18769,7 +15999,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18827,7 +16057,7 @@ paths: payment_providers: type: array items: - $ref: '#/components/schemas/payment_provider' + $ref: '#/components/schemas/PaymentProvider' '400': $ref: '#/components/responses/400_error' '401': @@ -18885,7 +16115,7 @@ paths: tax_providers: type: array items: - $ref: '#/components/schemas/tax_provider' + $ref: '#/components/schemas/TaxProvider' '400': $ref: '#/components/responses/400_error' '401': @@ -18948,7 +16178,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '401': @@ -19017,7 +16247,7 @@ paths: swaps: type: array items: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' count: type: integer description: The total number of items available @@ -19074,17 +16304,7 @@ paths: content: application/json: schema: - type: object - required: - - product_types - properties: - product_types: - type: array - description: >- - The IDs of the types of products to associate with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19134,7 +16354,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19181,17 +16401,7 @@ paths: content: application/json: schema: - type: object - required: - - product_types - properties: - product_types: - type: array - description: >- - The IDs of the types of products to remove association with - this tax rate - items: - type: string + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19241,7 +16451,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19289,15 +16499,7 @@ paths: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: The IDs of the products to associate with this tax rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19347,7 +16549,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19394,17 +16596,7 @@ paths: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: >- - The IDs of the products to remove association with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19454,7 +16646,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19502,17 +16694,7 @@ paths: content: application/json: schema: - type: object - required: - - shipping_options - properties: - shipping_options: - type: array - description: >- - The IDs of the shipping options to associate with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19563,7 +16745,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19610,17 +16792,8 @@ paths: content: application/json: schema: - type: object - required: - - shipping_options - properties: - shipping_options: - type: array - description: >- - The IDs of the shipping options to remove association with - this tax rate - items: - type: string + $ref: >- + #/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -19671,7 +16844,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19713,43 +16886,7 @@ paths: content: application/json: schema: - type: object - required: - - code - - name - - region_id - properties: - code: - type: string - description: A code to identify the tax type by - name: - type: string - description: A human friendly name for the tax - region_id: - type: string - description: The ID of the Region that the rate belongs to - rate: - type: number - description: The numeric rate to charge - products: - type: array - description: The IDs of the products associated with this tax rate - items: - type: string - shipping_options: - type: array - description: >- - The IDs of the shipping options associated with this tax - rate - items: - type: string - product_types: - type: array - description: >- - The IDs of the types of products associated with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19799,7 +16936,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19930,7 +17067,7 @@ paths: tax_rates: type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' count: type: integer description: The total number of items available @@ -20091,7 +17228,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -20138,39 +17275,7 @@ paths: content: application/json: schema: - type: object - properties: - code: - type: string - description: A code to identify the tax type by - name: - type: string - description: A human friendly name for the tax - region_id: - type: string - description: The ID of the Region that the rate belongs to - rate: - type: number - description: The numeric rate to charge - products: - type: array - description: The IDs of the products associated with this tax rate - items: - type: string - shipping_options: - type: array - description: >- - The IDs of the shipping options associated with this tax - rate - items: - type: string - product_types: - type: array - description: >- - The IDs of the types of products associated with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -20216,7 +17321,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -20399,32 +17504,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - password - properties: - email: - description: The Users email. - type: string - format: email - 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 - enum: - - admin - - member - - developer - password: - description: The Users password. - type: string - format: password + $ref: '#/components/schemas/AdminCreateUserRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20472,7 +17552,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20527,7 +17607,7 @@ paths: users: type: array items: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20661,7 +17741,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20690,29 +17770,7 @@ paths: content: application/json: schema: - type: object - properties: - 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 - enum: - - admin - - member - - developer - api_token: - description: The api token of the User. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminUpdateUserRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20758,7 +17816,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20781,14 +17839,7 @@ paths: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The Users email. - type: string - format: email + $ref: '#/components/schemas/AdminResetPasswordTokenRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20854,22 +17905,7 @@ paths: content: application/json: schema: - type: object - required: - - token - - password - properties: - email: - description: The Users email. - type: string - format: email - token: - description: The token generated from the 'password-token' endpoint. - type: string - password: - description: The Users new password. - type: string - format: password + $ref: '#/components/schemas/AdminResetPasswordRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20917,7 +17953,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -21067,7 +18103,7 @@ paths: variants: type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' count: type: integer description: The total number of items available @@ -21096,7 +18132,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: An unknown error occurred. @@ -21106,7 +18142,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: >- @@ -21118,7 +18154,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: invalid_request_error message: Discount with code TEST already exists. @@ -21128,7 +18164,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: message: Entity with id 1 was not found type: not_found @@ -21138,21 +18174,21 @@ components: application/json: schema: oneOf: - - $ref: '#/components/schemas/error' - - $ref: '#/components/schemas/multiple_errors' + - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/MultipleErrors' examples: not_allowed: $ref: '#/components/examples/not_allowed_error' invalid_data: $ref: '#/components/examples/invalid_data_error' - multiple_errors: + MultipleErrors: $ref: '#/components/examples/multiple_errors' 500_error: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' examples: database: $ref: '#/components/examples/database_error' @@ -21363,10 +18399,9 @@ components: Where `{sid}` is the value of `connect.sid` that you copied. schemas: - address_fields: + AddressFields: title: Address Fields description: Address fields used when creating/updating an address. - x-resourceId: address type: object properties: company: @@ -21418,10 +18453,9 @@ components: description: An optional key-value map with additional details example: car: white - address: + Address: title: Address description: An address. - x-resourceId: address type: object properties: id: @@ -21502,10 +18536,9 @@ components: description: An optional key-value map with additional details example: car: white - batch_job: + BatchJob: title: Batch Job description: A Batch Job. - x-resourceId: batch_job type: object required: - type @@ -21645,10 +18678,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - cart: + Cart: title: Cart description: Represents a user cart - x-resourceId: cart type: object properties: id: @@ -21665,19 +18697,19 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' region_id: type: string description: The region's ID @@ -21706,24 +18738,24 @@ components: type: object payment_session: description: The selected payment session in the cart. - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' type: type: string description: The cart's type. @@ -21823,10 +18855,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - claim_image: + ClaimImage: title: Claim Image description: Represents photo documentation of a claim. - x-resourceId: claim_image type: object required: - claim_item_id @@ -21865,12 +18896,11 @@ components: description: An optional key-value map with additional details example: car: white - claim_item: + ClaimItem: title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. - x-resourceId: claim_item type: object required: - claim_order_id @@ -21887,7 +18917,7 @@ components: type: array description: Available if the relation `images` is expanded. items: - $ref: '#/components/schemas/claim_image' + $ref: '#/components/schemas/ClaimImage' claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -21902,7 +18932,7 @@ components: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. type: string @@ -21934,7 +18964,7 @@ components: relation 'tags' is expanded. type: array items: - $ref: '#/components/schemas/claim_tag' + $ref: '#/components/schemas/ClaimTag' created_at: type: string description: The date with timezone at which the resource was created. @@ -21952,13 +18982,12 @@ components: description: An optional key-value map with additional details example: car: white - claim_order: + ClaimOrder: title: Claim Order description: >- Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. - x-resourceId: claim_order type: object required: - type @@ -21998,14 +19027,14 @@ components: description: The items that have been claimed type: array items: - $ref: '#/components/schemas/claim_item' + $ref: '#/components/schemas/ClaimItem' 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/LineItem' order_id: description: The ID of the order that the claim comes from. type: string @@ -22024,17 +19053,17 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $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/ShippingMethod' 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 @@ -22075,12 +19104,11 @@ components: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - claim_tag: + ClaimTag: title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. - x-resourceId: claim_tag type: object required: - value @@ -22110,10 +19138,9 @@ components: description: An optional key-value map with additional details example: car: white - country: + Country: title: Country description: Country details - x-resourceId: country type: object required: - iso_2 @@ -22165,10 +19192,9 @@ components: region: description: A region object. Available if the relation `region` is expanded. type: object - currency: + Currency: title: Currency description: Currency - x-resourceId: currency type: object required: - code @@ -22198,13 +19224,12 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean - custom_shipping_option: + CustomShippingOption: title: Custom Shipping Option description: >- Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option - x-resourceId: custom_shipping_option type: object required: - price @@ -22260,10 +19285,9 @@ components: [EXPERIMENTAL] Indicates if the custom shipping option price include tax type: boolean - customer_group: + CustomerGroup: title: Customer Group description: Represents a customer group - x-resourceId: customer_group type: object required: - name @@ -22290,7 +19314,7 @@ components: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' created_at: type: string description: The date with timezone at which the resource was created. @@ -22308,10 +19332,9 @@ components: description: An optional key-value map with additional details example: car: white - customer: + Customer: title: Customer description: Represents a customer - x-resourceId: customer type: object required: - email @@ -22338,12 +19361,12 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' phone: type: string description: The customer's phone number @@ -22364,7 +19387,7 @@ components: relation `groups` is expanded. type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' created_at: type: string description: The date with timezone at which the resource was created. @@ -22382,10 +19405,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_customer_group: + DiscountConditionCustomerGroup: title: Product Tag Discount Condition description: Associates a discount condition with a customer group - x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -22401,10 +19423,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22418,10 +19440,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_collection: + DiscountConditionProductCollection: title: Product Collection Discount Condition description: Associates a discount condition with a product collection - x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -22437,10 +19458,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22454,10 +19475,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_tag: + DiscountConditionProductTag: title: Product Tag Discount Condition description: Associates a discount condition with a product tag - x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -22473,10 +19493,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22490,10 +19510,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_type: + DiscountConditionProductType: title: Product Type Discount Condition description: Associates a discount condition with a product type - x-resourceId: discount_condition_product type: object required: - product_type_id @@ -22509,10 +19528,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22526,10 +19545,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product: + DiscountConditionProduct: title: Product Discount Condition description: Associates a discount condition with a product - x-resourceId: discount_condition_product type: object required: - product_id @@ -22545,10 +19563,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22562,10 +19580,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition: + DiscountCondition: title: Discount Condition description: Holds rule conditions for when a discount is applicable - x-resourceId: discount_condition type: object required: - type @@ -22597,7 +19614,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' products: description: >- products associated with this condition if type = products. @@ -22658,12 +19675,11 @@ components: description: An optional key-value map with additional details example: car: white - discount_rule: + DiscountRule: title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. - x-resourceId: discount_rule type: object required: - type @@ -22726,12 +19742,11 @@ components: description: An optional key-value map with additional details example: car: white - discount: + Discount: title: Discount description: >- Represents a discount that can be applied to a cart for promotional purposes. - x-resourceId: discount type: object required: - code @@ -22759,7 +19774,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -22774,7 +19789,7 @@ components: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. type: string @@ -22821,10 +19836,9 @@ components: description: An optional key-value map with additional details example: car: white - draft-order: + DraftOrder: title: DraftOrder description: Represents a draft order - x-resourceId: draft-order type: object properties: id: @@ -22894,12 +19908,11 @@ components: description: An optional key-value map with additional details example: car: white - fulfillment_item: + FulfillmentItem: title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. - x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -22921,17 +19934,16 @@ components: type: object item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer example: 1 - fulfillment_provider: + FulfillmentProvider: title: Fulfillment Provider description: >- Represents a fulfillment provider plugin and holds its installation status. - x-resourceId: fulfillment_provider type: object properties: id: @@ -22945,7 +19957,7 @@ components: to `false`. type: boolean example: true - fulfillment: + Fulfillment: title: Fulfillment description: >- Fulfillments are created once store operators can prepare the purchased @@ -22955,7 +19967,6 @@ components: partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. - x-resourceId: fulfillment type: object required: - provider_id @@ -22995,7 +20006,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' items: description: >- The Fulfillment Items in the Fulfillment - these hold information @@ -23003,7 +20014,7 @@ components: the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_item' + $ref: '#/components/schemas/FulfillmentItem' tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -23011,7 +20022,7 @@ components: Provider. Available if the relation `tracking_links` is expanded. type: array items: - $ref: '#/components/schemas/tracking_link' + $ref: '#/components/schemas/TrackingLink' tracking_numbers: deprecated: true description: >- @@ -23066,12 +20077,11 @@ components: description: An optional key-value map with additional details example: car: white - gift_card_transaction: + GiftCardTransaction: title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order - x-resourceId: gift_card_transaction type: object required: - gift_card_id @@ -23113,12 +20123,11 @@ components: description: The tax rate of the transaction type: number example: 0 - gift_card: + GiftCard: title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. - x-resourceId: gift_card type: object required: - code @@ -23168,6 +20177,10 @@ components: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. @@ -23185,12 +20198,11 @@ components: description: An optional key-value map with additional details example: car: white - idempotency_key: + IdempotencyKey: title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. - x-resourceId: idempotency_key type: object required: - idempotency_key @@ -23242,10 +20254,9 @@ components: type: string description: Where to continue from. default: started - image: + Image: title: Image description: Images holds a reference to a URL at which the image file can be found. - x-resourceId: image type: object required: - url @@ -23275,10 +20286,9 @@ components: description: An optional key-value map with additional details example: car: white - invite: + Invite: title: Invite description: Represents an invite - x-resourceId: invite type: object required: - user_email @@ -23327,10 +20337,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_adjustment: + LineItemAdjustment: title: Line Item Adjustment - description: Represents an Line Item Adjustment - x-resourceId: line_item_adjustment + description: Represents a Line Item Adjustment type: object required: - item_id @@ -23347,7 +20356,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' description: type: string description: The line item's adjustment description @@ -23358,7 +20367,7 @@ components: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' amount: type: number description: The adjustment amount @@ -23368,10 +20377,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_tax_line: + LineItemTaxLine: title: Line Item Tax Line - description: Represents an Line Item Tax Line - x-resourceId: line_item_tax_line + description: Represents a Line Item Tax Line type: object required: - item_id @@ -23388,7 +20396,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' code: description: A code to identify the tax type by type: string @@ -23414,7 +20422,7 @@ components: description: An optional key-value map with additional details example: car: white - line_item: + LineItem: title: Line Item description: >- Line Items represent purchasable units that can be added to a Cart for @@ -23422,7 +20430,6 @@ components: resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. - x-resourceId: line_item type: object required: - title @@ -23467,12 +20474,12 @@ components: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: '#/components/schemas/line_item_tax_line' + $ref: '#/components/schemas/LineItemTaxLine' adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: '#/components/schemas/line_item_adjustment' + $ref: '#/components/schemas/LineItemAdjustment' title: description: >- The title of the Line Item, this should be easily identifiable by @@ -23608,7 +20615,7 @@ components: description: An optional key-value map with additional details example: car: white - money_amount: + MoneyAmount: title: Money Amount description: >- Money Amounts represents an amount that a given Product Variant can be @@ -23617,7 +20624,6 @@ components: fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. - x-resourceId: money_amount type: object required: - currency_code @@ -23636,7 +20642,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to @@ -23661,7 +20667,7 @@ components: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' variant_id: description: The id of the Product Variant contained in the Line Item. type: string @@ -23695,13 +20701,12 @@ components: description: An optional key-value map with additional details example: car: white - note: + Note: title: Note description: >- Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. - x-resourceId: note type: object required: - value @@ -23730,7 +20735,7 @@ components: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' created_at: type: string description: The date with timezone at which the resource was created. @@ -23748,12 +20753,11 @@ components: description: An optional key-value map with additional details example: car: white - notification_provider: + NotificationProvider: title: Notification Provider description: >- Represents a notification provider plugin and holds its installation status. - x-resourceId: notification_provider type: object required: - id @@ -23769,14 +20773,13 @@ components: to `false`. type: boolean default: true - notification: + Notification: title: Notification description: >- Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. - x-resourceId: notification type: object required: - resource_type @@ -23825,14 +20828,14 @@ components: Notification. type: array items: - $ref: '#/components/schemas/notification_resend' + $ref: '#/components/schemas/NotificationResend' provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -23841,10 +20844,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - notification_resend: + NotificationResend: title: Notification Resend description: A resend of a Notification. - x-resourceId: notification_resend type: object properties: id: @@ -23889,14 +20891,14 @@ components: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -23908,7 +20910,6 @@ components: OAuth: title: OAuth description: Represent an OAuth app - x-resourceId: OAuth type: object required: - id @@ -23939,10 +20940,9 @@ components: type: object description: Any data necessary to the app. example: {} - order_edit: + OrderEdit: title: Order Edit description: Order edit keeps track of order items changes. - x-resourceId: order_edit type: object required: - order_id @@ -23960,12 +20960,12 @@ components: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: '#/components/schemas/order_item_change' + $ref: '#/components/schemas/OrderItemChange' internal_note: description: An optional note with additional details about the order edit. type: string @@ -24052,14 +21052,14 @@ components: type: array description: Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' created_at: type: string description: The date with timezone at which the resource was created. @@ -24068,10 +21068,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - order_item_change: + OrderItemChange: title: Order Item Change description: Represents an order edit item change - x-resourceId: order_item_change type: object required: - type @@ -24094,21 +21093,21 @@ components: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' created_at: type: string description: The date with timezone at which the resource was created. @@ -24126,10 +21125,9 @@ components: description: An optional key-value map with additional details example: car: white - order: + Order: title: Order description: Represents an order - x-resourceId: order type: object required: - customer_id @@ -24205,14 +21203,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' region_id: type: string description: The region's ID @@ -24229,7 +21227,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The order's tax rate type: number @@ -24256,21 +21254,21 @@ components: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' returns: type: array description: >- @@ -24318,21 +21316,21 @@ components: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: '#/components/schemas/gift_card_transaction' + $ref: '#/components/schemas/GiftCardTransaction' canceled_at: type: string description: The date the order was canceled on. @@ -24405,10 +21403,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - payment_collection: + PaymentCollection: title: Payment Collection description: Payment Collection - x-resourceId: payment_collection type: object required: - type @@ -24451,7 +21448,7 @@ components: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' currency_code: description: The 3 character ISO code for the currency. type: string @@ -24461,17 +21458,17 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' created_by: type: string description: The ID of the user that created the payment collection. @@ -24492,10 +21489,9 @@ components: description: An optional key-value map with additional details example: car: white - payment_provider: + PaymentProvider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. - x-resourceId: payment_provider type: object required: - id @@ -24511,7 +21507,7 @@ components: to `false`. type: boolean default: true - payment_session: + PaymentSession: title: Payment Session description: >- Payment Sessions are created when a Customer initilizes the checkout @@ -24520,7 +21516,6 @@ components: communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. - x-resourceId: payment_session type: object required: - cart_id @@ -24589,12 +21584,11 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - payment: + Payment: title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. - x-resourceId: payment type: object required: - amount @@ -24638,7 +21632,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount_refunded: description: >- The amount of the original Payment amount that has been refunded @@ -24687,12 +21681,11 @@ components: description: An optional key-value map with additional details example: car: white - price_list: + PriceList: title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. - x-resourceId: price_list type: object required: - name @@ -24749,8 +21742,8 @@ components: type: array items: oneOf: - - $ref: '#/components/schemas/money_amount' - - $ref: '#/components/schemas/customer_group' + - $ref: '#/components/schemas/MoneyAmount' + - $ref: '#/components/schemas/CustomerGroup' includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean @@ -24766,10 +21759,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - product_collection: + ProductCollection: title: Product Collection description: Product Collections represents a group of Products that are related. - x-resourceId: product_collection type: object required: - title @@ -24813,13 +21805,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option_value: + ProductOptionValue: title: Product Option Value description: >- A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. - x-resourceId: product_option_value type: object required: - value @@ -24845,7 +21836,7 @@ components: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variant_id: description: >- The ID of the Product Variant that the Product Option Value is @@ -24854,7 +21845,7 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' created_at: type: string description: The date with timezone at which the resource was created. @@ -24872,13 +21863,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option: + ProductOption: title: Product Option description: >- Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. - x-resourceId: product_option type: object required: - title @@ -24898,7 +21888,7 @@ components: Available if the relation `values` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' product_id: description: The ID of the Product that the Product Option is defined for. type: string @@ -24923,10 +21913,9 @@ components: description: An optional key-value map with additional details example: car: white - product_tag: + ProductTag: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. - x-resourceId: product_tag type: object required: - value @@ -24956,12 +21945,11 @@ components: description: An optional key-value map with additional details example: car: white - product_tax_rate: + ProductTaxRate: 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 type: object required: - product_id @@ -24973,14 +21961,14 @@ components: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -24994,12 +21982,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type_tax_rate: + ProductTypeTaxRate: 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 type: object required: - product_type_id @@ -25011,14 +21998,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' rate_id: description: The id of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -25032,12 +22019,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type: + ProductType: title: Product Type description: >- Product Type can be added to Products for filtering and reporting purposes. - x-resourceId: product_type type: object required: - value @@ -25067,14 +22053,13 @@ components: description: An optional key-value map with additional details example: car: white - product_variant: + ProductVariant: title: Product Variant description: >- Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. - x-resourceId: product_variant type: object required: - title @@ -25105,7 +22090,7 @@ components: Region. Available if the relation `prices` is expanded. type: array items: - $ref: '#/components/schemas/money_amount' + $ref: '#/components/schemas/MoneyAmount' sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -25207,7 +22192,7 @@ components: Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' created_at: type: string description: The date with timezone at which the resource was created. @@ -25225,10 +22210,9 @@ components: description: An optional key-value map with additional details example: car: white - product_variant_prices_fields: + ProductVariantPricesFields: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. - x-resourceId: product_variant_prices_fields type: object properties: original_price: @@ -25266,13 +22250,12 @@ components: code: type: string description: The code of the tax rate - product: + Product: title: Product description: >- Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. - x-resourceId: product type: object required: - title @@ -25323,7 +22306,7 @@ components: expanded. 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 @@ -25335,7 +22318,7 @@ components: Option Values. Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variants: description: >- The Product Variants that belong to the Product. Each will have a @@ -25343,7 +22326,7 @@ components: relation `variants` is expanded. type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -25353,7 +22336,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -25421,14 +22404,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' tags: description: >- The Product Tags assigned to the Product. Available if the relation `tags` is expanded. type: array items: - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discountable: description: >- Whether the Product can be discounted. Discounts will not apply to @@ -25464,10 +22447,9 @@ components: description: An optional key-value map with additional details example: car: white - publishable_api_key_sales_channel: + PublishableApiKeySalesChannel: title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels - x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: @@ -25478,12 +22460,11 @@ components: type: string description: The publishable API key's ID example: pak_01G1G5V21KADXNGH29BJMAJ4B4 - publishable_api_key: + PublishableApiKey: title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. - x-resourceId: publishable_api_key type: object properties: id: @@ -25520,13 +22501,12 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - refund: + Refund: title: Refund description: >- Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. - x-resourceId: refund type: object required: - order_id @@ -25586,14 +22566,13 @@ components: description: An optional key-value map with additional details example: car: white - region: + Region: title: Region description: >- Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. - x-resourceId: region type: object required: - name @@ -25619,7 +22598,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -25630,7 +22609,7 @@ components: relation `tax_rates` is expanded. type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' tax_code: description: >- The tax code used on purchases in the Region. This may be used by @@ -25651,28 +22630,28 @@ components: relation `countries` is expanded. type: array items: - $ref: '#/components/schemas/country' + $ref: '#/components/schemas/Country' tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: '#/components/schemas/tax_provider' + $ref: '#/components/schemas/TaxProvider' payment_providers: description: >- The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/payment_provider' + $ref: '#/components/schemas/PaymentProvider' fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean @@ -25693,12 +22672,11 @@ components: description: An optional key-value map with additional details example: car: white - return_item: + ReturnItem: title: Return Item description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. - x-resourceId: return_item type: object required: - return_id @@ -25710,14 +22688,14 @@ components: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -25742,7 +22720,7 @@ components: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' note: description: An optional note with additional details about the Return. type: string @@ -25752,12 +22730,11 @@ components: description: An optional key-value map with additional details example: car: white - return_reason: + ReturnReason: title: Return Reason description: >- A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. - x-resourceId: return_reason type: object required: - value @@ -25785,10 +22762,10 @@ components: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' created_at: type: string description: The date with timezone at which the resource was created. @@ -25806,13 +22783,12 @@ components: description: An optional key-value map with additional details example: car: white - return: + Return: title: Return description: >- Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. - x-resourceId: return type: object required: - refund_amount @@ -25836,7 +22812,7 @@ components: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/return_item' + $ref: '#/components/schemas/ReturnItem' swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -25867,7 +22843,7 @@ components: Available if the relation `shipping_method` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -25910,10 +22886,9 @@ components: description: An optional key-value map with additional details example: car: white - sales_channel: + SalesChannel: title: Sales Channel description: A Sales Channel - x-resourceId: sales_channel type: object required: - name @@ -25946,10 +22921,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_method_tax_line: + ShippingMethodTaxLine: title: Shipping Method Tax Line description: Shipping Method Tax Line - x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -25966,7 +22940,7 @@ components: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' code: description: A code to identify the tax type by type: string @@ -25992,14 +22966,13 @@ components: description: An optional key-value map with additional details example: car: white - shipping_method: + ShippingMethod: title: Shipping Method description: >- Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. - x-resourceId: shipping_method type: object required: - shipping_option_id @@ -26017,7 +22990,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -26061,7 +23034,7 @@ components: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: '#/components/schemas/shipping_method_tax_line' + $ref: '#/components/schemas/ShippingMethodTaxLine' price: description: >- The amount to charge for the Shipping Method. The currency of the @@ -26079,12 +23052,11 @@ components: includes_tax: description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' type: boolean - shipping_option_requirement: + ShippingOptionRequirement: title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. - x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -26103,7 +23075,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' type: description: >- The type of the requirement, this defines how the value will be @@ -26124,7 +23096,7 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_option: + ShippingOption: title: Shipping Option description: >- Shipping Options represent a way in which an Order or Return can be @@ -26133,7 +23105,6 @@ components: Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. - x-resourceId: shipping_option type: object required: - name @@ -26168,7 +23139,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -26177,7 +23148,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' price_type: description: >- The type of pricing calculation that is used when creatin Shipping @@ -26208,7 +23179,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option_requirement' + $ref: '#/components/schemas/ShippingOptionRequirement' data: description: >- The data needed for the Fulfillment Provider to identify the @@ -26235,12 +23206,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_profile: + ShippingProfile: title: Shipping Profile description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. - x-resourceId: shipping_profile type: object required: - name @@ -26281,7 +23251,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' created_at: type: string description: The date with timezone at which the resource was created. @@ -26299,12 +23269,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_tax_rate: + ShippingTaxRate: 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 type: object required: - shipping_option_id @@ -26316,14 +23285,14 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -26337,10 +23306,9 @@ components: description: An optional key-value map with additional details example: car: white - staged_job: + StagedJob: title: Staged Job description: A staged job resource - x-resourceId: staged_job type: object required: - event_name @@ -26357,10 +23325,9 @@ components: description: Data necessary for the job type: object example: {} - store: + Store: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' - x-resourceId: store type: object properties: id: @@ -26380,14 +23347,14 @@ components: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' currencies: description: >- The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. 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 @@ -26418,7 +23385,7 @@ components: description: An optional key-value map with additional details example: car: white - swap: + Swap: title: Swap description: >- Swaps can be created when a Customer wishes to exchange Products that @@ -26428,7 +23395,6 @@ components: for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. - x-resourceId: swap type: object required: - fulfillment_status @@ -26480,7 +23446,7 @@ components: relation `additional_items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' return_order: description: >- A return order object. The Return that is issued for the return part @@ -26492,13 +23458,13 @@ components: relation `fulfillments` is expanded. 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. Available if the relation `payment` is expanded. - $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 @@ -26514,14 +23480,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_methods: description: >- The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string @@ -26573,10 +23539,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_line: + TaxLine: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. - x-resourceId: tax_line type: object required: - rate @@ -26611,10 +23576,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_provider: + TaxProvider: title: Tax Provider description: The tax service used to calculate taxes - x-resourceId: tax_provider type: object properties: id: @@ -26628,12 +23592,11 @@ components: to `false`. type: boolean default: true - tax_rate: + TaxRate: 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 type: object required: - name @@ -26711,13 +23674,12 @@ components: description: An optional key-value map with additional details example: car: white - tracking_link: + TrackingLink: 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. - x-resourceId: tracking_link type: object required: - tracking_number @@ -26741,7 +23703,7 @@ components: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' idempotency_key: type: string description: >- @@ -26768,10 +23730,9 @@ components: description: An optional key-value map with additional details example: car: white - user: + User: title: User description: Represents a User who can manage store settings. - x-resourceId: user type: object required: - email @@ -26813,24 +23774,22 @@ components: description: An optional key-value map with additional details example: car: white - multiple_errors: + MultipleErrors: title: Multiple Errors - x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' message: type: string default: >- Provided request body contains errors. Please check the data and retry the request - error: + Error: title: Response Error - x-resourceId: error type: object properties: code: @@ -26842,3 +23801,3002 @@ components: type: type: string description: A slug indicating the type of the error. + AdminPostAppsReq: + type: object + 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. + AdminPostAuthReq: + type: object + required: + - email + - password + properties: + email: + type: string + description: The User's email. + format: email + password: + type: string + description: The User's password. + format: password + AdminPostBatchesReq: + type: object + required: + - type + - context + properties: + type: + type: string + description: The type of batch job to start. + example: product-export + context: + type: object + description: >- + Additional infomration regarding the batch to be used for + processing. + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + type: boolean + description: >- + Set a batch job in dry_run mode to get some information on what will + be done without applying any modifications. + default: false + AdminPostProductsToCollectionReq: + type: object + required: + - product_ids + properties: + product_ids: + description: An array of Product IDs to add to the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + AdminPostCollectionsReq: + type: object + required: + - title + properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided we will + kebab-case the title. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminDeleteProductsFromCollectionReq: + type: object + required: + - product_ids + properties: + product_ids: + description: An array of Product IDs to remove from the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + AdminPostCollectionsCollectionReq: + type: object + properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided we will + kebab-case the title. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostCurrenciesCurrencyReq: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' + AdminPostCustomerGroupsGroupCustomersBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminDeleteCustomerGroupsGroupCustomerBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to remove + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminPostCustomerGroupsGroupReq: + type: object + properties: + name: + description: Name of the customer group + type: string + metadata: + description: Metadata for the customer. + type: object + AdminPostCustomersReq: + type: object + required: + - email + - first_name + - last_name + - password + properties: + email: + type: string + description: The customer's email. + format: email + first_name: + type: string + description: The customer's first name. + last_name: + type: string + description: The customer's last name. + password: + type: string + description: The customer's password. + format: password + phone: + type: string + description: The customer's phone number. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostCustomersCustomerReq: + type: object + properties: + email: + type: string + description: The Customer's email. + format: email + first_name: + type: string + description: The Customer's first name. + last_name: + type: string + description: The Customer's last name. + phone: + type: string + description: The Customer's phone number. + password: + type: string + description: The Customer's password. + format: password + groups: + type: array + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + description: A list of customer groups to which the customer belongs. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + AdminPostDiscountsDiscountConditions: + type: object + required: + - operator + properties: + operator: + description: Operator of the condition + type: string + enum: + - in + - not_in + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on product + types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied on + product collections. + items: + type: string + product_tags: + type: array + description: list of product tag IDs if the condition is applied on product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on customer + groups. + items: + type: string + AdminPostDiscountsReq: + type: object + required: + - code + - rule + - regions + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + is_dynamic: + type: boolean + description: >- + Whether the Discount should have multiple instances of itself, each + with a different code. This can be useful for automatically + generated codes that all have to follow a common set of rules. + default: false + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - type + - value + - allocation + properties: + description: + type: string + description: A short description of the discount + type: + type: string + description: >- + The type of the Discount, can be `fixed` for discounts that + reduce the price by a fixed amount, `percentage` for percentage + reductions or `free_shipping` for shipping vouchers. + enum: + - fixed + - percentage + - free_shipping + value: + type: number + description: >- + The value that the discount represents; this will depend on the + type of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: >- + A set of conditions that can be used to limit when the discount + can be used. Only one of `products`, `product_types`, + `product_collections`, `product_tags`, and `customer_groups` + should be provided. + items: + type: object + required: + - operator + properties: + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: >- + list of product IDs if the condition is applied on + products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on + product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied + on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is applied on + product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on + customer groups. + items: + type: string + is_disabled: + type: boolean + description: >- + Whether the Discount code is disabled on creation. You will have to + enable it later to make it available to Customers. + default: false + starts_at: + type: string + format: date-time + description: The time at which the Discount should be available. + ends_at: + type: string + format: date-time + description: The time at which the Discount should no longer be available. + valid_duration: + type: string + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + regions: + description: >- + A list of Region ids representing the Regions in which the Discount + can be used. + type: array + items: + type: string + usage_limit: + type: number + description: Maximum times the discount can be used + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminDeleteDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + AdminPostDiscountsDiscountConditionsCondition: + type: object + properties: + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on product + types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied on + product collections. + items: + type: string + product_tags: + type: array + description: list of product tag IDs if the condition is applied on product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on customer + groups. + items: + type: string + AdminPostDiscountsDiscountReq: + type: object + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - id + properties: + id: + type: string + description: The ID of the Rule + description: + type: string + description: A short description of the discount + value: + type: number + description: >- + The value that the discount represents; this will depend on the + type of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: >- + A set of conditions that can be used to limit when the discount + can be used. Only one of `products`, `product_types`, + `product_collections`, `product_tags`, and `customer_groups` + should be provided. + items: + type: object + required: + - operator + properties: + id: + type: string + description: The ID of the Rule + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: >- + list of product IDs if the condition is applied on + products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on + product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied + on product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is applied on + product tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on + customer groups. + items: + type: string + is_disabled: + type: boolean + description: >- + 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 + description: The time at which the Discount should be available. + ends_at: + type: string + format: date-time + description: The time at which the Discount should no longer be available. + valid_duration: + type: string + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + usage_limit: + type: number + description: Maximum times the discount can be used + regions: + description: >- + A list of Region ids representing the Regions in which the Discount + can be used. + type: array + items: + type: string + metadata: + description: An object containing metadata of the discount + type: object + AdminPostDraftOrdersReq: + type: object + required: + - email + - region_id + - shipping_methods + properties: + status: + description: The status of the draft order + type: string + enum: + - open + - completed + email: + description: The email of the customer of the draft order + type: string + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - type: string + items: + description: The Line Items that have been received. + type: array + items: + type: object + required: + - quantity + properties: + variant_id: + description: The ID of the Product Variant to generate the Line Item from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the + Line Item. + type: object + region_id: + description: The ID of the region for the draft order + type: string + discounts: + description: The discounts to add on the draft order + type: array + items: + type: object + required: + - code + properties: + code: + description: The code of the discount to apply + type: string + customer_id: + description: The ID of the customer to add on the draft order + type: string + no_notification_order: + description: >- + An optional flag passed to the resulting order to determine use of + notifications. + type: boolean + shipping_methods: + description: The shipping methods for the draft order + type: array + items: + type: object + required: + - option_id + properties: + option_id: + description: The ID of the shipping option in use + type: string + data: + description: The optional additional data needed for the shipping method + type: object + price: + description: The potential custom price of the shipping + type: integer + metadata: + description: >- + The optional key-value map with additional details about the Draft + Order. + type: object + AdminPostDraftOrdersDraftOrderLineItemsReq: + type: object + required: + - quantity + properties: + variant_id: + description: The ID of the Product Variant to generate the Line Item from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + default: Custom item + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the Line + Item. + type: object + AdminPostDraftOrdersDraftOrderReq: + type: object + properties: + region_id: + type: string + description: The ID of the Region to create the Draft Order in. + country_code: + type: string + description: The 2 character ISO code for the Country. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + email: + type: string + description: An email to be used on the Draft Order. + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - type: string + discounts: + description: An array of Discount codes to add to the Draft Order. + type: array + items: + type: object + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + no_notification_order: + description: >- + An optional flag passed to the resulting order to determine use of + notifications. + type: boolean + customer_id: + description: The ID of the Customer to associate the Draft Order with. + type: string + AdminPostDraftOrdersDraftOrderLineItemsItemReq: + type: object + properties: + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the Line + Item. + type: object + AdminPostGiftCardsReq: + type: object + required: + - region_id + properties: + value: + type: integer + description: The value (excluding VAT) that the Gift Card should represent. + is_disabled: + type: boolean + description: >- + Whether the Gift Card is disabled on creation. You will have to + enable it later to make it available to Customers. + ends_at: + type: string + format: date-time + description: The time at which the Gift Card should no longer be available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostGiftCardsGiftCardReq: + type: object + properties: + balance: + type: integer + description: The value (excluding VAT) that the Gift Card should represent. + is_disabled: + type: boolean + description: >- + Whether the Gift Card is disabled on creation. You will have to + enable it later to make it available to Customers. + ends_at: + type: string + format: date-time + description: The time at which the Gift Card should no longer be available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostInvitesInviteAcceptReq: + type: object + 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 + format: password + AdminPostInvitesReq: + type: object + required: + - user + - role + properties: + user: + description: The email for the user to be created. + type: string + format: email + role: + description: The role of the user to be created. + type: string + enum: + - admin + - member + - developer + AdminPostNotesReq: + type: object + required: + - resource_id + - resource_type + - value + properties: + resource_id: + type: string + description: The ID of the resource which the Note relates to. + resource_type: + type: string + description: The type of resource which the Note relates to. + value: + type: string + description: The content of the Note to create. + AdminPostNotesNoteReq: + type: object + required: + - value + properties: + value: + type: string + description: The updated description of the Note. + AdminPostNotificationsNotificationResendReq: + type: object + properties: + to: + description: >- + A new address or user identifier that the Notification should be + sent to + type: string + AdminPostOrderEditsEditLineItemsReq: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the variant ID to add + type: string + quantity: + description: The quantity to add + type: number + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrderEditsReq: + type: object + required: + - order_id + properties: + order_id: + description: The ID of the order to create the edit for. + type: string + internal_note: + description: An optional note to create for the order edit. + type: string + AdminPostOrderEditsEditLineItemsLineItemReq: + type: object + required: + - quantity + properties: + quantity: + description: The quantity to update + type: number + AdminPostOrderEditsOrderEditReq: + type: object + properties: + internal_note: + description: An optional note to create or update for the order edit. + type: string + AdminPostOrdersOrderClaimsClaimShipmentsReq: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + AdminPostOrdersOrderClaimsReq: + type: object + required: + - type + - claim_items + properties: + type: + description: >- + The type of the Claim. This will determine how the Claim is treated: + `replace` Claims will result in a Fulfillment with new items being + created, while a `refund` Claim will refund the amount paid for the + claimed items. + type: string + enum: + - replace + - refund + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: A list of image URL's that will be associated with the Claim + items: + type: string + return_shipping: + description: >- + Optional details for the Return Shipping Method, if the items are to + be sent back. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: >- + The new items to send to the Customer when the Claim type is + Replace. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + shipping_address: + type: object + description: >- + An optional shipping address to send the claim to. Defaults to the + parent order's shipping address + $ref: '#/components/schemas/Address' + refund_amount: + description: The amount to refund the Customer when the Claim type is `refund`. + type: integer + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderFulfillmentsReq: + type: object + required: + - items + properties: + items: + description: The Line Items to include in the Fulfillment. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderShipmentReq: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: >- + If set to true no notification will be send related to this + Shipment. + type: boolean + AdminPostOrdersOrderSwapsSwapShipmentsReq: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: If set to true no notification will be sent related to this Claim. + type: boolean + AdminPostOrdersOrderSwapsReq: + type: object + 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. + type: string + quantity: + description: The number of items that will be returned + type: integer + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + return_shipping: + description: How the Swap will be returned. + type: object + required: + - option_id + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + 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. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + custom_shipping_options: + description: >- + The custom shipping options to potentially create a Shipping Method + from. + type: array + items: + required: + - option_id + - price + properties: + option_id: + description: The ID of the Shipping Option to override with a custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + allow_backorder: + description: 'If true, swaps can be completed with items out of stock' + type: boolean + default: true + AdminPostOrdersOrderClaimsClaimFulfillmentsReq: + type: object + properties: + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + AdminPostOrdersOrderSwapsSwapFulfillmentsReq: + type: object + properties: + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + AdminPostOrdersOrderRefundsReq: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + no_notification: + description: If set to true no notification will be send related to this Refund. + type: boolean + AdminPostOrdersOrderReturnsReq: + type: object + required: + - items + properties: + items: + description: The Line Items that will be returned. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + return_shipping: + description: The Shipping Method to be used to handle the return shipment. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + note: + description: An optional note with information about the Return. + type: string + receive_now: + description: >- + A flag to indicate if the Return should be registerd as received + immediately. + type: boolean + default: false + no_notification: + description: >- + A flag to indicate if no notifications should be emitted related to + the requested Return. + type: boolean + refund: + description: The amount to refund. + type: integer + AdminPostOrdersOrderClaimsClaimReq: + type: object + properties: + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - id + - images + - tags + properties: + id: + description: The ID of the Claim Item. + type: string + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: object + properties: + id: + type: string + description: Tag ID + value: + type: string + description: Tag value + images: + description: A list of image URL's that will be associated with the Claim + type: array + items: + type: object + properties: + id: + type: string + description: Image ID + url: + type: string + description: Image URL + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderReq: + type: object + properties: + email: + description: the email for the order + type: string + billing_address: + description: Billing address + anyOf: + - $ref: '#/components/schemas/AddressFields' + shipping_address: + description: Shipping address + anyOf: + - $ref: '#/components/schemas/AddressFields' + items: + description: The Line Items for the order + type: array + items: + $ref: '#/components/schemas/LineItem' + region: + description: ID of the region where the order belongs + type: string + discounts: + description: Discounts applied to the order + type: array + items: + $ref: '#/components/schemas/Discount' + customer_id: + description: ID of the customer + type: string + payment_method: + description: payment method chosen for the order + 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 + items: + $ref: '#/components/schemas/LineItem' + description: Items to ship + no_notification: + description: >- + A flag to indicate if no notifications should be emitted related to + the updated order. + type: boolean + AdminUpdatePaymentCollectionsReq: + type: object + properties: + description: + description: An optional description to create or update the payment collection. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostPaymentRefundsReq: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + AdminPostPriceListPricesPricesReq: + type: object + properties: + prices: + description: The prices to update or add. + type: array + items: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + override: + description: >- + If true the prices will replace all existing prices associated with + the Price List. + type: boolean + AdminPostPriceListsPriceListReq: + type: object + required: + - name + - description + - type + - prices + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + required: + - amount + - variant_id + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + variant_id: + description: The ID of the Variant for which the price is used. + type: string + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminDeletePriceListPricesPricesReq: + type: object + properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string + AdminPostPriceListsPriceListPriceListReq: + type: object + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminPostProductsProductOptionsReq: + type: object + required: + - title + properties: + title: + description: The title the Product Option will be identified by i.e. "Size" + type: string + AdminPostProductsReq: + type: object + required: + - title + properties: + title: + description: The title of the Product + type: string + subtitle: + description: The subtitle of the Product + type: string + description: + description: A description of the Product. + type: string + is_giftcard: + description: >- + A flag to indicate if the Product represents a Gift Card. Purchasing + Products with this flag set to `true` will result in a Gift Card + being created. + type: boolean + default: false + discountable: + description: >- + A flag to indicate if discounts can be applied to the LineItems + generated from this Product + type: boolean + default: true + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. + type: string + handle: + description: A unique handle to identify the Product by. + type: string + status: + description: The status of the product. + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. + type: array + items: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + options: + description: >- + The Options that the Product should have. These define on which + properties the Product's Product Variants will differ. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Option by. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - value + properties: + value: + description: >- + The value to give for the Product Option at the same + index in the Product's `options` field. + type: string + weight: + description: The weight of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostProductsProductVariantsReq: + type: object + required: + - title + - prices + - options + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + AdminPostProductsProductMetadataReq: + type: object + required: + - key + - value + properties: + key: + description: The metadata key + type: string + value: + description: The metadata value + type: string + AdminPostProductsProductOptionsOption: + type: object + required: + - title + properties: + title: + description: The title of the Product Option + type: string + AdminPostProductsProductReq: + type: object + properties: + title: + description: The title of the Product + type: string + subtitle: + description: The subtitle of the Product + type: string + description: + description: A description of the Product. + type: string + discountable: + description: >- + A flag to indicate if discounts can be applied to the LineItems + generated from this Product + type: boolean + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. + type: string + handle: + description: A unique handle to identify the Product by. + type: string + status: + description: The status of the product. + type: string + enum: + - draft + - proposed + - published + - rejected + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. + type: array + items: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + properties: + id: + description: The ID of the Product Variant. + type: string + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the Price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Option. + type: string + value: + description: >- + The value to give for the Product Option at the same + index in the Product's `options` field. + type: string + weight: + description: The wieght of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostProductsProductVariantsVariantReq: + type: object + required: + - prices + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The weight of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + AdminPostPublishableApiKeySalesChannelsBatchReq: + type: object + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: The IDs of the sales channels to add to the publishable api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + AdminPostPublishableApiKeysReq: + type: object + required: + - title + properties: + title: + description: A title for the publishable api key + type: string + AdminDeletePublishableApiKeySalesChannelsBatchReq: + type: object + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: The IDs of the sales channels to delete from the publishable api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + AdminPostPublishableApiKeysPublishableApiKeyReq: + type: object + properties: + title: + description: A title to update for the key. + type: string + AdminPostRegionsRegionCountriesReq: + type: object + required: + - country_code + properties: + country_code: + description: The 2 character ISO code for the Country. + type: string + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + AdminPostRegionsRegionFulfillmentProvidersReq: + type: object + required: + - provider_id + properties: + provider_id: + description: The ID of the Fulfillment Provider to add. + type: string + AdminPostRegionsRegionPaymentProvidersReq: + type: object + required: + - provider_id + properties: + provider_id: + description: The ID of the Payment Provider to add. + type: string + AdminPostRegionsReq: + type: object + required: + - name + - currency_code + - tax_rate + - payment_providers + - fulfillment_providers + - countries + 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 + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + 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 Provider IDs that should be enabled for the Region + type: array + items: + type: string + fulfillment_providers: + description: >- + A list of Fulfillment Provider IDs that should be enabled for the + Region + type: array + items: + type: string + countries: + description: >- + A list of countries' 2 ISO Characters that should be included in the + Region. + example: + - US + type: array + items: + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of region' + type: boolean + AdminPostRegionsRegionReq: + type: object + 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 + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + 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 + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of region' + type: boolean + payment_providers: + description: A list of Payment Provider IDs that should be enabled for the Region + type: array + items: + type: string + fulfillment_providers: + description: >- + A list of Fulfillment Provider IDs that should be enabled for the + Region + type: array + items: + type: string + countries: + description: >- + A list of countries' 2 ISO Characters that should be included in the + Region. + type: array + items: + type: string + AdminPostReturnReasonsReq: + type: object + required: + - label + - value + properties: + 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 + 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 + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostReturnReasonsReasonReq: + type: object + properties: + 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 + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostReturnsReturnReceiveReq: + type: object + required: + - items + properties: + items: + description: The Line Items that have been received. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: number + AdminPostSalesChannelsChannelProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to add to the Sales Channel + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the product + AdminPostSalesChannelsReq: + type: object + required: + - name + properties: + name: + description: The name of the Sales Channel + type: string + description: + description: The description of the Sales Channel + type: string + is_disabled: + description: Whether the Sales Channel is disabled or not. + type: boolean + AdminDeleteSalesChannelsChannelProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to delete from the Sales Channel. + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of a product + type: string + AdminPostSalesChannelsSalesChannelReq: + type: object + properties: + name: + type: string + description: Name of the sales channel. + description: + type: string + description: Sales Channel description. + is_disabled: + type: boolean + description: Indication of if the sales channel is active. + AdminPostShippingOptionsReq: + type: object + required: + - name + - region_id + - provider_id + - data + - price_type + properties: + name: + description: The name of the Shipping Option + type: string + region_id: + description: The ID of the Region in which the Shipping Option will be available. + type: string + provider_id: + description: The ID of the Fulfillment Provider that handles the Shipping Option. + type: string + profile_id: + description: The ID of the Shipping Profile to add the Shipping Option to. + type: number + data: + description: >- + The data needed for the Fulfillment Provider to handle shipping with + this Shipping Option. + type: object + price_type: + description: The type of the Shipping Option price. + type: string + enum: + - flat_rate + - calculated + amount: + description: The amount to charge for the Shipping Option. + type: integer + requirements: + description: >- + The requirements that must be satisfied for the Shipping Option to + be available. + type: array + items: + required: + - type + - amount + properties: + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + is_return: + description: Whether the Shipping Option defines a return shipment. + type: boolean + default: false + admin_only: + description: 'If true, the option can be used for draft orders' + type: boolean + default: false + metadata: + description: An optional set of key-value pairs with additional information. + type: object + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + AdminPostShippingOptionsOptionReq: + type: object + required: + - requirements + properties: + name: + description: The name of the Shipping Option + type: string + 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 Option to + be available. + type: array + items: + required: + - type + - amount + properties: + id: + description: The ID of the requirement + type: string + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + AdminPostShippingProfilesReq: + type: object + required: + - name + properties: + name: + description: The name of the Shipping Profile + type: string + AdminPostShippingProfilesProfileReq: + type: object + properties: + name: + description: The name of the Shipping Profile + type: string + AdminPostStoreReq: + type: object + properties: + name: + description: The name of the Store + type: string + swap_link_template: + description: >- + 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 + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currencies: + description: Array of currencies in 2 character ISO code format. + type: array + items: + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostTaxRatesTaxRateProductTypesReq: + type: object + required: + - product_types + properties: + product_types: + type: array + description: The IDs of the types of products to associate with this tax rate + items: + type: string + AdminPostTaxRatesTaxRateProductsReq: + type: object + required: + - products + properties: + products: + type: array + description: The IDs of the products to associate with this tax rate + items: + type: string + AdminPostTaxRatesTaxRateShippingOptionsReq: + type: object + required: + - shipping_options + properties: + shipping_options: + type: array + description: The IDs of the shipping options to associate with this tax rate + items: + type: string + AdminPostTaxRatesReq: + type: object + required: + - code + - name + - region_id + properties: + code: + type: string + description: A code to identify the tax type by + name: + type: string + description: A human friendly name for the tax + region_id: + type: string + description: The ID of the Region that the rate belongs to + rate: + type: number + description: The numeric rate to charge + products: + type: array + description: The IDs of the products associated with this tax rate + items: + type: string + shipping_options: + type: array + description: The IDs of the shipping options associated with this tax rate + items: + type: string + product_types: + type: array + description: The IDs of the types of products associated with this tax rate + items: + type: string + AdminDeleteTaxRatesTaxRateProductTypesReq: + type: object + required: + - product_types + properties: + product_types: + type: array + description: >- + The IDs of the types of products to remove association with this tax + rate + items: + type: string + AdminDeleteTaxRatesTaxRateProductsReq: + type: object + required: + - products + properties: + products: + type: array + description: The IDs of the products to remove association with this tax rate + items: + type: string + AdminDeleteTaxRatesTaxRateShippingOptionsReq: + type: object + required: + - shipping_options + properties: + shipping_options: + type: array + description: >- + The IDs of the shipping options to remove association with this tax + rate + items: + type: string + AdminPostTaxRatesTaxRateReq: + type: object + properties: + code: + type: string + description: A code to identify the tax type by + name: + type: string + description: A human friendly name for the tax + region_id: + type: string + description: The ID of the Region that the rate belongs to + rate: + type: number + description: The numeric rate to charge + products: + type: array + description: The IDs of the products associated with this tax rate + items: + type: string + shipping_options: + type: array + description: The IDs of the shipping options associated with this tax rate + items: + type: string + product_types: + type: array + description: The IDs of the types of products associated with this tax rate + items: + type: string + AdminDeleteUploadsReq: + type: object + required: + - file_key + properties: + file_key: + description: key of the file to delete + type: string + AdminPostUploadsDownloadUrlReq: + type: object + required: + - file_key + properties: + file_key: + description: key of the file to obtain the download link for + type: string + AdminCreateUserRequest: + type: object + required: + - email + - password + properties: + email: + description: The Users email. + type: string + format: email + 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 + enum: + - admin + - member + - developer + password: + description: The Users password. + type: string + format: password + AdminResetPasswordTokenRequest: + type: object + required: + - email + properties: + email: + description: The Users email. + type: string + format: email + AdminResetPasswordRequest: + type: object + required: + - token + - password + properties: + email: + description: The Users email. + type: string + format: email + token: + description: The token generated from the 'password-token' endpoint. + type: string + password: + description: The Users new password. + type: string + format: password + AdminUpdateUserRequest: + type: object + properties: + 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 + enum: + - admin + - member + - developer + api_token: + description: The api token of the User. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/admin/code_samples/JavaScript/discounts/postundefined b/docs/api/admin/code_samples/JavaScript/discounts/postundefined index fdb9dae2a3..873666ba15 100644 --- a/docs/api/admin/code_samples/JavaScript/discounts/postundefined +++ b/docs/api/admin/code_samples/JavaScript/discounts/postundefined @@ -9,7 +9,7 @@ medusa.admin.discounts.create({ value: 10, allocation: AllocationType.ITEM }, - regions: ['reg_XXXXXXXX'], + regions: ["reg_XXXXXXXX"], is_dynamic: false, is_disabled: false }) diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined index 4ae4ed80a7..599fe4aa64 100644 --- a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined +++ b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined @@ -2,8 +2,8 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.orderEdits.addLineItem(order_edit_id, { - variant_id, - quantity + variant_id, + quantity }) .then(({ order_edit }) => { console.log(order_edit.id) diff --git a/docs/api/admin/code_samples/Shell/discounts/postundefined b/docs/api/admin/code_samples/Shell/discounts/postundefined index d0cb7fb00c..a651e15ba4 100644 --- a/docs/api/admin/code_samples/Shell/discounts/postundefined +++ b/docs/api/admin/code_samples/Shell/discounts/postundefined @@ -8,5 +8,5 @@ curl --location --request POST 'https://medusa-url.com/admin/discounts' \ "value": 10, "allocation": "item" }, - "regions": ['reg_XXXXXXXX'] + "regions": ["reg_XXXXXXXX"] }' diff --git a/docs/api/admin/components/responses/400_error.yaml b/docs/api/admin/components/responses/400_error.yaml index 95f25b376b..b960f05fb4 100644 --- a/docs/api/admin/components/responses/400_error.yaml +++ b/docs/api/admin/components/responses/400_error.yaml @@ -3,12 +3,12 @@ content: application/json: schema: oneOf: - - $ref: ../schemas/error.yaml - - $ref: ../schemas/multiple_errors.yaml + - $ref: ../schemas/Error.yaml + - $ref: ../schemas/MultipleErrors.yaml examples: not_allowed: $ref: ../examples/not_allowed_error.yaml invalid_data: $ref: ../examples/invalid_data_error.yaml - multiple_errors: + MultipleErrors: $ref: ../examples/multiple_errors.yaml diff --git a/docs/api/admin/components/responses/500_error.yaml b/docs/api/admin/components/responses/500_error.yaml index ecb2e70917..5da1a171e5 100644 --- a/docs/api/admin/components/responses/500_error.yaml +++ b/docs/api/admin/components/responses/500_error.yaml @@ -2,7 +2,7 @@ description: Server Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml examples: database: $ref: ../examples/database_error.yaml diff --git a/docs/api/admin/components/responses/default_error.yaml b/docs/api/admin/components/responses/default_error.yaml index b7d6911d9d..5591502a6c 100644 --- a/docs/api/admin/components/responses/default_error.yaml +++ b/docs/api/admin/components/responses/default_error.yaml @@ -2,7 +2,7 @@ description: Default Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: unknown_error message: An unknown error occurred. diff --git a/docs/api/admin/components/responses/invalid_request_error.yaml b/docs/api/admin/components/responses/invalid_request_error.yaml index 4050c5fc89..c70a32b01f 100644 --- a/docs/api/admin/components/responses/invalid_request_error.yaml +++ b/docs/api/admin/components/responses/invalid_request_error.yaml @@ -2,7 +2,7 @@ description: Invalid Request Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: invalid_request_error message: Discount with code TEST already exists. diff --git a/docs/api/admin/components/responses/invalid_state_error.yaml b/docs/api/admin/components/responses/invalid_state_error.yaml index fbbf916749..479206bab5 100644 --- a/docs/api/admin/components/responses/invalid_state_error.yaml +++ b/docs/api/admin/components/responses/invalid_state_error.yaml @@ -2,7 +2,7 @@ description: Invalid State Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: unknown_error message: >- diff --git a/docs/api/admin/components/responses/not_found_error.yaml b/docs/api/admin/components/responses/not_found_error.yaml index 667ae355c0..c6fea98d05 100644 --- a/docs/api/admin/components/responses/not_found_error.yaml +++ b/docs/api/admin/components/responses/not_found_error.yaml @@ -2,7 +2,7 @@ description: Not Found Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: message: Entity with id 1 was not found type: not_found diff --git a/docs/api/admin/components/schemas/address.yaml b/docs/api/admin/components/schemas/Address.yaml similarity index 98% rename from docs/api/admin/components/schemas/address.yaml rename to docs/api/admin/components/schemas/Address.yaml index d39d1760ae..a69d410311 100644 --- a/docs/api/admin/components/schemas/address.yaml +++ b/docs/api/admin/components/schemas/Address.yaml @@ -1,6 +1,5 @@ title: Address description: An address. -x-resourceId: address type: object properties: id: diff --git a/docs/api/admin/components/schemas/address_fields.yaml b/docs/api/admin/components/schemas/AddressFields.yaml similarity index 98% rename from docs/api/admin/components/schemas/address_fields.yaml rename to docs/api/admin/components/schemas/AddressFields.yaml index 303b9d5ca9..6e4c4d6358 100644 --- a/docs/api/admin/components/schemas/address_fields.yaml +++ b/docs/api/admin/components/schemas/AddressFields.yaml @@ -1,6 +1,5 @@ title: Address Fields description: Address fields used when creating/updating an address. -x-resourceId: address type: object properties: company: diff --git a/docs/api/admin/components/schemas/AdminCreateUserRequest.yaml b/docs/api/admin/components/schemas/AdminCreateUserRequest.yaml new file mode 100644 index 0000000000..e725065733 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminCreateUserRequest.yaml @@ -0,0 +1,26 @@ +type: object +required: + - email + - password +properties: + email: + description: The Users email. + type: string + format: email + 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 + enum: + - admin + - member + - developer + password: + description: The Users password. + type: string + format: password diff --git a/docs/api/admin/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml b/docs/api/admin/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml new file mode 100644 index 0000000000..1829b6c7cf --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - customer_ids +properties: + customer_ids: + description: The ids of the customers to remove + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml b/docs/api/admin/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml new file mode 100644 index 0000000000..65ab064008 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - resources +properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string diff --git a/docs/api/admin/components/schemas/AdminDeletePriceListPricesPricesReq.yaml b/docs/api/admin/components/schemas/AdminDeletePriceListPricesPricesReq.yaml new file mode 100644 index 0000000000..0b1e797641 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeletePriceListPricesPricesReq.yaml @@ -0,0 +1,7 @@ +type: object +properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteProductsFromCollectionReq.yaml b/docs/api/admin/components/schemas/AdminDeleteProductsFromCollectionReq.yaml new file mode 100644 index 0000000000..0c9720a349 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteProductsFromCollectionReq.yaml @@ -0,0 +1,10 @@ +type: object +required: + - product_ids +properties: + product_ids: + description: An array of Product IDs to remove from the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string diff --git a/docs/api/admin/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq.yaml b/docs/api/admin/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq.yaml new file mode 100644 index 0000000000..4fb1c786f2 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq.yaml @@ -0,0 +1,15 @@ +type: object +required: + - sales_channel_ids +properties: + sales_channel_ids: + description: The IDs of the sales channels to delete from the publishable api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel diff --git a/docs/api/admin/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq.yaml b/docs/api/admin/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq.yaml new file mode 100644 index 0000000000..176d203729 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq.yaml @@ -0,0 +1,15 @@ +type: object +required: + - product_ids +properties: + product_ids: + description: The IDs of the products to delete from the Sales Channel. + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of a product + type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq.yaml b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq.yaml new file mode 100644 index 0000000000..499a433451 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - product_types +properties: + product_types: + type: array + description: The IDs of the types of products to remove association with this tax rate + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq.yaml b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq.yaml new file mode 100644 index 0000000000..9e8ca198b0 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - products +properties: + products: + type: array + description: The IDs of the products to remove association with this tax rate + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq.yaml b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq.yaml new file mode 100644 index 0000000000..b3c0433aae --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - shipping_options +properties: + shipping_options: + type: array + description: The IDs of the shipping options to remove association with this tax rate + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteUploadsReq.yaml b/docs/api/admin/components/schemas/AdminDeleteUploadsReq.yaml new file mode 100644 index 0000000000..0a967b0845 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteUploadsReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - file_key +properties: + file_key: + description: key of the file to delete + type: string diff --git a/docs/api/admin/components/schemas/AdminPostAppsReq.yaml b/docs/api/admin/components/schemas/AdminPostAppsReq.yaml new file mode 100644 index 0000000000..91cda2d7de --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostAppsReq.yaml @@ -0,0 +1,15 @@ +type: object +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. diff --git a/docs/api/admin/components/schemas/AdminPostAuthReq.yaml b/docs/api/admin/components/schemas/AdminPostAuthReq.yaml new file mode 100644 index 0000000000..2d945cc366 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostAuthReq.yaml @@ -0,0 +1,13 @@ +type: object +required: + - email + - password +properties: + email: + type: string + description: The User's email. + format: email + password: + type: string + description: The User's password. + format: password diff --git a/docs/api/admin/components/schemas/AdminPostBatchesReq.yaml b/docs/api/admin/components/schemas/AdminPostBatchesReq.yaml new file mode 100644 index 0000000000..2e52f9c9ee --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostBatchesReq.yaml @@ -0,0 +1,34 @@ +type: object +required: + - type + - context +properties: + type: + type: string + description: The type of batch job to start. + example: product-export + context: + type: object + description: Additional infomration regarding the batch to be used for processing. + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + type: boolean + description: >- + Set a batch job in dry_run mode to get some information on what will be + done without applying any modifications. + default: false diff --git a/docs/api/admin/components/schemas/AdminPostCollectionsCollectionReq.yaml b/docs/api/admin/components/schemas/AdminPostCollectionsCollectionReq.yaml new file mode 100644 index 0000000000..95e7bb1f33 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCollectionsCollectionReq.yaml @@ -0,0 +1,13 @@ +type: object +properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided we will + kebab-case the title. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostCollectionsReq.yaml b/docs/api/admin/components/schemas/AdminPostCollectionsReq.yaml new file mode 100644 index 0000000000..23edc85cc8 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCollectionsReq.yaml @@ -0,0 +1,15 @@ +type: object +required: + - title +properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided we will + kebab-case the title. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostCurrenciesCurrencyReq.yaml b/docs/api/admin/components/schemas/AdminPostCurrenciesCurrencyReq.yaml new file mode 100644 index 0000000000..4c168fc38a --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCurrenciesCurrencyReq.yaml @@ -0,0 +1,5 @@ +type: object +properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' diff --git a/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml b/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml new file mode 100644 index 0000000000..ba460c4c79 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - customer_ids +properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string diff --git a/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupReq.yaml b/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupReq.yaml new file mode 100644 index 0000000000..8f647d1e83 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupReq.yaml @@ -0,0 +1,8 @@ +type: object +properties: + name: + description: Name of the customer group + type: string + metadata: + description: Metadata for the customer. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostCustomersCustomerReq.yaml b/docs/api/admin/components/schemas/AdminPostCustomersCustomerReq.yaml new file mode 100644 index 0000000000..c10421b691 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCustomersCustomerReq.yaml @@ -0,0 +1,32 @@ +type: object +properties: + email: + type: string + description: The Customer's email. + format: email + first_name: + type: string + description: The Customer's first name. + last_name: + type: string + description: The Customer's last name. + phone: + type: string + description: The Customer's phone number. + password: + type: string + description: The Customer's password. + format: password + groups: + type: array + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + description: A list of customer groups to which the customer belongs. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostCustomersReq.yaml b/docs/api/admin/components/schemas/AdminPostCustomersReq.yaml new file mode 100644 index 0000000000..250c211fb5 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCustomersReq.yaml @@ -0,0 +1,27 @@ +type: object +required: + - email + - first_name + - last_name + - password +properties: + email: + type: string + description: The customer's email. + format: email + first_name: + type: string + description: The customer's first name. + last_name: + type: string + description: The customer's last name. + password: + type: string + description: The customer's password. + format: password + phone: + type: string + description: The customer's phone number. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditions.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditions.yaml new file mode 100644 index 0000000000..f510e4b7f2 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditions.yaml @@ -0,0 +1,37 @@ +type: object +required: + - operator +properties: + operator: + description: Operator of the condition + type: string + enum: + - in + - not_in + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: list of product type IDs if the condition is applied on product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied on product + collections. + items: + type: string + product_tags: + type: array + description: list of product tag IDs if the condition is applied on product tags. + items: + type: string + customer_groups: + type: array + description: list of customer group IDs if the condition is applied on customer groups. + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsCondition.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsCondition.yaml new file mode 100644 index 0000000000..7e6f366712 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsCondition.yaml @@ -0,0 +1,29 @@ +type: object +properties: + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: list of product type IDs if the condition is applied on product types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied on product + collections. + items: + type: string + product_tags: + type: array + description: list of product tag IDs if the condition is applied on product tags. + items: + type: string + customer_groups: + type: array + description: list of customer group IDs if the condition is applied on customer groups. + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml new file mode 100644 index 0000000000..afe209d46e --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - resources +properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsDiscountReq.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountReq.yaml new file mode 100644 index 0000000000..d7acadcf2f --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountReq.yaml @@ -0,0 +1,111 @@ +type: object +properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - id + properties: + id: + type: string + description: The ID of the Rule + description: + type: string + description: A short description of the discount + value: + type: number + description: >- + The value that the discount represents; this will depend on the type + of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: >- + A set of conditions that can be used to limit when the discount can be + used. Only one of `products`, `product_types`, `product_collections`, + `product_tags`, and `customer_groups` should be provided. + items: + type: object + required: + - operator + properties: + id: + type: string + description: The ID of the Rule + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on product + types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied on + product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is applied on product + tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on + customer groups. + items: + type: string + is_disabled: + type: boolean + description: >- + 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 + description: The time at which the Discount should be available. + ends_at: + type: string + format: date-time + description: The time at which the Discount should no longer be available. + valid_duration: + type: string + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + usage_limit: + type: number + description: Maximum times the discount can be used + regions: + description: >- + A list of Region ids representing the Regions in which the Discount can be + used. + type: array + items: + type: string + metadata: + description: An object containing metadata of the discount + type: object diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsReq.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsReq.yaml new file mode 100644 index 0000000000..a73bc06eb3 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDiscountsReq.yaml @@ -0,0 +1,130 @@ +type: object +required: + - code + - rule + - regions +properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + is_dynamic: + type: boolean + description: >- + Whether the Discount should have multiple instances of itself, each with a + different code. This can be useful for automatically generated codes that + all have to follow a common set of rules. + default: false + rule: + description: The Discount Rule that defines how Discounts are calculated + type: object + required: + - type + - value + - allocation + properties: + description: + type: string + description: A short description of the discount + type: + type: string + description: >- + The type of the Discount, can be `fixed` for discounts that reduce the + price by a fixed amount, `percentage` for percentage reductions or + `free_shipping` for shipping vouchers. + enum: + - fixed + - percentage + - free_shipping + value: + type: number + description: >- + The value that the discount represents; this will depend on the type + of the discount + allocation: + type: string + description: The scope that the discount should apply to. + enum: + - total + - item + conditions: + type: array + description: >- + A set of conditions that can be used to limit when the discount can + be used. Only one of `products`, `product_types`, + `product_collections`, `product_tags`, and `customer_groups` should be + provided. + items: + type: object + required: + - operator + properties: + operator: + type: string + description: Operator of the condition + enum: + - in + - not_in + products: + type: array + description: list of product IDs if the condition is applied on products. + items: + type: string + product_types: + type: array + description: >- + list of product type IDs if the condition is applied on product + types. + items: + type: string + product_collections: + type: array + description: >- + list of product collection IDs if the condition is applied on + product collections. + items: + type: string + product_tags: + type: array + description: >- + list of product tag IDs if the condition is applied on product + tags. + items: + type: string + customer_groups: + type: array + description: >- + list of customer group IDs if the condition is applied on + customer groups. + items: + type: string + is_disabled: + type: boolean + description: >- + Whether the Discount code is disabled on creation. You will have to enable + it later to make it available to Customers. + default: false + starts_at: + type: string + format: date-time + description: The time at which the Discount should be available. + ends_at: + type: string + format: date-time + description: The time at which the Discount should no longer be available. + valid_duration: + type: string + description: Duration the discount runs between + example: P3Y6M4DT12H30M5S + regions: + description: >- + A list of Region ids representing the Regions in which the Discount can be + used. + type: array + items: + type: string + usage_limit: + type: number + description: Maximum times the discount can be used + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq.yaml b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq.yaml new file mode 100644 index 0000000000..2f631fea3b --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq.yaml @@ -0,0 +1,14 @@ +type: object +properties: + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: The optional key-value map with additional details about the Line Item. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq.yaml b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq.yaml new file mode 100644 index 0000000000..c05a24e9ac --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq.yaml @@ -0,0 +1,20 @@ +type: object +required: + - quantity +properties: + variant_id: + description: The ID of the Product Variant to generate the Line Item from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + default: Custom item + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: The optional key-value map with additional details about the Line Item. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml new file mode 100644 index 0000000000..05a6d92efc --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml @@ -0,0 +1,45 @@ +type: object +properties: + region_id: + type: string + description: The ID of the Region to create the Draft Order in. + country_code: + type: string + description: The 2 character ISO code for the Country. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + email: + type: string + description: An email to be used on the Draft Order. + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: ./AddressFields.yaml + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: ./AddressFields.yaml + - type: string + discounts: + description: An array of Discount codes to add to the Draft Order. + type: array + items: + type: object + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + no_notification_order: + description: >- + An optional flag passed to the resulting order to determine use of + notifications. + type: boolean + customer_id: + description: The ID of the Customer to associate the Draft Order with. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostDraftOrdersReq.yaml b/docs/api/admin/components/schemas/AdminPostDraftOrdersReq.yaml new file mode 100644 index 0000000000..e2f7db512d --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDraftOrdersReq.yaml @@ -0,0 +1,93 @@ +type: object +required: + - email + - region_id + - shipping_methods +properties: + status: + description: The status of the draft order + type: string + enum: + - open + - completed + email: + description: The email of the customer of the draft order + type: string + format: email + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: ./AddressFields.yaml + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: ./AddressFields.yaml + - type: string + items: + description: The Line Items that have been received. + type: array + items: + type: object + required: + - quantity + properties: + variant_id: + description: The ID of the Product Variant to generate the Line Item from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the Line + Item. + type: object + region_id: + description: The ID of the region for the draft order + type: string + discounts: + description: The discounts to add on the draft order + type: array + items: + type: object + required: + - code + properties: + code: + description: The code of the discount to apply + type: string + customer_id: + description: The ID of the customer to add on the draft order + type: string + no_notification_order: + description: >- + An optional flag passed to the resulting order to determine use of + notifications. + type: boolean + shipping_methods: + description: The shipping methods for the draft order + type: array + items: + type: object + required: + - option_id + properties: + option_id: + description: The ID of the shipping option in use + type: string + data: + description: The optional additional data needed for the shipping method + type: object + price: + description: The potential custom price of the shipping + type: integer + metadata: + description: The optional key-value map with additional details about the Draft Order. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostGiftCardsGiftCardReq.yaml b/docs/api/admin/components/schemas/AdminPostGiftCardsGiftCardReq.yaml new file mode 100644 index 0000000000..e7976952f4 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostGiftCardsGiftCardReq.yaml @@ -0,0 +1,20 @@ +type: object +properties: + balance: + type: integer + description: The value (excluding VAT) that the Gift Card should represent. + is_disabled: + type: boolean + description: >- + Whether the Gift Card is disabled on creation. You will have to enable it + later to make it available to Customers. + ends_at: + type: string + format: date-time + description: The time at which the Gift Card should no longer be available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostGiftCardsReq.yaml b/docs/api/admin/components/schemas/AdminPostGiftCardsReq.yaml new file mode 100644 index 0000000000..fc19e7674d --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostGiftCardsReq.yaml @@ -0,0 +1,22 @@ +type: object +required: + - region_id +properties: + value: + type: integer + description: The value (excluding VAT) that the Gift Card should represent. + is_disabled: + type: boolean + description: >- + Whether the Gift Card is disabled on creation. You will have to enable it + later to make it available to Customers. + ends_at: + type: string + format: date-time + description: The time at which the Gift Card should no longer be available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostInvitesInviteAcceptReq.yaml b/docs/api/admin/components/schemas/AdminPostInvitesInviteAcceptReq.yaml new file mode 100644 index 0000000000..41600a6ddb --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostInvitesInviteAcceptReq.yaml @@ -0,0 +1,26 @@ +type: object +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 + format: password diff --git a/docs/api/admin/components/schemas/AdminPostInvitesReq.yaml b/docs/api/admin/components/schemas/AdminPostInvitesReq.yaml new file mode 100644 index 0000000000..31d8426e51 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostInvitesReq.yaml @@ -0,0 +1,16 @@ +type: object +required: + - user + - role +properties: + user: + description: The email for the user to be created. + type: string + format: email + role: + description: The role of the user to be created. + type: string + enum: + - admin + - member + - developer diff --git a/docs/api/admin/components/schemas/AdminPostNotesNoteReq.yaml b/docs/api/admin/components/schemas/AdminPostNotesNoteReq.yaml new file mode 100644 index 0000000000..1c2bb16901 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostNotesNoteReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - value +properties: + value: + type: string + description: The updated description of the Note. diff --git a/docs/api/admin/components/schemas/AdminPostNotesReq.yaml b/docs/api/admin/components/schemas/AdminPostNotesReq.yaml new file mode 100644 index 0000000000..01ef23d775 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostNotesReq.yaml @@ -0,0 +1,15 @@ +type: object +required: + - resource_id + - resource_type + - value +properties: + resource_id: + type: string + description: The ID of the resource which the Note relates to. + resource_type: + type: string + description: The type of resource which the Note relates to. + value: + type: string + description: The content of the Note to create. diff --git a/docs/api/admin/components/schemas/AdminPostNotificationsNotificationResendReq.yaml b/docs/api/admin/components/schemas/AdminPostNotificationsNotificationResendReq.yaml new file mode 100644 index 0000000000..3d6d6575df --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostNotificationsNotificationResendReq.yaml @@ -0,0 +1,5 @@ +type: object +properties: + to: + description: A new address or user identifier that the Notification should be sent to + type: string diff --git a/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq.yaml b/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq.yaml new file mode 100644 index 0000000000..cb38c689f2 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - quantity +properties: + quantity: + description: The quantity to update + type: number diff --git a/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsReq.yaml new file mode 100644 index 0000000000..6671ae2e12 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - variant_id + - quantity +properties: + variant_id: + description: The ID of the variant ID to add + type: string + quantity: + description: The quantity to add + type: number + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostOrderEditsOrderEditReq.yaml b/docs/api/admin/components/schemas/AdminPostOrderEditsOrderEditReq.yaml new file mode 100644 index 0000000000..0956090625 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrderEditsOrderEditReq.yaml @@ -0,0 +1,5 @@ +type: object +properties: + internal_note: + description: An optional note to create or update for the order edit. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostOrderEditsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrderEditsReq.yaml new file mode 100644 index 0000000000..37fcff4261 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrderEditsReq.yaml @@ -0,0 +1,10 @@ +type: object +required: + - order_id +properties: + order_id: + description: The ID of the order to create the edit for. + type: string + internal_note: + description: An optional note to create for the order edit. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.yaml new file mode 100644 index 0000000000..9ebb87d7e4 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.yaml @@ -0,0 +1,8 @@ +type: object +properties: + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml new file mode 100644 index 0000000000..8ae3a23fe6 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml @@ -0,0 +1,78 @@ +type: object +properties: + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - id + - images + - tags + properties: + id: + description: The ID of the Claim Item. + type: string + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: object + properties: + id: + type: string + description: Tag ID + value: + type: string + description: Tag value + images: + description: A list of image URL's that will be associated with the Claim + type: array + items: + type: object + properties: + id: + type: string + description: Image ID + url: + type: string + description: Image URL + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq.yaml new file mode 100644 index 0000000000..e94def5834 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq.yaml @@ -0,0 +1,12 @@ +type: object +required: + - fulfillment_id +properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml new file mode 100644 index 0000000000..cd86c5f9a0 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml @@ -0,0 +1,104 @@ +type: object +required: + - type + - claim_items +properties: + type: + description: >- + The type of the Claim. This will determine how the Claim is treated: + `replace` Claims will result in a Fulfillment with new items being + created, while a `refund` Claim will refund the amount paid for the + claimed items. + type: string + enum: + - replace + - refund + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: A list of image URL's that will be associated with the Claim + items: + type: string + return_shipping: + description: >- + Optional details for the Return Shipping Method, if the items are to be + sent back. + type: object + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer when the Claim type is Replace. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + shipping_address: + type: object + description: >- + An optional shipping address to send the claim to. Defaults to the parent + order's shipping address + $ref: ./Address.yaml + refund_amount: + description: The amount to refund the Customer when the Claim type is `refund`. + type: integer + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml new file mode 100644 index 0000000000..c910300406 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml @@ -0,0 +1,24 @@ +type: object +required: + - items +properties: + items: + description: The Line Items to include in the Fulfillment. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderRefundsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderRefundsReq.yaml new file mode 100644 index 0000000000..ee19081712 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderRefundsReq.yaml @@ -0,0 +1,17 @@ +type: object +required: + - amount + - reason +properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + no_notification: + description: If set to true no notification will be send related to this Refund. + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderReq.yaml new file mode 100644 index 0000000000..5a7c57fb2d --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderReq.yaml @@ -0,0 +1,65 @@ +type: object +properties: + email: + description: the email for the order + type: string + billing_address: + description: Billing address + anyOf: + - $ref: ./AddressFields.yaml + shipping_address: + description: Shipping address + anyOf: + - $ref: ./AddressFields.yaml + items: + description: The Line Items for the order + type: array + items: + $ref: ./LineItem.yaml + region: + description: ID of the region where the order belongs + type: string + discounts: + description: Discounts applied to the order + type: array + items: + $ref: ./Discount.yaml + customer_id: + description: ID of the customer + type: string + payment_method: + description: payment method chosen for the order + 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 + items: + $ref: ./LineItem.yaml + description: Items to ship + no_notification: + description: >- + A flag to indicate if no notifications should be emitted related to the + updated order. + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderReturnsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderReturnsReq.yaml new file mode 100644 index 0000000000..938c93c8ef --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderReturnsReq.yaml @@ -0,0 +1,51 @@ +type: object +required: + - items +properties: + items: + description: The Line Items that will be returned. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + return_shipping: + description: The Shipping Method to be used to handle the return shipment. + type: object + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + note: + description: An optional note with information about the Return. + type: string + receive_now: + description: >- + A flag to indicate if the Return should be registerd as received + immediately. + type: boolean + default: false + no_notification: + description: >- + A flag to indicate if no notifications should be emitted related to the + requested Return. + type: boolean + refund: + description: The amount to refund. + type: integer diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderShipmentReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderShipmentReq.yaml new file mode 100644 index 0000000000..760275eb19 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderShipmentReq.yaml @@ -0,0 +1,15 @@ +type: object +required: + - fulfillment_id +properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: If set to true no notification will be send related to this Shipment. + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsReq.yaml new file mode 100644 index 0000000000..45e754b776 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsReq.yaml @@ -0,0 +1,71 @@ +type: object +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. + type: string + quantity: + description: The number of items that will be returned + type: integer + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + return_shipping: + description: How the Swap will be returned. + type: object + required: + - option_id + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + 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. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + custom_shipping_options: + description: The custom shipping options to potentially create a Shipping Method from. + type: array + items: + required: + - option_id + - price + properties: + option_id: + description: The ID of the Shipping Option to override with a custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + allow_backorder: + description: If true, swaps can be completed with items out of stock + type: boolean + default: true diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.yaml new file mode 100644 index 0000000000..9ebb87d7e4 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.yaml @@ -0,0 +1,8 @@ +type: object +properties: + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq.yaml new file mode 100644 index 0000000000..fab12e01e5 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq.yaml @@ -0,0 +1,15 @@ +type: object +required: + - fulfillment_id +properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + no_notification: + description: If set to true no notification will be sent related to this Claim. + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostPaymentRefundsReq.yaml b/docs/api/admin/components/schemas/AdminPostPaymentRefundsReq.yaml new file mode 100644 index 0000000000..3ac53d359a --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPaymentRefundsReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - amount + - reason +properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostPriceListPricesPricesReq.yaml b/docs/api/admin/components/schemas/AdminPostPriceListPricesPricesReq.yaml new file mode 100644 index 0000000000..28d3868fdb --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPriceListPricesPricesReq.yaml @@ -0,0 +1,43 @@ +type: object +properties: + prices: + description: The prices to update or add. + type: array + items: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only required if + currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be used. + Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + override: + description: >- + If true the prices will replace all existing prices associated with the + Price List. + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml new file mode 100644 index 0000000000..09bbab331c --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml @@ -0,0 +1,77 @@ +type: object +properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only required if + currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be used. + Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostPriceListsPriceListReq.yaml b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListReq.yaml new file mode 100644 index 0000000000..aeb0835071 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListReq.yaml @@ -0,0 +1,79 @@ +type: object +required: + - name + - description + - type + - prices +properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + required: + - amount + - variant_id + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only required if + currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be used. + Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + variant_id: + description: The ID of the Variant for which the price is used. + type: string + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductMetadataReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductMetadataReq.yaml new file mode 100644 index 0000000000..bb97fc5ea7 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductMetadataReq.yaml @@ -0,0 +1,11 @@ +type: object +required: + - key + - value +properties: + key: + description: The metadata key + type: string + value: + description: The metadata value + type: string diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductOptionsOption.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductOptionsOption.yaml new file mode 100644 index 0000000000..2e287f30d7 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductOptionsOption.yaml @@ -0,0 +1,7 @@ +type: object +required: + - title +properties: + title: + description: The title of the Product Option + type: string diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductOptionsReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductOptionsReq.yaml new file mode 100644 index 0000000000..db0ba5be42 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductOptionsReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - title +properties: + title: + description: The title the Product Option will be identified by i.e. "Size" + type: string diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductReq.yaml new file mode 100644 index 0000000000..024aaa2c9c --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductReq.yaml @@ -0,0 +1,204 @@ +type: object +properties: + title: + description: The title of the Product + type: string + subtitle: + description: The subtitle of the Product + type: string + description: + description: A description of the Product. + type: string + discountable: + description: >- + A flag to indicate if discounts can be applied to the LineItems generated + from this Product + type: boolean + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. + type: string + handle: + description: A unique handle to identify the Product by. + type: string + status: + description: The status of the product. + type: string + enum: + - draft + - proposed + - published + - rejected + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. + type: array + items: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: The value of the Tag, these will be upserted. + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + properties: + id: + description: The ID of the Product Variant. + type: string + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the Price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Option. + type: string + value: + description: >- + The value to give for the Product Option at the same index in + the Product's `options` field. + type: string + weight: + description: The wieght of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductVariantsReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsReq.yaml new file mode 100644 index 0000000000..209ef9bd18 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsReq.yaml @@ -0,0 +1,104 @@ +type: object +required: + - title + - prices + - options +properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only required if + currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be used. + Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductVariantsVariantReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsVariantReq.yaml new file mode 100644 index 0000000000..9deff44aeb --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsVariantReq.yaml @@ -0,0 +1,101 @@ +type: object +required: + - prices +properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The weight of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only required if + currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be used. + Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostProductsReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsReq.yaml new file mode 100644 index 0000000000..a779060218 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsReq.yaml @@ -0,0 +1,223 @@ +type: object +required: + - title +properties: + title: + description: The title of the Product + type: string + subtitle: + description: The subtitle of the Product + type: string + description: + description: A description of the Product. + type: string + is_giftcard: + description: >- + A flag to indicate if the Product represents a Gift Card. Purchasing + Products with this flag set to `true` will result in a Gift Card being + created. + type: boolean + default: false + discountable: + description: >- + A flag to indicate if discounts can be applied to the LineItems generated + from this Product + type: boolean + default: true + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. + type: string + handle: + description: A unique handle to identify the Product by. + type: string + status: + description: The status of the product. + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. + type: array + items: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: The value of the Tag, these will be upserted. + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + options: + description: >- + The Options that the Product should have. These define on which properties + the Product's Product Variants will differ. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Option by. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - value + properties: + value: + description: >- + The value to give for the Product Option at the same index in + the Product's `options` field. + type: string + weight: + description: The weight of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostProductsToCollectionReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsToCollectionReq.yaml new file mode 100644 index 0000000000..6311a4138b --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsToCollectionReq.yaml @@ -0,0 +1,10 @@ +type: object +required: + - product_ids +properties: + product_ids: + description: An array of Product IDs to add to the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq.yaml b/docs/api/admin/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq.yaml new file mode 100644 index 0000000000..3e7c404f26 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq.yaml @@ -0,0 +1,15 @@ +type: object +required: + - sales_channel_ids +properties: + sales_channel_ids: + description: The IDs of the sales channels to add to the publishable api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel diff --git a/docs/api/admin/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq.yaml b/docs/api/admin/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq.yaml new file mode 100644 index 0000000000..aeed291732 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq.yaml @@ -0,0 +1,5 @@ +type: object +properties: + title: + description: A title to update for the key. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostPublishableApiKeysReq.yaml b/docs/api/admin/components/schemas/AdminPostPublishableApiKeysReq.yaml new file mode 100644 index 0000000000..fa0807e2e7 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPublishableApiKeysReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - title +properties: + title: + description: A title for the publishable api key + type: string diff --git a/docs/api/admin/components/schemas/AdminPostRegionsRegionCountriesReq.yaml b/docs/api/admin/components/schemas/AdminPostRegionsRegionCountriesReq.yaml new file mode 100644 index 0000000000..92f579df49 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostRegionsRegionCountriesReq.yaml @@ -0,0 +1,11 @@ +type: object +required: + - country_code +properties: + country_code: + description: The 2 character ISO code for the Country. + type: string + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. diff --git a/docs/api/admin/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq.yaml b/docs/api/admin/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq.yaml new file mode 100644 index 0000000000..6552d1244b --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - provider_id +properties: + provider_id: + description: The ID of the Fulfillment Provider to add. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostRegionsRegionPaymentProvidersReq.yaml b/docs/api/admin/components/schemas/AdminPostRegionsRegionPaymentProvidersReq.yaml new file mode 100644 index 0000000000..325284c651 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostRegionsRegionPaymentProvidersReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - provider_id +properties: + provider_id: + description: The ID of the Payment Provider to add. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostRegionsRegionReq.yaml b/docs/api/admin/components/schemas/AdminPostRegionsRegionReq.yaml new file mode 100644 index 0000000000..e55bed24f3 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostRegionsRegionReq.yaml @@ -0,0 +1,50 @@ +type: object +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 + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + 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 + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of region' + type: boolean + payment_providers: + description: A list of Payment Provider IDs that should be enabled for the Region + type: array + items: + type: string + fulfillment_providers: + description: A list of Fulfillment Provider IDs that should be enabled for the Region + type: array + items: + type: string + countries: + description: >- + A list of countries' 2 ISO Characters that should be included in the + Region. + type: array + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminPostRegionsReq.yaml b/docs/api/admin/components/schemas/AdminPostRegionsReq.yaml new file mode 100644 index 0000000000..1c48e5380c --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostRegionsReq.yaml @@ -0,0 +1,46 @@ +type: object +required: + - name + - currency_code + - tax_rate + - payment_providers + - fulfillment_providers + - countries +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 + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + 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 Provider IDs that should be enabled for the Region + type: array + items: + type: string + fulfillment_providers: + description: A list of Fulfillment Provider IDs that should be enabled for the Region + type: array + items: + type: string + countries: + description: >- + A list of countries' 2 ISO Characters that should be included in the + Region. + example: + - US + type: array + items: + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of region' + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostReturnReasonsReasonReq.yaml b/docs/api/admin/components/schemas/AdminPostReturnReasonsReasonReq.yaml new file mode 100644 index 0000000000..383ba92bfc --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostReturnReasonsReasonReq.yaml @@ -0,0 +1,14 @@ +type: object +properties: + 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 + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostReturnReasonsReq.yaml b/docs/api/admin/components/schemas/AdminPostReturnReasonsReq.yaml new file mode 100644 index 0000000000..ce30d0eefe --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostReturnReasonsReq.yaml @@ -0,0 +1,20 @@ +type: object +required: + - label + - value +properties: + 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 + 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 + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostReturnsReturnReceiveReq.yaml b/docs/api/admin/components/schemas/AdminPostReturnsReturnReceiveReq.yaml new file mode 100644 index 0000000000..68ee28260e --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostReturnsReturnReceiveReq.yaml @@ -0,0 +1,21 @@ +type: object +required: + - items +properties: + items: + description: The Line Items that have been received. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: number diff --git a/docs/api/admin/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq.yaml b/docs/api/admin/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq.yaml new file mode 100644 index 0000000000..90b5b227c9 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq.yaml @@ -0,0 +1,15 @@ +type: object +required: + - product_ids +properties: + product_ids: + description: The IDs of the products to add to the Sales Channel + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the product diff --git a/docs/api/admin/components/schemas/AdminPostSalesChannelsReq.yaml b/docs/api/admin/components/schemas/AdminPostSalesChannelsReq.yaml new file mode 100644 index 0000000000..20fa813fa5 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostSalesChannelsReq.yaml @@ -0,0 +1,13 @@ +type: object +required: + - name +properties: + name: + description: The name of the Sales Channel + type: string + description: + description: The description of the Sales Channel + type: string + is_disabled: + description: Whether the Sales Channel is disabled or not. + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostSalesChannelsSalesChannelReq.yaml b/docs/api/admin/components/schemas/AdminPostSalesChannelsSalesChannelReq.yaml new file mode 100644 index 0000000000..50df11bd37 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostSalesChannelsSalesChannelReq.yaml @@ -0,0 +1,11 @@ +type: object +properties: + name: + type: string + description: Name of the sales channel. + description: + type: string + description: Sales Channel description. + is_disabled: + type: boolean + description: Indication of if the sales channel is active. diff --git a/docs/api/admin/components/schemas/AdminPostShippingOptionsOptionReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingOptionsOptionReq.yaml new file mode 100644 index 0000000000..91f0798ca7 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostShippingOptionsOptionReq.yaml @@ -0,0 +1,41 @@ +type: object +required: + - requirements +properties: + name: + description: The name of the Shipping Option + type: string + 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 Option to be + available. + type: array + items: + required: + - type + - amount + properties: + id: + description: The ID of the requirement + type: string + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostShippingOptionsReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingOptionsReq.yaml new file mode 100644 index 0000000000..d5088992f1 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostShippingOptionsReq.yaml @@ -0,0 +1,67 @@ +type: object +required: + - name + - region_id + - provider_id + - data + - price_type +properties: + name: + description: The name of the Shipping Option + type: string + region_id: + description: The ID of the Region in which the Shipping Option will be available. + type: string + provider_id: + description: The ID of the Fulfillment Provider that handles the Shipping Option. + type: string + profile_id: + description: The ID of the Shipping Profile to add the Shipping Option to. + type: number + data: + description: >- + The data needed for the Fulfillment Provider to handle shipping with this + Shipping Option. + type: object + price_type: + description: The type of the Shipping Option price. + type: string + enum: + - flat_rate + - calculated + amount: + description: The amount to charge for the Shipping Option. + type: integer + requirements: + description: >- + The requirements that must be satisfied for the Shipping Option to be + available. + type: array + items: + required: + - type + - amount + properties: + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + is_return: + description: Whether the Shipping Option defines a return shipment. + type: boolean + default: false + admin_only: + description: If true, the option can be used for draft orders + type: boolean + default: false + metadata: + description: An optional set of key-value pairs with additional information. + type: object + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostShippingProfilesProfileReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingProfilesProfileReq.yaml new file mode 100644 index 0000000000..5f0da87a1a --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostShippingProfilesProfileReq.yaml @@ -0,0 +1,5 @@ +type: object +properties: + name: + description: The name of the Shipping Profile + type: string diff --git a/docs/api/admin/components/schemas/AdminPostShippingProfilesReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingProfilesReq.yaml new file mode 100644 index 0000000000..790a1e4704 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostShippingProfilesReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - name +properties: + name: + description: The name of the Shipping Profile + type: string diff --git a/docs/api/admin/components/schemas/AdminPostStoreReq.yaml b/docs/api/admin/components/schemas/AdminPostStoreReq.yaml new file mode 100644 index 0000000000..6a6f746821 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostStoreReq.yaml @@ -0,0 +1,32 @@ +type: object +properties: + name: + description: The name of the Store + type: string + swap_link_template: + description: 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 + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currencies: + description: Array of currencies in 2 character ISO code format. + type: array + items: + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostTaxRatesReq.yaml b/docs/api/admin/components/schemas/AdminPostTaxRatesReq.yaml new file mode 100644 index 0000000000..ac7bcd0575 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostTaxRatesReq.yaml @@ -0,0 +1,33 @@ +type: object +required: + - code + - name + - region_id +properties: + code: + type: string + description: A code to identify the tax type by + name: + type: string + description: A human friendly name for the tax + region_id: + type: string + description: The ID of the Region that the rate belongs to + rate: + type: number + description: The numeric rate to charge + products: + type: array + description: The IDs of the products associated with this tax rate + items: + type: string + shipping_options: + type: array + description: The IDs of the shipping options associated with this tax rate + items: + type: string + product_types: + type: array + description: The IDs of the types of products associated with this tax rate + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq.yaml b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq.yaml new file mode 100644 index 0000000000..74ee9a8d35 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - product_types +properties: + product_types: + type: array + description: The IDs of the types of products to associate with this tax rate + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductsReq.yaml b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductsReq.yaml new file mode 100644 index 0000000000..74c55626a9 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductsReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - products +properties: + products: + type: array + description: The IDs of the products to associate with this tax rate + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateReq.yaml b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateReq.yaml new file mode 100644 index 0000000000..93b1597180 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateReq.yaml @@ -0,0 +1,29 @@ +type: object +properties: + code: + type: string + description: A code to identify the tax type by + name: + type: string + description: A human friendly name for the tax + region_id: + type: string + description: The ID of the Region that the rate belongs to + rate: + type: number + description: The numeric rate to charge + products: + type: array + description: The IDs of the products associated with this tax rate + items: + type: string + shipping_options: + type: array + description: The IDs of the shipping options associated with this tax rate + items: + type: string + product_types: + type: array + description: The IDs of the types of products associated with this tax rate + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq.yaml b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq.yaml new file mode 100644 index 0000000000..1a7110b271 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - shipping_options +properties: + shipping_options: + type: array + description: The IDs of the shipping options to associate with this tax rate + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminPostUploadsDownloadUrlReq.yaml b/docs/api/admin/components/schemas/AdminPostUploadsDownloadUrlReq.yaml new file mode 100644 index 0000000000..c3b01ef725 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostUploadsDownloadUrlReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - file_key +properties: + file_key: + description: key of the file to obtain the download link for + type: string diff --git a/docs/api/admin/components/schemas/AdminResetPasswordRequest.yaml b/docs/api/admin/components/schemas/AdminResetPasswordRequest.yaml new file mode 100644 index 0000000000..149a0bddd6 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminResetPasswordRequest.yaml @@ -0,0 +1,16 @@ +type: object +required: + - token + - password +properties: + email: + description: The Users email. + type: string + format: email + token: + description: The token generated from the 'password-token' endpoint. + type: string + password: + description: The Users new password. + type: string + format: password diff --git a/docs/api/admin/components/schemas/AdminResetPasswordTokenRequest.yaml b/docs/api/admin/components/schemas/AdminResetPasswordTokenRequest.yaml new file mode 100644 index 0000000000..22f7609d2e --- /dev/null +++ b/docs/api/admin/components/schemas/AdminResetPasswordTokenRequest.yaml @@ -0,0 +1,8 @@ +type: object +required: + - email +properties: + email: + description: The Users email. + type: string + format: email diff --git a/docs/api/admin/components/schemas/AdminUpdatePaymentCollectionsReq.yaml b/docs/api/admin/components/schemas/AdminUpdatePaymentCollectionsReq.yaml new file mode 100644 index 0000000000..11f57ce8db --- /dev/null +++ b/docs/api/admin/components/schemas/AdminUpdatePaymentCollectionsReq.yaml @@ -0,0 +1,8 @@ +type: object +properties: + description: + description: An optional description to create or update the payment collection. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminUpdateUserRequest.yaml b/docs/api/admin/components/schemas/AdminUpdateUserRequest.yaml new file mode 100644 index 0000000000..df01dd696d --- /dev/null +++ b/docs/api/admin/components/schemas/AdminUpdateUserRequest.yaml @@ -0,0 +1,21 @@ +type: object +properties: + 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 + enum: + - admin + - member + - developer + api_token: + description: The api token of the User. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/store/components/schemas/batch_job.yaml b/docs/api/admin/components/schemas/BatchJob.yaml similarity index 99% rename from docs/api/store/components/schemas/batch_job.yaml rename to docs/api/admin/components/schemas/BatchJob.yaml index c06c261ba5..92a81b4576 100644 --- a/docs/api/store/components/schemas/batch_job.yaml +++ b/docs/api/admin/components/schemas/BatchJob.yaml @@ -1,6 +1,5 @@ title: Batch Job description: A Batch Job. -x-resourceId: batch_job type: object required: - type diff --git a/docs/api/store/components/schemas/cart.yaml b/docs/api/admin/components/schemas/Cart.yaml similarity index 95% rename from docs/api/store/components/schemas/cart.yaml rename to docs/api/admin/components/schemas/Cart.yaml index de1d520a2d..aef4b274ff 100644 --- a/docs/api/store/components/schemas/cart.yaml +++ b/docs/api/admin/components/schemas/Cart.yaml @@ -1,6 +1,5 @@ title: Cart description: Represents a user cart -x-resourceId: cart type: object properties: id: @@ -17,19 +16,19 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml items: description: Available if the relation `items` is expanded. type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml region_id: type: string description: The region's ID @@ -58,24 +57,24 @@ properties: type: object payment_session: description: The selected payment session in the cart. - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: ./payment.yaml + $ref: ./Payment.yaml shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml type: type: string description: The cart's type. diff --git a/docs/api/admin/components/schemas/claim_image.yaml b/docs/api/admin/components/schemas/ClaimImage.yaml similarity index 97% rename from docs/api/admin/components/schemas/claim_image.yaml rename to docs/api/admin/components/schemas/ClaimImage.yaml index 783d89c06d..721cfcf6a5 100644 --- a/docs/api/admin/components/schemas/claim_image.yaml +++ b/docs/api/admin/components/schemas/ClaimImage.yaml @@ -1,6 +1,5 @@ title: Claim Image description: Represents photo documentation of a claim. -x-resourceId: claim_image type: object required: - claim_item_id diff --git a/docs/api/store/components/schemas/claim_item.yaml b/docs/api/admin/components/schemas/ClaimItem.yaml similarity index 95% rename from docs/api/store/components/schemas/claim_item.yaml rename to docs/api/admin/components/schemas/ClaimItem.yaml index cb7e85c9dd..6fc251960c 100644 --- a/docs/api/store/components/schemas/claim_item.yaml +++ b/docs/api/admin/components/schemas/ClaimItem.yaml @@ -2,7 +2,6 @@ title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. -x-resourceId: claim_item type: object required: - claim_order_id @@ -19,7 +18,7 @@ properties: type: array description: Available if the relation `images` is expanded. items: - $ref: ./claim_image.yaml + $ref: ./ClaimImage.yaml claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -32,7 +31,7 @@ properties: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml variant_id: description: The ID of the product variant that is claimed. type: string @@ -64,7 +63,7 @@ properties: relation 'tags' is expanded. type: array items: - $ref: ./claim_tag.yaml + $ref: ./ClaimTag.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/claim_order.yaml b/docs/api/admin/components/schemas/ClaimOrder.yaml similarity index 95% rename from docs/api/store/components/schemas/claim_order.yaml rename to docs/api/admin/components/schemas/ClaimOrder.yaml index ed55db009d..561dbec67d 100644 --- a/docs/api/store/components/schemas/claim_order.yaml +++ b/docs/api/admin/components/schemas/ClaimOrder.yaml @@ -3,7 +3,6 @@ description: >- Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. -x-resourceId: claim_order type: object required: - type @@ -43,14 +42,14 @@ properties: description: The items that have been claimed type: array items: - $ref: ./claim_item.yaml + $ref: ./ClaimItem.yaml additional_items: description: >- Refers to the new items to be shipped when the claim order has the type `replace` type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml order_id: description: The ID of the order that the claim comes from. type: string @@ -69,17 +68,17 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer diff --git a/docs/api/store/components/schemas/claim_tag.yaml b/docs/api/admin/components/schemas/ClaimTag.yaml similarity index 97% rename from docs/api/store/components/schemas/claim_tag.yaml rename to docs/api/admin/components/schemas/ClaimTag.yaml index 46a23e4da8..bf557fcc6d 100644 --- a/docs/api/store/components/schemas/claim_tag.yaml +++ b/docs/api/admin/components/schemas/ClaimTag.yaml @@ -2,7 +2,6 @@ title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. -x-resourceId: claim_tag type: object required: - value diff --git a/docs/api/store/components/schemas/country.yaml b/docs/api/admin/components/schemas/Country.yaml similarity index 98% rename from docs/api/store/components/schemas/country.yaml rename to docs/api/admin/components/schemas/Country.yaml index d8a7a18e36..c28bb31871 100644 --- a/docs/api/store/components/schemas/country.yaml +++ b/docs/api/admin/components/schemas/Country.yaml @@ -1,6 +1,5 @@ title: Country description: Country details -x-resourceId: country type: object required: - iso_2 diff --git a/docs/api/admin/components/schemas/currency.yaml b/docs/api/admin/components/schemas/Currency.yaml similarity index 97% rename from docs/api/admin/components/schemas/currency.yaml rename to docs/api/admin/components/schemas/Currency.yaml index be164ffa9e..c553448ec2 100644 --- a/docs/api/admin/components/schemas/currency.yaml +++ b/docs/api/admin/components/schemas/Currency.yaml @@ -1,6 +1,5 @@ title: Currency description: Currency -x-resourceId: currency type: object required: - code diff --git a/docs/api/admin/components/schemas/custom_shipping_option.yaml b/docs/api/admin/components/schemas/CustomShippingOption.yaml similarity index 97% rename from docs/api/admin/components/schemas/custom_shipping_option.yaml rename to docs/api/admin/components/schemas/CustomShippingOption.yaml index 40ff8c8229..619df289c4 100644 --- a/docs/api/admin/components/schemas/custom_shipping_option.yaml +++ b/docs/api/admin/components/schemas/CustomShippingOption.yaml @@ -3,7 +3,6 @@ description: >- Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option -x-resourceId: custom_shipping_option type: object required: - price diff --git a/docs/api/store/components/schemas/customer.yaml b/docs/api/admin/components/schemas/Customer.yaml similarity index 94% rename from docs/api/store/components/schemas/customer.yaml rename to docs/api/admin/components/schemas/Customer.yaml index aa0e83a77c..9c91270354 100644 --- a/docs/api/store/components/schemas/customer.yaml +++ b/docs/api/admin/components/schemas/Customer.yaml @@ -1,6 +1,5 @@ title: Customer description: Represents a customer -x-resourceId: customer type: object required: - email @@ -27,12 +26,12 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: ./address.yaml + $ref: ./Address.yaml phone: type: string description: The customer's phone number @@ -53,7 +52,7 @@ properties: `groups` is expanded. type: array items: - $ref: ./customer_group.yaml + $ref: ./CustomerGroup.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/customer_group.yaml b/docs/api/admin/components/schemas/CustomerGroup.yaml similarity index 95% rename from docs/api/store/components/schemas/customer_group.yaml rename to docs/api/admin/components/schemas/CustomerGroup.yaml index 0d4769c7ad..69e2edfe7c 100644 --- a/docs/api/store/components/schemas/customer_group.yaml +++ b/docs/api/admin/components/schemas/CustomerGroup.yaml @@ -1,6 +1,5 @@ title: Customer Group description: Represents a customer group -x-resourceId: customer_group type: object required: - name @@ -27,7 +26,7 @@ properties: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: ./price_list.yaml + $ref: ./PriceList.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount.yaml b/docs/api/admin/components/schemas/Discount.yaml similarity index 97% rename from docs/api/store/components/schemas/discount.yaml rename to docs/api/admin/components/schemas/Discount.yaml index 1950a503cb..72c9365c95 100644 --- a/docs/api/store/components/schemas/discount.yaml +++ b/docs/api/admin/components/schemas/Discount.yaml @@ -1,6 +1,5 @@ title: Discount description: Represents a discount that can be applied to a cart for promotional purposes. -x-resourceId: discount type: object required: - code @@ -28,7 +27,7 @@ properties: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: ./discount_rule.yaml + $ref: ./DiscountRule.yaml is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -43,7 +42,7 @@ properties: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: ./discount.yaml + $ref: ./Discount.yaml starts_at: description: The time at which the discount can be used. type: string diff --git a/docs/api/store/components/schemas/discount_condition.yaml b/docs/api/admin/components/schemas/DiscountCondition.yaml similarity index 97% rename from docs/api/store/components/schemas/discount_condition.yaml rename to docs/api/admin/components/schemas/DiscountCondition.yaml index 794e839eb3..40f5247a38 100644 --- a/docs/api/store/components/schemas/discount_condition.yaml +++ b/docs/api/admin/components/schemas/DiscountCondition.yaml @@ -1,6 +1,5 @@ title: Discount Condition description: Holds rule conditions for when a discount is applicable -x-resourceId: discount_condition type: object required: - type @@ -32,7 +31,7 @@ properties: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: ./discount_rule.yaml + $ref: ./DiscountRule.yaml products: description: >- products associated with this condition if type = products. Available if diff --git a/docs/api/admin/components/schemas/discount_condition_customer_group.yaml b/docs/api/admin/components/schemas/DiscountConditionCustomerGroup.yaml similarity index 89% rename from docs/api/admin/components/schemas/discount_condition_customer_group.yaml rename to docs/api/admin/components/schemas/DiscountConditionCustomerGroup.yaml index 51867349ad..143c2c2a50 100644 --- a/docs/api/admin/components/schemas/discount_condition_customer_group.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionCustomerGroup.yaml @@ -1,6 +1,5 @@ title: Product Tag Discount Condition description: Associates a discount condition with a customer group -x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: ./customer_group.yaml + $ref: ./CustomerGroup.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount_condition_product.yaml b/docs/api/admin/components/schemas/DiscountConditionProduct.yaml similarity index 90% rename from docs/api/admin/components/schemas/discount_condition_product.yaml rename to docs/api/admin/components/schemas/DiscountConditionProduct.yaml index b88eac53c2..ca1540fcbb 100644 --- a/docs/api/admin/components/schemas/discount_condition_product.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProduct.yaml @@ -1,6 +1,5 @@ title: Product Discount Condition description: Associates a discount condition with a product -x-resourceId: discount_condition_product type: object required: - product_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: ./product.yaml + $ref: ./Product.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount_condition_product_collection.yaml b/docs/api/admin/components/schemas/DiscountConditionProductCollection.yaml similarity index 89% rename from docs/api/store/components/schemas/discount_condition_product_collection.yaml rename to docs/api/admin/components/schemas/DiscountConditionProductCollection.yaml index bc0065ef9f..49e19e9590 100644 --- a/docs/api/store/components/schemas/discount_condition_product_collection.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProductCollection.yaml @@ -1,6 +1,5 @@ title: Product Collection Discount Condition description: Associates a discount condition with a product collection -x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: ./product_collection.yaml + $ref: ./ProductCollection.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount_condition_product_tag.yaml b/docs/api/admin/components/schemas/DiscountConditionProductTag.yaml similarity index 90% rename from docs/api/store/components/schemas/discount_condition_product_tag.yaml rename to docs/api/admin/components/schemas/DiscountConditionProductTag.yaml index d3ba121f43..3b7c0738f0 100644 --- a/docs/api/store/components/schemas/discount_condition_product_tag.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProductTag.yaml @@ -1,6 +1,5 @@ title: Product Tag Discount Condition description: Associates a discount condition with a product tag -x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: ./product_tag.yaml + $ref: ./ProductTag.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount_condition_product_type.yaml b/docs/api/admin/components/schemas/DiscountConditionProductType.yaml similarity index 90% rename from docs/api/admin/components/schemas/discount_condition_product_type.yaml rename to docs/api/admin/components/schemas/DiscountConditionProductType.yaml index 03a6393c44..471000a1e7 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_type.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProductType.yaml @@ -1,6 +1,5 @@ title: Product Type Discount Condition description: Associates a discount condition with a product type -x-resourceId: discount_condition_product type: object required: - product_type_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount_rule.yaml b/docs/api/admin/components/schemas/DiscountRule.yaml similarity index 98% rename from docs/api/store/components/schemas/discount_rule.yaml rename to docs/api/admin/components/schemas/DiscountRule.yaml index ab6ab1a80e..1a6ec45afb 100644 --- a/docs/api/store/components/schemas/discount_rule.yaml +++ b/docs/api/admin/components/schemas/DiscountRule.yaml @@ -2,7 +2,6 @@ title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. -x-resourceId: discount_rule type: object required: - type diff --git a/docs/api/store/components/schemas/draft-order.yaml b/docs/api/admin/components/schemas/DraftOrder.yaml similarity index 98% rename from docs/api/store/components/schemas/draft-order.yaml rename to docs/api/admin/components/schemas/DraftOrder.yaml index 1c96c22bc7..5e18ec0f8f 100644 --- a/docs/api/store/components/schemas/draft-order.yaml +++ b/docs/api/admin/components/schemas/DraftOrder.yaml @@ -1,6 +1,5 @@ title: DraftOrder description: Represents a draft order -x-resourceId: draft-order type: object properties: id: diff --git a/docs/api/admin/components/schemas/error.yaml b/docs/api/admin/components/schemas/Error.yaml similarity index 93% rename from docs/api/admin/components/schemas/error.yaml rename to docs/api/admin/components/schemas/Error.yaml index cad9495918..787671c4a4 100644 --- a/docs/api/admin/components/schemas/error.yaml +++ b/docs/api/admin/components/schemas/Error.yaml @@ -1,5 +1,4 @@ title: Response Error -x-resourceId: error type: object properties: code: diff --git a/docs/api/admin/components/schemas/fulfillment.yaml b/docs/api/admin/components/schemas/Fulfillment.yaml similarity index 96% rename from docs/api/admin/components/schemas/fulfillment.yaml rename to docs/api/admin/components/schemas/Fulfillment.yaml index d6ee5c6960..0c34d6607b 100644 --- a/docs/api/admin/components/schemas/fulfillment.yaml +++ b/docs/api/admin/components/schemas/Fulfillment.yaml @@ -7,7 +7,6 @@ description: >- plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. -x-resourceId: fulfillment type: object required: - provider_id @@ -45,7 +44,7 @@ properties: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml items: description: >- The Fulfillment Items in the Fulfillment - these hold information about @@ -53,7 +52,7 @@ properties: `items` is expanded. type: array items: - $ref: ./fulfillment_item.yaml + $ref: ./FulfillmentItem.yaml tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -61,7 +60,7 @@ properties: Available if the relation `tracking_links` is expanded. type: array items: - $ref: ./tracking_link.yaml + $ref: ./TrackingLink.yaml tracking_numbers: deprecated: true description: >- diff --git a/docs/api/store/components/schemas/fulfillment_item.yaml b/docs/api/admin/components/schemas/FulfillmentItem.yaml similarity index 93% rename from docs/api/store/components/schemas/fulfillment_item.yaml rename to docs/api/admin/components/schemas/FulfillmentItem.yaml index f233f45f68..8578f6a4d7 100644 --- a/docs/api/store/components/schemas/fulfillment_item.yaml +++ b/docs/api/admin/components/schemas/FulfillmentItem.yaml @@ -2,7 +2,6 @@ title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. -x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -22,7 +21,7 @@ properties: type: object item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer diff --git a/docs/api/store/components/schemas/fulfillment_provider.yaml b/docs/api/admin/components/schemas/FulfillmentProvider.yaml similarity index 93% rename from docs/api/store/components/schemas/fulfillment_provider.yaml rename to docs/api/admin/components/schemas/FulfillmentProvider.yaml index 584c933111..bbd8801420 100644 --- a/docs/api/store/components/schemas/fulfillment_provider.yaml +++ b/docs/api/admin/components/schemas/FulfillmentProvider.yaml @@ -1,6 +1,5 @@ title: Fulfillment Provider description: Represents a fulfillment provider plugin and holds its installation status. -x-resourceId: fulfillment_provider type: object properties: id: diff --git a/docs/api/admin/components/schemas/gift_card.yaml b/docs/api/admin/components/schemas/GiftCard.yaml similarity index 94% rename from docs/api/admin/components/schemas/gift_card.yaml rename to docs/api/admin/components/schemas/GiftCard.yaml index 054f93319f..d169d35e54 100644 --- a/docs/api/admin/components/schemas/gift_card.yaml +++ b/docs/api/admin/components/schemas/GiftCard.yaml @@ -2,7 +2,6 @@ title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. -x-resourceId: gift_card type: object required: - code @@ -52,6 +51,10 @@ properties: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/gift_card_transaction.yaml b/docs/api/admin/components/schemas/GiftCardTransaction.yaml similarity index 97% rename from docs/api/admin/components/schemas/gift_card_transaction.yaml rename to docs/api/admin/components/schemas/GiftCardTransaction.yaml index fb16341851..df738aa63b 100644 --- a/docs/api/admin/components/schemas/gift_card_transaction.yaml +++ b/docs/api/admin/components/schemas/GiftCardTransaction.yaml @@ -2,7 +2,6 @@ title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order -x-resourceId: gift_card_transaction type: object required: - gift_card_id diff --git a/docs/api/store/components/schemas/idempotency_key.yaml b/docs/api/admin/components/schemas/IdempotencyKey.yaml similarity index 98% rename from docs/api/store/components/schemas/idempotency_key.yaml rename to docs/api/admin/components/schemas/IdempotencyKey.yaml index 9bff9c0f90..b496aadde3 100644 --- a/docs/api/store/components/schemas/idempotency_key.yaml +++ b/docs/api/admin/components/schemas/IdempotencyKey.yaml @@ -2,7 +2,6 @@ title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. -x-resourceId: idempotency_key type: object required: - idempotency_key diff --git a/docs/api/admin/components/schemas/image.yaml b/docs/api/admin/components/schemas/Image.yaml similarity index 97% rename from docs/api/admin/components/schemas/image.yaml rename to docs/api/admin/components/schemas/Image.yaml index 61bc475c32..5250816766 100644 --- a/docs/api/admin/components/schemas/image.yaml +++ b/docs/api/admin/components/schemas/Image.yaml @@ -1,6 +1,5 @@ title: Image description: Images holds a reference to a URL at which the image file can be found. -x-resourceId: image type: object required: - url diff --git a/docs/api/store/components/schemas/invite.yaml b/docs/api/admin/components/schemas/Invite.yaml similarity index 98% rename from docs/api/store/components/schemas/invite.yaml rename to docs/api/admin/components/schemas/Invite.yaml index aac3ce0b7f..9e16e818ea 100644 --- a/docs/api/store/components/schemas/invite.yaml +++ b/docs/api/admin/components/schemas/Invite.yaml @@ -1,6 +1,5 @@ title: Invite description: Represents an invite -x-resourceId: invite type: object required: - user_email diff --git a/docs/api/store/components/schemas/line_item.yaml b/docs/api/admin/components/schemas/LineItem.yaml similarity index 98% rename from docs/api/store/components/schemas/line_item.yaml rename to docs/api/admin/components/schemas/LineItem.yaml index ae9ed1eaa0..0e0c64de6f 100644 --- a/docs/api/store/components/schemas/line_item.yaml +++ b/docs/api/admin/components/schemas/LineItem.yaml @@ -4,7 +4,6 @@ description: >- 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. -x-resourceId: line_item type: object required: - title @@ -47,12 +46,12 @@ properties: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: ./line_item_tax_line.yaml + $ref: ./LineItemTaxLine.yaml adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: ./line_item_adjustment.yaml + $ref: ./LineItemAdjustment.yaml title: description: >- The title of the Line Item, this should be easily identifiable by the diff --git a/docs/api/admin/components/schemas/line_item_adjustment.yaml b/docs/api/admin/components/schemas/LineItemAdjustment.yaml similarity index 87% rename from docs/api/admin/components/schemas/line_item_adjustment.yaml rename to docs/api/admin/components/schemas/LineItemAdjustment.yaml index 677f69388a..28b41b9566 100644 --- a/docs/api/admin/components/schemas/line_item_adjustment.yaml +++ b/docs/api/admin/components/schemas/LineItemAdjustment.yaml @@ -1,6 +1,5 @@ title: Line Item Adjustment -description: Represents an Line Item Adjustment -x-resourceId: line_item_adjustment +description: Represents a Line Item Adjustment type: object required: - item_id @@ -17,7 +16,7 @@ properties: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml description: type: string description: The line item's adjustment description @@ -28,7 +27,7 @@ properties: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: ./discount.yaml + $ref: ./Discount.yaml amount: type: number description: The adjustment amount diff --git a/docs/api/admin/components/schemas/line_item_tax_line.yaml b/docs/api/admin/components/schemas/LineItemTaxLine.yaml similarity index 90% rename from docs/api/admin/components/schemas/line_item_tax_line.yaml rename to docs/api/admin/components/schemas/LineItemTaxLine.yaml index b149f62d42..2ee2e0a546 100644 --- a/docs/api/admin/components/schemas/line_item_tax_line.yaml +++ b/docs/api/admin/components/schemas/LineItemTaxLine.yaml @@ -1,6 +1,5 @@ title: Line Item Tax Line -description: Represents an Line Item Tax Line -x-resourceId: line_item_tax_line +description: Represents a Line Item Tax Line type: object required: - item_id @@ -17,7 +16,7 @@ properties: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml code: description: A code to identify the tax type by type: string diff --git a/docs/api/admin/components/schemas/money_amount.yaml b/docs/api/admin/components/schemas/MoneyAmount.yaml similarity index 97% rename from docs/api/admin/components/schemas/money_amount.yaml rename to docs/api/admin/components/schemas/MoneyAmount.yaml index 929194a759..223ddf5f44 100644 --- a/docs/api/admin/components/schemas/money_amount.yaml +++ b/docs/api/admin/components/schemas/MoneyAmount.yaml @@ -5,7 +5,6 @@ description: >- with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. -x-resourceId: money_amount type: object required: - currency_code @@ -24,7 +23,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to charge @@ -49,7 +48,7 @@ properties: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: ./price_list.yaml + $ref: ./PriceList.yaml variant_id: description: The id of the Product Variant contained in the Line Item. type: string diff --git a/docs/api/store/components/schemas/multiple_errors.yaml b/docs/api/admin/components/schemas/MultipleErrors.yaml similarity index 82% rename from docs/api/store/components/schemas/multiple_errors.yaml rename to docs/api/admin/components/schemas/MultipleErrors.yaml index 0327c94e70..7ca18cda3b 100644 --- a/docs/api/store/components/schemas/multiple_errors.yaml +++ b/docs/api/admin/components/schemas/MultipleErrors.yaml @@ -1,12 +1,11 @@ title: Multiple Errors -x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: ./error.yaml + $ref: ./Error.yaml message: type: string default: >- diff --git a/docs/api/store/components/schemas/note.yaml b/docs/api/admin/components/schemas/Note.yaml similarity index 97% rename from docs/api/store/components/schemas/note.yaml rename to docs/api/admin/components/schemas/Note.yaml index 16f1e9fe50..2decb4f715 100644 --- a/docs/api/store/components/schemas/note.yaml +++ b/docs/api/admin/components/schemas/Note.yaml @@ -2,7 +2,6 @@ title: Note description: >- Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. -x-resourceId: note type: object required: - value @@ -31,7 +30,7 @@ properties: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: ./user.yaml + $ref: ./User.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/notification.yaml b/docs/api/admin/components/schemas/Notification.yaml similarity index 95% rename from docs/api/store/components/schemas/notification.yaml rename to docs/api/admin/components/schemas/Notification.yaml index 9db10fe27a..ddc77a9c73 100644 --- a/docs/api/store/components/schemas/notification.yaml +++ b/docs/api/admin/components/schemas/Notification.yaml @@ -4,7 +4,6 @@ description: >- to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. -x-resourceId: notification type: object required: - resource_type @@ -50,14 +49,14 @@ properties: description: The resends that have been completed after the original Notification. type: array items: - $ref: ./notification_resend.yaml + $ref: ./NotificationResend.yaml provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: ./notification_provider.yaml + $ref: ./NotificationProvider.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/notification_provider.yaml b/docs/api/admin/components/schemas/NotificationProvider.yaml similarity index 93% rename from docs/api/admin/components/schemas/notification_provider.yaml rename to docs/api/admin/components/schemas/NotificationProvider.yaml index dacf80d189..fbc83c6837 100644 --- a/docs/api/admin/components/schemas/notification_provider.yaml +++ b/docs/api/admin/components/schemas/NotificationProvider.yaml @@ -1,6 +1,5 @@ title: Notification Provider description: Represents a notification provider plugin and holds its installation status. -x-resourceId: notification_provider type: object required: - id diff --git a/docs/api/store/components/schemas/notification_resend.yaml b/docs/api/admin/components/schemas/NotificationResend.yaml similarity index 95% rename from docs/api/store/components/schemas/notification_resend.yaml rename to docs/api/admin/components/schemas/NotificationResend.yaml index 2b15999aa6..cd88d291ae 100644 --- a/docs/api/store/components/schemas/notification_resend.yaml +++ b/docs/api/admin/components/schemas/NotificationResend.yaml @@ -1,6 +1,5 @@ title: Notification Resend description: A resend of a Notification. -x-resourceId: notification_resend type: object properties: id: @@ -44,14 +43,14 @@ properties: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: ./notification.yaml + $ref: ./Notification.yaml provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: ./notification_provider.yaml + $ref: ./NotificationProvider.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/OAuth.yaml b/docs/api/admin/components/schemas/OAuth.yaml index 6b6cb8b660..9f22524f3e 100644 --- a/docs/api/admin/components/schemas/OAuth.yaml +++ b/docs/api/admin/components/schemas/OAuth.yaml @@ -1,6 +1,5 @@ title: OAuth description: Represent an OAuth app -x-resourceId: OAuth type: object required: - id diff --git a/docs/api/store/components/schemas/order.yaml b/docs/api/admin/components/schemas/Order.yaml similarity index 96% rename from docs/api/store/components/schemas/order.yaml rename to docs/api/admin/components/schemas/Order.yaml index 464edc17fb..fbc5185c9b 100644 --- a/docs/api/store/components/schemas/order.yaml +++ b/docs/api/admin/components/schemas/Order.yaml @@ -1,6 +1,5 @@ title: Order description: Represents an order -x-resourceId: order type: object required: - customer_id @@ -76,14 +75,14 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml region_id: type: string description: The region's ID @@ -100,7 +99,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml tax_rate: description: The order's tax rate type: number @@ -127,21 +126,21 @@ properties: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: ./payment.yaml + $ref: ./Payment.yaml fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml returns: type: array description: >- @@ -187,21 +186,21 @@ properties: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: ./order_edit.yaml + $ref: ./OrderEdit.yaml gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: ./gift_card_transaction.yaml + $ref: ./GiftCardTransaction.yaml canceled_at: type: string description: The date the order was canceled on. diff --git a/docs/api/admin/components/schemas/order_edit.yaml b/docs/api/admin/components/schemas/OrderEdit.yaml similarity index 95% rename from docs/api/admin/components/schemas/order_edit.yaml rename to docs/api/admin/components/schemas/OrderEdit.yaml index 5574c2b6f2..ea53ce0b14 100644 --- a/docs/api/admin/components/schemas/order_edit.yaml +++ b/docs/api/admin/components/schemas/OrderEdit.yaml @@ -1,6 +1,5 @@ title: Order Edit description: Order edit keeps track of order items changes. -x-resourceId: order_edit type: object required: - order_id @@ -18,12 +17,12 @@ properties: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: ./order.yaml + $ref: ./Order.yaml changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: ./order_item_change.yaml + $ref: ./OrderItemChange.yaml internal_note: description: An optional note with additional details about the order edit. type: string @@ -106,14 +105,14 @@ properties: type: array description: Available if the relation `items` is expanded. items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: ./payment_collection.yaml + $ref: ./PaymentCollection.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/order_item_change.yaml b/docs/api/admin/components/schemas/OrderItemChange.yaml similarity index 93% rename from docs/api/store/components/schemas/order_item_change.yaml rename to docs/api/admin/components/schemas/OrderItemChange.yaml index 9bc3b3a826..49d0ecab5b 100644 --- a/docs/api/store/components/schemas/order_item_change.yaml +++ b/docs/api/admin/components/schemas/OrderItemChange.yaml @@ -1,6 +1,5 @@ title: Order Item Change description: Represents an order edit item change -x-resourceId: order_item_change type: object required: - type @@ -23,21 +22,21 @@ properties: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: ./order_edit.yaml + $ref: ./OrderEdit.yaml original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/payment.yaml b/docs/api/admin/components/schemas/Payment.yaml similarity index 98% rename from docs/api/store/components/schemas/payment.yaml rename to docs/api/admin/components/schemas/Payment.yaml index 384e04b16c..d224dca6cf 100644 --- a/docs/api/store/components/schemas/payment.yaml +++ b/docs/api/admin/components/schemas/Payment.yaml @@ -2,7 +2,6 @@ title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. -x-resourceId: payment type: object required: - amount @@ -46,7 +45,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml amount_refunded: description: >- The amount of the original Payment amount that has been refunded back to diff --git a/docs/api/admin/components/schemas/payment_collection.yaml b/docs/api/admin/components/schemas/PaymentCollection.yaml similarity index 93% rename from docs/api/admin/components/schemas/payment_collection.yaml rename to docs/api/admin/components/schemas/PaymentCollection.yaml index 3f5663b39a..096abf613c 100644 --- a/docs/api/admin/components/schemas/payment_collection.yaml +++ b/docs/api/admin/components/schemas/PaymentCollection.yaml @@ -1,6 +1,5 @@ title: Payment Collection description: Payment Collection -x-resourceId: payment_collection type: object required: - type @@ -43,7 +42,7 @@ properties: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: ./region.yaml + $ref: ./Region.yaml currency_code: description: The 3 character ISO code for the currency. type: string @@ -53,17 +52,17 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: ./payment.yaml + $ref: ./Payment.yaml created_by: type: string description: The ID of the user that created the payment collection. diff --git a/docs/api/store/components/schemas/payment_provider.yaml b/docs/api/admin/components/schemas/PaymentProvider.yaml similarity index 94% rename from docs/api/store/components/schemas/payment_provider.yaml rename to docs/api/admin/components/schemas/PaymentProvider.yaml index 081a6b7462..57cf719a28 100644 --- a/docs/api/store/components/schemas/payment_provider.yaml +++ b/docs/api/admin/components/schemas/PaymentProvider.yaml @@ -1,6 +1,5 @@ title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. -x-resourceId: payment_provider type: object required: - id diff --git a/docs/api/admin/components/schemas/payment_session.yaml b/docs/api/admin/components/schemas/PaymentSession.yaml similarity index 98% rename from docs/api/admin/components/schemas/payment_session.yaml rename to docs/api/admin/components/schemas/PaymentSession.yaml index ca8c513a26..3d7e87862b 100644 --- a/docs/api/admin/components/schemas/payment_session.yaml +++ b/docs/api/admin/components/schemas/PaymentSession.yaml @@ -6,7 +6,6 @@ description: >- with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. -x-resourceId: payment_session type: object required: - cart_id diff --git a/docs/api/admin/components/schemas/price_list.yaml b/docs/api/admin/components/schemas/PriceList.yaml similarity index 95% rename from docs/api/admin/components/schemas/price_list.yaml rename to docs/api/admin/components/schemas/PriceList.yaml index b774028314..6c1fc7de25 100644 --- a/docs/api/admin/components/schemas/price_list.yaml +++ b/docs/api/admin/components/schemas/PriceList.yaml @@ -2,7 +2,6 @@ title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. -x-resourceId: price_list type: object required: - name @@ -57,8 +56,8 @@ properties: type: array items: oneOf: - - $ref: ./money_amount.yaml - - $ref: ./customer_group.yaml + - $ref: ./MoneyAmount.yaml + - $ref: ./CustomerGroup.yaml includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean diff --git a/docs/api/admin/components/schemas/product.yaml b/docs/api/admin/components/schemas/Product.yaml similarity index 96% rename from docs/api/admin/components/schemas/product.yaml rename to docs/api/admin/components/schemas/Product.yaml index e0116cc51d..5112dc072f 100644 --- a/docs/api/admin/components/schemas/product.yaml +++ b/docs/api/admin/components/schemas/Product.yaml @@ -3,7 +3,6 @@ description: >- Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. -x-resourceId: product type: object required: - title @@ -48,7 +47,7 @@ properties: description: Images of the Product. Available if the relation `images` is expanded. type: array items: - $ref: ./image.yaml + $ref: ./Image.yaml thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -60,7 +59,7 @@ properties: Available if the relation `options` is expanded. type: array items: - $ref: ./product_option.yaml + $ref: ./ProductOption.yaml variants: description: >- The Product Variants that belong to the Product. Each will have a unique @@ -68,7 +67,7 @@ properties: is expanded. type: array items: - $ref: ./product_variant.yaml + $ref: ./ProductVariant.yaml profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -78,7 +77,7 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: ./shipping_profile.yaml + $ref: ./ShippingProfile.yaml weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -144,14 +143,14 @@ properties: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml tags: description: >- The Product Tags assigned to the Product. Available if the relation `tags` is expanded. type: array items: - $ref: ./product_tag.yaml + $ref: ./ProductTag.yaml discountable: description: >- Whether the Product can be discounted. Discounts will not apply to Line diff --git a/docs/api/store/components/schemas/product_collection.yaml b/docs/api/admin/components/schemas/ProductCollection.yaml similarity index 97% rename from docs/api/store/components/schemas/product_collection.yaml rename to docs/api/admin/components/schemas/ProductCollection.yaml index a3fd98cefb..0f215f050c 100644 --- a/docs/api/store/components/schemas/product_collection.yaml +++ b/docs/api/admin/components/schemas/ProductCollection.yaml @@ -1,6 +1,5 @@ title: Product Collection description: Product Collections represents a group of Products that are related. -x-resourceId: product_collection type: object required: - title diff --git a/docs/api/admin/components/schemas/product_option.yaml b/docs/api/admin/components/schemas/ProductOption.yaml similarity index 95% rename from docs/api/admin/components/schemas/product_option.yaml rename to docs/api/admin/components/schemas/ProductOption.yaml index aaaf0d58c1..0179d34d93 100644 --- a/docs/api/admin/components/schemas/product_option.yaml +++ b/docs/api/admin/components/schemas/ProductOption.yaml @@ -3,7 +3,6 @@ description: >- Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. -x-resourceId: product_option type: object required: - title @@ -23,7 +22,7 @@ properties: Available if the relation `values` is expanded. type: array items: - $ref: ./product_option_value.yaml + $ref: ./ProductOptionValue.yaml product_id: description: The ID of the Product that the Product Option is defined for. type: string diff --git a/docs/api/store/components/schemas/product_option_value.yaml b/docs/api/admin/components/schemas/ProductOptionValue.yaml similarity index 94% rename from docs/api/store/components/schemas/product_option_value.yaml rename to docs/api/admin/components/schemas/ProductOptionValue.yaml index 407e69a536..467e538803 100644 --- a/docs/api/store/components/schemas/product_option_value.yaml +++ b/docs/api/admin/components/schemas/ProductOptionValue.yaml @@ -2,7 +2,6 @@ title: Product Option Value description: >- A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. -x-resourceId: product_option_value type: object required: - value @@ -26,7 +25,7 @@ properties: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: ./product_option.yaml + $ref: ./ProductOption.yaml variant_id: description: >- The ID of the Product Variant that the Product Option Value is defined @@ -35,7 +34,7 @@ properties: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: ./product_variant.yaml + $ref: ./ProductVariant.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/product_tag.yaml b/docs/api/admin/components/schemas/ProductTag.yaml similarity index 97% rename from docs/api/store/components/schemas/product_tag.yaml rename to docs/api/admin/components/schemas/ProductTag.yaml index 8240386ddf..615174509c 100644 --- a/docs/api/store/components/schemas/product_tag.yaml +++ b/docs/api/admin/components/schemas/ProductTag.yaml @@ -1,6 +1,5 @@ title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. -x-resourceId: product_tag type: object required: - value diff --git a/docs/api/admin/components/schemas/product_tax_rate.yaml b/docs/api/admin/components/schemas/ProductTaxRate.yaml similarity index 92% rename from docs/api/admin/components/schemas/product_tax_rate.yaml rename to docs/api/admin/components/schemas/ProductTaxRate.yaml index db175e899d..a179b64cdd 100644 --- a/docs/api/admin/components/schemas/product_tax_rate.yaml +++ b/docs/api/admin/components/schemas/ProductTaxRate.yaml @@ -2,7 +2,6 @@ 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 type: object required: - product_id @@ -14,14 +13,14 @@ properties: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: ./product.yaml + $ref: ./Product.yaml rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/product_type.yaml b/docs/api/admin/components/schemas/ProductType.yaml similarity index 97% rename from docs/api/admin/components/schemas/product_type.yaml rename to docs/api/admin/components/schemas/ProductType.yaml index b6e06d4190..88555b5bf4 100644 --- a/docs/api/admin/components/schemas/product_type.yaml +++ b/docs/api/admin/components/schemas/ProductType.yaml @@ -1,6 +1,5 @@ title: Product Type description: Product Type can be added to Products for filtering and reporting purposes. -x-resourceId: product_type type: object required: - value diff --git a/docs/api/admin/components/schemas/product_type_tax_rate.yaml b/docs/api/admin/components/schemas/ProductTypeTaxRate.yaml similarity index 91% rename from docs/api/admin/components/schemas/product_type_tax_rate.yaml rename to docs/api/admin/components/schemas/ProductTypeTaxRate.yaml index 48445a6b80..a11a7ba760 100644 --- a/docs/api/admin/components/schemas/product_type_tax_rate.yaml +++ b/docs/api/admin/components/schemas/ProductTypeTaxRate.yaml @@ -2,7 +2,6 @@ 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 type: object required: - product_type_id @@ -14,14 +13,14 @@ properties: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml rate_id: description: The id of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/product_variant.yaml b/docs/api/admin/components/schemas/ProductVariant.yaml similarity index 97% rename from docs/api/store/components/schemas/product_variant.yaml rename to docs/api/admin/components/schemas/ProductVariant.yaml index a0cb2eacc9..3079f7bb14 100644 --- a/docs/api/store/components/schemas/product_variant.yaml +++ b/docs/api/admin/components/schemas/ProductVariant.yaml @@ -3,7 +3,6 @@ description: >- Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. -x-resourceId: product_variant type: object required: - title @@ -34,7 +33,7 @@ properties: Available if the relation `prices` is expanded. type: array items: - $ref: ./money_amount.yaml + $ref: ./MoneyAmount.yaml sku: description: >- The unique stock keeping unit used to identify the Product Variant. This @@ -130,7 +129,7 @@ properties: the relation `options` is expanded. type: array items: - $ref: ./product_option_value.yaml + $ref: ./ProductOptionValue.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/product_variant_prices_fields.yaml b/docs/api/admin/components/schemas/ProductVariantPricesFields.yaml similarity index 96% rename from docs/api/admin/components/schemas/product_variant_prices_fields.yaml rename to docs/api/admin/components/schemas/ProductVariantPricesFields.yaml index aee4659828..3bece0c504 100644 --- a/docs/api/admin/components/schemas/product_variant_prices_fields.yaml +++ b/docs/api/admin/components/schemas/ProductVariantPricesFields.yaml @@ -1,6 +1,5 @@ title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. -x-resourceId: product_variant_prices_fields type: object properties: original_price: diff --git a/docs/api/admin/components/schemas/publishable_api_key.yaml b/docs/api/admin/components/schemas/PublishableApiKey.yaml similarity index 97% rename from docs/api/admin/components/schemas/publishable_api_key.yaml rename to docs/api/admin/components/schemas/PublishableApiKey.yaml index 061b34b8c8..38818bccaf 100644 --- a/docs/api/admin/components/schemas/publishable_api_key.yaml +++ b/docs/api/admin/components/schemas/PublishableApiKey.yaml @@ -2,7 +2,6 @@ title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. -x-resourceId: publishable_api_key type: object properties: id: diff --git a/docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml b/docs/api/admin/components/schemas/PublishableApiKeySalesChannel.yaml similarity index 89% rename from docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml rename to docs/api/admin/components/schemas/PublishableApiKeySalesChannel.yaml index d0ab55c29a..e2461daba5 100644 --- a/docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml +++ b/docs/api/admin/components/schemas/PublishableApiKeySalesChannel.yaml @@ -1,6 +1,5 @@ title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels -x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: diff --git a/docs/api/admin/components/schemas/refund.yaml b/docs/api/admin/components/schemas/Refund.yaml similarity index 98% rename from docs/api/admin/components/schemas/refund.yaml rename to docs/api/admin/components/schemas/Refund.yaml index fae6a881f3..936eb3842c 100644 --- a/docs/api/admin/components/schemas/refund.yaml +++ b/docs/api/admin/components/schemas/Refund.yaml @@ -3,7 +3,6 @@ description: >- Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. -x-resourceId: refund type: object required: - order_id diff --git a/docs/api/admin/components/schemas/region.yaml b/docs/api/admin/components/schemas/Region.yaml similarity index 93% rename from docs/api/admin/components/schemas/region.yaml rename to docs/api/admin/components/schemas/Region.yaml index 15b245b470..89b86870dc 100644 --- a/docs/api/admin/components/schemas/region.yaml +++ b/docs/api/admin/components/schemas/Region.yaml @@ -4,7 +4,6 @@ description: >- The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. -x-resourceId: region type: object required: - name @@ -30,7 +29,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -41,7 +40,7 @@ properties: `tax_rates` is expanded. type: array items: - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml tax_code: description: >- The tax code used on purchases in the Region. This may be used by other @@ -62,28 +61,28 @@ properties: `countries` is expanded. type: array items: - $ref: ./country.yaml + $ref: ./Country.yaml tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: ./tax_provider.yaml + $ref: ./TaxProvider.yaml payment_providers: description: >- The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: ./payment_provider.yaml + $ref: ./PaymentProvider.yaml fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean diff --git a/docs/api/admin/components/schemas/return.yaml b/docs/api/admin/components/schemas/Return.yaml similarity index 97% rename from docs/api/admin/components/schemas/return.yaml rename to docs/api/admin/components/schemas/Return.yaml index 7ba545dcdc..406389b61d 100644 --- a/docs/api/admin/components/schemas/return.yaml +++ b/docs/api/admin/components/schemas/Return.yaml @@ -3,7 +3,6 @@ description: >- Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. -x-resourceId: return type: object required: - refund_amount @@ -27,7 +26,7 @@ properties: the relation `items` is expanded. type: array items: - $ref: ./return_item.yaml + $ref: ./ReturnItem.yaml swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -56,7 +55,7 @@ properties: the relation `shipping_method` is expanded. type: array items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml shipping_data: description: >- Data about the return shipment as provided by the Fulfilment Provider that diff --git a/docs/api/store/components/schemas/return_item.yaml b/docs/api/admin/components/schemas/ReturnItem.yaml similarity index 93% rename from docs/api/store/components/schemas/return_item.yaml rename to docs/api/admin/components/schemas/ReturnItem.yaml index 4ecc64bc8d..d56d8604a5 100644 --- a/docs/api/store/components/schemas/return_item.yaml +++ b/docs/api/admin/components/schemas/ReturnItem.yaml @@ -2,7 +2,6 @@ title: Return Item description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. -x-resourceId: return_item type: object required: - return_id @@ -14,14 +13,14 @@ properties: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: ./return.yaml + $ref: ./Return.yaml item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -46,7 +45,7 @@ properties: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml note: description: An optional note with additional details about the Return. type: string diff --git a/docs/api/store/components/schemas/return_reason.yaml b/docs/api/admin/components/schemas/ReturnReason.yaml similarity index 94% rename from docs/api/store/components/schemas/return_reason.yaml rename to docs/api/admin/components/schemas/ReturnReason.yaml index 2e4d4d83ef..ff9a50bf3f 100644 --- a/docs/api/store/components/schemas/return_reason.yaml +++ b/docs/api/admin/components/schemas/ReturnReason.yaml @@ -2,7 +2,6 @@ title: Return Reason description: >- A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. -x-resourceId: return_reason type: object required: - value @@ -30,10 +29,10 @@ properties: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/sales_channel.yaml b/docs/api/admin/components/schemas/SalesChannel.yaml similarity index 97% rename from docs/api/store/components/schemas/sales_channel.yaml rename to docs/api/admin/components/schemas/SalesChannel.yaml index 7c4e1f2920..a79b3fd206 100644 --- a/docs/api/store/components/schemas/sales_channel.yaml +++ b/docs/api/admin/components/schemas/SalesChannel.yaml @@ -1,6 +1,5 @@ title: Sales Channel description: A Sales Channel -x-resourceId: sales_channel type: object required: - name diff --git a/docs/api/store/components/schemas/shipping_method.yaml b/docs/api/admin/components/schemas/ShippingMethod.yaml similarity index 96% rename from docs/api/store/components/schemas/shipping_method.yaml rename to docs/api/admin/components/schemas/ShippingMethod.yaml index 4ac18c8e93..9ac6b87cc6 100644 --- a/docs/api/store/components/schemas/shipping_method.yaml +++ b/docs/api/admin/components/schemas/ShippingMethod.yaml @@ -4,7 +4,6 @@ description: >- Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. -x-resourceId: shipping_method type: object required: - shipping_option_id @@ -20,7 +19,7 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -60,7 +59,7 @@ properties: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: ./shipping_method_tax_line.yaml + $ref: ./ShippingMethodTaxLine.yaml price: description: >- The amount to charge for the Shipping Method. The currency of the price is diff --git a/docs/api/admin/components/schemas/shipping_method_tax_line.yaml b/docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml similarity index 94% rename from docs/api/admin/components/schemas/shipping_method_tax_line.yaml rename to docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml index 3387bfbfe2..1089796789 100644 --- a/docs/api/admin/components/schemas/shipping_method_tax_line.yaml +++ b/docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml @@ -1,6 +1,5 @@ title: Shipping Method Tax Line description: Shipping Method Tax Line -x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -17,7 +16,7 @@ properties: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml code: description: A code to identify the tax type by type: string diff --git a/docs/api/admin/components/schemas/shipping_option.yaml b/docs/api/admin/components/schemas/ShippingOption.yaml similarity index 95% rename from docs/api/admin/components/schemas/shipping_option.yaml rename to docs/api/admin/components/schemas/ShippingOption.yaml index a0e1c6538a..0efbef070c 100644 --- a/docs/api/admin/components/schemas/shipping_option.yaml +++ b/docs/api/admin/components/schemas/ShippingOption.yaml @@ -6,7 +6,6 @@ description: >- cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. -x-resourceId: shipping_option type: object required: - name @@ -41,7 +40,7 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: ./shipping_profile.yaml + $ref: ./ShippingProfile.yaml provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -50,7 +49,7 @@ properties: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml price_type: description: >- The type of pricing calculation that is used when creatin Shipping Methods @@ -78,7 +77,7 @@ properties: expanded. type: array items: - $ref: ./shipping_option_requirement.yaml + $ref: ./ShippingOptionRequirement.yaml data: description: >- The data needed for the Fulfillment Provider to identify the Shipping diff --git a/docs/api/store/components/schemas/shipping_option_requirement.yaml b/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml similarity index 94% rename from docs/api/store/components/schemas/shipping_option_requirement.yaml rename to docs/api/admin/components/schemas/ShippingOptionRequirement.yaml index 57d9719312..bebafda0ea 100644 --- a/docs/api/store/components/schemas/shipping_option_requirement.yaml +++ b/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml @@ -2,7 +2,6 @@ title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. -x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -21,7 +20,7 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml type: description: >- The type of the requirement, this defines how the value will be compared diff --git a/docs/api/store/components/schemas/shipping_profile.yaml b/docs/api/admin/components/schemas/ShippingProfile.yaml similarity index 96% rename from docs/api/store/components/schemas/shipping_profile.yaml rename to docs/api/admin/components/schemas/ShippingProfile.yaml index ba479ece92..0afd646078 100644 --- a/docs/api/store/components/schemas/shipping_profile.yaml +++ b/docs/api/admin/components/schemas/ShippingProfile.yaml @@ -2,7 +2,6 @@ title: Shipping Profile description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. -x-resourceId: shipping_profile type: object required: - name @@ -43,7 +42,7 @@ properties: expanded. type: array items: - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/shipping_tax_rate.yaml b/docs/api/admin/components/schemas/ShippingTaxRate.yaml similarity index 91% rename from docs/api/store/components/schemas/shipping_tax_rate.yaml rename to docs/api/admin/components/schemas/ShippingTaxRate.yaml index 30058a09af..7ab7938fb0 100644 --- a/docs/api/store/components/schemas/shipping_tax_rate.yaml +++ b/docs/api/admin/components/schemas/ShippingTaxRate.yaml @@ -2,7 +2,6 @@ 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 type: object required: - shipping_option_id @@ -14,14 +13,14 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/staged_job.yaml b/docs/api/admin/components/schemas/StagedJob.yaml similarity index 93% rename from docs/api/admin/components/schemas/staged_job.yaml rename to docs/api/admin/components/schemas/StagedJob.yaml index 055ceaee0e..a31192dbdc 100644 --- a/docs/api/admin/components/schemas/staged_job.yaml +++ b/docs/api/admin/components/schemas/StagedJob.yaml @@ -1,6 +1,5 @@ title: Staged Job description: A staged job resource -x-resourceId: staged_job type: object required: - event_name diff --git a/docs/api/store/components/schemas/store.yaml b/docs/api/admin/components/schemas/Store.yaml similarity index 96% rename from docs/api/store/components/schemas/store.yaml rename to docs/api/admin/components/schemas/Store.yaml index 98b90e81f4..d96015e522 100644 --- a/docs/api/store/components/schemas/store.yaml +++ b/docs/api/admin/components/schemas/Store.yaml @@ -1,6 +1,5 @@ title: Store description: Holds settings for the Store, such as name, currencies, etc. -x-resourceId: store type: object properties: id: @@ -20,14 +19,14 @@ properties: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml currencies: description: >- The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. type: array items: - $ref: ./currency.yaml + $ref: ./Currency.yaml swap_link_template: description: >- A template to generate Swap links from. Use {{cart_id}} to include the diff --git a/docs/api/admin/components/schemas/swap.yaml b/docs/api/admin/components/schemas/Swap.yaml similarity index 96% rename from docs/api/admin/components/schemas/swap.yaml rename to docs/api/admin/components/schemas/Swap.yaml index 31694ff199..d5a43a79d8 100644 --- a/docs/api/admin/components/schemas/swap.yaml +++ b/docs/api/admin/components/schemas/Swap.yaml @@ -7,7 +7,6 @@ description: >- the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. -x-resourceId: swap type: object required: - fulfillment_status @@ -57,7 +56,7 @@ properties: `additional_items` is expanded. type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml return_order: description: >- A return order object. The Return that is issued for the return part of @@ -69,13 +68,13 @@ properties: relation `fulfillments` is expanded. type: array items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. - $ref: ./payment.yaml + $ref: ./Payment.yaml difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May be @@ -91,14 +90,14 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_methods: description: >- The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. type: array items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string diff --git a/docs/api/store/components/schemas/tax_line.yaml b/docs/api/admin/components/schemas/TaxLine.yaml similarity index 97% rename from docs/api/store/components/schemas/tax_line.yaml rename to docs/api/admin/components/schemas/TaxLine.yaml index 3faaf02eb7..3300d86797 100644 --- a/docs/api/store/components/schemas/tax_line.yaml +++ b/docs/api/admin/components/schemas/TaxLine.yaml @@ -1,6 +1,5 @@ title: Tax Line description: Line item that specifies an amount of tax to add to a line item. -x-resourceId: tax_line type: object required: - rate diff --git a/docs/api/store/components/schemas/tax_provider.yaml b/docs/api/admin/components/schemas/TaxProvider.yaml similarity index 94% rename from docs/api/store/components/schemas/tax_provider.yaml rename to docs/api/admin/components/schemas/TaxProvider.yaml index 7f53c424a5..dc2b7ef07e 100644 --- a/docs/api/store/components/schemas/tax_provider.yaml +++ b/docs/api/admin/components/schemas/TaxProvider.yaml @@ -1,6 +1,5 @@ title: Tax Provider description: The tax service used to calculate taxes -x-resourceId: tax_provider type: object properties: id: diff --git a/docs/api/store/components/schemas/tax_rate.yaml b/docs/api/admin/components/schemas/TaxRate.yaml similarity index 98% rename from docs/api/store/components/schemas/tax_rate.yaml rename to docs/api/admin/components/schemas/TaxRate.yaml index cbe718652e..48ff10fd0c 100644 --- a/docs/api/store/components/schemas/tax_rate.yaml +++ b/docs/api/admin/components/schemas/TaxRate.yaml @@ -2,7 +2,6 @@ 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 type: object required: - name diff --git a/docs/api/store/components/schemas/tracking_link.yaml b/docs/api/admin/components/schemas/TrackingLink.yaml similarity index 96% rename from docs/api/store/components/schemas/tracking_link.yaml rename to docs/api/admin/components/schemas/TrackingLink.yaml index 25867d8a97..85a7f696e7 100644 --- a/docs/api/store/components/schemas/tracking_link.yaml +++ b/docs/api/admin/components/schemas/TrackingLink.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: tracking_link type: object required: - tracking_number @@ -27,7 +26,7 @@ properties: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml idempotency_key: type: string description: >- diff --git a/docs/api/admin/components/schemas/user.yaml b/docs/api/admin/components/schemas/User.yaml similarity index 98% rename from docs/api/admin/components/schemas/user.yaml rename to docs/api/admin/components/schemas/User.yaml index 042cd46cb2..c35e299a8f 100644 --- a/docs/api/admin/components/schemas/user.yaml +++ b/docs/api/admin/components/schemas/User.yaml @@ -1,6 +1,5 @@ title: User description: Represents a User who can manage store settings. -x-resourceId: user type: object required: - email diff --git a/docs/api/admin/openapi.yaml b/docs/api/admin/openapi.yaml index b762f21692..dc21e13028 100644 --- a/docs/api/admin/openapi.yaml +++ b/docs/api/admin/openapi.yaml @@ -108,106 +108,77 @@ tags: sessions. - name: App description: App endpoints that allow handling apps in Medusa. - x-resourceId: OAuth - name: Batch Job description: Batch Job endpoints that allow handling batch jobs in Medusa. - x-resourceId: batch_job - name: Claim description: Claim endpoints that allow handling claims in Medusa. - x-resourceId: claim_order - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Customer Group description: Customer Group endpoints that allow handling customer groups in Medusa. - x-resourceId: customer_group - name: Discount description: Discount endpoints that allow handling discounts in Medusa. - x-resourceId: discount - name: Discount Condition description: >- Discount Condition endpoints that allow handling discount conditions in Medusa. - x-resourceId: discount_condition - name: Draft Order description: Draft Order endpoints that allow handling draft orders in Medusa. - x-resourceId: draft-order - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Invite description: Invite endpoints that allow handling invites in Medusa. - x-resourceId: invite - name: Note description: Note endpoints that allow handling notes in Medusa. - x-resourceId: note - name: Notification description: Notification endpoints that allow handling notifications in Medusa. - x-resourceId: notification - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Price List description: Price List endpoints that allow handling price lists in Medusa. - x-resourceId: price_list - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Tag description: Product Tag endpoints that allow handling product tags in Medusa. - x-resourceId: product_tag - name: Product Type description: Product Types endpoints that allow handling product types in Medusa. - x-resourceId: product_type - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Sales Channel description: Sales Channel endpoints that allow handling sales channels in Medusa. - x-resourceId: sales_channel - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Shipping Profile description: >- Shipping Profile endpoints that allow handling shipping profiles in Medusa. - x-resourceId: shipping_profile - name: Store description: Store endpoints that allow handling stores in Medusa. - x-resourceId: store - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap - name: Tax Rate description: Tax Rate endpoints that allow handling tax rates in Medusa. - x-resourceId: tax_rate - name: Upload description: Upload endpoints that allow handling uploads in Medusa. - name: User description: User endpoints that allow handling users in Medusa. - x-resourceId: user servers: - url: https://api.medusa-commerce.com/admin paths: + /apps/authorizations: + $ref: paths/apps_authorizations.yaml + /apps: + $ref: paths/apps.yaml /auth: $ref: paths/auth.yaml - /currencies: - $ref: paths/currencies.yaml - /currencies/{code}: - $ref: paths/currencies_{code}.yaml /batch-jobs/{id}/cancel: $ref: paths/batch-jobs_{id}_cancel.yaml /batch-jobs/{id}/confirm: @@ -222,6 +193,10 @@ paths: $ref: paths/collections.yaml /collections/{id}: $ref: paths/collections_{id}.yaml + /currencies: + $ref: paths/currencies.yaml + /currencies/{code}: + $ref: paths/currencies_{code}.yaml /customer-groups/{id}/customers/batch: $ref: paths/customer-groups_{id}_customers_batch.yaml /customer-groups: @@ -230,26 +205,10 @@ paths: $ref: paths/customer-groups_{id}.yaml /customer-groups/{id}/customers: $ref: paths/customer-groups_{id}_customers.yaml - /apps/authorizations: - $ref: paths/apps_authorizations.yaml - /apps: - $ref: paths/apps.yaml /customers: $ref: paths/customers.yaml /customers/{id}: $ref: paths/customers_{id}.yaml - /draft-orders: - $ref: paths/draft-orders.yaml - /draft-orders/{id}/line-items: - $ref: paths/draft-orders_{id}_line-items.yaml - /draft-orders/{id}: - $ref: paths/draft-orders_{id}.yaml - /draft-orders/{id}/line-items/{line_id}: - $ref: paths/draft-orders_{id}_line-items_{line_id}.yaml - /draft-orders/{id}/pay: - $ref: paths/draft-orders_{id}_pay.yaml - /admin/draft-orders/{id}: - $ref: paths/admin_draft-orders_{id}.yaml /discounts/{id}/regions/{region_id}: $ref: paths/discounts_{id}_regions_{region_id}.yaml /discounts/{discount_id}/conditions/{condition_id}/batch: @@ -268,6 +227,18 @@ paths: $ref: paths/discounts_{id}_dynamic-codes_{code}.yaml /discounts/code/{code}: $ref: paths/discounts_code_{code}.yaml + /draft-orders: + $ref: paths/draft-orders.yaml + /draft-orders/{id}/line-items: + $ref: paths/draft-orders_{id}_line-items.yaml + /draft-orders/{id}: + $ref: paths/draft-orders_{id}.yaml + /draft-orders/{id}/line-items/{line_id}: + $ref: paths/draft-orders_{id}_line-items_{line_id}.yaml + /draft-orders/{id}/pay: + $ref: paths/draft-orders_{id}_pay.yaml + /admin/draft-orders/{id}: + $ref: paths/admin_draft-orders_{id}.yaml /gift-cards: $ref: paths/gift-cards.yaml /gift-cards/{id}: @@ -288,6 +259,22 @@ paths: $ref: paths/notifications.yaml /notifications/{id}/resend: $ref: paths/notifications_{id}_resend.yaml + /order-edits/{id}/items: + $ref: paths/order-edits_{id}_items.yaml + /order-edits/{id}/cancel: + $ref: paths/order-edits_{id}_cancel.yaml + /order-edits/{id}/confirm: + $ref: paths/order-edits_{id}_confirm.yaml + /order-edits: + $ref: paths/order-edits.yaml + /order-edits/{id}/items/{item_id}: + $ref: paths/order-edits_{id}_items_{item_id}.yaml + /order-edits/{id}/changes/{change_id}: + $ref: paths/order-edits_{id}_changes_{change_id}.yaml + /order-edits/{id}: + $ref: paths/order-edits_{id}.yaml + /order-edits/{id}/request: + $ref: paths/order-edits_{id}_request.yaml /orders/{id}/shipping-methods: $ref: paths/orders_{id}_shipping-methods.yaml /orders/{id}/archive: @@ -338,22 +325,6 @@ paths: $ref: paths/orders_{id}_return.yaml /order/{id}/claims/{claim_id}: $ref: paths/order_{id}_claims_{claim_id}.yaml - /order-edits/{id}/items: - $ref: paths/order-edits_{id}_items.yaml - /order-edits/{id}/cancel: - $ref: paths/order-edits_{id}_cancel.yaml - /order-edits/{id}/confirm: - $ref: paths/order-edits_{id}_confirm.yaml - /order-edits: - $ref: paths/order-edits.yaml - /order-edits/{id}/items/{item_id}: - $ref: paths/order-edits_{id}_items_{item_id}.yaml - /order-edits/{id}/changes/{change_id}: - $ref: paths/order-edits_{id}_changes_{change_id}.yaml - /order-edits/{id}: - $ref: paths/order-edits_{id}.yaml - /order-edits/{id}/request: - $ref: paths/order-edits_{id}_request.yaml /payment-collections/{id}: $ref: paths/payment-collections_{id}.yaml /payment-collections/{id}/authorize: @@ -432,18 +403,18 @@ paths: $ref: paths/return-reasons.yaml /return-reasons/{id}: $ref: paths/return-reasons_{id}.yaml - /sales-channels/{id}/products/batch: - $ref: paths/sales-channels_{id}_products_batch.yaml - /sales-channels: - $ref: paths/sales-channels.yaml - /sales-channels/{id}: - $ref: paths/sales-channels_{id}.yaml /returns/{id}/cancel: $ref: paths/returns_{id}_cancel.yaml /returns: $ref: paths/returns.yaml /returns/{id}/receive: $ref: paths/returns_{id}_receive.yaml + /sales-channels/{id}/products/batch: + $ref: paths/sales-channels_{id}_products_batch.yaml + /sales-channels: + $ref: paths/sales-channels.yaml + /sales-channels/{id}: + $ref: paths/sales-channels_{id}.yaml /shipping-options: $ref: paths/shipping-options.yaml /shipping-options/{id}: diff --git a/docs/api/admin/paths/admin_draft-orders_{id}.yaml b/docs/api/admin/paths/admin_draft-orders_{id}.yaml index 09630a97d9..2840671094 100644 --- a/docs/api/admin/paths/admin_draft-orders_{id}.yaml +++ b/docs/api/admin/paths/admin_draft-orders_{id}.yaml @@ -14,51 +14,7 @@ post: content: application/json: schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Draft Order in. - country_code: - type: string - description: The 2 character ISO code for the Country. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Draft Order. - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: ../components/schemas/address_fields.yaml - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: ../components/schemas/address_fields.yaml - - type: string - discounts: - description: An array of Discount codes to add to the Draft Order. - type: array - items: - type: object - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine use - of notifications. - type: boolean - customer_id: - description: The ID of the Customer to associate the Draft Order with. - type: string + $ref: ../components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -82,7 +38,7 @@ post: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/apps_authorizations.yaml b/docs/api/admin/paths/apps_authorizations.yaml index 083b1c4d48..fe5c56aefd 100644 --- a/docs/api/admin/paths/apps_authorizations.yaml +++ b/docs/api/admin/paths/apps_authorizations.yaml @@ -7,21 +7,7 @@ post: content: application/json: schema: - type: object - 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. + $ref: ../components/schemas/AdminPostAppsReq.yaml x-codeSamples: - lang: Shell label: cURL diff --git a/docs/api/admin/paths/auth.yaml b/docs/api/admin/paths/auth.yaml index d9eb880401..7df22e8372 100644 --- a/docs/api/admin/paths/auth.yaml +++ b/docs/api/admin/paths/auth.yaml @@ -39,7 +39,7 @@ post: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -114,7 +114,7 @@ get: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/batch-jobs.yaml b/docs/api/admin/paths/batch-jobs.yaml index fb7b06064c..620314d7bb 100644 --- a/docs/api/admin/paths/batch-jobs.yaml +++ b/docs/api/admin/paths/batch-jobs.yaml @@ -7,42 +7,7 @@ post: content: application/json: schema: - type: object - required: - - type - - context - properties: - type: - type: string - description: The type of batch job to start. - example: product-export - context: - type: object - description: >- - Additional infomration regarding the batch to be used for - processing. - example: - shape: - prices: - - region: null - currency_code: eur - dynamicImageColumnCount: 4 - dynamicOptionColumnCount: 2 - list_config: - skip: 0 - take: 50 - order: - created_at: DESC - relations: - - variants - - variant.prices - - images - dry_run: - type: boolean - description: >- - Set a batch job in dry_run mode to get some information on what - will be done without applying any modifications. - default: false + $ref: ../components/schemas/AdminPostBatchesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -66,7 +31,7 @@ post: type: object properties: batch_job: - $ref: ../components/schemas/batch_job.yaml + $ref: ../components/schemas/BatchJob.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -345,7 +310,7 @@ get: batch_jobs: type: array items: - $ref: ../components/schemas/batch_job.yaml + $ref: ../components/schemas/BatchJob.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/batch-jobs_{id}.yaml b/docs/api/admin/paths/batch-jobs_{id}.yaml index 2278e04dfb..590a2bcf81 100644 --- a/docs/api/admin/paths/batch-jobs_{id}.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}.yaml @@ -33,7 +33,7 @@ get: type: object properties: batch_job: - $ref: ../components/schemas/batch_job.yaml + $ref: ../components/schemas/BatchJob.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml b/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml index cddbde3b9e..1802061a1c 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml @@ -33,7 +33,7 @@ post: type: object properties: batch_job: - $ref: ../components/schemas/batch_job.yaml + $ref: ../components/schemas/BatchJob.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml b/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml index ed31dff4fe..e2230ad52a 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml @@ -33,7 +33,7 @@ post: type: object properties: batch_job: - $ref: ../components/schemas/batch_job.yaml + $ref: ../components/schemas/BatchJob.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/collections.yaml b/docs/api/admin/paths/collections.yaml index 3dd991bf7c..fbd79a669c 100644 --- a/docs/api/admin/paths/collections.yaml +++ b/docs/api/admin/paths/collections.yaml @@ -7,23 +7,7 @@ post: content: application/json: schema: - type: object - required: - - title - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided we - will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostCollectionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -47,7 +31,7 @@ post: type: object properties: collection: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -189,7 +173,7 @@ get: collections: type: array items: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/collections_{id}.yaml b/docs/api/admin/paths/collections_{id}.yaml index 2b75a31ee1..a98116c2bf 100644 --- a/docs/api/admin/paths/collections_{id}.yaml +++ b/docs/api/admin/paths/collections_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: collection: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,21 +119,7 @@ post: content: application/json: schema: - type: object - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided we - will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostCollectionsCollectionReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -157,7 +143,7 @@ post: type: object properties: collection: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/collections_{id}_products_batch.yaml b/docs/api/admin/paths/collections_{id}_products_batch.yaml index 50cda5b52b..2d696a0484 100644 --- a/docs/api/admin/paths/collections_{id}_products_batch.yaml +++ b/docs/api/admin/paths/collections_{id}_products_batch.yaml @@ -14,16 +14,7 @@ post: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + $ref: ../components/schemas/AdminPostProductsToCollectionReq.yaml x-codeSamples: - lang: Shell label: cURL @@ -43,7 +34,7 @@ post: type: object properties: collection: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -72,16 +63,7 @@ delete: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to remove from the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + $ref: ../components/schemas/AdminDeleteProductsFromCollectionReq.yaml x-codeSamples: - lang: Shell label: cURL diff --git a/docs/api/admin/paths/currencies.yaml b/docs/api/admin/paths/currencies.yaml index b707270a89..739390489f 100644 --- a/docs/api/admin/paths/currencies.yaml +++ b/docs/api/admin/paths/currencies.yaml @@ -53,7 +53,7 @@ get: currencies: type: array items: - $ref: ../components/schemas/currency.yaml + $ref: ../components/schemas/Currency.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/currencies_{code}.yaml b/docs/api/admin/paths/currencies_{code}.yaml index 70d8229a93..fc68439223 100644 --- a/docs/api/admin/paths/currencies_{code}.yaml +++ b/docs/api/admin/paths/currencies_{code}.yaml @@ -14,11 +14,7 @@ post: content: application/json: schema: - type: object - properties: - includes_tax: - type: boolean - description: '[EXPERIMENTAL] Tax included in prices of currency.' + $ref: ../components/schemas/AdminPostCurrenciesCurrencyReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -39,4 +35,4 @@ post: type: object properties: currency: - $ref: ../components/schemas/currency.yaml + $ref: ../components/schemas/Currency.yaml diff --git a/docs/api/admin/paths/customer-groups.yaml b/docs/api/admin/paths/customer-groups.yaml index 9d9787b29c..f3358f5dae 100644 --- a/docs/api/admin/paths/customer-groups.yaml +++ b/docs/api/admin/paths/customer-groups.yaml @@ -27,7 +27,7 @@ post: type: object properties: customer_group: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -201,7 +201,7 @@ get: customer_groups: type: array items: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/customer-groups_{id}.yaml b/docs/api/admin/paths/customer-groups_{id}.yaml index 2d0b5c1fca..be757bb093 100644 --- a/docs/api/admin/paths/customer-groups_{id}.yaml +++ b/docs/api/admin/paths/customer-groups_{id}.yaml @@ -100,7 +100,7 @@ get: type: object properties: customer_group: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -129,14 +129,7 @@ post: content: application/json: schema: - type: object - properties: - name: - description: Name of the customer group - type: string - metadata: - description: Metadata for the customer. - type: object + $ref: ../components/schemas/AdminPostCustomerGroupsGroupReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -160,7 +153,7 @@ post: type: object properties: customer_group: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/customer-groups_{id}_customers.yaml b/docs/api/admin/paths/customer-groups_{id}_customers.yaml index 602adf0ae9..1e0f51e3a2 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers.yaml +++ b/docs/api/admin/paths/customer-groups_{id}_customers.yaml @@ -35,7 +35,7 @@ get: customers: type: array items: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml b/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml index a45e279435..026d2d010a 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml +++ b/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml @@ -14,20 +14,8 @@ post: content: application/json: schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to add - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string + $ref: >- + ../components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -53,7 +41,7 @@ post: type: object properties: customer_group: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -82,20 +70,8 @@ delete: content: application/json: schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to remove - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string + $ref: >- + ../components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -121,7 +97,7 @@ delete: type: object properties: customer_group: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/customers.yaml b/docs/api/admin/paths/customers.yaml index 0b67b4bc8e..6a2c283eb8 100644 --- a/docs/api/admin/paths/customers.yaml +++ b/docs/api/admin/paths/customers.yaml @@ -7,35 +7,7 @@ post: content: application/json: schema: - type: object - required: - - email - - first_name - - last_name - - password - properties: - email: - type: string - description: The customer's email. - format: email - first_name: - type: string - description: The customer's first name. - last_name: - type: string - description: The customer's last name. - password: - type: string - description: The customer's password. - format: password - phone: - type: string - description: The customer's phone number. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostCustomersReq.yaml tags: - Customer x-codeSamples: @@ -59,7 +31,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -125,7 +97,7 @@ get: customers: type: array items: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/customers_{id}.yaml b/docs/api/admin/paths/customers_{id}.yaml index 4b729d7f9f..5295e0bd70 100644 --- a/docs/api/admin/paths/customers_{id}.yaml +++ b/docs/api/admin/paths/customers_{id}.yaml @@ -43,7 +43,7 @@ get: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -82,40 +82,7 @@ post: content: application/json: schema: - type: object - properties: - email: - type: string - description: The Customer's email. - format: email - first_name: - type: string - description: The Customer's first name. - last_name: - type: string - description: The Customer's last name. - phone: - type: string - description: The Customer's phone number. - password: - type: string - description: The Customer's password. - format: password - groups: - type: array - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - description: A list of customer groups to which the customer belongs. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostCustomersCustomerReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -139,7 +106,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts.yaml b/docs/api/admin/paths/discounts.yaml index da81dcaf2e..48e56e3da4 100644 --- a/docs/api/admin/paths/discounts.yaml +++ b/docs/api/admin/paths/discounts.yaml @@ -20,141 +20,7 @@ post: content: application/json: schema: - type: object - required: - - code - - rule - - regions - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - is_dynamic: - type: boolean - description: >- - Whether the Discount should have multiple instances of itself, - each with a different code. This can be useful for automatically - generated codes that all have to follow a common set of rules. - default: false - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - type - - value - - allocation - properties: - description: - type: string - description: A short description of the discount - type: - type: string - description: >- - The type of the Discount, can be `fixed` for discounts that - reduce the price by a fixed amount, `percentage` for - percentage reductions or `free_shipping` for shipping - vouchers. - enum: - - fixed - - percentage - - free_shipping - value: - type: number - description: >- - The value that the discount represents; this will depend on - the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, and - `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied - on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied - on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will have - to enable it later to make it available to Customers. - default: false - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: The time at which the Discount should no longer be available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - usage_limit: - type: number - description: Maximum times the discount can be used - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostDiscountsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -178,7 +44,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -278,7 +144,7 @@ get: discounts: type: array items: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/discounts_code_{code}.yaml b/docs/api/admin/paths/discounts_code_{code}.yaml index b290e9417a..5d5997d34b 100644 --- a/docs/api/admin/paths/discounts_code_{code}.yaml +++ b/docs/api/admin/paths/discounts_code_{code}.yaml @@ -43,7 +43,7 @@ get: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml index 377c96c705..8ff0e9eef1 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml @@ -31,49 +31,7 @@ post: content: application/json: schema: - type: object - required: - - operator - properties: - operator: - description: Operator of the condition - type: string - enum: - - in - - not_in - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on product - types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied on - product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on product - tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: ../components/schemas/AdminPostDiscountsDiscountConditions.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -98,7 +56,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml index af581bd4e3..9730b4108e 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml @@ -65,7 +65,7 @@ delete: default: true discount: description: The Discount to which the condition used to belong - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -131,7 +131,7 @@ get: type: object properties: discount_condition: - $ref: ../components/schemas/discount_condition.yaml + $ref: ../components/schemas/DiscountCondition.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -183,41 +183,8 @@ post: content: application/json: schema: - type: object - properties: - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on product - types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied on - product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on product - tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: >- + ../components/schemas/AdminPostDiscountsDiscountConditionsCondition.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -243,7 +210,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml index dcfb03cc4c..2c9781b8b3 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml @@ -34,20 +34,8 @@ post: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be added to the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + ../components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -73,7 +61,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -122,20 +110,8 @@ delete: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be deleted from the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + ../components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -161,7 +137,7 @@ delete: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{id}.yaml b/docs/api/admin/paths/discounts_{id}.yaml index 571033e59e..bd7cf157c8 100644 --- a/docs/api/admin/paths/discounts_{id}.yaml +++ b/docs/api/admin/paths/discounts_{id}.yaml @@ -100,7 +100,7 @@ get: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -145,120 +145,7 @@ post: content: application/json: schema: - type: object - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - id - properties: - id: - type: string - description: The ID of the Rule - description: - type: string - description: A short description of the discount - value: - type: number - description: >- - The value that the discount represents; this will depend on - the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, and - `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - id: - type: string - description: The ID of the Rule - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied - on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied - on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - 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 - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: The time at which the Discount should no longer be available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - usage_limit: - type: number - description: Maximum times the discount can be used - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - metadata: - description: An object containing metadata of the discount - type: object + $ref: ../components/schemas/AdminPostDiscountsDiscountReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -282,7 +169,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml b/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml index 4b1fccd709..f84d9639e1 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml +++ b/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml @@ -35,7 +35,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml b/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml index a6203c3997..d1f2a7c71a 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml +++ b/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml @@ -41,7 +41,7 @@ delete: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml b/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml index 85dc282dc2..da2a06418b 100644 --- a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml +++ b/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml @@ -40,7 +40,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -96,7 +96,7 @@ delete: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/draft-orders.yaml b/docs/api/admin/paths/draft-orders.yaml index b15bf56296..7c57cc7065 100644 --- a/docs/api/admin/paths/draft-orders.yaml +++ b/docs/api/admin/paths/draft-orders.yaml @@ -7,106 +7,7 @@ post: content: application/json: schema: - type: object - required: - - email - - items - - region_id - - shipping_methods - properties: - status: - description: The status of the draft order - type: string - enum: - - open - - completed - email: - description: The email of the customer of the draft order - type: string - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: ../components/schemas/address_fields.yaml - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: ../components/schemas/address_fields.yaml - - type: string - items: - description: The Line Items that have been received. - type: array - items: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line Item - from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about - the Line Item. - type: object - region_id: - description: The ID of the region for the draft order - type: string - discounts: - description: The discounts to add on the draft order - type: array - items: - type: object - required: - - code - properties: - code: - description: The code of the discount to apply - type: string - customer_id: - description: The ID of the customer to add on the draft order - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine use - of notifications. - type: boolean - shipping_methods: - description: The shipping methods for the draft order - type: array - items: - type: object - required: - - option_id - properties: - option_id: - description: The ID of the shipping option in use - type: string - data: - description: >- - The optional additional data needed for the shipping - method - type: object - price: - description: The potential custom price of the shipping - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Draft Order. - type: object + $ref: ../components/schemas/AdminPostDraftOrdersReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -130,7 +31,7 @@ post: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -193,7 +94,7 @@ get: draft_orders: type: array items: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/draft-orders_{id}.yaml b/docs/api/admin/paths/draft-orders_{id}.yaml index 76c2c7d7fe..c65beb2cff 100644 --- a/docs/api/admin/paths/draft-orders_{id}.yaml +++ b/docs/api/admin/paths/draft-orders_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml b/docs/api/admin/paths/draft-orders_{id}_line-items.yaml index e0bbd3de00..843f755985 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_line-items.yaml @@ -14,28 +14,8 @@ post: content: application/json: schema: - type: object - required: - - quantity - properties: - variant_id: - description: The ID of the Product Variant to generate the Line Item from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - default: Custom item - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object + $ref: >- + ../components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -59,7 +39,7 @@ post: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml b/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml index d91330afa7..7c10c48c6a 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml @@ -41,7 +41,7 @@ delete: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -76,22 +76,8 @@ post: content: application/json: schema: - type: object - properties: - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object + $ref: >- + ../components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -117,7 +103,7 @@ post: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/draft-orders_{id}_pay.yaml b/docs/api/admin/paths/draft-orders_{id}_pay.yaml index 9865df7c71..33498b2817 100644 --- a/docs/api/admin/paths/draft-orders_{id}_pay.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_pay.yaml @@ -33,7 +33,7 @@ post: type: object properties: order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/gift-cards.yaml b/docs/api/admin/paths/gift-cards.yaml index 9b7b83be5e..6a2bd0f9e4 100644 --- a/docs/api/admin/paths/gift-cards.yaml +++ b/docs/api/admin/paths/gift-cards.yaml @@ -9,30 +9,7 @@ post: content: application/json: schema: - type: object - required: - - region_id - properties: - value: - type: integer - description: The value (excluding VAT) that the Gift Card should represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have to - enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: The time at which the Gift Card should no longer be available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostGiftCardsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -56,7 +33,7 @@ post: type: object properties: gift_card: - $ref: ../components/schemas/gift_card.yaml + $ref: ../components/schemas/GiftCard.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -117,7 +94,7 @@ get: gift_cards: type: array items: - $ref: ../components/schemas/gift_card.yaml + $ref: ../components/schemas/GiftCard.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/gift-cards_{id}.yaml b/docs/api/admin/paths/gift-cards_{id}.yaml index f607e44f74..736536499e 100644 --- a/docs/api/admin/paths/gift-cards_{id}.yaml +++ b/docs/api/admin/paths/gift-cards_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: gift_card: - $ref: ../components/schemas/gift_card.yaml + $ref: ../components/schemas/GiftCard.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -121,28 +121,7 @@ post: content: application/json: schema: - type: object - properties: - balance: - type: integer - description: The value (excluding VAT) that the Gift Card should represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have to - enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: The time at which the Gift Card should no longer be available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostGiftCardsGiftCardReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -166,7 +145,7 @@ post: type: object properties: gift_card: - $ref: ../components/schemas/gift_card.yaml + $ref: ../components/schemas/GiftCard.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/invites.yaml b/docs/api/admin/paths/invites.yaml index ef4a2f8449..6de86e8dbf 100644 --- a/docs/api/admin/paths/invites.yaml +++ b/docs/api/admin/paths/invites.yaml @@ -7,22 +7,7 @@ post: content: application/json: schema: - type: object - required: - - user - - role - properties: - user: - description: The email for the user to be created. - type: string - format: email - role: - description: The role of the user to be created. - type: string - enum: - - admin - - member - - developer + $ref: ../components/schemas/AdminPostInvitesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -82,7 +67,7 @@ get: invites: type: array items: - $ref: ../components/schemas/invite.yaml + $ref: ../components/schemas/Invite.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/invites_accept.yaml b/docs/api/admin/paths/invites_accept.yaml index ec434b2eac..a6f393d12b 100644 --- a/docs/api/admin/paths/invites_accept.yaml +++ b/docs/api/admin/paths/invites_accept.yaml @@ -6,32 +6,7 @@ post: content: application/json: schema: - type: object - 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 - format: password + $ref: ../components/schemas/AdminPostInvitesInviteAcceptReq.yaml x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/notes.yaml b/docs/api/admin/paths/notes.yaml index 38e4dfed12..a92fea1245 100644 --- a/docs/api/admin/paths/notes.yaml +++ b/docs/api/admin/paths/notes.yaml @@ -7,21 +7,7 @@ post: content: application/json: schema: - type: object - required: - - resource_id - - resource_type - - value - properties: - resource_id: - type: string - description: The ID of the resource which the Note relates to. - resource_type: - type: string - description: The type of resource which the Note relates to. - value: - type: string - description: The content of the Note to create. + $ref: ../components/schemas/AdminPostNotesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -45,7 +31,7 @@ post: type: object properties: note: - $ref: ../components/schemas/note.yaml + $ref: ../components/schemas/Note.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -106,7 +92,7 @@ get: notes: type: array items: - $ref: ../components/schemas/note.yaml + $ref: ../components/schemas/Note.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/notes_{id}.yaml b/docs/api/admin/paths/notes_{id}.yaml index 6df867754a..2a363e121e 100644 --- a/docs/api/admin/paths/notes_{id}.yaml +++ b/docs/api/admin/paths/notes_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: note: - $ref: ../components/schemas/note.yaml + $ref: ../components/schemas/Note.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,13 +119,7 @@ post: content: application/json: schema: - type: object - required: - - value - properties: - value: - type: string - description: The updated description of the Note. + $ref: ../components/schemas/AdminPostNotesNoteReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -149,7 +143,7 @@ post: type: object properties: note: - $ref: ../components/schemas/note.yaml + $ref: ../components/schemas/Note.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/notifications.yaml b/docs/api/admin/paths/notifications.yaml index 5eef45e280..d34b6f4804 100644 --- a/docs/api/admin/paths/notifications.yaml +++ b/docs/api/admin/paths/notifications.yaml @@ -82,7 +82,7 @@ get: notifications: type: array items: - $ref: ../components/schemas/notification.yaml + $ref: ../components/schemas/Notification.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/notifications_{id}_resend.yaml b/docs/api/admin/paths/notifications_{id}_resend.yaml index 1a782230ef..4ac15c94f6 100644 --- a/docs/api/admin/paths/notifications_{id}_resend.yaml +++ b/docs/api/admin/paths/notifications_{id}_resend.yaml @@ -16,13 +16,8 @@ post: content: application/json: schema: - type: object - properties: - to: - description: >- - A new address or user identifier that the Notification should be - sent to - type: string + $ref: >- + ../components/schemas/AdminPostNotificationsNotificationResendReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -46,7 +41,7 @@ post: type: object properties: notification: - $ref: ../components/schemas/notification.yaml + $ref: ../components/schemas/Notification.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits.yaml b/docs/api/admin/paths/order-edits.yaml index d0fd4c5836..7f1af81759 100644 --- a/docs/api/admin/paths/order-edits.yaml +++ b/docs/api/admin/paths/order-edits.yaml @@ -6,16 +6,7 @@ post: content: application/json: schema: - type: object - required: - - order_id - properties: - order_id: - description: The ID of the order to create the edit for. - type: string - internal_note: - description: An optional note to create for the order edit. - type: string + $ref: ../components/schemas/AdminPostOrderEditsReq.yaml x-authenticated: true x-codeSamples: - lang: JavaScript @@ -40,7 +31,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -115,7 +106,7 @@ get: properties: order_edits: type: array - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/order-edits_{id}.yaml b/docs/api/admin/paths/order-edits_{id}.yaml index 5c4b92f53e..af5f1e57b5 100644 --- a/docs/api/admin/paths/order-edits_{id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,11 +119,7 @@ post: content: application/json: schema: - type: object - properties: - internal_note: - description: An optional note to create or update for the order edit. - type: string + $ref: ../components/schemas/AdminPostOrderEditsOrderEditReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -147,7 +143,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits_{id}_cancel.yaml b/docs/api/admin/paths/order-edits_{id}_cancel.yaml index ac8584dc54..e378f19a34 100644 --- a/docs/api/admin/paths/order-edits_{id}_cancel.yaml +++ b/docs/api/admin/paths/order-edits_{id}_cancel.yaml @@ -33,7 +33,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits_{id}_confirm.yaml b/docs/api/admin/paths/order-edits_{id}_confirm.yaml index 5614450bda..0f035a3369 100644 --- a/docs/api/admin/paths/order-edits_{id}_confirm.yaml +++ b/docs/api/admin/paths/order-edits_{id}_confirm.yaml @@ -33,7 +33,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits_{id}_items.yaml b/docs/api/admin/paths/order-edits_{id}_items.yaml index aa105f7af6..326b7cadc0 100644 --- a/docs/api/admin/paths/order-edits_{id}_items.yaml +++ b/docs/api/admin/paths/order-edits_{id}_items.yaml @@ -13,22 +13,7 @@ post: content: application/json: schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the variant ID to add - type: string - quantity: - description: The quantity to add - type: number - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostOrderEditsEditLineItemsReq.yaml x-authenticated: true x-codeSamples: - lang: JavaScript @@ -53,7 +38,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml b/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml index 4cc271b53b..e0c0919d78 100644 --- a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml @@ -40,7 +40,7 @@ delete: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -75,13 +75,8 @@ post: content: application/json: schema: - type: object - required: - - quantity - properties: - quantity: - description: The quantity to update - type: number + $ref: >- + ../components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -106,7 +101,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits_{id}_request.yaml b/docs/api/admin/paths/order-edits_{id}_request.yaml index 145cc617b6..94e8acdc8e 100644 --- a/docs/api/admin/paths/order-edits_{id}_request.yaml +++ b/docs/api/admin/paths/order-edits_{id}_request.yaml @@ -33,7 +33,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order_{id}_claims.yaml b/docs/api/admin/paths/order_{id}_claims.yaml index b337301ed5..2d4aee6462 100644 --- a/docs/api/admin/paths/order_{id}_claims.yaml +++ b/docs/api/admin/paths/order_{id}_claims.yaml @@ -14,124 +14,7 @@ post: content: application/json: schema: - type: object - required: - - type - - claim_items - properties: - type: - description: >- - The type of the Claim. This will determine how the Claim is - treated: `replace` Claims will result in a Fulfillment with new - items being created, while a `refund` Claim will refund the - amount paid for the claimed items. - type: string - enum: - - replace - - refund - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: Short text describing the Claim Item in further detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: string - images: - description: >- - A list of image URL's that will be associated with the - Claim - items: - type: string - return_shipping: - description: >- - Optional details for the Return Shipping Method, if the items - are to be sent back. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: >- - The new items to send to the Customer when the Claim type is - Replace. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping Method - from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - shipping_address: - type: object - description: >- - An optional shipping address to send the claim to. Defaults to - the parent order's shipping address - $ref: ../components/schemas/address.yaml - refund_amount: - description: >- - The amount to refund the Customer when the Claim type is - `refund`. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostOrdersOrderClaimsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -155,7 +38,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml b/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml index 4378a9fcc9..0554d754b8 100644 --- a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml +++ b/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml @@ -20,94 +20,7 @@ post: content: application/json: schema: - type: object - properties: - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - id - - images - - tags - properties: - id: - description: The ID of the Claim Item. - type: string - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: Short text describing the Claim Item in further detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: object - properties: - id: - type: string - description: Tag ID - value: - type: string - description: Tag value - images: - description: >- - A list of image URL's that will be associated with the - Claim - type: array - items: - type: object - properties: - id: - type: string - description: Image ID - url: - type: string - description: Image URL - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping Method - from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -131,7 +44,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order_{id}_swaps.yaml b/docs/api/admin/paths/order_{id}_swaps.yaml index 01dcb5f09e..3730e0c5d1 100644 --- a/docs/api/admin/paths/order_{id}_swaps.yaml +++ b/docs/api/admin/paths/order_{id}_swaps.yaml @@ -16,85 +16,7 @@ post: content: application/json: schema: - type: object - 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. - type: string - quantity: - description: The number of items that will be returned - type: integer - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - return_shipping: - description: How the Swap will be returned. - type: object - required: - - option_id - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - 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. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - custom_shipping_options: - description: >- - The custom shipping options to potentially create a Shipping - Method from. - type: array - items: - required: - - option_id - - price - properties: - option_id: - description: >- - The ID of the Shipping Option to override with a custom - price. - type: string - price: - description: The custom price of the Shipping Option. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - allow_backorder: - description: If true, swaps can be completed with items out of stock - type: boolean - default: true + $ref: ../components/schemas/AdminPostOrdersOrderSwapsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -118,7 +40,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders.yaml b/docs/api/admin/paths/orders.yaml index 435a893e15..fd89f2bd8a 100644 --- a/docs/api/admin/paths/orders.yaml +++ b/docs/api/admin/paths/orders.yaml @@ -242,7 +242,7 @@ get: orders: type: array items: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/orders_{id}.yaml b/docs/api/admin/paths/orders_{id}.yaml index 98e4b6e24e..8d172d6e7c 100644 --- a/docs/api/admin/paths/orders_{id}.yaml +++ b/docs/api/admin/paths/orders_{id}.yaml @@ -33,7 +33,7 @@ get: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -62,71 +62,7 @@ post: content: application/json: schema: - type: object - properties: - email: - description: the email for the order - type: string - billing_address: - description: Billing address - anyOf: - - $ref: ../components/schemas/address_fields.yaml - shipping_address: - description: Shipping address - anyOf: - - $ref: ../components/schemas/address_fields.yaml - items: - description: The Line Items for the order - type: array - items: - $ref: ../components/schemas/line_item.yaml - region: - description: ID of the region where the order belongs - type: string - discounts: - description: Discounts applied to the order - type: array - items: - $ref: ../components/schemas/discount.yaml - customer_id: - description: ID of the customer - type: string - payment_method: - description: payment method chosen for the order - 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 - items: - $ref: ../components/schemas/line_item.yaml - description: Items to ship - no_notification: - description: >- - A flag to indicate if no notifications should be emitted related - to the updated order. - type: boolean + $ref: ../components/schemas/AdminPostOrdersOrderReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -150,7 +86,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_archive.yaml b/docs/api/admin/paths/orders_{id}_archive.yaml index 0975e57931..d2e57d0960 100644 --- a/docs/api/admin/paths/orders_{id}_archive.yaml +++ b/docs/api/admin/paths/orders_{id}_archive.yaml @@ -33,7 +33,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_cancel.yaml index edb1c6636c..2f46c1853b 100644 --- a/docs/api/admin/paths/orders_{id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_cancel.yaml @@ -36,7 +36,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_capture.yaml b/docs/api/admin/paths/orders_{id}_capture.yaml index a9ced207e1..2640a03b48 100644 --- a/docs/api/admin/paths/orders_{id}_capture.yaml +++ b/docs/api/admin/paths/orders_{id}_capture.yaml @@ -33,7 +33,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml index 2016427c17..04951b25c7 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml @@ -41,7 +41,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml index 99c746a51d..8a4e372cdc 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml @@ -20,18 +20,8 @@ post: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + ../components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -57,7 +47,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml index af476dc33a..957be39b25 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -47,7 +47,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml index 41690eaf23..30814ec8da 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml @@ -20,18 +20,8 @@ post: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string + $ref: >- + ../components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -57,7 +47,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_complete.yaml b/docs/api/admin/paths/orders_{id}_complete.yaml index b5b778944f..3c51f1298a 100644 --- a/docs/api/admin/paths/orders_{id}_complete.yaml +++ b/docs/api/admin/paths/orders_{id}_complete.yaml @@ -33,7 +33,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_fulfillment.yaml b/docs/api/admin/paths/orders_{id}_fulfillment.yaml index 79a007905c..1d2fac8cf6 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillment.yaml +++ b/docs/api/admin/paths/orders_{id}_fulfillment.yaml @@ -16,34 +16,7 @@ post: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items to include in the Fulfillment. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of Line Item to fulfill. - type: string - quantity: - description: The quantity of the Line Item to fulfill. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -67,7 +40,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml index af2e69f609..1eaef848b0 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -41,7 +41,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_refund.yaml b/docs/api/admin/paths/orders_{id}_refund.yaml index 78cc3ae1fc..9ec6262938 100644 --- a/docs/api/admin/paths/orders_{id}_refund.yaml +++ b/docs/api/admin/paths/orders_{id}_refund.yaml @@ -14,25 +14,7 @@ post: content: application/json: schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Refund. - type: boolean + $ref: ../components/schemas/AdminPostOrdersOrderRefundsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -56,7 +38,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_return.yaml b/docs/api/admin/paths/orders_{id}_return.yaml index cc705d9908..b1a6e0387d 100644 --- a/docs/api/admin/paths/orders_{id}_return.yaml +++ b/docs/api/admin/paths/orders_{id}_return.yaml @@ -16,59 +16,7 @@ post: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items that will be returned. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - return_shipping: - description: The Shipping Method to be used to handle the return shipment. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - price: - type: integer - description: The price to charge for the Shipping Method. - note: - description: An optional note with information about the Return. - type: string - receive_now: - description: >- - A flag to indicate if the Return should be registerd as received - immediately. - type: boolean - default: false - no_notification: - description: >- - A flag to indicate if no notifications should be emitted related - to the requested Return. - type: boolean - refund: - description: The amount to refund. - type: integer + $ref: ../components/schemas/AdminPostOrdersOrderReturnsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -93,7 +41,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_shipment.yaml b/docs/api/admin/paths/orders_{id}_shipment.yaml index 30c6c49b3b..342b5e38cb 100644 --- a/docs/api/admin/paths/orders_{id}_shipment.yaml +++ b/docs/api/admin/paths/orders_{id}_shipment.yaml @@ -14,23 +14,7 @@ post: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Shipment. - type: boolean + $ref: ../components/schemas/AdminPostOrdersOrderShipmentReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -54,7 +38,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml index 5383f21bb6..044c460284 100644 --- a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml +++ b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml @@ -35,7 +35,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml index 4df3ddca51..7bdc8fdcfd 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml @@ -40,7 +40,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml index 5fa53506cb..3c87673b34 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml @@ -20,18 +20,8 @@ post: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + ../components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -57,7 +47,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml index 1e2101fa3c..b4924eb557 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -47,7 +47,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml index 2124ae886c..180c2c8172 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml @@ -44,7 +44,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml index 302533759c..46e984cd91 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml @@ -20,23 +20,7 @@ post: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be sent related to this - Claim. - type: boolean + $ref: ../components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -62,7 +46,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/payment-collections_{id}.yaml b/docs/api/admin/paths/payment-collections_{id}.yaml index 23ef45ecb0..6eb698e388 100644 --- a/docs/api/admin/paths/payment-collections_{id}.yaml +++ b/docs/api/admin/paths/payment-collections_{id}.yaml @@ -92,7 +92,7 @@ get: type: object properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -121,18 +121,7 @@ post: content: application/json: schema: - type: object - properties: - description: - description: >- - An optional description to create or update the payment - collection. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminUpdatePaymentCollectionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -156,7 +145,7 @@ post: type: object properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/payment-collections_{id}_authorize.yaml b/docs/api/admin/paths/payment-collections_{id}_authorize.yaml index f70e0629ef..ac876ca2aa 100644 --- a/docs/api/admin/paths/payment-collections_{id}_authorize.yaml +++ b/docs/api/admin/paths/payment-collections_{id}_authorize.yaml @@ -34,7 +34,7 @@ post: type: object properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/payments_{id}.yaml b/docs/api/admin/paths/payments_{id}.yaml index 298c23a4dd..261c03bc84 100644 --- a/docs/api/admin/paths/payments_{id}.yaml +++ b/docs/api/admin/paths/payments_{id}.yaml @@ -33,7 +33,7 @@ get: type: object properties: payment: - $ref: ../components/schemas/payment.yaml + $ref: ../components/schemas/Payment.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/payments_{id}_capture.yaml b/docs/api/admin/paths/payments_{id}_capture.yaml index 1a2f9a6ffd..c60c0f33e9 100644 --- a/docs/api/admin/paths/payments_{id}_capture.yaml +++ b/docs/api/admin/paths/payments_{id}_capture.yaml @@ -33,7 +33,7 @@ post: type: object properties: payment: - $ref: ../components/schemas/payment.yaml + $ref: ../components/schemas/Payment.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/payments_{id}_refund.yaml b/docs/api/admin/paths/payments_{id}_refund.yaml index c25d1eef1e..4e2b2feb56 100644 --- a/docs/api/admin/paths/payments_{id}_refund.yaml +++ b/docs/api/admin/paths/payments_{id}_refund.yaml @@ -14,20 +14,7 @@ post: content: application/json: schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string + $ref: ../components/schemas/AdminPostPaymentRefundsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -51,7 +38,7 @@ post: type: object properties: refund: - $ref: ../components/schemas/refund.yaml + $ref: ../components/schemas/Refund.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/price-lists.yaml b/docs/api/admin/paths/price-lists.yaml index 6d69d0c6b5..a80ea6ebaa 100644 --- a/docs/api/admin/paths/price-lists.yaml +++ b/docs/api/admin/paths/price-lists.yaml @@ -7,85 +7,7 @@ post: content: application/json: schema: - type: object - required: - - name - - description - - type - - prices - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: The date with timezone that the Price List starts being valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price will - be used. Only required if region_id is not provided. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - variant_id: - description: The ID of the Variant for which the price is used. - type: string - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: ../components/schemas/AdminPostPriceListsPriceListReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -109,7 +31,7 @@ post: type: object properties: price_list: - $ref: ../components/schemas/price_list.yaml + $ref: ../components/schemas/PriceList.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -293,7 +215,7 @@ get: price_lists: type: array items: - $ref: ../components/schemas/price_list.yaml + $ref: ../components/schemas/PriceList.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/price-lists_{id}.yaml b/docs/api/admin/paths/price-lists_{id}.yaml index e5d440d8a7..a4262d9979 100644 --- a/docs/api/admin/paths/price-lists_{id}.yaml +++ b/docs/api/admin/paths/price-lists_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: price_list: - $ref: ../components/schemas/price_list.yaml + $ref: ../components/schemas/PriceList.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,83 +119,7 @@ post: content: application/json: schema: - type: object - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: The date with timezone that the Price List starts being valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price will - be used. Only required if region_id is not provided. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: ../components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -219,7 +143,7 @@ post: type: object properties: price_list: - $ref: ../components/schemas/price_list.yaml + $ref: ../components/schemas/PriceList.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml b/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml index 8cd6653167..489dc91870 100644 --- a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml +++ b/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml @@ -14,49 +14,7 @@ post: content: application/json: schema: - type: object - properties: - prices: - description: The prices to update or add. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price will - be used. Only required if region_id is not provided. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - override: - description: >- - If true the prices will replace all existing prices associated - with the Price List. - type: boolean + $ref: ../components/schemas/AdminPostPriceListPricesPricesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -80,7 +38,7 @@ post: type: object properties: price_list: - $ref: ../components/schemas/price_list.yaml + $ref: ../components/schemas/PriceList.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -111,13 +69,7 @@ delete: content: application/json: schema: - type: object - properties: - price_ids: - description: The price id's of the Money Amounts to delete. - type: array - items: - type: string + $ref: ../components/schemas/AdminDeletePriceListPricesPricesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/price-lists_{id}_products.yaml b/docs/api/admin/paths/price-lists_{id}_products.yaml index 8ab10beb00..66d89f48b1 100644 --- a/docs/api/admin/paths/price-lists_{id}_products.yaml +++ b/docs/api/admin/paths/price-lists_{id}_products.yaml @@ -201,7 +201,7 @@ get: products: type: array items: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/product-tags.yaml b/docs/api/admin/paths/product-tags.yaml index af33fea80e..dbf6d2eed6 100644 --- a/docs/api/admin/paths/product-tags.yaml +++ b/docs/api/admin/paths/product-tags.yaml @@ -116,7 +116,7 @@ get: type: object properties: product_tags: - $ref: ../components/schemas/product_tag.yaml + $ref: ../components/schemas/ProductTag.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/product-types.yaml b/docs/api/admin/paths/product-types.yaml index 00a5779158..32c4deb44f 100644 --- a/docs/api/admin/paths/product-types.yaml +++ b/docs/api/admin/paths/product-types.yaml @@ -116,7 +116,7 @@ get: type: object properties: product_types: - $ref: ../components/schemas/product_type.yaml + $ref: ../components/schemas/ProductType.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/products.yaml b/docs/api/admin/paths/products.yaml index 9501af2435..f8751763ad 100644 --- a/docs/api/admin/paths/products.yaml +++ b/docs/api/admin/paths/products.yaml @@ -7,241 +7,7 @@ post: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - is_giftcard: - description: >- - A flag to indicate if the Product represents a Gift Card. - Purchasing Products with this flag set to `true` will result in - a Gift Card being created. - type: boolean - default: false - discountable: - description: >- - A flag to indicate if discounts can be applied to the LineItems - generated from this Product - type: boolean - default: true - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - default: draft - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: The value of the Tag, these will be upserted. - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - options: - description: >- - The Options that the Product should have. These define on which - properties the Product's Product Variants will differ. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Option by. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - region_id: - description: >- - The ID of the Region for which the price is used. - Only required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id is - not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - value - properties: - value: - description: >- - The value to give for the Product Option at the same - index in the Product's `options` field. - type: string - weight: - description: The weight of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object + $ref: ../components/schemas/AdminPostProductsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -265,7 +31,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -480,6 +246,11 @@ get: result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -505,7 +276,7 @@ get: products: type: array items: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/products_types.yaml b/docs/api/admin/paths/products_types.yaml index 0e66866033..3a59bf42c9 100644 --- a/docs/api/admin/paths/products_types.yaml +++ b/docs/api/admin/paths/products_types.yaml @@ -29,7 +29,7 @@ get: types: type: array items: - $ref: ../components/schemas/product_type.yaml + $ref: ../components/schemas/ProductType.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/products_{id}.yaml b/docs/api/admin/paths/products_{id}.yaml index 8f5a1fb944..9aa12442b0 100644 --- a/docs/api/admin/paths/products_{id}.yaml +++ b/docs/api/admin/paths/products_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,222 +119,7 @@ post: content: application/json: schema: - type: object - properties: - title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - discountable: - description: >- - A flag to indicate if discounts can be applied to the LineItems - generated from this Product - type: boolean - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: The value of the Tag, these will be upserted. - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - properties: - id: - description: The ID of the Product Variant. - type: string - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the Price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. - Only required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id is - not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Option. - type: string - value: - description: >- - The value to give for the Product Option at the same - index in the Product's `options` field. - type: string - weight: - description: The wieght of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object + $ref: ../components/schemas/AdminPostProductsProductReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -358,7 +143,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/products_{id}_metadata.yaml b/docs/api/admin/paths/products_{id}_metadata.yaml index a12924da0e..3763a0bd21 100644 --- a/docs/api/admin/paths/products_{id}_metadata.yaml +++ b/docs/api/admin/paths/products_{id}_metadata.yaml @@ -14,17 +14,7 @@ post: content: application/json: schema: - type: object - required: - - key - - value - properties: - key: - description: The metadata key - type: string - value: - description: The metadata value - type: string + $ref: ../components/schemas/AdminPostProductsProductMetadataReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -48,7 +38,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/products_{id}_options.yaml b/docs/api/admin/paths/products_{id}_options.yaml index 1759a58c75..e3dfbe91ad 100644 --- a/docs/api/admin/paths/products_{id}_options.yaml +++ b/docs/api/admin/paths/products_{id}_options.yaml @@ -14,13 +14,7 @@ post: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title the Product Option will be identified by i.e. "Size" - type: string + $ref: ../components/schemas/AdminPostProductsProductOptionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -44,7 +38,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml b/docs/api/admin/paths/products_{id}_options_{option_id}.yaml index f508f113c0..8ddc2ab70f 100644 --- a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml +++ b/docs/api/admin/paths/products_{id}_options_{option_id}.yaml @@ -55,7 +55,7 @@ delete: description: Whether or not the items were deleted. default: true product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -90,13 +90,7 @@ post: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product Option - type: string + $ref: ../components/schemas/AdminPostProductsProductOptionsOption.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -121,7 +115,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/products_{id}_variants.yaml b/docs/api/admin/paths/products_{id}_variants.yaml index 63efd59531..2f9f540936 100644 --- a/docs/api/admin/paths/products_{id}_variants.yaml +++ b/docs/api/admin/paths/products_{id}_variants.yaml @@ -16,110 +16,7 @@ post: content: application/json: schema: - type: object - required: - - title - - prices - - options - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: Whether the Product Variant can be purchased when out of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: The Manufacturer Identification code for the Product Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price will - be used. Only required if region_id is not provided. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: ../components/schemas/AdminPostProductsProductVariantsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -143,7 +40,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -211,7 +108,7 @@ get: variants: type: array items: - $ref: ../components/schemas/product_variant.yaml + $ref: ../components/schemas/ProductVariant.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml b/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml index e72e74992b..97be489152 100644 --- a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml +++ b/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml @@ -52,7 +52,7 @@ delete: description: Whether or not the items were deleted. default: true product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -87,107 +87,8 @@ post: content: application/json: schema: - type: object - required: - - prices - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: Whether the Product Variant can be purchased when out of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The weight of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: The Manufacturer Identification code for the Product Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price will - be used. Only required if region_id is not provided. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: >- + ../components/schemas/AdminPostProductsProductVariantsVariantReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -213,7 +114,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-key_{id}.yaml b/docs/api/admin/paths/publishable-api-key_{id}.yaml index 9708176000..a97871df47 100644 --- a/docs/api/admin/paths/publishable-api-key_{id}.yaml +++ b/docs/api/admin/paths/publishable-api-key_{id}.yaml @@ -14,11 +14,8 @@ post: content: application/json: schema: - type: object - properties: - title: - description: A title to update for the key. - type: string + $ref: >- + ../components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -42,7 +39,7 @@ post: type: object properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-keys.yaml b/docs/api/admin/paths/publishable-api-keys.yaml index 3b0fec67e5..459ae1d1be 100644 --- a/docs/api/admin/paths/publishable-api-keys.yaml +++ b/docs/api/admin/paths/publishable-api-keys.yaml @@ -6,13 +6,7 @@ post: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: A title for the publishable api key - type: string + $ref: ../components/schemas/AdminPostPublishableApiKeysReq.yaml x-authenticated: true x-codeSamples: - lang: JavaScript @@ -37,7 +31,7 @@ post: type: object properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -107,7 +101,7 @@ get: properties: publishable_api_keys: type: array - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-keys_{id}.yaml b/docs/api/admin/paths/publishable-api-keys_{id}.yaml index d4352511a2..879e95e2cf 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}.yaml @@ -80,7 +80,7 @@ get: type: object properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml index f97a61a77a..026c07f9f3 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml @@ -34,7 +34,7 @@ post: type: object properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml index e3b2336dd7..db752109fc 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml @@ -10,6 +10,11 @@ get: description: The ID of the Publishable Api Key. schema: type: string + - in: query + name: q + description: Query used for searching sales channels' names and descriptions. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -36,7 +41,7 @@ get: sales_channels: type: array items: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml index 6ee16f2114..d5ebc19d8f 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml @@ -14,20 +14,8 @@ post: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: The IDs of the sales channels to add to the publishable api key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + ../components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -52,7 +40,7 @@ post: schema: properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -81,22 +69,8 @@ delete: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: >- - The IDs of the sales channels to delete from the publishable api - key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + ../components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -121,7 +95,7 @@ delete: schema: properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions.yaml b/docs/api/admin/paths/regions.yaml index 08eb2548f9..cb9689cadb 100644 --- a/docs/api/admin/paths/regions.yaml +++ b/docs/api/admin/paths/regions.yaml @@ -7,56 +7,7 @@ post: content: application/json: schema: - type: object - required: - - name - - currency_code - - tax_rate - - payment_providers - - fulfillment_providers - - countries - 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 - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - 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 Provider IDs that should be enabled for the - Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled for - the Region - type: array - items: - type: string - countries: - description: >- - A list of countries' 2 ISO Characters that should be included in - the Region. - example: - - US - type: array - items: - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of region' - type: boolean + $ref: ../components/schemas/AdminPostRegionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -80,7 +31,7 @@ post: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -162,7 +113,7 @@ get: regions: type: array items: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/regions_{id}.yaml b/docs/api/admin/paths/regions_{id}.yaml index a029d709ab..3af3854927 100644 --- a/docs/api/admin/paths/regions_{id}.yaml +++ b/docs/api/admin/paths/regions_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,63 +119,7 @@ post: content: application/json: schema: - type: object - 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 - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - 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 - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of region' - type: boolean - payment_providers: - description: >- - A list of Payment Provider IDs that should be enabled for the - Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled for - the Region - type: array - items: - type: string - countries: - description: >- - A list of countries' 2 ISO Characters that should be included in - the Region. - type: array - items: - type: string + $ref: ../components/schemas/AdminPostRegionsRegionReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -199,7 +143,7 @@ post: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_countries.yaml b/docs/api/admin/paths/regions_{id}_countries.yaml index a319e40210..67bb512250 100644 --- a/docs/api/admin/paths/regions_{id}_countries.yaml +++ b/docs/api/admin/paths/regions_{id}_countries.yaml @@ -14,17 +14,7 @@ post: content: application/json: schema: - type: object - required: - - country_code - properties: - country_code: - description: The 2 character ISO code for the Country. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. + $ref: ../components/schemas/AdminPostRegionsRegionCountriesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -48,7 +38,7 @@ post: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml b/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml index 95ea1544cb..c68d9ce238 100644 --- a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml +++ b/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml @@ -44,7 +44,7 @@ delete: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml index 805220e108..1683a5f2e2 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml @@ -14,13 +14,8 @@ post: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Fulfillment Provider to add. - type: string + $ref: >- + ../components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -45,7 +40,7 @@ post: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml index 45bc96c7bf..cd9097439e 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml @@ -41,7 +41,7 @@ delete: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_payment-providers.yaml b/docs/api/admin/paths/regions_{id}_payment-providers.yaml index 04fbd3e380..83abf118c3 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers.yaml +++ b/docs/api/admin/paths/regions_{id}_payment-providers.yaml @@ -14,13 +14,7 @@ post: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Payment Provider to add. - type: string + $ref: ../components/schemas/AdminPostRegionsRegionPaymentProvidersReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -45,7 +39,7 @@ post: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml b/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml index c9f71b3f23..3d2c890ef7 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml @@ -41,7 +41,7 @@ delete: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/return-reasons.yaml b/docs/api/admin/paths/return-reasons.yaml index 3174ac1317..9f837be913 100644 --- a/docs/api/admin/paths/return-reasons.yaml +++ b/docs/api/admin/paths/return-reasons.yaml @@ -7,28 +7,7 @@ post: content: application/json: schema: - type: object - required: - - label - - value - properties: - 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 - 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 - metadata: - description: An optional set of key-value pairs with additional information. - type: object + $ref: ../components/schemas/AdminPostReturnReasonsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -52,7 +31,7 @@ post: type: object properties: return_reason: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -95,7 +74,7 @@ get: return_reasons: type: array items: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/return-reasons_{id}.yaml b/docs/api/admin/paths/return-reasons_{id}.yaml index 14657da2d4..7d33d59612 100644 --- a/docs/api/admin/paths/return-reasons_{id}.yaml +++ b/docs/api/admin/paths/return-reasons_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: return_reason: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,22 +119,7 @@ post: content: application/json: schema: - type: object - properties: - 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 - metadata: - description: An optional set of key-value pairs with additional information. - type: object + $ref: ../components/schemas/AdminPostReturnReasonsReasonReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -158,7 +143,7 @@ post: type: object properties: return_reason: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/returns.yaml b/docs/api/admin/paths/returns.yaml index f290bd7af5..556bf4fb98 100644 --- a/docs/api/admin/paths/returns.yaml +++ b/docs/api/admin/paths/returns.yaml @@ -40,7 +40,7 @@ get: returns: type: array items: - $ref: ../components/schemas/return.yaml + $ref: ../components/schemas/Return.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/returns_{id}_cancel.yaml b/docs/api/admin/paths/returns_{id}_cancel.yaml index 5960e68332..6eb4ddc4d9 100644 --- a/docs/api/admin/paths/returns_{id}_cancel.yaml +++ b/docs/api/admin/paths/returns_{id}_cancel.yaml @@ -32,7 +32,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/returns_{id}_receive.yaml b/docs/api/admin/paths/returns_{id}_receive.yaml index 10e260fbed..a9b568196a 100644 --- a/docs/api/admin/paths/returns_{id}_receive.yaml +++ b/docs/api/admin/paths/returns_{id}_receive.yaml @@ -15,27 +15,7 @@ post: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items that have been received. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - refund: - description: The amount to refund. - type: number + $ref: ../components/schemas/AdminPostReturnsReturnReceiveReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -59,7 +39,7 @@ post: type: object properties: return: - $ref: ../components/schemas/return.yaml + $ref: ../components/schemas/Return.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/sales-channels.yaml b/docs/api/admin/paths/sales-channels.yaml index a3f067eb41..ab7bab6a69 100644 --- a/docs/api/admin/paths/sales-channels.yaml +++ b/docs/api/admin/paths/sales-channels.yaml @@ -7,19 +7,7 @@ post: content: application/json: schema: - type: object - required: - - name - properties: - name: - description: The name of the Sales Channel - type: string - description: - description: The description of the Sales Channel - type: string - is_disabled: - description: Whether the Sales Channel is disabled or not. - type: boolean + $ref: ../components/schemas/AdminPostSalesChannelsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -43,7 +31,7 @@ post: type: object properties: sales_channel: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -204,7 +192,7 @@ get: sales_channels: type: array items: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/sales-channels_{id}.yaml b/docs/api/admin/paths/sales-channels_{id}.yaml index f4f09ece87..df2e649fdc 100644 --- a/docs/api/admin/paths/sales-channels_{id}.yaml +++ b/docs/api/admin/paths/sales-channels_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: sales_channel: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,17 +119,7 @@ post: content: application/json: schema: - type: object - properties: - name: - type: string - description: Name of the sales channel. - description: - type: string - description: Sales Channel description. - is_disabled: - type: boolean - description: Indication of if the sales channel is active. + $ref: ../components/schemas/AdminPostSalesChannelsSalesChannelReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -153,7 +143,7 @@ post: type: object properties: sales_channel: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml b/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml index c703ac2dc5..e85bfabb81 100644 --- a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml +++ b/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml @@ -14,21 +14,8 @@ post: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: The IDs of the products to add to the Sales Channel - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the product + $ref: >- + ../components/schemas/AdminPostSalesChannelsChannelProductsBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -53,7 +40,7 @@ post: type: object properties: sales_channel: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -82,21 +69,8 @@ delete: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: The IDs of the products to delete from the Sales Channel. - type: array - items: - type: object - required: - - id - properties: - id: - description: The ID of a product - type: string + $ref: >- + ../components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -122,7 +96,7 @@ delete: type: object properties: sales_channel: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/shipping-options.yaml b/docs/api/admin/paths/shipping-options.yaml index e8b543375a..0e3d88bb08 100644 --- a/docs/api/admin/paths/shipping-options.yaml +++ b/docs/api/admin/paths/shipping-options.yaml @@ -7,77 +7,7 @@ post: content: application/json: schema: - type: object - required: - - name - - region_id - - provider_id - - data - - price_type - properties: - name: - description: The name of the Shipping Option - type: string - region_id: - description: >- - The ID of the Region in which the Shipping Option will be - available. - type: string - provider_id: - description: >- - The ID of the Fulfillment Provider that handles the Shipping - Option. - type: string - profile_id: - description: The ID of the Shipping Profile to add the Shipping Option to. - type: number - data: - description: >- - The data needed for the Fulfillment Provider to handle shipping - with this Shipping Option. - type: object - price_type: - description: The type of the Shipping Option price. - type: string - enum: - - flat_rate - - calculated - amount: - description: The amount to charge for the Shipping Option. - type: integer - requirements: - description: >- - The requirements that must be satisfied for the Shipping Option - to be available. - type: array - items: - required: - - type - - amount - properties: - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - is_return: - description: Whether the Shipping Option defines a return shipment. - type: boolean - default: false - admin_only: - description: If true, the option can be used for draft orders - type: boolean - default: false - metadata: - description: An optional set of key-value pairs with additional information. - type: object - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + $ref: ../components/schemas/AdminPostShippingOptionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -101,7 +31,7 @@ post: type: object properties: shipping_option: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -160,7 +90,7 @@ get: shipping_options: type: array items: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/shipping-options_{id}.yaml b/docs/api/admin/paths/shipping-options_{id}.yaml index 71b9682338..32f77bde79 100644 --- a/docs/api/admin/paths/shipping-options_{id}.yaml +++ b/docs/api/admin/paths/shipping-options_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: shipping_option: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,47 +119,7 @@ post: content: application/json: schema: - type: object - required: - - requirements - properties: - name: - description: The name of the Shipping Option - type: string - 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 Option - to be available. - type: array - items: - required: - - type - - amount - properties: - id: - description: The ID of the requirement - type: string - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + $ref: ../components/schemas/AdminPostShippingOptionsOptionReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -183,7 +143,7 @@ post: type: object properties: shipping_option: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/shipping-profiles.yaml b/docs/api/admin/paths/shipping-profiles.yaml index 4352be2379..a6d0019d37 100644 --- a/docs/api/admin/paths/shipping-profiles.yaml +++ b/docs/api/admin/paths/shipping-profiles.yaml @@ -7,13 +7,7 @@ post: content: application/json: schema: - type: object - required: - - name - properties: - name: - description: The name of the Shipping Profile - type: string + $ref: ../components/schemas/AdminPostShippingProfilesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -37,7 +31,7 @@ post: type: object properties: shipping_profile: - $ref: ../components/schemas/shipping_profile.yaml + $ref: ../components/schemas/ShippingProfile.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -80,7 +74,7 @@ get: shipping_profiles: type: array items: - $ref: ../components/schemas/shipping_profile.yaml + $ref: ../components/schemas/ShippingProfile.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/shipping-profiles_{id}.yaml b/docs/api/admin/paths/shipping-profiles_{id}.yaml index 319dae965b..7e8ced6ba8 100644 --- a/docs/api/admin/paths/shipping-profiles_{id}.yaml +++ b/docs/api/admin/paths/shipping-profiles_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: shipping_profile: - $ref: ../components/schemas/shipping_profile.yaml + $ref: ../components/schemas/ShippingProfile.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -118,11 +118,7 @@ post: content: application/json: schema: - type: object - properties: - name: - description: The name of the Shipping Profile - type: string + $ref: ../components/schemas/AdminPostShippingProfilesProfileReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -146,7 +142,7 @@ post: type: object properties: shipping_profile: - $ref: ../components/schemas/shipping_profile.yaml + $ref: ../components/schemas/ShippingProfile.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/store.yaml b/docs/api/admin/paths/store.yaml index 73000bd2ef..43e9b03410 100644 --- a/docs/api/admin/paths/store.yaml +++ b/docs/api/admin/paths/store.yaml @@ -26,7 +26,7 @@ get: type: object properties: store: - $ref: ../components/schemas/store.yaml + $ref: ../components/schemas/Store.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -48,40 +48,7 @@ post: content: application/json: schema: - type: object - properties: - name: - description: The name of the Store - type: string - swap_link_template: - description: >- - 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 - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - currencies: - description: Array of currencies in 2 character ISO code format. - type: array - items: - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object + $ref: ../components/schemas/AdminPostStoreReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -105,7 +72,7 @@ post: type: object properties: store: - $ref: ../components/schemas/store.yaml + $ref: ../components/schemas/Store.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/store_currencies_{code}.yaml b/docs/api/admin/paths/store_currencies_{code}.yaml index 5d7f1b006c..651a4d03cb 100644 --- a/docs/api/admin/paths/store_currencies_{code}.yaml +++ b/docs/api/admin/paths/store_currencies_{code}.yaml @@ -36,7 +36,7 @@ post: type: object properties: store: - $ref: ../components/schemas/store.yaml + $ref: ../components/schemas/Store.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -87,7 +87,7 @@ delete: type: object properties: store: - $ref: ../components/schemas/store.yaml + $ref: ../components/schemas/Store.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/store_payment-providers.yaml b/docs/api/admin/paths/store_payment-providers.yaml index f44208295c..87f3db3c05 100644 --- a/docs/api/admin/paths/store_payment-providers.yaml +++ b/docs/api/admin/paths/store_payment-providers.yaml @@ -28,7 +28,7 @@ get: payment_providers: type: array items: - $ref: ../components/schemas/payment_provider.yaml + $ref: ../components/schemas/PaymentProvider.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/store_tax-providers.yaml b/docs/api/admin/paths/store_tax-providers.yaml index 1dc2ca9346..15968f5187 100644 --- a/docs/api/admin/paths/store_tax-providers.yaml +++ b/docs/api/admin/paths/store_tax-providers.yaml @@ -28,7 +28,7 @@ get: tax_providers: type: array items: - $ref: ../components/schemas/tax_provider.yaml + $ref: ../components/schemas/TaxProvider.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/swaps.yaml b/docs/api/admin/paths/swaps.yaml index eef8025b2e..e3ccdbe78b 100644 --- a/docs/api/admin/paths/swaps.yaml +++ b/docs/api/admin/paths/swaps.yaml @@ -41,7 +41,7 @@ get: swaps: type: array items: - $ref: ../components/schemas/swap.yaml + $ref: ../components/schemas/Swap.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/swaps_{id}.yaml b/docs/api/admin/paths/swaps_{id}.yaml index ce9c635afb..4463605886 100644 --- a/docs/api/admin/paths/swaps_{id}.yaml +++ b/docs/api/admin/paths/swaps_{id}.yaml @@ -33,7 +33,7 @@ get: type: object properties: swap: - $ref: ../components/schemas/swap.yaml + $ref: ../components/schemas/Swap.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/tax-rates.yaml b/docs/api/admin/paths/tax-rates.yaml index 089b0007df..44a6f2270a 100644 --- a/docs/api/admin/paths/tax-rates.yaml +++ b/docs/api/admin/paths/tax-rates.yaml @@ -26,39 +26,7 @@ post: content: application/json: schema: - type: object - required: - - code - - name - - region_id - properties: - code: - type: string - description: A code to identify the tax type by - name: - type: string - description: A human friendly name for the tax - region_id: - type: string - description: The ID of the Region that the rate belongs to - rate: - type: number - description: The numeric rate to charge - products: - type: array - description: The IDs of the products associated with this tax rate - items: - type: string - shipping_options: - type: array - description: The IDs of the shipping options associated with this tax rate - items: - type: string - product_types: - type: array - description: The IDs of the types of products associated with this tax rate - items: - type: string + $ref: ../components/schemas/AdminPostTaxRatesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -82,7 +50,7 @@ post: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -199,7 +167,7 @@ get: tax_rates: type: array items: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/tax-rates_{id}.yaml b/docs/api/admin/paths/tax-rates_{id}.yaml index ad00d6371a..64796ba8d6 100644 --- a/docs/api/admin/paths/tax-rates_{id}.yaml +++ b/docs/api/admin/paths/tax-rates_{id}.yaml @@ -108,7 +108,7 @@ get: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -155,35 +155,7 @@ post: content: application/json: schema: - type: object - properties: - code: - type: string - description: A code to identify the tax type by - name: - type: string - description: A human friendly name for the tax - region_id: - type: string - description: The ID of the Region that the rate belongs to - rate: - type: number - description: The numeric rate to charge - products: - type: array - description: The IDs of the products associated with this tax rate - items: - type: string - shipping_options: - type: array - description: The IDs of the shipping options associated with this tax rate - items: - type: string - product_types: - type: array - description: The IDs of the types of products associated with this tax rate - items: - type: string + $ref: ../components/schemas/AdminPostTaxRatesTaxRateReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -207,7 +179,7 @@ post: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml index 29b787caf5..45c9308856 100644 --- a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml @@ -32,15 +32,7 @@ post: content: application/json: schema: - type: object - required: - - product_types - properties: - product_types: - type: array - description: The IDs of the types of products to associate with this tax rate - items: - type: string + $ref: ../components/schemas/AdminPostTaxRatesTaxRateProductTypesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -65,7 +57,7 @@ post: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -112,17 +104,7 @@ delete: content: application/json: schema: - type: object - required: - - product_types - properties: - product_types: - type: array - description: >- - The IDs of the types of products to remove association with this - tax rate - items: - type: string + $ref: ../components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -148,7 +130,7 @@ delete: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml index db4f16f995..7db58c1b34 100644 --- a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml @@ -32,15 +32,7 @@ post: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: The IDs of the products to associate with this tax rate - items: - type: string + $ref: ../components/schemas/AdminPostTaxRatesTaxRateProductsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -64,7 +56,7 @@ post: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -111,15 +103,7 @@ delete: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: The IDs of the products to remove association with this tax rate - items: - type: string + $ref: ../components/schemas/AdminDeleteTaxRatesTaxRateProductsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -144,7 +128,7 @@ delete: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml index 5cbe03173b..a180a9b0d2 100644 --- a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml @@ -32,15 +32,8 @@ post: content: application/json: schema: - type: object - required: - - shipping_options - properties: - shipping_options: - type: array - description: The IDs of the shipping options to associate with this tax rate - items: - type: string + $ref: >- + ../components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -66,7 +59,7 @@ post: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -113,17 +106,8 @@ delete: content: application/json: schema: - type: object - required: - - shipping_options - properties: - shipping_options: - type: array - description: >- - The IDs of the shipping options to remove association with this - tax rate - items: - type: string + $ref: >- + ../components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -149,7 +133,7 @@ delete: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/users.yaml b/docs/api/admin/paths/users.yaml index 71a4ce1f42..33f32882bb 100644 --- a/docs/api/admin/paths/users.yaml +++ b/docs/api/admin/paths/users.yaml @@ -7,32 +7,7 @@ post: content: application/json: schema: - type: object - required: - - email - - password - properties: - email: - description: The Users email. - type: string - format: email - 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 - enum: - - admin - - member - - developer - password: - description: The Users password. - type: string - format: password + $ref: ../components/schemas/AdminCreateUserRequest.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -56,7 +31,7 @@ post: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -99,7 +74,7 @@ get: users: type: array items: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/users_password-token.yaml b/docs/api/admin/paths/users_password-token.yaml index d1f0912af2..5a3cbff64a 100644 --- a/docs/api/admin/paths/users_password-token.yaml +++ b/docs/api/admin/paths/users_password-token.yaml @@ -7,14 +7,7 @@ post: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The Users email. - type: string - format: email + $ref: ../components/schemas/AdminResetPasswordTokenRequest.yaml x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/users_reset-password.yaml b/docs/api/admin/paths/users_reset-password.yaml index ac2a00085c..bda603c314 100644 --- a/docs/api/admin/paths/users_reset-password.yaml +++ b/docs/api/admin/paths/users_reset-password.yaml @@ -7,22 +7,7 @@ post: content: application/json: schema: - type: object - required: - - token - - password - properties: - email: - description: The Users email. - type: string - format: email - token: - description: The token generated from the 'password-token' endpoint. - type: string - password: - description: The Users new password. - type: string - format: password + $ref: ../components/schemas/AdminResetPasswordRequest.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -46,7 +31,7 @@ post: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/users_{id}.yaml b/docs/api/admin/paths/users_{id}.yaml index c702e5d767..7b023f8546 100644 --- a/docs/api/admin/paths/users_{id}.yaml +++ b/docs/api/admin/paths/users_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,27 +119,7 @@ post: content: application/json: schema: - type: object - properties: - 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 - enum: - - admin - - member - - developer - api_token: - description: The api token of the User. - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object + $ref: ../components/schemas/AdminUpdateUserRequest.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -163,7 +143,7 @@ post: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/variants.yaml b/docs/api/admin/paths/variants.yaml index 82985adaf9..c168a933e7 100644 --- a/docs/api/admin/paths/variants.yaml +++ b/docs/api/admin/paths/variants.yaml @@ -118,7 +118,7 @@ get: variants: type: array items: - $ref: ../components/schemas/product_variant.yaml + $ref: ../components/schemas/ProductVariant.yaml count: type: integer description: The total number of items available diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index be32e3a13b..e9b55c54ac 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -108,40 +108,28 @@ tags: sessions. - name: Cart description: Cart endpoints that allow handling carts in Medusa. - x-resourceId: cart - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap servers: - url: 'https://api.medusa-commerce.com/store' paths: @@ -190,7 +178,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -289,7 +277,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -355,6 +343,923 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/carts/{id}/shipping-methods': + post: + operationId: PostCartsCartShippingMethod + description: Adds a Shipping Method to the Cart. + summary: Add a Shipping Method + parameters: + - in: path + name: id + required: true + description: The cart ID. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.addShippingMethod(cart_id, { + option_id + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "option_id": "{option_id}", + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - option_id + properties: + option_id: + type: string + description: ID of the shipping option to create the method from + data: + type: object + description: >- + Used to hold any data that the shipping method may need to + process the fulfillment of the order. Look at the + documentation for your installed fulfillment providers to + find out what to send. + '/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 + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/taxes' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/complete': + post: + summary: Complete a Cart + operationId: PostCartsCartComplete + description: >- + Completes a cart. The following steps will be performed. Payment + authorization is attempted and if more work is required, we simply + return the cart for further updates. If payment is authorized and order + is not yet created, we make sure to do so. The completion of a cart can + be performed idempotently with a provided header `Idempotency-Key`. If + not provided, we will generate one for the request. + parameters: + - in: path + name: id + required: true + description: The Cart id. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.complete(cart_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/complete' + tags: + - Cart + responses: + '200': + description: >- + If a cart was successfully authorized, but requires further action + from the user the response body will contain the cart with an + updated payment session. If the Cart was successfully completed the + response body will contain the newly created Order. + content: + application/json: + schema: + type: object + properties: + type: + type: string + description: The type of the data property. + enum: + - order + - cart + - swap + data: + type: object + description: >- + The data of the result object. Its type depends on the + type field. + oneOf: + - type: object + description: >- + Cart was successfully authorized and order was placed + successfully. + properties: + order: + $ref: '#/components/schemas/Order' + - type: object + description: >- + Cart was successfully authorized but requires further + actions. + properties: + cart: + $ref: '#/components/schemas/Cart' + - type: object + description: >- + When cart is used for a swap and it has been completed + successfully. + properties: + cart: + $ref: '#/components/schemas/Swap' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts: + post: + summary: Create a Cart + operationId: PostCart + description: >- + Creates a Cart within the given region and with the initial items. If no + `region_id` is provided the cart will be associated with the first + Region available. If no items are provided the cart will be empty after + creation. If a user is logged in the cart's customer id and email will + be set. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.create() + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts' + tags: + - Cart + responses: + '200': + description: Successfully created a new Cart + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-sessions': + post: + operationId: PostCartsCartPaymentSessions + summary: Create Payment Sessions + description: >- + Creates Payment Sessions for each of the available Payment Providers in + the Cart's Region. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.createPaymentSessions(cart_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/discounts/{code}': + delete: + operationId: DeleteCartsCartDiscountsDiscount + description: Removes a Discount from a Cart. + summary: Remove Discount + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: code + required: true + description: The unique Discount code. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.deleteDiscount(cart_id, code) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/discounts/{code}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/line-items/{line_id}': + delete: + operationId: DeleteCartsCartLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.lineItems.delete(cart_id, line_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCartLineItemsItem + summary: Update a Line Item + description: Updates a Line Item if the desired quantity can be fulfilled. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.lineItems.update(cart_id, line_id, { + quantity: 1 + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "quantity": 1 + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - quantity + properties: + quantity: + type: integer + description: The quantity to set the Line Item to. + '/carts/{id}/payment-sessions/{provider_id}': + delete: + operationId: DeleteCartsCartPaymentSessionsSession + summary: Delete a Payment Session + description: >- + Deletes a Payment Session on a Cart. May be useful if a payment has + failed. + 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 used to create the Payment Session to + be deleted. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.deletePaymentSession(cart_id, 'manual') + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCartPaymentSessionUpdate + summary: Update a Payment Session + description: Updates a Payment Session with additional data. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: The id of the payment provider. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.updatePaymentSession(cart_id, 'manual', { + data: { + } + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "data": {} + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: object + description: The data to update the payment session with. + '/carts/{id}': + get: + operationId: GetCartsCart + summary: Get a Cart + description: Retrieves a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.retrieve(cart_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/carts/{id}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCart + summary: Update a Cart + description: Updates a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.update(cart_id, { + email: 'user@example.com' + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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 + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.refreshPaymentSession(cart_id, 'manual') + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-session': + post: + operationId: PostCartsCartPaymentSession + summary: Select a Payment Session + description: >- + Selects a Payment Session as the session intended to be used towards the + completion of the Cart. + parameters: + - in: path + name: id + required: true + description: The ID of the Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.setPaymentSession(cart_id, { + provider_id: 'manual' + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "provider_id": "manual" + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. '/collections/{id}': get: operationId: GetCollectionsCollection @@ -397,7 +1302,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '404': @@ -504,7 +1409,7 @@ paths: collections: type: array items: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' count: type: integer description: The total number of items available @@ -534,22 +1439,7 @@ paths: content: application/json: schema: - type: object - required: - - address - properties: - address: - description: The Address to add to the Customer. - allOf: - - $ref: '#/components/schemas/address_fields' - - type: object - required: - - first_name - - last_name - - address_1 - - city - - country_code - - postal_code + $ref: '#/components/schemas/StorePostCustomersCustomerAddressesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -613,7 +1503,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -635,30 +1525,7 @@ paths: content: application/json: schema: - type: object - required: - - first_name - - last_name - - email - - password - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - phone: - description: The Customer's phone number. - type: string + $ref: '#/components/schemas/StorePostCustomersReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -703,7 +1570,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '404': @@ -783,7 +1650,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -812,8 +1679,8 @@ paths: content: application/json: schema: - anyOf: - - $ref: '#/components/schemas/address_fields' + $ref: >- + #/components/schemas/StorePostCustomersCustomerAddressesAddressReq x-codeSamples: - lang: JavaScript label: JS Client @@ -858,7 +1725,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -915,7 +1782,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -937,33 +1804,7 @@ paths: content: application/json: schema: - type: object - 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_fields' - description: The full billing address object - - type: string - description: The ID of an existing billing address - password: - description: The Customer's password. - type: string - phone: - description: The Customer's phone number. - type: string - email: - description: The email of the customer. - type: string - metadata: - description: Metadata about the customer. - type: object + $ref: '#/components/schemas/StorePostCustomersCustomerReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1008,7 +1849,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -1300,7 +2141,7 @@ paths: orders: type: array items: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' count: type: integer description: The total number of items available @@ -1334,14 +2175,7 @@ paths: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The email of the customer. - type: string - format: email + $ref: '#/components/schemas/StorePostCustomersCustomerPasswordTokenReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1401,23 +2235,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - password - - token - properties: - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - token: - description: The reset password token - type: string + $ref: '#/components/schemas/StorePostCustomersResetPasswordReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1460,7 +2278,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -1473,1027 +2291,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/shipping-methods': - post: - operationId: PostCartsCartShippingMethod - description: Adds a Shipping Method to the Cart. - summary: Add a Shipping Method - parameters: - - in: path - name: id - required: true - description: The cart ID. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.addShippingMethod(cart_id, { - option_id - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "option_id": "{option_id}", - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - option_id - properties: - option_id: - type: string - description: ID of the shipping option to create the method from - data: - type: object - description: >- - Used to hold any data that the shipping method may need to - process the fulfillment of the order. Look at the - documentation for your installed fulfillment providers to - find out what to send. - '/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 - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/taxes' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/complete': - post: - summary: Complete a Cart - operationId: PostCartsCartComplete - description: >- - Completes a cart. The following steps will be performed. Payment - authorization is attempted and if more work is required, we simply - return the cart for further updates. If payment is authorized and order - is not yet created, we make sure to do so. The completion of a cart can - be performed idempotently with a provided header `Idempotency-Key`. If - not provided, we will generate one for the request. - parameters: - - in: path - name: id - required: true - description: The Cart id. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.complete(cart_id) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/complete' - tags: - - Cart - responses: - '200': - description: >- - If a cart was successfully authorized, but requires further action - from the user the response body will contain the cart with an - updated payment session. If the Cart was successfully completed the - response body will contain the newly created Order. - content: - application/json: - schema: - type: object - properties: - type: - type: string - description: The type of the data property. - enum: - - order - - cart - - swap - data: - type: object - description: >- - The data of the result object. Its type depends on the - type field. - oneOf: - - type: object - description: >- - Cart was successfully authorized and order was placed - successfully. - properties: - order: - $ref: '#/components/schemas/order' - - type: object - description: >- - Cart was successfully authorized but requires further - actions. - properties: - cart: - $ref: '#/components/schemas/cart' - - type: object - description: >- - When cart is used for a swap and it has been completed - successfully. - properties: - cart: - $ref: '#/components/schemas/swap' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /carts: - post: - summary: Create a Cart - operationId: PostCart - description: >- - Creates a Cart within the given region and with the initial items. If no - `region_id` is provided the cart will be associated with the first - Region available. If no items are provided the cart will be empty after - creation. If a user is logged in the cart's customer id and email will - be set. - requestBody: - content: - application/json: - schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Cart in. - sales_channel_id: - type: string - description: >- - [EXPERIMENTAL] The ID of the Sales channel to create the - Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - items: - description: >- - An optional array of `variant_id`, `quantity` pairs to - generate Line Items from. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: >- - The id of the Product Variant to generate a Line Item - from. - type: string - quantity: - description: The quantity of the Product Variant to add - type: integer - context: - description: >- - An optional object to provide context to the Cart. The - `context` field is automatically populated with `ip` and - `user_agent` - type: object - example: - ip: '::1' - user_agent: Chrome - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.create() - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: | - curl --location --request POST 'https://medusa-url.com/store/carts' - tags: - - Cart - responses: - '200': - description: Successfully created a new Cart - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/payment-sessions': - post: - operationId: PostCartsCartPaymentSessions - summary: Create Payment Sessions - description: >- - Creates Payment Sessions for each of the available Payment Providers in - the Cart's Region. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.createPaymentSessions(cart_id) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/discounts/{code}': - delete: - operationId: DeleteCartsCartDiscountsDiscount - description: Removes a Discount from a Cart. - summary: Remove Discount - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: code - required: true - description: The unique Discount code. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.deleteDiscount(cart_id, code) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/discounts/{code}' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/line-items/{line_id}': - delete: - operationId: DeleteCartsCartLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: line_id - required: true - description: The id of the Line Item. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.lineItems.delete(cart_id, line_id) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostCartsCartLineItemsItem - summary: Update a Line Item - description: Updates a Line Item if the desired quantity can be fulfilled. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: line_id - required: true - description: The id of the Line Item. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.lineItems.update(cart_id, line_id, { - quantity: 1 - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "quantity": 1 - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - type: integer - description: The quantity to set the Line Item to. - '/carts/{id}/payment-sessions/{provider_id}': - delete: - operationId: DeleteCartsCartPaymentSessionsSession - summary: Delete a Payment Session - description: >- - Deletes a Payment Session on a Cart. May be useful if a payment has - failed. - 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 used to create the Payment Session to - be deleted. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.deletePaymentSession(cart_id, 'manual') - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostCartsCartPaymentSessionUpdate - summary: Update a Payment Session - description: Updates a Payment Session with additional data. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: provider_id - required: true - description: The id of the payment provider. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.updatePaymentSession(cart_id, 'manual', { - data: { - } - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "data": {} - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - data - properties: - data: - type: object - description: The data to update the payment session with. - '/carts/{id}': - get: - operationId: GetCartsCart - summary: Get a Cart - description: Retrieves a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.retrieve(cart_id) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/carts/{id}' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostCartsCart - summary: Update a Cart - description: Updates a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - region_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. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Cart. - format: email - sales_channel_id: - type: string - description: The ID of the Sales channel to update the Cart with. - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address' - description: A full billing address object. - - type: string - description: The billing address ID - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address' - description: A full shipping address object. - - type: string - description: The shipping address ID - gift_cards: - description: An array of Gift Card codes to add to the Cart. - type: array - items: - required: - - code - 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: - required: - - code - 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 - example: - ip: '::1' - user_agent: Chrome - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.update(cart_id, { - email: 'user@example.com' - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "email": "user@example.com" - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/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 - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.refreshPaymentSession(cart_id, 'manual') - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/payment-session': - post: - operationId: PostCartsCartPaymentSession - summary: Select a Payment Session - description: >- - Selects a Payment Session as the session intended to be used towards the - completion of the Cart. - parameters: - - in: path - name: id - required: true - description: The ID of the Cart. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.setPaymentSession(cart_id, { - provider_id: 'manual' - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "provider_id": "manual" - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. '/gift-cards/{code}': get: operationId: GetGiftCardsCode @@ -2536,7 +2333,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '404': @@ -2588,7 +2385,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -2613,11 +2410,7 @@ paths: content: application/json: schema: - type: object - properties: - declined_reason: - type: string - description: The reason for declining the OrderEdit. + $ref: '#/components/schemas/StorePostOrderEditsOrderEditDecline' x-codeSamples: - lang: JavaScript label: JS Client @@ -2647,7 +2440,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -2698,7 +2491,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -2722,12 +2515,7 @@ paths: content: application/json: schema: - required: - - token - properties: - token: - description: The invite token provided by the admin. - type: string + $ref: '#/components/schemas/StorePostCustomersCustomerAcceptClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2825,7 +2613,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -2878,7 +2666,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -2954,7 +2742,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -2976,14 +2764,7 @@ paths: content: application/json: schema: - required: - - order_ids - properties: - order_ids: - description: The ids of the orders to claim - type: array - items: - type: string + $ref: '#/components/schemas/StorePostCustomersCustomerOrderClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3054,12 +2835,8 @@ paths: content: application/json: schema: - properties: - session_ids: - description: List of Payment Session IDs to authorize. - type: array - items: - type: string + $ref: >- + #/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq x-codeSamples: - lang: JavaScript label: JS Client @@ -3094,7 +2871,7 @@ paths: schema: properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -3160,7 +2937,7 @@ paths: schema: properties: payment_session: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' '400': $ref: '#/components/responses/400_error' '401': @@ -3230,7 +3007,7 @@ paths: type: object properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -3260,28 +3037,7 @@ paths: content: application/json: schema: - properties: - sessions: - description: >- - An array of payment sessions related to the Payment - Collection. If the session_id is not provided, existing - sessions not present will be deleted and the provided ones - will be created. - type: array - items: - required: - - provider_id - - amount - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - amount: - type: integer - description: The amount . - session_id: - type: string - description: The ID of the Payment Session to be updated. + $ref: '#/components/schemas/StorePostPaymentCollectionsBatchSessionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3343,7 +3099,7 @@ paths: schema: properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -3373,12 +3129,7 @@ paths: content: application/json: schema: - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. + $ref: '#/components/schemas/StorePaymentCollectionSessionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3418,7 +3169,7 @@ paths: schema: properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -3452,21 +3203,6 @@ paths: description: The id of the Payment Session to be refreshed. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - - customer_id - properties: - provider_id: - description: The Payment Provider id. - type: string - customer_id: - description: The Customer id. - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -3477,7 +3213,7 @@ paths: 3 }) medusa.paymentCollections.refreshPaymentSession(payment_collection_id, - session_id, payload) + session_id) .then(({ payment_session }) => { console.log(payment_session.id); @@ -3498,7 +3234,7 @@ paths: type: object properties: payment_session: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' '400': $ref: '#/components/responses/400_error' '404': @@ -3642,7 +3378,7 @@ paths: type: object properties: product_types: - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' count: type: integer description: The total number of items available @@ -3731,16 +3467,16 @@ paths: properties: product: allOf: - - $ref: '#/components/schemas/product' + - $ref: '#/components/schemas/Product' - type: object properties: variants: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' + - $ref: '#/components/schemas/ProductVariant' - $ref: >- - #/components/schemas/product_variant_prices_fields + #/components/schemas/ProductVariantPricesFields '400': $ref: '#/components/responses/400_error' '404': @@ -3901,6 +3637,11 @@ paths: the result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -3934,16 +3675,16 @@ paths: type: array items: allOf: - - $ref: '#/components/schemas/product' + - $ref: '#/components/schemas/Product' - type: object properties: variants: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' + - $ref: '#/components/schemas/ProductVariant' - $ref: >- - #/components/schemas/product_variant_prices_fields + #/components/schemas/ProductVariantPricesFields count: type: integer description: The total number of items available @@ -4075,7 +3816,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '404': @@ -4179,119 +3920,7 @@ paths: regions: type: array items: - $ref: '#/components/schemas/region' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /returns: - post: - operationId: PostReturns - summary: Create Return - description: Creates a Return for an Order. - requestBody: - content: - application/json: - schema: - type: object - required: - - order_id - - items - 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: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item from the Order. - type: string - quantity: - description: The quantity to return. - type: integer - reason_id: - description: The ID of the return reason. - type: string - note: - description: A note to add to the item returned. - type: string - 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 - required: - - option_id - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.returns.create({ - order_id, - items: [ - { - item_id, - quantity: 1 - } - ] - }) - - .then((data) => { - console.log(data.return.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/returns' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "order_id": "asfasf", - "items": [ - { - "item_id": "assfasf", - "quantity": 1 - } - ] - }' - tags: - - Return - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - return: - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '404': @@ -4344,7 +3973,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '404': @@ -4392,7 +4021,78 @@ paths: return_reasons: type: array items: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /returns: + post: + operationId: PostReturns + summary: Create Return + description: Creates a Return for an Order. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostReturnsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.returns.create({ + order_id, + items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then((data) => { + console.log(data.return.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/returns' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "order_id": "asfasf", + "items": [ + { + "item_id": "assfasf", + "quantity": 1 + } + ] + }' + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + return: + $ref: '#/components/schemas/Return' '400': $ref: '#/components/responses/400_error' '404': @@ -4458,7 +4158,7 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '404': @@ -4513,7 +4213,7 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '404': @@ -4535,54 +4235,7 @@ paths: content: application/json: schema: - type: object - required: - - order_id - - return_items - - additional_items - properties: - order_id: - type: string - description: The ID of the Order to create the Swap for. - return_items: - 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. - type: string - quantity: - description: The quantity to swap. - type: integer - reason_id: - description: The ID of the reason of this return. - type: string - note: - description: The note to add to the item being swapped. - type: string - return_shipping_option: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - additional_items: - 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. - type: string - quantity: - description: The quantity to send of the variant. - type: integer + $ref: '#/components/schemas/StorePostSwapsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4645,7 +4298,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '404': @@ -4698,7 +4351,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '404': @@ -4759,8 +4412,8 @@ paths: properties: variant: allOf: - - $ref: '#/components/schemas/product_variant' - - $ref: '#/components/schemas/product_variant_prices_fields' + - $ref: '#/components/schemas/ProductVariant' + - $ref: '#/components/schemas/ProductVariantPricesFields' '400': $ref: '#/components/responses/400_error' '404': @@ -4858,8 +4511,8 @@ paths: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' - - $ref: '#/components/schemas/product_variant_prices_fields' + - $ref: '#/components/schemas/ProductVariant' + - $ref: '#/components/schemas/ProductVariantPricesFields' '400': $ref: '#/components/responses/400_error' '404': @@ -4924,7 +4577,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -4964,7 +4617,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: An unknown error occurred. @@ -4974,7 +4627,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: >- @@ -4986,7 +4639,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: invalid_request_error message: Discount with code TEST already exists. @@ -4996,7 +4649,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: message: Entity with id 1 was not found type: not_found @@ -5006,21 +4659,21 @@ components: application/json: schema: oneOf: - - $ref: '#/components/schemas/error' - - $ref: '#/components/schemas/multiple_errors' + - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/MultipleErrors' examples: not_allowed: $ref: '#/components/examples/not_allowed_error' invalid_data: $ref: '#/components/examples/invalid_data_error' - multiple_errors: + MultipleErrors: $ref: '#/components/examples/multiple_errors' 500_error: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' examples: database: $ref: '#/components/examples/database_error' @@ -5158,10 +4811,9 @@ components: Where `{sid}` is the value of `connect.sid` that you copied. schemas: - address_fields: + AddressFields: title: Address Fields description: Address fields used when creating/updating an address. - x-resourceId: address type: object properties: company: @@ -5213,10 +4865,9 @@ components: description: An optional key-value map with additional details example: car: white - address: + Address: title: Address description: An address. - x-resourceId: address type: object properties: id: @@ -5297,10 +4948,9 @@ components: description: An optional key-value map with additional details example: car: white - batch_job: + BatchJob: title: Batch Job description: A Batch Job. - x-resourceId: batch_job type: object required: - type @@ -5440,10 +5090,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - cart: + Cart: title: Cart description: Represents a user cart - x-resourceId: cart type: object properties: id: @@ -5460,19 +5109,19 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' region_id: type: string description: The region's ID @@ -5501,24 +5150,24 @@ components: type: object payment_session: description: The selected payment session in the cart. - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' type: type: string description: The cart's type. @@ -5618,10 +5267,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - claim_image: + ClaimImage: title: Claim Image description: Represents photo documentation of a claim. - x-resourceId: claim_image type: object required: - claim_item_id @@ -5660,12 +5308,11 @@ components: description: An optional key-value map with additional details example: car: white - claim_item: + ClaimItem: title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. - x-resourceId: claim_item type: object required: - claim_order_id @@ -5682,7 +5329,7 @@ components: type: array description: Available if the relation `images` is expanded. items: - $ref: '#/components/schemas/claim_image' + $ref: '#/components/schemas/ClaimImage' claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -5697,7 +5344,7 @@ components: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. type: string @@ -5729,7 +5376,7 @@ components: relation 'tags' is expanded. type: array items: - $ref: '#/components/schemas/claim_tag' + $ref: '#/components/schemas/ClaimTag' created_at: type: string description: The date with timezone at which the resource was created. @@ -5747,13 +5394,12 @@ components: description: An optional key-value map with additional details example: car: white - claim_order: + ClaimOrder: title: Claim Order description: >- Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. - x-resourceId: claim_order type: object required: - type @@ -5793,14 +5439,14 @@ components: description: The items that have been claimed type: array items: - $ref: '#/components/schemas/claim_item' + $ref: '#/components/schemas/ClaimItem' 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/LineItem' order_id: description: The ID of the order that the claim comes from. type: string @@ -5819,17 +5465,17 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $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/ShippingMethod' 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 @@ -5870,12 +5516,11 @@ components: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - claim_tag: + ClaimTag: title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. - x-resourceId: claim_tag type: object required: - value @@ -5905,10 +5550,9 @@ components: description: An optional key-value map with additional details example: car: white - country: + Country: title: Country description: Country details - x-resourceId: country type: object required: - iso_2 @@ -5960,10 +5604,9 @@ components: region: description: A region object. Available if the relation `region` is expanded. type: object - currency: + Currency: title: Currency description: Currency - x-resourceId: currency type: object required: - code @@ -5993,13 +5636,12 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean - custom_shipping_option: + CustomShippingOption: title: Custom Shipping Option description: >- Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option - x-resourceId: custom_shipping_option type: object required: - price @@ -6055,10 +5697,9 @@ components: [EXPERIMENTAL] Indicates if the custom shipping option price include tax type: boolean - customer_group: + CustomerGroup: title: Customer Group description: Represents a customer group - x-resourceId: customer_group type: object required: - name @@ -6085,7 +5726,7 @@ components: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' created_at: type: string description: The date with timezone at which the resource was created. @@ -6103,10 +5744,9 @@ components: description: An optional key-value map with additional details example: car: white - customer: + Customer: title: Customer description: Represents a customer - x-resourceId: customer type: object required: - email @@ -6133,12 +5773,12 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' phone: type: string description: The customer's phone number @@ -6159,7 +5799,7 @@ components: relation `groups` is expanded. type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' created_at: type: string description: The date with timezone at which the resource was created. @@ -6177,10 +5817,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_customer_group: + DiscountConditionCustomerGroup: title: Product Tag Discount Condition description: Associates a discount condition with a customer group - x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -6196,10 +5835,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6213,10 +5852,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_collection: + DiscountConditionProductCollection: title: Product Collection Discount Condition description: Associates a discount condition with a product collection - x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -6232,10 +5870,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6249,10 +5887,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_tag: + DiscountConditionProductTag: title: Product Tag Discount Condition description: Associates a discount condition with a product tag - x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -6268,10 +5905,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6285,10 +5922,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_type: + DiscountConditionProductType: title: Product Type Discount Condition description: Associates a discount condition with a product type - x-resourceId: discount_condition_product type: object required: - product_type_id @@ -6304,10 +5940,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6321,10 +5957,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product: + DiscountConditionProduct: title: Product Discount Condition description: Associates a discount condition with a product - x-resourceId: discount_condition_product type: object required: - product_id @@ -6340,10 +5975,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6357,10 +5992,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition: + DiscountCondition: title: Discount Condition description: Holds rule conditions for when a discount is applicable - x-resourceId: discount_condition type: object required: - type @@ -6392,7 +6026,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' products: description: >- products associated with this condition if type = products. @@ -6453,12 +6087,11 @@ components: description: An optional key-value map with additional details example: car: white - discount_rule: + DiscountRule: title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. - x-resourceId: discount_rule type: object required: - type @@ -6521,12 +6154,11 @@ components: description: An optional key-value map with additional details example: car: white - discount: + Discount: title: Discount description: >- Represents a discount that can be applied to a cart for promotional purposes. - x-resourceId: discount type: object required: - code @@ -6554,7 +6186,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -6569,7 +6201,7 @@ components: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. type: string @@ -6616,10 +6248,9 @@ components: description: An optional key-value map with additional details example: car: white - draft-order: + DraftOrder: title: DraftOrder description: Represents a draft order - x-resourceId: draft-order type: object properties: id: @@ -6689,12 +6320,11 @@ components: description: An optional key-value map with additional details example: car: white - fulfillment_item: + FulfillmentItem: title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. - x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -6716,17 +6346,16 @@ components: type: object item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer example: 1 - fulfillment_provider: + FulfillmentProvider: title: Fulfillment Provider description: >- Represents a fulfillment provider plugin and holds its installation status. - x-resourceId: fulfillment_provider type: object properties: id: @@ -6740,7 +6369,7 @@ components: to `false`. type: boolean example: true - fulfillment: + Fulfillment: title: Fulfillment description: >- Fulfillments are created once store operators can prepare the purchased @@ -6750,7 +6379,6 @@ components: partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. - x-resourceId: fulfillment type: object required: - provider_id @@ -6790,7 +6418,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' items: description: >- The Fulfillment Items in the Fulfillment - these hold information @@ -6798,7 +6426,7 @@ components: the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_item' + $ref: '#/components/schemas/FulfillmentItem' tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -6806,7 +6434,7 @@ components: Provider. Available if the relation `tracking_links` is expanded. type: array items: - $ref: '#/components/schemas/tracking_link' + $ref: '#/components/schemas/TrackingLink' tracking_numbers: deprecated: true description: >- @@ -6861,12 +6489,11 @@ components: description: An optional key-value map with additional details example: car: white - gift_card_transaction: + GiftCardTransaction: title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order - x-resourceId: gift_card_transaction type: object required: - gift_card_id @@ -6908,12 +6535,11 @@ components: description: The tax rate of the transaction type: number example: 0 - gift_card: + GiftCard: title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. - x-resourceId: gift_card type: object required: - code @@ -6963,6 +6589,10 @@ components: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. @@ -6980,12 +6610,11 @@ components: description: An optional key-value map with additional details example: car: white - idempotency_key: + IdempotencyKey: title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. - x-resourceId: idempotency_key type: object required: - idempotency_key @@ -7037,10 +6666,9 @@ components: type: string description: Where to continue from. default: started - image: + Image: title: Image description: Images holds a reference to a URL at which the image file can be found. - x-resourceId: image type: object required: - url @@ -7070,10 +6698,9 @@ components: description: An optional key-value map with additional details example: car: white - invite: + Invite: title: Invite description: Represents an invite - x-resourceId: invite type: object required: - user_email @@ -7122,10 +6749,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_adjustment: + LineItemAdjustment: title: Line Item Adjustment - description: Represents an Line Item Adjustment - x-resourceId: line_item_adjustment + description: Represents a Line Item Adjustment type: object required: - item_id @@ -7142,7 +6768,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' description: type: string description: The line item's adjustment description @@ -7153,7 +6779,7 @@ components: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' amount: type: number description: The adjustment amount @@ -7163,10 +6789,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_tax_line: + LineItemTaxLine: title: Line Item Tax Line - description: Represents an Line Item Tax Line - x-resourceId: line_item_tax_line + description: Represents a Line Item Tax Line type: object required: - item_id @@ -7183,7 +6808,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' code: description: A code to identify the tax type by type: string @@ -7209,7 +6834,7 @@ components: description: An optional key-value map with additional details example: car: white - line_item: + LineItem: title: Line Item description: >- Line Items represent purchasable units that can be added to a Cart for @@ -7217,7 +6842,6 @@ components: resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. - x-resourceId: line_item type: object required: - title @@ -7262,12 +6886,12 @@ components: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: '#/components/schemas/line_item_tax_line' + $ref: '#/components/schemas/LineItemTaxLine' adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: '#/components/schemas/line_item_adjustment' + $ref: '#/components/schemas/LineItemAdjustment' title: description: >- The title of the Line Item, this should be easily identifiable by @@ -7403,7 +7027,7 @@ components: description: An optional key-value map with additional details example: car: white - money_amount: + MoneyAmount: title: Money Amount description: >- Money Amounts represents an amount that a given Product Variant can be @@ -7412,7 +7036,6 @@ components: fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. - x-resourceId: money_amount type: object required: - currency_code @@ -7431,7 +7054,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to @@ -7456,7 +7079,7 @@ components: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' variant_id: description: The id of the Product Variant contained in the Line Item. type: string @@ -7490,13 +7113,12 @@ components: description: An optional key-value map with additional details example: car: white - note: + Note: title: Note description: >- Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. - x-resourceId: note type: object required: - value @@ -7525,7 +7147,7 @@ components: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' created_at: type: string description: The date with timezone at which the resource was created. @@ -7543,12 +7165,11 @@ components: description: An optional key-value map with additional details example: car: white - notification_provider: + NotificationProvider: title: Notification Provider description: >- Represents a notification provider plugin and holds its installation status. - x-resourceId: notification_provider type: object required: - id @@ -7564,14 +7185,13 @@ components: to `false`. type: boolean default: true - notification: + Notification: title: Notification description: >- Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. - x-resourceId: notification type: object required: - resource_type @@ -7620,14 +7240,14 @@ components: Notification. type: array items: - $ref: '#/components/schemas/notification_resend' + $ref: '#/components/schemas/NotificationResend' provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -7636,10 +7256,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - notification_resend: + NotificationResend: title: Notification Resend description: A resend of a Notification. - x-resourceId: notification_resend type: object properties: id: @@ -7684,14 +7303,14 @@ components: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -7703,7 +7322,6 @@ components: OAuth: title: OAuth description: Represent an OAuth app - x-resourceId: OAuth type: object required: - id @@ -7734,10 +7352,9 @@ components: type: object description: Any data necessary to the app. example: {} - order_edit: + OrderEdit: title: Order Edit description: Order edit keeps track of order items changes. - x-resourceId: order_edit type: object required: - order_id @@ -7755,12 +7372,12 @@ components: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: '#/components/schemas/order_item_change' + $ref: '#/components/schemas/OrderItemChange' internal_note: description: An optional note with additional details about the order edit. type: string @@ -7847,14 +7464,14 @@ components: type: array description: Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' created_at: type: string description: The date with timezone at which the resource was created. @@ -7863,10 +7480,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - order_item_change: + OrderItemChange: title: Order Item Change description: Represents an order edit item change - x-resourceId: order_item_change type: object required: - type @@ -7889,21 +7505,21 @@ components: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' created_at: type: string description: The date with timezone at which the resource was created. @@ -7921,10 +7537,9 @@ components: description: An optional key-value map with additional details example: car: white - order: + Order: title: Order description: Represents an order - x-resourceId: order type: object required: - customer_id @@ -8000,14 +7615,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' region_id: type: string description: The region's ID @@ -8024,7 +7639,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The order's tax rate type: number @@ -8051,21 +7666,21 @@ components: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' returns: type: array description: >- @@ -8113,21 +7728,21 @@ components: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: '#/components/schemas/gift_card_transaction' + $ref: '#/components/schemas/GiftCardTransaction' canceled_at: type: string description: The date the order was canceled on. @@ -8200,10 +7815,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - payment_collection: + PaymentCollection: title: Payment Collection description: Payment Collection - x-resourceId: payment_collection type: object required: - type @@ -8246,7 +7860,7 @@ components: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' currency_code: description: The 3 character ISO code for the currency. type: string @@ -8256,17 +7870,17 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' created_by: type: string description: The ID of the user that created the payment collection. @@ -8287,10 +7901,9 @@ components: description: An optional key-value map with additional details example: car: white - payment_provider: + PaymentProvider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. - x-resourceId: payment_provider type: object required: - id @@ -8306,7 +7919,7 @@ components: to `false`. type: boolean default: true - payment_session: + PaymentSession: title: Payment Session description: >- Payment Sessions are created when a Customer initilizes the checkout @@ -8315,7 +7928,6 @@ components: communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. - x-resourceId: payment_session type: object required: - cart_id @@ -8384,12 +7996,11 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - payment: + Payment: title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. - x-resourceId: payment type: object required: - amount @@ -8433,7 +8044,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount_refunded: description: >- The amount of the original Payment amount that has been refunded @@ -8482,12 +8093,11 @@ components: description: An optional key-value map with additional details example: car: white - price_list: + PriceList: title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. - x-resourceId: price_list type: object required: - name @@ -8544,8 +8154,8 @@ components: type: array items: oneOf: - - $ref: '#/components/schemas/money_amount' - - $ref: '#/components/schemas/customer_group' + - $ref: '#/components/schemas/MoneyAmount' + - $ref: '#/components/schemas/CustomerGroup' includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean @@ -8561,10 +8171,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - product_collection: + ProductCollection: title: Product Collection description: Product Collections represents a group of Products that are related. - x-resourceId: product_collection type: object required: - title @@ -8608,13 +8217,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option_value: + ProductOptionValue: title: Product Option Value description: >- A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. - x-resourceId: product_option_value type: object required: - value @@ -8640,7 +8248,7 @@ components: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variant_id: description: >- The ID of the Product Variant that the Product Option Value is @@ -8649,7 +8257,7 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' created_at: type: string description: The date with timezone at which the resource was created. @@ -8667,13 +8275,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option: + ProductOption: title: Product Option description: >- Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. - x-resourceId: product_option type: object required: - title @@ -8693,7 +8300,7 @@ components: Available if the relation `values` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' product_id: description: The ID of the Product that the Product Option is defined for. type: string @@ -8718,10 +8325,9 @@ components: description: An optional key-value map with additional details example: car: white - product_tag: + ProductTag: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. - x-resourceId: product_tag type: object required: - value @@ -8751,12 +8357,11 @@ components: description: An optional key-value map with additional details example: car: white - product_tax_rate: + ProductTaxRate: 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 type: object required: - product_id @@ -8768,14 +8373,14 @@ components: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -8789,12 +8394,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type_tax_rate: + ProductTypeTaxRate: 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 type: object required: - product_type_id @@ -8806,14 +8410,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' rate_id: description: The id of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -8827,12 +8431,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type: + ProductType: title: Product Type description: >- Product Type can be added to Products for filtering and reporting purposes. - x-resourceId: product_type type: object required: - value @@ -8862,14 +8465,13 @@ components: description: An optional key-value map with additional details example: car: white - product_variant: + ProductVariant: title: Product Variant description: >- Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. - x-resourceId: product_variant type: object required: - title @@ -8900,7 +8502,7 @@ components: Region. Available if the relation `prices` is expanded. type: array items: - $ref: '#/components/schemas/money_amount' + $ref: '#/components/schemas/MoneyAmount' sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -9002,7 +8604,7 @@ components: Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' created_at: type: string description: The date with timezone at which the resource was created. @@ -9020,10 +8622,9 @@ components: description: An optional key-value map with additional details example: car: white - product_variant_prices_fields: + ProductVariantPricesFields: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. - x-resourceId: product_variant_prices_fields type: object properties: original_price: @@ -9061,13 +8662,12 @@ components: code: type: string description: The code of the tax rate - product: + Product: title: Product description: >- Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. - x-resourceId: product type: object required: - title @@ -9118,7 +8718,7 @@ components: expanded. 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 @@ -9130,7 +8730,7 @@ components: Option Values. Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variants: description: >- The Product Variants that belong to the Product. Each will have a @@ -9138,7 +8738,7 @@ components: relation `variants` is expanded. type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -9148,7 +8748,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -9216,14 +8816,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' tags: description: >- The Product Tags assigned to the Product. Available if the relation `tags` is expanded. type: array items: - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discountable: description: >- Whether the Product can be discounted. Discounts will not apply to @@ -9259,10 +8859,9 @@ components: description: An optional key-value map with additional details example: car: white - publishable_api_key_sales_channel: + PublishableApiKeySalesChannel: title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels - x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: @@ -9273,12 +8872,11 @@ components: type: string description: The publishable API key's ID example: pak_01G1G5V21KADXNGH29BJMAJ4B4 - publishable_api_key: + PublishableApiKey: title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. - x-resourceId: publishable_api_key type: object properties: id: @@ -9315,13 +8913,12 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - refund: + Refund: title: Refund description: >- Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. - x-resourceId: refund type: object required: - order_id @@ -9381,14 +8978,13 @@ components: description: An optional key-value map with additional details example: car: white - region: + Region: title: Region description: >- Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. - x-resourceId: region type: object required: - name @@ -9414,7 +9010,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -9425,7 +9021,7 @@ components: relation `tax_rates` is expanded. type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' tax_code: description: >- The tax code used on purchases in the Region. This may be used by @@ -9446,28 +9042,28 @@ components: relation `countries` is expanded. type: array items: - $ref: '#/components/schemas/country' + $ref: '#/components/schemas/Country' tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: '#/components/schemas/tax_provider' + $ref: '#/components/schemas/TaxProvider' payment_providers: description: >- The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/payment_provider' + $ref: '#/components/schemas/PaymentProvider' fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean @@ -9488,12 +9084,11 @@ components: description: An optional key-value map with additional details example: car: white - return_item: + ReturnItem: title: Return Item description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. - x-resourceId: return_item type: object required: - return_id @@ -9505,14 +9100,14 @@ components: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -9537,7 +9132,7 @@ components: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' note: description: An optional note with additional details about the Return. type: string @@ -9547,12 +9142,11 @@ components: description: An optional key-value map with additional details example: car: white - return_reason: + ReturnReason: title: Return Reason description: >- A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. - x-resourceId: return_reason type: object required: - value @@ -9580,10 +9174,10 @@ components: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' created_at: type: string description: The date with timezone at which the resource was created. @@ -9601,13 +9195,12 @@ components: description: An optional key-value map with additional details example: car: white - return: + Return: title: Return description: >- Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. - x-resourceId: return type: object required: - refund_amount @@ -9631,7 +9224,7 @@ components: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/return_item' + $ref: '#/components/schemas/ReturnItem' swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -9662,7 +9255,7 @@ components: Available if the relation `shipping_method` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -9705,10 +9298,9 @@ components: description: An optional key-value map with additional details example: car: white - sales_channel: + SalesChannel: title: Sales Channel description: A Sales Channel - x-resourceId: sales_channel type: object required: - name @@ -9741,10 +9333,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_method_tax_line: + ShippingMethodTaxLine: title: Shipping Method Tax Line description: Shipping Method Tax Line - x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -9761,7 +9352,7 @@ components: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' code: description: A code to identify the tax type by type: string @@ -9787,14 +9378,13 @@ components: description: An optional key-value map with additional details example: car: white - shipping_method: + ShippingMethod: title: Shipping Method description: >- Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. - x-resourceId: shipping_method type: object required: - shipping_option_id @@ -9812,7 +9402,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -9856,7 +9446,7 @@ components: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: '#/components/schemas/shipping_method_tax_line' + $ref: '#/components/schemas/ShippingMethodTaxLine' price: description: >- The amount to charge for the Shipping Method. The currency of the @@ -9874,12 +9464,11 @@ components: includes_tax: description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' type: boolean - shipping_option_requirement: + ShippingOptionRequirement: title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. - x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -9898,7 +9487,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' type: description: >- The type of the requirement, this defines how the value will be @@ -9919,7 +9508,7 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_option: + ShippingOption: title: Shipping Option description: >- Shipping Options represent a way in which an Order or Return can be @@ -9928,7 +9517,6 @@ components: Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. - x-resourceId: shipping_option type: object required: - name @@ -9963,7 +9551,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -9972,7 +9560,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' price_type: description: >- The type of pricing calculation that is used when creatin Shipping @@ -10003,7 +9591,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option_requirement' + $ref: '#/components/schemas/ShippingOptionRequirement' data: description: >- The data needed for the Fulfillment Provider to identify the @@ -10030,12 +9618,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_profile: + ShippingProfile: title: Shipping Profile description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. - x-resourceId: shipping_profile type: object required: - name @@ -10076,7 +9663,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' created_at: type: string description: The date with timezone at which the resource was created. @@ -10094,12 +9681,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_tax_rate: + ShippingTaxRate: 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 type: object required: - shipping_option_id @@ -10111,14 +9697,14 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -10132,10 +9718,9 @@ components: description: An optional key-value map with additional details example: car: white - staged_job: + StagedJob: title: Staged Job description: A staged job resource - x-resourceId: staged_job type: object required: - event_name @@ -10152,10 +9737,9 @@ components: description: Data necessary for the job type: object example: {} - store: + Store: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' - x-resourceId: store type: object properties: id: @@ -10175,14 +9759,14 @@ components: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' currencies: description: >- The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. 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 @@ -10213,7 +9797,7 @@ components: description: An optional key-value map with additional details example: car: white - swap: + Swap: title: Swap description: >- Swaps can be created when a Customer wishes to exchange Products that @@ -10223,7 +9807,6 @@ components: for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. - x-resourceId: swap type: object required: - fulfillment_status @@ -10275,7 +9858,7 @@ components: relation `additional_items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' return_order: description: >- A return order object. The Return that is issued for the return part @@ -10287,13 +9870,13 @@ components: relation `fulfillments` is expanded. 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. Available if the relation `payment` is expanded. - $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 @@ -10309,14 +9892,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_methods: description: >- The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string @@ -10368,10 +9951,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_line: + TaxLine: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. - x-resourceId: tax_line type: object required: - rate @@ -10406,10 +9988,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_provider: + TaxProvider: title: Tax Provider description: The tax service used to calculate taxes - x-resourceId: tax_provider type: object properties: id: @@ -10423,12 +10004,11 @@ components: to `false`. type: boolean default: true - tax_rate: + TaxRate: 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 type: object required: - name @@ -10506,13 +10086,12 @@ components: description: An optional key-value map with additional details example: car: white - tracking_link: + TrackingLink: 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. - x-resourceId: tracking_link type: object required: - tracking_number @@ -10536,7 +10115,7 @@ components: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' idempotency_key: type: string description: >- @@ -10563,10 +10142,9 @@ components: description: An optional key-value map with additional details example: car: white - user: + User: title: User description: Represents a User who can manage store settings. - x-resourceId: user type: object required: - email @@ -10608,24 +10186,22 @@ components: description: An optional key-value map with additional details example: car: white - multiple_errors: + MultipleErrors: title: Multiple Errors - x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' message: type: string default: >- Provided request body contains errors. Please check the data and retry the request - error: + Error: title: Response Error - x-resourceId: error type: object properties: code: @@ -10637,3 +10213,363 @@ components: type: type: string description: A slug indicating the type of the error. + StorePostCartReq: + type: object + properties: + region_id: + type: string + description: The ID of the Region to create the Cart in. + sales_channel_id: + type: string + description: '[EXPERIMENTAL] The ID of the Sales channel to create the Cart in.' + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + items: + description: >- + An optional array of `variant_id`, `quantity` pairs to generate Line + Items from. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The id of the Product Variant to generate a Line Item from. + type: string + quantity: + description: The quantity of the Product Variant to add + type: integer + context: + description: >- + An optional object to provide context to the Cart. The `context` + field is automatically populated with `ip` and `user_agent` + type: object + example: + ip: '::1' + user_agent: Chrome + StorePostCartsCartReq: + type: object + properties: + region_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. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + email: + type: string + description: An email to be used on the Cart. + format: email + sales_channel_id: + type: string + description: The ID of the Sales channel to update the Cart with. + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/Address' + description: A full billing address object. + - type: string + description: The billing address ID + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/Address' + description: A full shipping address object. + - type: string + description: The shipping address ID + gift_cards: + description: An array of Gift Card codes to add to the Cart. + type: array + items: + required: + - code + 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: + required: + - code + 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 + example: + ip: '::1' + user_agent: Chrome + StorePostCustomersCustomerAddressesReq: + type: object + required: + - address + properties: + address: + description: The Address to add to the Customer. + allOf: + - $ref: '#/components/schemas/AddressFields' + - type: object + required: + - first_name + - last_name + - address_1 + - city + - country_code + - postal_code + StorePostCustomersReq: + type: object + required: + - first_name + - last_name + - email + - password + properties: + first_name: + description: The Customer's first name. + type: string + last_name: + description: The Customer's last name. + type: string + email: + description: The email of the customer. + type: string + format: email + password: + description: The Customer's password. + type: string + format: password + phone: + description: The Customer's phone number. + type: string + StorePostCustomersCustomerPasswordTokenReq: + type: object + required: + - email + properties: + email: + description: The email of the customer. + type: string + format: email + StorePostCustomersResetPasswordReq: + type: object + required: + - email + - password + - token + properties: + email: + description: The email of the customer. + type: string + format: email + password: + description: The Customer's password. + type: string + format: password + token: + description: The reset password token + type: string + StorePostCustomersCustomerAddressesAddressReq: + anyOf: + - $ref: '#/components/schemas/AddressFields' + StorePostCustomersCustomerReq: + type: object + 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/AddressFields' + description: The full billing address object + - type: string + description: The ID of an existing billing address + password: + description: The Customer's password. + type: string + phone: + description: The Customer's phone number. + type: string + email: + description: The email of the customer. + type: string + metadata: + description: Metadata about the customer. + type: object + StorePostOrderEditsOrderEditDecline: + type: object + properties: + declined_reason: + type: string + description: The reason for declining the OrderEdit. + StorePostCustomersCustomerAcceptClaimReq: + type: object + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + StorePostCustomersCustomerOrderClaimReq: + type: object + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string + StorePostPaymentCollectionsBatchSessionsAuthorizeReq: + type: object + required: + - session_ids + properties: + session_ids: + description: List of Payment Session IDs to authorize. + type: array + items: + type: string + StorePostPaymentCollectionsBatchSessionsReq: + type: object + required: + - sessions + properties: + sessions: + description: >- + An array of payment sessions related to the Payment Collection. If + the session_id is not provided, existing sessions not present will + be deleted and the provided ones will be created. + type: array + items: + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. + StorePaymentCollectionSessionsReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + StorePostReturnsReq: + type: object + required: + - order_id + - items + 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: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item from the Order. + type: string + quantity: + description: The quantity to return. + type: integer + reason_id: + description: The ID of the return reason. + type: string + note: + description: A note to add to the item returned. + type: string + 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 + required: + - option_id + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + StorePostSwapsReq: + type: object + required: + - order_id + - return_items + - additional_items + properties: + order_id: + type: string + description: The ID of the Order to create the Swap for. + return_items: + 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. + type: string + quantity: + description: The quantity to swap. + type: integer + reason_id: + description: The ID of the reason of this return. + type: string + note: + description: The note to add to the item being swapped. + type: string + return_shipping_option: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + additional_items: + 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. + type: string + quantity: + description: The quantity to send of the variant. + type: integer diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 5f35d6cf56..e9b55c54ac 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -108,40 +108,28 @@ tags: sessions. - name: Cart description: Cart endpoints that allow handling carts in Medusa. - x-resourceId: cart - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap servers: - url: 'https://api.medusa-commerce.com/store' paths: @@ -190,7 +178,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -289,7 +277,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -355,6 +343,923 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/carts/{id}/shipping-methods': + post: + operationId: PostCartsCartShippingMethod + description: Adds a Shipping Method to the Cart. + summary: Add a Shipping Method + parameters: + - in: path + name: id + required: true + description: The cart ID. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.addShippingMethod(cart_id, { + option_id + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "option_id": "{option_id}", + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - option_id + properties: + option_id: + type: string + description: ID of the shipping option to create the method from + data: + type: object + description: >- + Used to hold any data that the shipping method may need to + process the fulfillment of the order. Look at the + documentation for your installed fulfillment providers to + find out what to send. + '/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 + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/taxes' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/complete': + post: + summary: Complete a Cart + operationId: PostCartsCartComplete + description: >- + Completes a cart. The following steps will be performed. Payment + authorization is attempted and if more work is required, we simply + return the cart for further updates. If payment is authorized and order + is not yet created, we make sure to do so. The completion of a cart can + be performed idempotently with a provided header `Idempotency-Key`. If + not provided, we will generate one for the request. + parameters: + - in: path + name: id + required: true + description: The Cart id. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.complete(cart_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/complete' + tags: + - Cart + responses: + '200': + description: >- + If a cart was successfully authorized, but requires further action + from the user the response body will contain the cart with an + updated payment session. If the Cart was successfully completed the + response body will contain the newly created Order. + content: + application/json: + schema: + type: object + properties: + type: + type: string + description: The type of the data property. + enum: + - order + - cart + - swap + data: + type: object + description: >- + The data of the result object. Its type depends on the + type field. + oneOf: + - type: object + description: >- + Cart was successfully authorized and order was placed + successfully. + properties: + order: + $ref: '#/components/schemas/Order' + - type: object + description: >- + Cart was successfully authorized but requires further + actions. + properties: + cart: + $ref: '#/components/schemas/Cart' + - type: object + description: >- + When cart is used for a swap and it has been completed + successfully. + properties: + cart: + $ref: '#/components/schemas/Swap' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts: + post: + summary: Create a Cart + operationId: PostCart + description: >- + Creates a Cart within the given region and with the initial items. If no + `region_id` is provided the cart will be associated with the first + Region available. If no items are provided the cart will be empty after + creation. If a user is logged in the cart's customer id and email will + be set. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.create() + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts' + tags: + - Cart + responses: + '200': + description: Successfully created a new Cart + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-sessions': + post: + operationId: PostCartsCartPaymentSessions + summary: Create Payment Sessions + description: >- + Creates Payment Sessions for each of the available Payment Providers in + the Cart's Region. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.createPaymentSessions(cart_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/discounts/{code}': + delete: + operationId: DeleteCartsCartDiscountsDiscount + description: Removes a Discount from a Cart. + summary: Remove Discount + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: code + required: true + description: The unique Discount code. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.deleteDiscount(cart_id, code) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/discounts/{code}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/line-items/{line_id}': + delete: + operationId: DeleteCartsCartLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.lineItems.delete(cart_id, line_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCartLineItemsItem + summary: Update a Line Item + description: Updates a Line Item if the desired quantity can be fulfilled. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.lineItems.update(cart_id, line_id, { + quantity: 1 + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "quantity": 1 + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - quantity + properties: + quantity: + type: integer + description: The quantity to set the Line Item to. + '/carts/{id}/payment-sessions/{provider_id}': + delete: + operationId: DeleteCartsCartPaymentSessionsSession + summary: Delete a Payment Session + description: >- + Deletes a Payment Session on a Cart. May be useful if a payment has + failed. + 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 used to create the Payment Session to + be deleted. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.deletePaymentSession(cart_id, 'manual') + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCartPaymentSessionUpdate + summary: Update a Payment Session + description: Updates a Payment Session with additional data. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: The id of the payment provider. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.updatePaymentSession(cart_id, 'manual', { + data: { + } + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "data": {} + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: object + description: The data to update the payment session with. + '/carts/{id}': + get: + operationId: GetCartsCart + summary: Get a Cart + description: Retrieves a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.retrieve(cart_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/carts/{id}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCart + summary: Update a Cart + description: Updates a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.update(cart_id, { + email: 'user@example.com' + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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 + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.refreshPaymentSession(cart_id, 'manual') + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-session': + post: + operationId: PostCartsCartPaymentSession + summary: Select a Payment Session + description: >- + Selects a Payment Session as the session intended to be used towards the + completion of the Cart. + parameters: + - in: path + name: id + required: true + description: The ID of the Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.setPaymentSession(cart_id, { + provider_id: 'manual' + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "provider_id": "manual" + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. '/collections/{id}': get: operationId: GetCollectionsCollection @@ -397,7 +1302,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '404': @@ -504,7 +1409,7 @@ paths: collections: type: array items: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' count: type: integer description: The total number of items available @@ -524,1080 +1429,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/shipping-methods': - post: - operationId: PostCartsCartShippingMethod - description: Adds a Shipping Method to the Cart. - summary: Add a Shipping Method - parameters: - - in: path - name: id - required: true - description: The cart ID. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.addShippingMethod(cart_id, { - option_id - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "option_id": "{option_id}", - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - option_id - properties: - option_id: - type: string - description: ID of the shipping option to create the method from - data: - type: object - description: >- - Used to hold any data that the shipping method may need to - process the fulfillment of the order. Look at the - documentation for your installed fulfillment providers to - find out what to send. - '/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 - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/taxes' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/complete': - post: - summary: Complete a Cart - operationId: PostCartsCartComplete - description: >- - Completes a cart. The following steps will be performed. Payment - authorization is attempted and if more work is required, we simply - return the cart for further updates. If payment is authorized and order - is not yet created, we make sure to do so. The completion of a cart can - be performed idempotently with a provided header `Idempotency-Key`. If - not provided, we will generate one for the request. - parameters: - - in: path - name: id - required: true - description: The Cart id. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.complete(cart_id) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/complete' - tags: - - Cart - responses: - '200': - description: >- - If a cart was successfully authorized, but requires further action - from the user the response body will contain the cart with an - updated payment session. If the Cart was successfully completed the - response body will contain the newly created Order. - content: - application/json: - schema: - type: object - properties: - type: - type: string - description: The type of the data property. - enum: - - order - - cart - - swap - data: - type: object - description: >- - The data of the result object. Its type depends on the - type field. - oneOf: - - type: object - description: >- - Cart was successfully authorized and order was placed - successfully. - properties: - order: - $ref: '#/components/schemas/order' - - type: object - description: >- - Cart was successfully authorized but requires further - actions. - properties: - cart: - $ref: '#/components/schemas/cart' - - type: object - description: >- - When cart is used for a swap and it has been completed - successfully. - properties: - cart: - $ref: '#/components/schemas/swap' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /carts: - post: - summary: Create a Cart - operationId: PostCart - description: >- - Creates a Cart within the given region and with the initial items. If no - `region_id` is provided the cart will be associated with the first - Region available. If no items are provided the cart will be empty after - creation. If a user is logged in the cart's customer id and email will - be set. - requestBody: - content: - application/json: - schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Cart in. - sales_channel_id: - type: string - description: >- - [EXPERIMENTAL] The ID of the Sales channel to create the - Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - items: - description: >- - An optional array of `variant_id`, `quantity` pairs to - generate Line Items from. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: >- - The id of the Product Variant to generate a Line Item - from. - type: string - quantity: - description: The quantity of the Product Variant to add - type: integer - context: - description: >- - An optional object to provide context to the Cart. The - `context` field is automatically populated with `ip` and - `user_agent` - type: object - example: - ip: '::1' - user_agent: Chrome - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.create() - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: | - curl --location --request POST 'https://medusa-url.com/store/carts' - tags: - - Cart - responses: - '200': - description: Successfully created a new Cart - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/payment-sessions': - post: - operationId: PostCartsCartPaymentSessions - summary: Create Payment Sessions - description: >- - Creates Payment Sessions for each of the available Payment Providers in - the Cart's Region. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.createPaymentSessions(cart_id) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/discounts/{code}': - delete: - operationId: DeleteCartsCartDiscountsDiscount - description: Removes a Discount from a Cart. - summary: Remove Discount - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: code - required: true - description: The unique Discount code. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.deleteDiscount(cart_id, code) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/discounts/{code}' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/line-items/{line_id}': - delete: - operationId: DeleteCartsCartLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: line_id - required: true - description: The id of the Line Item. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.lineItems.delete(cart_id, line_id) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostCartsCartLineItemsItem - summary: Update a Line Item - description: Updates a Line Item if the desired quantity can be fulfilled. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: line_id - required: true - description: The id of the Line Item. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.lineItems.update(cart_id, line_id, { - quantity: 1 - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "quantity": 1 - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - type: integer - description: The quantity to set the Line Item to. - '/carts/{id}/payment-sessions/{provider_id}': - delete: - operationId: DeleteCartsCartPaymentSessionsSession - summary: Delete a Payment Session - description: >- - Deletes a Payment Session on a Cart. May be useful if a payment has - failed. - 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 used to create the Payment Session to - be deleted. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.deletePaymentSession(cart_id, 'manual') - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostCartsCartPaymentSessionUpdate - summary: Update a Payment Session - description: Updates a Payment Session with additional data. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: provider_id - required: true - description: The id of the payment provider. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.updatePaymentSession(cart_id, 'manual', { - data: { - } - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "data": {} - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - data - properties: - data: - type: object - description: The data to update the payment session with. - '/carts/{id}': - get: - operationId: GetCartsCart - summary: Get a Cart - description: Retrieves a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.retrieve(cart_id) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/carts/{id}' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostCartsCart - summary: Update a Cart - description: Updates a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - region_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. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Cart. - format: email - sales_channel_id: - type: string - description: The ID of the Sales channel to update the Cart with. - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address' - description: A full billing address object. - - type: string - description: The billing address ID - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address' - description: A full shipping address object. - - type: string - description: The shipping address ID - gift_cards: - description: An array of Gift Card codes to add to the Cart. - type: array - items: - required: - - code - 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: - required: - - code - 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 - example: - ip: '::1' - user_agent: Chrome - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.update(cart_id, { - email: 'user@example.com' - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "email": "user@example.com" - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/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 - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.refreshPaymentSession(cart_id, 'manual') - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/payment-session': - post: - operationId: PostCartsCartPaymentSession - summary: Select a Payment Session - description: >- - Selects a Payment Session as the session intended to be used towards the - completion of the Cart. - parameters: - - in: path - name: id - required: true - description: The ID of the Cart. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.setPaymentSession(cart_id, { - provider_id: 'manual' - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "provider_id": "manual" - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - '/gift-cards/{code}': - get: - operationId: GetGiftCardsCode - summary: Get 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 - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.giftCards.retrieve(code) - - .then(({ gift_card }) => { - console.log(gift_card.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/gift-cards/{code}' - tags: - - Gift Card - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - gift_card: - $ref: '#/components/schemas/gift_card' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' /customers/me/addresses: post: operationId: PostCustomersCustomerAddresses @@ -1608,22 +1439,7 @@ paths: content: application/json: schema: - type: object - required: - - address - properties: - address: - description: The Address to add to the Customer. - allOf: - - $ref: '#/components/schemas/address_fields' - - type: object - required: - - first_name - - last_name - - address_1 - - city - - country_code - - postal_code + $ref: '#/components/schemas/StorePostCustomersCustomerAddressesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1687,7 +1503,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -1709,30 +1525,7 @@ paths: content: application/json: schema: - type: object - required: - - first_name - - last_name - - email - - password - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - phone: - description: The Customer's phone number. - type: string + $ref: '#/components/schemas/StorePostCustomersReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1777,7 +1570,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '404': @@ -1857,7 +1650,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -1886,8 +1679,8 @@ paths: content: application/json: schema: - anyOf: - - $ref: '#/components/schemas/address_fields' + $ref: >- + #/components/schemas/StorePostCustomersCustomerAddressesAddressReq x-codeSamples: - lang: JavaScript label: JS Client @@ -1932,7 +1725,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -1989,7 +1782,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2011,33 +1804,7 @@ paths: content: application/json: schema: - type: object - 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_fields' - description: The full billing address object - - type: string - description: The ID of an existing billing address - password: - description: The Customer's password. - type: string - phone: - description: The Customer's phone number. - type: string - email: - description: The email of the customer. - type: string - metadata: - description: Metadata about the customer. - type: object + $ref: '#/components/schemas/StorePostCustomersCustomerReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2082,7 +1849,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2374,7 +2141,7 @@ paths: orders: type: array items: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' count: type: integer description: The total number of items available @@ -2408,14 +2175,7 @@ paths: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The email of the customer. - type: string - format: email + $ref: '#/components/schemas/StorePostCustomersCustomerPasswordTokenReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2475,23 +2235,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - password - - token - properties: - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - token: - description: The reset password token - type: string + $ref: '#/components/schemas/StorePostCustomersResetPasswordReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2534,7 +2278,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2547,163 +2291,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/batch/authorize': - post: - operationId: PostPaymentCollectionsSessionsBatchAuthorize - summary: Authorize Payment Sessions of a Payment Collection - description: Authorizes Payment Sessions of a Payment Collection. - x-authenticated: false - parameters: - - in: path - name: id - required: true - description: The ID of the Payment Collections. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - session_ids: - description: List of Payment Session IDs to authorize. - type: array - items: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.paymentCollections.authorize(payment_id) - - .then(({ payment_collection }) => { - console.log(payment_collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Payment - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - payment_collection: - $ref: '#/components/schemas/payment_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/{session_id}/authorize': - post: - operationId: PostPaymentCollectionsSessionsSessionAuthorize - summary: Authorize a Payment Session of a Payment Collection - description: Authorizes a Payment Session of a Payment Collection. - x-authenticated: false - parameters: - - in: path - name: id - required: true - description: The ID of the Payment Collections. - schema: - type: string - - in: path - name: session_id - required: true - description: The ID of the Payment Session. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.paymentCollections.authorize(payment_id, session_id) - - .then(({ payment_collection }) => { - console.log(payment_collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Payment - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - payment_session: - $ref: '#/components/schemas/payment_session' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/payment-collections/{id}': + '/gift-cards/{code}': get: - operationId: GetPaymentCollectionsPaymentCollection - summary: Retrieve an PaymentCollection - description: Retrieves a PaymentCollection. - x-authenticated: false + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unqiue code. parameters: - in: path - name: id + name: code required: true - description: The ID of the PaymentCollection. - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. + description: The unique Gift Card code. schema: type: string x-codeSamples: @@ -2715,22 +2312,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged in or use api token + medusa.giftCards.retrieve(code) - medusa.paymentCollections.retrieve(paymentCollectionId) - .then(({ payment_collection }) => { - console.log(payment_collection.id) - }) + .then(({ gift_card }) => { + console.log(gift_card.id); + }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/store/payment-collections/{id}' - security: - - api_token: [] - - cookie_auth: [] + 'https://medusa-url.com/store/gift-cards/{code}' tags: - - PaymentCollection + - Gift Card responses: '200': description: OK @@ -2739,12 +2332,10 @@ paths: schema: type: object properties: - payment_collection: - $ref: '#/components/schemas/payment_collection' + gift_card: + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2753,45 +2344,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/batch': + '/order-edits/{id}/complete': post: - operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch - summary: Manage Multiple Payment Sessions from Payment Collections - description: Manages Multiple Payment Sessions from Payment Collections. - x-authenticated: false + operationId: PostOrderEditsOrderEditComplete + summary: Completes an OrderEdit + description: Completes an OrderEdit. parameters: - in: path name: id required: true - description: The ID of the Payment Collections. + description: The ID of the Order Edit. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - sessions: - description: >- - An array of payment sessions related to the Payment - Collection. If the session_id is not provided, existing - sessions not present will be deleted and the provided ones - will be created. - type: array - items: - required: - - provider_id - - amount - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - amount: - type: integer - description: The amount . - session_id: - type: string - description: The ID of the Payment Session to be updated. x-codeSamples: - lang: JavaScript label: JS Client @@ -2801,204 +2365,17 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged in or use api token - - // Total amount = 10000 - - // Adding two new sessions - - medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ - { - provider_id: "stripe", - amount: 5000, - }, - { - provider_id: "manual", - amount: 5000, - }, - ]) - - .then(({ payment_collection }) => { - console.log(payment_collection.id); - }); - - // Updating one session and removing the other - - medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ - { - provider_id: "stripe", - amount: 10000, - session_id: "ps_123456" - }, - ]) - - .then(({ payment_collection }) => { - console.log(payment_collection.id); - }); + medusa.orderEdits.complete(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' - security: - - api_token: [] - - cookie_auth: [] + 'https://medusa-url.com/store/order-edits/{id}/complete' tags: - - Payment - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - payment_collection: - $ref: '#/components/schemas/payment_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions': - post: - operationId: PostPaymentCollectionsSessions - summary: Manage Payment Sessions from Payment Collections - description: Manages Payment Sessions from Payment Collections. - x-authenticated: false - parameters: - - in: path - name: id - required: true - description: The ID of the Payment Collection. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - // Total amount = 10000 - - // Adding a payment session - - medusa.paymentCollections.managePaymentSession(payment_id, { - provider_id: "stripe" }) - - .then(({ payment_collection }) => { - console.log(payment_collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Payment - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - payment_collection: - $ref: '#/components/schemas/payment_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/{session_id}': - post: - operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession - summary: Refresh a Payment Session - description: >- - Refreshes a Payment Session to ensure that it is in sync with the - Payment Collection. - x-authenticated: false - parameters: - - in: path - name: id - required: true - description: The id of the PaymentCollection. - schema: - type: string - - in: path - name: session_id - required: true - description: The id of the Payment Session to be refreshed. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - - customer_id - properties: - provider_id: - description: The Payment Provider id. - type: string - customer_id: - description: The Customer id. - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.paymentCollections.refreshPaymentSession(payment_collection_id, - session_id, payload) - - .then(({ payment_session }) => { - console.log(payment_session.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' - tags: - - PaymentCollection + - OrderEdit responses: '200': description: OK @@ -3007,10 +2384,118 @@ paths: schema: type: object properties: - payment_session: - $ref: '#/components/schemas/payment_session' + order_edit: + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/decline': + post: + operationId: PostOrderEditsOrderEditDecline + summary: Decline an OrderEdit + description: Declines an OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostOrderEditsOrderEditDecline' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orderEdits.decline(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id); + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/order-edits/{id}/decline' + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}': + get: + operationId: GetOrderEditsOrderEdit + summary: Retrieve an OrderEdit + description: Retrieves a OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orderEdits.retrieve(order_edit_id) + + .then(({ order_edit }) => { + console.log(order_edit.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/order-edits/{id}' + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -3030,12 +2515,7 @@ paths: content: application/json: schema: - required: - - token - properties: - token: - description: The invite token provided by the admin. - type: string + $ref: '#/components/schemas/StorePostCustomersCustomerAcceptClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3133,7 +2613,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -3186,7 +2666,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -3262,7 +2742,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -3284,14 +2764,7 @@ paths: content: application/json: schema: - required: - - order_ids - properties: - order_ids: - description: The ids of the orders to claim - type: array - items: - type: string + $ref: '#/components/schemas/StorePostCustomersCustomerOrderClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3345,77 +2818,25 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/complete': + '/payment-collections/{id}/sessions/batch/authorize': post: - operationId: PostOrderEditsOrderEditComplete - summary: Completes an OrderEdit - description: Completes an OrderEdit. + operationId: PostPaymentCollectionsSessionsBatchAuthorize + summary: Authorize Payment Sessions of a Payment Collection + description: Authorizes Payment Sessions of a Payment Collection. + x-authenticated: false parameters: - in: path name: id required: true - description: The ID of the Order Edit. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.orderEdits.complete(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/order-edits/{id}/complete' - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '500': - $ref: '#/components/responses/500_error' - '/order-edits/{id}/decline': - post: - operationId: PostOrderEditsOrderEditDecline - summary: Decline an OrderEdit - description: Declines an OrderEdit. - parameters: - - in: path - name: id - required: true - description: The ID of the OrderEdit. + description: The ID of the Payment Collections. schema: type: string requestBody: content: application/json: schema: - type: object - properties: - declined_reason: - type: string - description: The reason for declining the OrderEdit. + $ref: >- + #/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq x-codeSamples: - lang: JavaScript label: JS Client @@ -3425,45 +2846,61 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdits.decline(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id); - }) + // must be previously logged in or use api token + + medusa.paymentCollections.authorize(payment_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/store/order-edits/{id}/decline' + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' + security: + - api_token: [] + - cookie_auth: [] tags: - - OrderEdit + - Payment responses: '200': description: OK content: application/json: schema: - type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + payment_collection: + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}': - get: - operationId: GetOrderEditsOrderEdit - summary: Retrieve an OrderEdit - description: Retrieves a OrderEdit. + '/payment-collections/{id}/sessions/{session_id}/authorize': + post: + operationId: PostPaymentCollectionsSessionsSessionAuthorize + summary: Authorize a Payment Session of a Payment Collection + description: Authorizes a Payment Session of a Payment Collection. + x-authenticated: false parameters: - in: path name: id required: true - description: The ID of the OrderEdit. + description: The ID of the Payment Collections. + schema: + type: string + - in: path + name: session_id + required: true + description: The ID of the Payment Session. schema: type: string x-codeSamples: @@ -3475,18 +2912,92 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdits.retrieve(order_edit_id) + // must be previously logged in or use api token - .then(({ order_edit }) => { - console.log(order_edit.id); + medusa.paymentCollections.authorize(payment_id, session_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/order-edits/{id}' + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' + security: + - api_token: [] + - cookie_auth: [] tags: - - OrderEdit + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_session: + $ref: '#/components/schemas/PaymentSession' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}': + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/payment-collections/{id}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection responses: '200': description: OK @@ -3495,8 +3006,8 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + payment_collection: + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -3509,6 +3020,231 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/batch': + post: + operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch + summary: Manage Multiple Payment Sessions from Payment Collections + description: Manages Multiple Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostPaymentCollectionsBatchSessionsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding two new sessions + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 5000, + }, + { + provider_id: "manual", + amount: 5000, + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + + // Updating one session and removing the other + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 10000, + session_id: "ps_123456" + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions': + post: + operationId: PostPaymentCollectionsSessions + summary: Manage Payment Sessions from Payment Collections + description: Manages Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionSessionsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding a payment session + + medusa.paymentCollections.managePaymentSession(payment_id, { + provider_id: "stripe" }) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/{session_id}': + post: + operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the + Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The id of the PaymentCollection. + schema: + type: string + - in: path + name: session_id + required: true + description: The id of the Payment Session to be refreshed. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.paymentCollections.refreshPaymentSession(payment_collection_id, + session_id) + + .then(({ payment_session }) => { + console.log(payment_session.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_session: + $ref: '#/components/schemas/PaymentSession' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /product-types: get: operationId: GetProductTypes @@ -3642,7 +3378,7 @@ paths: type: object properties: product_types: - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' count: type: integer description: The total number of items available @@ -3731,16 +3467,16 @@ paths: properties: product: allOf: - - $ref: '#/components/schemas/product' + - $ref: '#/components/schemas/Product' - type: object properties: variants: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' + - $ref: '#/components/schemas/ProductVariant' - $ref: >- - #/components/schemas/product_variant_prices_fields + #/components/schemas/ProductVariantPricesFields '400': $ref: '#/components/responses/400_error' '404': @@ -3901,6 +3637,11 @@ paths: the result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -3934,16 +3675,16 @@ paths: type: array items: allOf: - - $ref: '#/components/schemas/product' + - $ref: '#/components/schemas/Product' - type: object properties: variants: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' + - $ref: '#/components/schemas/ProductVariant' - $ref: >- - #/components/schemas/product_variant_prices_fields + #/components/schemas/ProductVariantPricesFields count: type: integer description: The total number of items available @@ -4075,7 +3816,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '404': @@ -4179,7 +3920,7 @@ paths: regions: type: array items: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '404': @@ -4232,7 +3973,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '404': @@ -4280,7 +4021,7 @@ paths: return_reasons: type: array items: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '404': @@ -4300,48 +4041,7 @@ paths: content: application/json: schema: - type: object - required: - - order_id - - items - 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: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item from the Order. - type: string - quantity: - description: The quantity to return. - type: integer - reason_id: - description: The ID of the return reason. - type: string - note: - description: A note to add to the item returned. - type: string - 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 - required: - - option_id - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. + $ref: '#/components/schemas/StorePostReturnsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4392,7 +4092,7 @@ paths: type: object properties: return: - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' '400': $ref: '#/components/responses/400_error' '404': @@ -4458,7 +4158,7 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '404': @@ -4513,7 +4213,7 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '404': @@ -4535,54 +4235,7 @@ paths: content: application/json: schema: - type: object - required: - - order_id - - return_items - - additional_items - properties: - order_id: - type: string - description: The ID of the Order to create the Swap for. - return_items: - 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. - type: string - quantity: - description: The quantity to swap. - type: integer - reason_id: - description: The ID of the reason of this return. - type: string - note: - description: The note to add to the item being swapped. - type: string - return_shipping_option: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - additional_items: - 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. - type: string - quantity: - description: The quantity to send of the variant. - type: integer + $ref: '#/components/schemas/StorePostSwapsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4645,7 +4298,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '404': @@ -4698,7 +4351,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '404': @@ -4759,8 +4412,8 @@ paths: properties: variant: allOf: - - $ref: '#/components/schemas/product_variant' - - $ref: '#/components/schemas/product_variant_prices_fields' + - $ref: '#/components/schemas/ProductVariant' + - $ref: '#/components/schemas/ProductVariantPricesFields' '400': $ref: '#/components/responses/400_error' '404': @@ -4858,8 +4511,8 @@ paths: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' - - $ref: '#/components/schemas/product_variant_prices_fields' + - $ref: '#/components/schemas/ProductVariant' + - $ref: '#/components/schemas/ProductVariantPricesFields' '400': $ref: '#/components/responses/400_error' '404': @@ -4924,7 +4577,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -4964,7 +4617,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: An unknown error occurred. @@ -4974,7 +4627,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: >- @@ -4986,7 +4639,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: invalid_request_error message: Discount with code TEST already exists. @@ -4996,7 +4649,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: message: Entity with id 1 was not found type: not_found @@ -5006,21 +4659,21 @@ components: application/json: schema: oneOf: - - $ref: '#/components/schemas/error' - - $ref: '#/components/schemas/multiple_errors' + - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/MultipleErrors' examples: not_allowed: $ref: '#/components/examples/not_allowed_error' invalid_data: $ref: '#/components/examples/invalid_data_error' - multiple_errors: + MultipleErrors: $ref: '#/components/examples/multiple_errors' 500_error: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' examples: database: $ref: '#/components/examples/database_error' @@ -5158,10 +4811,9 @@ components: Where `{sid}` is the value of `connect.sid` that you copied. schemas: - address_fields: + AddressFields: title: Address Fields description: Address fields used when creating/updating an address. - x-resourceId: address type: object properties: company: @@ -5213,10 +4865,9 @@ components: description: An optional key-value map with additional details example: car: white - address: + Address: title: Address description: An address. - x-resourceId: address type: object properties: id: @@ -5297,10 +4948,9 @@ components: description: An optional key-value map with additional details example: car: white - batch_job: + BatchJob: title: Batch Job description: A Batch Job. - x-resourceId: batch_job type: object required: - type @@ -5440,10 +5090,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - cart: + Cart: title: Cart description: Represents a user cart - x-resourceId: cart type: object properties: id: @@ -5460,19 +5109,19 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' region_id: type: string description: The region's ID @@ -5501,24 +5150,24 @@ components: type: object payment_session: description: The selected payment session in the cart. - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' type: type: string description: The cart's type. @@ -5618,10 +5267,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - claim_image: + ClaimImage: title: Claim Image description: Represents photo documentation of a claim. - x-resourceId: claim_image type: object required: - claim_item_id @@ -5660,12 +5308,11 @@ components: description: An optional key-value map with additional details example: car: white - claim_item: + ClaimItem: title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. - x-resourceId: claim_item type: object required: - claim_order_id @@ -5682,7 +5329,7 @@ components: type: array description: Available if the relation `images` is expanded. items: - $ref: '#/components/schemas/claim_image' + $ref: '#/components/schemas/ClaimImage' claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -5697,7 +5344,7 @@ components: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. type: string @@ -5729,7 +5376,7 @@ components: relation 'tags' is expanded. type: array items: - $ref: '#/components/schemas/claim_tag' + $ref: '#/components/schemas/ClaimTag' created_at: type: string description: The date with timezone at which the resource was created. @@ -5747,13 +5394,12 @@ components: description: An optional key-value map with additional details example: car: white - claim_order: + ClaimOrder: title: Claim Order description: >- Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. - x-resourceId: claim_order type: object required: - type @@ -5793,14 +5439,14 @@ components: description: The items that have been claimed type: array items: - $ref: '#/components/schemas/claim_item' + $ref: '#/components/schemas/ClaimItem' 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/LineItem' order_id: description: The ID of the order that the claim comes from. type: string @@ -5819,17 +5465,17 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $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/ShippingMethod' 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 @@ -5870,12 +5516,11 @@ components: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - claim_tag: + ClaimTag: title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. - x-resourceId: claim_tag type: object required: - value @@ -5905,10 +5550,9 @@ components: description: An optional key-value map with additional details example: car: white - country: + Country: title: Country description: Country details - x-resourceId: country type: object required: - iso_2 @@ -5960,10 +5604,9 @@ components: region: description: A region object. Available if the relation `region` is expanded. type: object - currency: + Currency: title: Currency description: Currency - x-resourceId: currency type: object required: - code @@ -5993,13 +5636,12 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean - custom_shipping_option: + CustomShippingOption: title: Custom Shipping Option description: >- Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option - x-resourceId: custom_shipping_option type: object required: - price @@ -6055,10 +5697,9 @@ components: [EXPERIMENTAL] Indicates if the custom shipping option price include tax type: boolean - customer_group: + CustomerGroup: title: Customer Group description: Represents a customer group - x-resourceId: customer_group type: object required: - name @@ -6085,7 +5726,7 @@ components: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' created_at: type: string description: The date with timezone at which the resource was created. @@ -6103,10 +5744,9 @@ components: description: An optional key-value map with additional details example: car: white - customer: + Customer: title: Customer description: Represents a customer - x-resourceId: customer type: object required: - email @@ -6133,12 +5773,12 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' phone: type: string description: The customer's phone number @@ -6159,7 +5799,7 @@ components: relation `groups` is expanded. type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' created_at: type: string description: The date with timezone at which the resource was created. @@ -6177,10 +5817,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_customer_group: + DiscountConditionCustomerGroup: title: Product Tag Discount Condition description: Associates a discount condition with a customer group - x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -6196,10 +5835,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6213,10 +5852,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_collection: + DiscountConditionProductCollection: title: Product Collection Discount Condition description: Associates a discount condition with a product collection - x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -6232,10 +5870,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6249,10 +5887,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_tag: + DiscountConditionProductTag: title: Product Tag Discount Condition description: Associates a discount condition with a product tag - x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -6268,10 +5905,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6285,10 +5922,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_type: + DiscountConditionProductType: title: Product Type Discount Condition description: Associates a discount condition with a product type - x-resourceId: discount_condition_product type: object required: - product_type_id @@ -6304,10 +5940,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6321,10 +5957,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product: + DiscountConditionProduct: title: Product Discount Condition description: Associates a discount condition with a product - x-resourceId: discount_condition_product type: object required: - product_id @@ -6340,10 +5975,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6357,10 +5992,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition: + DiscountCondition: title: Discount Condition description: Holds rule conditions for when a discount is applicable - x-resourceId: discount_condition type: object required: - type @@ -6392,7 +6026,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' products: description: >- products associated with this condition if type = products. @@ -6453,12 +6087,11 @@ components: description: An optional key-value map with additional details example: car: white - discount_rule: + DiscountRule: title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. - x-resourceId: discount_rule type: object required: - type @@ -6521,12 +6154,11 @@ components: description: An optional key-value map with additional details example: car: white - discount: + Discount: title: Discount description: >- Represents a discount that can be applied to a cart for promotional purposes. - x-resourceId: discount type: object required: - code @@ -6554,7 +6186,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -6569,7 +6201,7 @@ components: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. type: string @@ -6616,10 +6248,9 @@ components: description: An optional key-value map with additional details example: car: white - draft-order: + DraftOrder: title: DraftOrder description: Represents a draft order - x-resourceId: draft-order type: object properties: id: @@ -6689,12 +6320,11 @@ components: description: An optional key-value map with additional details example: car: white - fulfillment_item: + FulfillmentItem: title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. - x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -6716,17 +6346,16 @@ components: type: object item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer example: 1 - fulfillment_provider: + FulfillmentProvider: title: Fulfillment Provider description: >- Represents a fulfillment provider plugin and holds its installation status. - x-resourceId: fulfillment_provider type: object properties: id: @@ -6740,7 +6369,7 @@ components: to `false`. type: boolean example: true - fulfillment: + Fulfillment: title: Fulfillment description: >- Fulfillments are created once store operators can prepare the purchased @@ -6750,7 +6379,6 @@ components: partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. - x-resourceId: fulfillment type: object required: - provider_id @@ -6790,7 +6418,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' items: description: >- The Fulfillment Items in the Fulfillment - these hold information @@ -6798,7 +6426,7 @@ components: the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_item' + $ref: '#/components/schemas/FulfillmentItem' tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -6806,7 +6434,7 @@ components: Provider. Available if the relation `tracking_links` is expanded. type: array items: - $ref: '#/components/schemas/tracking_link' + $ref: '#/components/schemas/TrackingLink' tracking_numbers: deprecated: true description: >- @@ -6861,12 +6489,11 @@ components: description: An optional key-value map with additional details example: car: white - gift_card_transaction: + GiftCardTransaction: title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order - x-resourceId: gift_card_transaction type: object required: - gift_card_id @@ -6908,12 +6535,11 @@ components: description: The tax rate of the transaction type: number example: 0 - gift_card: + GiftCard: title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. - x-resourceId: gift_card type: object required: - code @@ -6963,6 +6589,10 @@ components: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. @@ -6980,12 +6610,11 @@ components: description: An optional key-value map with additional details example: car: white - idempotency_key: + IdempotencyKey: title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. - x-resourceId: idempotency_key type: object required: - idempotency_key @@ -7037,10 +6666,9 @@ components: type: string description: Where to continue from. default: started - image: + Image: title: Image description: Images holds a reference to a URL at which the image file can be found. - x-resourceId: image type: object required: - url @@ -7070,10 +6698,9 @@ components: description: An optional key-value map with additional details example: car: white - invite: + Invite: title: Invite description: Represents an invite - x-resourceId: invite type: object required: - user_email @@ -7122,10 +6749,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_adjustment: + LineItemAdjustment: title: Line Item Adjustment - description: Represents an Line Item Adjustment - x-resourceId: line_item_adjustment + description: Represents a Line Item Adjustment type: object required: - item_id @@ -7142,7 +6768,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' description: type: string description: The line item's adjustment description @@ -7153,7 +6779,7 @@ components: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' amount: type: number description: The adjustment amount @@ -7163,10 +6789,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_tax_line: + LineItemTaxLine: title: Line Item Tax Line - description: Represents an Line Item Tax Line - x-resourceId: line_item_tax_line + description: Represents a Line Item Tax Line type: object required: - item_id @@ -7183,7 +6808,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' code: description: A code to identify the tax type by type: string @@ -7209,7 +6834,7 @@ components: description: An optional key-value map with additional details example: car: white - line_item: + LineItem: title: Line Item description: >- Line Items represent purchasable units that can be added to a Cart for @@ -7217,7 +6842,6 @@ components: resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. - x-resourceId: line_item type: object required: - title @@ -7262,12 +6886,12 @@ components: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: '#/components/schemas/line_item_tax_line' + $ref: '#/components/schemas/LineItemTaxLine' adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: '#/components/schemas/line_item_adjustment' + $ref: '#/components/schemas/LineItemAdjustment' title: description: >- The title of the Line Item, this should be easily identifiable by @@ -7403,7 +7027,7 @@ components: description: An optional key-value map with additional details example: car: white - money_amount: + MoneyAmount: title: Money Amount description: >- Money Amounts represents an amount that a given Product Variant can be @@ -7412,7 +7036,6 @@ components: fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. - x-resourceId: money_amount type: object required: - currency_code @@ -7431,7 +7054,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to @@ -7456,7 +7079,7 @@ components: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' variant_id: description: The id of the Product Variant contained in the Line Item. type: string @@ -7490,13 +7113,12 @@ components: description: An optional key-value map with additional details example: car: white - note: + Note: title: Note description: >- Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. - x-resourceId: note type: object required: - value @@ -7525,7 +7147,7 @@ components: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' created_at: type: string description: The date with timezone at which the resource was created. @@ -7543,12 +7165,11 @@ components: description: An optional key-value map with additional details example: car: white - notification_provider: + NotificationProvider: title: Notification Provider description: >- Represents a notification provider plugin and holds its installation status. - x-resourceId: notification_provider type: object required: - id @@ -7564,14 +7185,13 @@ components: to `false`. type: boolean default: true - notification: + Notification: title: Notification description: >- Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. - x-resourceId: notification type: object required: - resource_type @@ -7620,14 +7240,14 @@ components: Notification. type: array items: - $ref: '#/components/schemas/notification_resend' + $ref: '#/components/schemas/NotificationResend' provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -7636,10 +7256,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - notification_resend: + NotificationResend: title: Notification Resend description: A resend of a Notification. - x-resourceId: notification_resend type: object properties: id: @@ -7684,14 +7303,14 @@ components: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -7703,7 +7322,6 @@ components: OAuth: title: OAuth description: Represent an OAuth app - x-resourceId: OAuth type: object required: - id @@ -7734,10 +7352,9 @@ components: type: object description: Any data necessary to the app. example: {} - order_edit: + OrderEdit: title: Order Edit description: Order edit keeps track of order items changes. - x-resourceId: order_edit type: object required: - order_id @@ -7755,12 +7372,12 @@ components: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: '#/components/schemas/order_item_change' + $ref: '#/components/schemas/OrderItemChange' internal_note: description: An optional note with additional details about the order edit. type: string @@ -7847,14 +7464,14 @@ components: type: array description: Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' created_at: type: string description: The date with timezone at which the resource was created. @@ -7863,10 +7480,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - order_item_change: + OrderItemChange: title: Order Item Change description: Represents an order edit item change - x-resourceId: order_item_change type: object required: - type @@ -7889,21 +7505,21 @@ components: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' created_at: type: string description: The date with timezone at which the resource was created. @@ -7921,10 +7537,9 @@ components: description: An optional key-value map with additional details example: car: white - order: + Order: title: Order description: Represents an order - x-resourceId: order type: object required: - customer_id @@ -8000,14 +7615,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' region_id: type: string description: The region's ID @@ -8024,7 +7639,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The order's tax rate type: number @@ -8051,21 +7666,21 @@ components: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' returns: type: array description: >- @@ -8113,21 +7728,21 @@ components: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: '#/components/schemas/gift_card_transaction' + $ref: '#/components/schemas/GiftCardTransaction' canceled_at: type: string description: The date the order was canceled on. @@ -8200,10 +7815,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - payment_collection: + PaymentCollection: title: Payment Collection description: Payment Collection - x-resourceId: payment_collection type: object required: - type @@ -8246,7 +7860,7 @@ components: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' currency_code: description: The 3 character ISO code for the currency. type: string @@ -8256,17 +7870,17 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' created_by: type: string description: The ID of the user that created the payment collection. @@ -8287,10 +7901,9 @@ components: description: An optional key-value map with additional details example: car: white - payment_provider: + PaymentProvider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. - x-resourceId: payment_provider type: object required: - id @@ -8306,7 +7919,7 @@ components: to `false`. type: boolean default: true - payment_session: + PaymentSession: title: Payment Session description: >- Payment Sessions are created when a Customer initilizes the checkout @@ -8315,7 +7928,6 @@ components: communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. - x-resourceId: payment_session type: object required: - cart_id @@ -8384,12 +7996,11 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - payment: + Payment: title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. - x-resourceId: payment type: object required: - amount @@ -8433,7 +8044,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount_refunded: description: >- The amount of the original Payment amount that has been refunded @@ -8482,12 +8093,11 @@ components: description: An optional key-value map with additional details example: car: white - price_list: + PriceList: title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. - x-resourceId: price_list type: object required: - name @@ -8544,8 +8154,8 @@ components: type: array items: oneOf: - - $ref: '#/components/schemas/money_amount' - - $ref: '#/components/schemas/customer_group' + - $ref: '#/components/schemas/MoneyAmount' + - $ref: '#/components/schemas/CustomerGroup' includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean @@ -8561,10 +8171,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - product_collection: + ProductCollection: title: Product Collection description: Product Collections represents a group of Products that are related. - x-resourceId: product_collection type: object required: - title @@ -8608,13 +8217,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option_value: + ProductOptionValue: title: Product Option Value description: >- A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. - x-resourceId: product_option_value type: object required: - value @@ -8640,7 +8248,7 @@ components: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variant_id: description: >- The ID of the Product Variant that the Product Option Value is @@ -8649,7 +8257,7 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' created_at: type: string description: The date with timezone at which the resource was created. @@ -8667,13 +8275,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option: + ProductOption: title: Product Option description: >- Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. - x-resourceId: product_option type: object required: - title @@ -8693,7 +8300,7 @@ components: Available if the relation `values` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' product_id: description: The ID of the Product that the Product Option is defined for. type: string @@ -8718,10 +8325,9 @@ components: description: An optional key-value map with additional details example: car: white - product_tag: + ProductTag: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. - x-resourceId: product_tag type: object required: - value @@ -8751,12 +8357,11 @@ components: description: An optional key-value map with additional details example: car: white - product_tax_rate: + ProductTaxRate: 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 type: object required: - product_id @@ -8768,14 +8373,14 @@ components: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -8789,12 +8394,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type_tax_rate: + ProductTypeTaxRate: 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 type: object required: - product_type_id @@ -8806,14 +8410,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' rate_id: description: The id of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -8827,12 +8431,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type: + ProductType: title: Product Type description: >- Product Type can be added to Products for filtering and reporting purposes. - x-resourceId: product_type type: object required: - value @@ -8862,14 +8465,13 @@ components: description: An optional key-value map with additional details example: car: white - product_variant: + ProductVariant: title: Product Variant description: >- Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. - x-resourceId: product_variant type: object required: - title @@ -8900,7 +8502,7 @@ components: Region. Available if the relation `prices` is expanded. type: array items: - $ref: '#/components/schemas/money_amount' + $ref: '#/components/schemas/MoneyAmount' sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -9002,7 +8604,7 @@ components: Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' created_at: type: string description: The date with timezone at which the resource was created. @@ -9020,10 +8622,9 @@ components: description: An optional key-value map with additional details example: car: white - product_variant_prices_fields: + ProductVariantPricesFields: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. - x-resourceId: product_variant_prices_fields type: object properties: original_price: @@ -9061,13 +8662,12 @@ components: code: type: string description: The code of the tax rate - product: + Product: title: Product description: >- Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. - x-resourceId: product type: object required: - title @@ -9118,7 +8718,7 @@ components: expanded. 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 @@ -9130,7 +8730,7 @@ components: Option Values. Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variants: description: >- The Product Variants that belong to the Product. Each will have a @@ -9138,7 +8738,7 @@ components: relation `variants` is expanded. type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -9148,7 +8748,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -9216,14 +8816,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' tags: description: >- The Product Tags assigned to the Product. Available if the relation `tags` is expanded. type: array items: - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discountable: description: >- Whether the Product can be discounted. Discounts will not apply to @@ -9259,10 +8859,9 @@ components: description: An optional key-value map with additional details example: car: white - publishable_api_key_sales_channel: + PublishableApiKeySalesChannel: title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels - x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: @@ -9273,12 +8872,11 @@ components: type: string description: The publishable API key's ID example: pak_01G1G5V21KADXNGH29BJMAJ4B4 - publishable_api_key: + PublishableApiKey: title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. - x-resourceId: publishable_api_key type: object properties: id: @@ -9315,13 +8913,12 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - refund: + Refund: title: Refund description: >- Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. - x-resourceId: refund type: object required: - order_id @@ -9381,14 +8978,13 @@ components: description: An optional key-value map with additional details example: car: white - region: + Region: title: Region description: >- Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. - x-resourceId: region type: object required: - name @@ -9414,7 +9010,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -9425,7 +9021,7 @@ components: relation `tax_rates` is expanded. type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' tax_code: description: >- The tax code used on purchases in the Region. This may be used by @@ -9446,28 +9042,28 @@ components: relation `countries` is expanded. type: array items: - $ref: '#/components/schemas/country' + $ref: '#/components/schemas/Country' tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: '#/components/schemas/tax_provider' + $ref: '#/components/schemas/TaxProvider' payment_providers: description: >- The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/payment_provider' + $ref: '#/components/schemas/PaymentProvider' fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean @@ -9488,12 +9084,11 @@ components: description: An optional key-value map with additional details example: car: white - return_item: + ReturnItem: title: Return Item description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. - x-resourceId: return_item type: object required: - return_id @@ -9505,14 +9100,14 @@ components: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -9537,7 +9132,7 @@ components: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' note: description: An optional note with additional details about the Return. type: string @@ -9547,12 +9142,11 @@ components: description: An optional key-value map with additional details example: car: white - return_reason: + ReturnReason: title: Return Reason description: >- A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. - x-resourceId: return_reason type: object required: - value @@ -9580,10 +9174,10 @@ components: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' created_at: type: string description: The date with timezone at which the resource was created. @@ -9601,13 +9195,12 @@ components: description: An optional key-value map with additional details example: car: white - return: + Return: title: Return description: >- Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. - x-resourceId: return type: object required: - refund_amount @@ -9631,7 +9224,7 @@ components: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/return_item' + $ref: '#/components/schemas/ReturnItem' swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -9662,7 +9255,7 @@ components: Available if the relation `shipping_method` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -9705,10 +9298,9 @@ components: description: An optional key-value map with additional details example: car: white - sales_channel: + SalesChannel: title: Sales Channel description: A Sales Channel - x-resourceId: sales_channel type: object required: - name @@ -9741,10 +9333,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_method_tax_line: + ShippingMethodTaxLine: title: Shipping Method Tax Line description: Shipping Method Tax Line - x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -9761,7 +9352,7 @@ components: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' code: description: A code to identify the tax type by type: string @@ -9787,14 +9378,13 @@ components: description: An optional key-value map with additional details example: car: white - shipping_method: + ShippingMethod: title: Shipping Method description: >- Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. - x-resourceId: shipping_method type: object required: - shipping_option_id @@ -9812,7 +9402,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -9856,7 +9446,7 @@ components: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: '#/components/schemas/shipping_method_tax_line' + $ref: '#/components/schemas/ShippingMethodTaxLine' price: description: >- The amount to charge for the Shipping Method. The currency of the @@ -9874,12 +9464,11 @@ components: includes_tax: description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' type: boolean - shipping_option_requirement: + ShippingOptionRequirement: title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. - x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -9898,7 +9487,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' type: description: >- The type of the requirement, this defines how the value will be @@ -9919,7 +9508,7 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_option: + ShippingOption: title: Shipping Option description: >- Shipping Options represent a way in which an Order or Return can be @@ -9928,7 +9517,6 @@ components: Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. - x-resourceId: shipping_option type: object required: - name @@ -9963,7 +9551,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -9972,7 +9560,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' price_type: description: >- The type of pricing calculation that is used when creatin Shipping @@ -10003,7 +9591,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option_requirement' + $ref: '#/components/schemas/ShippingOptionRequirement' data: description: >- The data needed for the Fulfillment Provider to identify the @@ -10030,12 +9618,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_profile: + ShippingProfile: title: Shipping Profile description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. - x-resourceId: shipping_profile type: object required: - name @@ -10076,7 +9663,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' created_at: type: string description: The date with timezone at which the resource was created. @@ -10094,12 +9681,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_tax_rate: + ShippingTaxRate: 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 type: object required: - shipping_option_id @@ -10111,14 +9697,14 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -10132,10 +9718,9 @@ components: description: An optional key-value map with additional details example: car: white - staged_job: + StagedJob: title: Staged Job description: A staged job resource - x-resourceId: staged_job type: object required: - event_name @@ -10152,10 +9737,9 @@ components: description: Data necessary for the job type: object example: {} - store: + Store: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' - x-resourceId: store type: object properties: id: @@ -10175,14 +9759,14 @@ components: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' currencies: description: >- The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. 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 @@ -10213,7 +9797,7 @@ components: description: An optional key-value map with additional details example: car: white - swap: + Swap: title: Swap description: >- Swaps can be created when a Customer wishes to exchange Products that @@ -10223,7 +9807,6 @@ components: for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. - x-resourceId: swap type: object required: - fulfillment_status @@ -10275,7 +9858,7 @@ components: relation `additional_items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' return_order: description: >- A return order object. The Return that is issued for the return part @@ -10287,13 +9870,13 @@ components: relation `fulfillments` is expanded. 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. Available if the relation `payment` is expanded. - $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 @@ -10309,14 +9892,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_methods: description: >- The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string @@ -10368,10 +9951,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_line: + TaxLine: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. - x-resourceId: tax_line type: object required: - rate @@ -10406,10 +9988,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_provider: + TaxProvider: title: Tax Provider description: The tax service used to calculate taxes - x-resourceId: tax_provider type: object properties: id: @@ -10423,12 +10004,11 @@ components: to `false`. type: boolean default: true - tax_rate: + TaxRate: 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 type: object required: - name @@ -10506,13 +10086,12 @@ components: description: An optional key-value map with additional details example: car: white - tracking_link: + TrackingLink: 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. - x-resourceId: tracking_link type: object required: - tracking_number @@ -10536,7 +10115,7 @@ components: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' idempotency_key: type: string description: >- @@ -10563,10 +10142,9 @@ components: description: An optional key-value map with additional details example: car: white - user: + User: title: User description: Represents a User who can manage store settings. - x-resourceId: user type: object required: - email @@ -10608,24 +10186,22 @@ components: description: An optional key-value map with additional details example: car: white - multiple_errors: + MultipleErrors: title: Multiple Errors - x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' message: type: string default: >- Provided request body contains errors. Please check the data and retry the request - error: + Error: title: Response Error - x-resourceId: error type: object properties: code: @@ -10637,3 +10213,363 @@ components: type: type: string description: A slug indicating the type of the error. + StorePostCartReq: + type: object + properties: + region_id: + type: string + description: The ID of the Region to create the Cart in. + sales_channel_id: + type: string + description: '[EXPERIMENTAL] The ID of the Sales channel to create the Cart in.' + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + items: + description: >- + An optional array of `variant_id`, `quantity` pairs to generate Line + Items from. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The id of the Product Variant to generate a Line Item from. + type: string + quantity: + description: The quantity of the Product Variant to add + type: integer + context: + description: >- + An optional object to provide context to the Cart. The `context` + field is automatically populated with `ip` and `user_agent` + type: object + example: + ip: '::1' + user_agent: Chrome + StorePostCartsCartReq: + type: object + properties: + region_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. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + email: + type: string + description: An email to be used on the Cart. + format: email + sales_channel_id: + type: string + description: The ID of the Sales channel to update the Cart with. + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/Address' + description: A full billing address object. + - type: string + description: The billing address ID + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/Address' + description: A full shipping address object. + - type: string + description: The shipping address ID + gift_cards: + description: An array of Gift Card codes to add to the Cart. + type: array + items: + required: + - code + 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: + required: + - code + 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 + example: + ip: '::1' + user_agent: Chrome + StorePostCustomersCustomerAddressesReq: + type: object + required: + - address + properties: + address: + description: The Address to add to the Customer. + allOf: + - $ref: '#/components/schemas/AddressFields' + - type: object + required: + - first_name + - last_name + - address_1 + - city + - country_code + - postal_code + StorePostCustomersReq: + type: object + required: + - first_name + - last_name + - email + - password + properties: + first_name: + description: The Customer's first name. + type: string + last_name: + description: The Customer's last name. + type: string + email: + description: The email of the customer. + type: string + format: email + password: + description: The Customer's password. + type: string + format: password + phone: + description: The Customer's phone number. + type: string + StorePostCustomersCustomerPasswordTokenReq: + type: object + required: + - email + properties: + email: + description: The email of the customer. + type: string + format: email + StorePostCustomersResetPasswordReq: + type: object + required: + - email + - password + - token + properties: + email: + description: The email of the customer. + type: string + format: email + password: + description: The Customer's password. + type: string + format: password + token: + description: The reset password token + type: string + StorePostCustomersCustomerAddressesAddressReq: + anyOf: + - $ref: '#/components/schemas/AddressFields' + StorePostCustomersCustomerReq: + type: object + 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/AddressFields' + description: The full billing address object + - type: string + description: The ID of an existing billing address + password: + description: The Customer's password. + type: string + phone: + description: The Customer's phone number. + type: string + email: + description: The email of the customer. + type: string + metadata: + description: Metadata about the customer. + type: object + StorePostOrderEditsOrderEditDecline: + type: object + properties: + declined_reason: + type: string + description: The reason for declining the OrderEdit. + StorePostCustomersCustomerAcceptClaimReq: + type: object + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + StorePostCustomersCustomerOrderClaimReq: + type: object + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string + StorePostPaymentCollectionsBatchSessionsAuthorizeReq: + type: object + required: + - session_ids + properties: + session_ids: + description: List of Payment Session IDs to authorize. + type: array + items: + type: string + StorePostPaymentCollectionsBatchSessionsReq: + type: object + required: + - sessions + properties: + sessions: + description: >- + An array of payment sessions related to the Payment Collection. If + the session_id is not provided, existing sessions not present will + be deleted and the provided ones will be created. + type: array + items: + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. + StorePaymentCollectionSessionsReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + StorePostReturnsReq: + type: object + required: + - order_id + - items + 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: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item from the Order. + type: string + quantity: + description: The quantity to return. + type: integer + reason_id: + description: The ID of the return reason. + type: string + note: + description: A note to add to the item returned. + type: string + 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 + required: + - option_id + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + StorePostSwapsReq: + type: object + required: + - order_id + - return_items + - additional_items + properties: + order_id: + type: string + description: The ID of the Order to create the Swap for. + return_items: + 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. + type: string + quantity: + description: The quantity to swap. + type: integer + reason_id: + description: The ID of the reason of this return. + type: string + note: + description: The note to add to the item being swapped. + type: string + return_shipping_option: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + additional_items: + 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. + type: string + quantity: + description: The quantity to send of the variant. + type: integer diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined index f160bb1dda..8dfeeb183e 100644 --- a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined @@ -1,6 +1,6 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) -medusa.paymentCollections.refreshPaymentSession(payment_collection_id, session_id, payload) +medusa.paymentCollections.refreshPaymentSession(payment_collection_id, session_id) .then(({ payment_session }) => { console.log(payment_session.id); }); diff --git a/docs/api/store/components/responses/400_error.yaml b/docs/api/store/components/responses/400_error.yaml index 95f25b376b..b960f05fb4 100644 --- a/docs/api/store/components/responses/400_error.yaml +++ b/docs/api/store/components/responses/400_error.yaml @@ -3,12 +3,12 @@ content: application/json: schema: oneOf: - - $ref: ../schemas/error.yaml - - $ref: ../schemas/multiple_errors.yaml + - $ref: ../schemas/Error.yaml + - $ref: ../schemas/MultipleErrors.yaml examples: not_allowed: $ref: ../examples/not_allowed_error.yaml invalid_data: $ref: ../examples/invalid_data_error.yaml - multiple_errors: + MultipleErrors: $ref: ../examples/multiple_errors.yaml diff --git a/docs/api/store/components/responses/500_error.yaml b/docs/api/store/components/responses/500_error.yaml index ecb2e70917..5da1a171e5 100644 --- a/docs/api/store/components/responses/500_error.yaml +++ b/docs/api/store/components/responses/500_error.yaml @@ -2,7 +2,7 @@ description: Server Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml examples: database: $ref: ../examples/database_error.yaml diff --git a/docs/api/store/components/responses/default_error.yaml b/docs/api/store/components/responses/default_error.yaml index b7d6911d9d..5591502a6c 100644 --- a/docs/api/store/components/responses/default_error.yaml +++ b/docs/api/store/components/responses/default_error.yaml @@ -2,7 +2,7 @@ description: Default Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: unknown_error message: An unknown error occurred. diff --git a/docs/api/store/components/responses/invalid_request_error.yaml b/docs/api/store/components/responses/invalid_request_error.yaml index 4050c5fc89..c70a32b01f 100644 --- a/docs/api/store/components/responses/invalid_request_error.yaml +++ b/docs/api/store/components/responses/invalid_request_error.yaml @@ -2,7 +2,7 @@ description: Invalid Request Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: invalid_request_error message: Discount with code TEST already exists. diff --git a/docs/api/store/components/responses/invalid_state_error.yaml b/docs/api/store/components/responses/invalid_state_error.yaml index fbbf916749..479206bab5 100644 --- a/docs/api/store/components/responses/invalid_state_error.yaml +++ b/docs/api/store/components/responses/invalid_state_error.yaml @@ -2,7 +2,7 @@ description: Invalid State Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: unknown_error message: >- diff --git a/docs/api/store/components/responses/not_found_error.yaml b/docs/api/store/components/responses/not_found_error.yaml index 667ae355c0..c6fea98d05 100644 --- a/docs/api/store/components/responses/not_found_error.yaml +++ b/docs/api/store/components/responses/not_found_error.yaml @@ -2,7 +2,7 @@ description: Not Found Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: message: Entity with id 1 was not found type: not_found diff --git a/docs/api/store/components/schemas/address.yaml b/docs/api/store/components/schemas/Address.yaml similarity index 98% rename from docs/api/store/components/schemas/address.yaml rename to docs/api/store/components/schemas/Address.yaml index d39d1760ae..a69d410311 100644 --- a/docs/api/store/components/schemas/address.yaml +++ b/docs/api/store/components/schemas/Address.yaml @@ -1,6 +1,5 @@ title: Address description: An address. -x-resourceId: address type: object properties: id: diff --git a/docs/api/store/components/schemas/address_fields.yaml b/docs/api/store/components/schemas/AddressFields.yaml similarity index 98% rename from docs/api/store/components/schemas/address_fields.yaml rename to docs/api/store/components/schemas/AddressFields.yaml index 303b9d5ca9..6e4c4d6358 100644 --- a/docs/api/store/components/schemas/address_fields.yaml +++ b/docs/api/store/components/schemas/AddressFields.yaml @@ -1,6 +1,5 @@ title: Address Fields description: Address fields used when creating/updating an address. -x-resourceId: address type: object properties: company: diff --git a/docs/api/admin/components/schemas/batch_job.yaml b/docs/api/store/components/schemas/BatchJob.yaml similarity index 99% rename from docs/api/admin/components/schemas/batch_job.yaml rename to docs/api/store/components/schemas/BatchJob.yaml index c06c261ba5..92a81b4576 100644 --- a/docs/api/admin/components/schemas/batch_job.yaml +++ b/docs/api/store/components/schemas/BatchJob.yaml @@ -1,6 +1,5 @@ title: Batch Job description: A Batch Job. -x-resourceId: batch_job type: object required: - type diff --git a/docs/api/admin/components/schemas/cart.yaml b/docs/api/store/components/schemas/Cart.yaml similarity index 95% rename from docs/api/admin/components/schemas/cart.yaml rename to docs/api/store/components/schemas/Cart.yaml index de1d520a2d..aef4b274ff 100644 --- a/docs/api/admin/components/schemas/cart.yaml +++ b/docs/api/store/components/schemas/Cart.yaml @@ -1,6 +1,5 @@ title: Cart description: Represents a user cart -x-resourceId: cart type: object properties: id: @@ -17,19 +16,19 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml items: description: Available if the relation `items` is expanded. type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml region_id: type: string description: The region's ID @@ -58,24 +57,24 @@ properties: type: object payment_session: description: The selected payment session in the cart. - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: ./payment.yaml + $ref: ./Payment.yaml shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml type: type: string description: The cart's type. diff --git a/docs/api/store/components/schemas/claim_image.yaml b/docs/api/store/components/schemas/ClaimImage.yaml similarity index 97% rename from docs/api/store/components/schemas/claim_image.yaml rename to docs/api/store/components/schemas/ClaimImage.yaml index 783d89c06d..721cfcf6a5 100644 --- a/docs/api/store/components/schemas/claim_image.yaml +++ b/docs/api/store/components/schemas/ClaimImage.yaml @@ -1,6 +1,5 @@ title: Claim Image description: Represents photo documentation of a claim. -x-resourceId: claim_image type: object required: - claim_item_id diff --git a/docs/api/admin/components/schemas/claim_item.yaml b/docs/api/store/components/schemas/ClaimItem.yaml similarity index 95% rename from docs/api/admin/components/schemas/claim_item.yaml rename to docs/api/store/components/schemas/ClaimItem.yaml index cb7e85c9dd..6fc251960c 100644 --- a/docs/api/admin/components/schemas/claim_item.yaml +++ b/docs/api/store/components/schemas/ClaimItem.yaml @@ -2,7 +2,6 @@ title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. -x-resourceId: claim_item type: object required: - claim_order_id @@ -19,7 +18,7 @@ properties: type: array description: Available if the relation `images` is expanded. items: - $ref: ./claim_image.yaml + $ref: ./ClaimImage.yaml claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -32,7 +31,7 @@ properties: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml variant_id: description: The ID of the product variant that is claimed. type: string @@ -64,7 +63,7 @@ properties: relation 'tags' is expanded. type: array items: - $ref: ./claim_tag.yaml + $ref: ./ClaimTag.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/claim_order.yaml b/docs/api/store/components/schemas/ClaimOrder.yaml similarity index 95% rename from docs/api/admin/components/schemas/claim_order.yaml rename to docs/api/store/components/schemas/ClaimOrder.yaml index ed55db009d..561dbec67d 100644 --- a/docs/api/admin/components/schemas/claim_order.yaml +++ b/docs/api/store/components/schemas/ClaimOrder.yaml @@ -3,7 +3,6 @@ description: >- Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. -x-resourceId: claim_order type: object required: - type @@ -43,14 +42,14 @@ properties: description: The items that have been claimed type: array items: - $ref: ./claim_item.yaml + $ref: ./ClaimItem.yaml additional_items: description: >- Refers to the new items to be shipped when the claim order has the type `replace` type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml order_id: description: The ID of the order that the claim comes from. type: string @@ -69,17 +68,17 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer diff --git a/docs/api/admin/components/schemas/claim_tag.yaml b/docs/api/store/components/schemas/ClaimTag.yaml similarity index 97% rename from docs/api/admin/components/schemas/claim_tag.yaml rename to docs/api/store/components/schemas/ClaimTag.yaml index 46a23e4da8..bf557fcc6d 100644 --- a/docs/api/admin/components/schemas/claim_tag.yaml +++ b/docs/api/store/components/schemas/ClaimTag.yaml @@ -2,7 +2,6 @@ title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. -x-resourceId: claim_tag type: object required: - value diff --git a/docs/api/admin/components/schemas/country.yaml b/docs/api/store/components/schemas/Country.yaml similarity index 98% rename from docs/api/admin/components/schemas/country.yaml rename to docs/api/store/components/schemas/Country.yaml index d8a7a18e36..c28bb31871 100644 --- a/docs/api/admin/components/schemas/country.yaml +++ b/docs/api/store/components/schemas/Country.yaml @@ -1,6 +1,5 @@ title: Country description: Country details -x-resourceId: country type: object required: - iso_2 diff --git a/docs/api/store/components/schemas/currency.yaml b/docs/api/store/components/schemas/Currency.yaml similarity index 97% rename from docs/api/store/components/schemas/currency.yaml rename to docs/api/store/components/schemas/Currency.yaml index be164ffa9e..c553448ec2 100644 --- a/docs/api/store/components/schemas/currency.yaml +++ b/docs/api/store/components/schemas/Currency.yaml @@ -1,6 +1,5 @@ title: Currency description: Currency -x-resourceId: currency type: object required: - code diff --git a/docs/api/store/components/schemas/custom_shipping_option.yaml b/docs/api/store/components/schemas/CustomShippingOption.yaml similarity index 97% rename from docs/api/store/components/schemas/custom_shipping_option.yaml rename to docs/api/store/components/schemas/CustomShippingOption.yaml index 40ff8c8229..619df289c4 100644 --- a/docs/api/store/components/schemas/custom_shipping_option.yaml +++ b/docs/api/store/components/schemas/CustomShippingOption.yaml @@ -3,7 +3,6 @@ description: >- Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option -x-resourceId: custom_shipping_option type: object required: - price diff --git a/docs/api/admin/components/schemas/customer.yaml b/docs/api/store/components/schemas/Customer.yaml similarity index 94% rename from docs/api/admin/components/schemas/customer.yaml rename to docs/api/store/components/schemas/Customer.yaml index aa0e83a77c..9c91270354 100644 --- a/docs/api/admin/components/schemas/customer.yaml +++ b/docs/api/store/components/schemas/Customer.yaml @@ -1,6 +1,5 @@ title: Customer description: Represents a customer -x-resourceId: customer type: object required: - email @@ -27,12 +26,12 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: ./address.yaml + $ref: ./Address.yaml phone: type: string description: The customer's phone number @@ -53,7 +52,7 @@ properties: `groups` is expanded. type: array items: - $ref: ./customer_group.yaml + $ref: ./CustomerGroup.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/customer_group.yaml b/docs/api/store/components/schemas/CustomerGroup.yaml similarity index 95% rename from docs/api/admin/components/schemas/customer_group.yaml rename to docs/api/store/components/schemas/CustomerGroup.yaml index 0d4769c7ad..69e2edfe7c 100644 --- a/docs/api/admin/components/schemas/customer_group.yaml +++ b/docs/api/store/components/schemas/CustomerGroup.yaml @@ -1,6 +1,5 @@ title: Customer Group description: Represents a customer group -x-resourceId: customer_group type: object required: - name @@ -27,7 +26,7 @@ properties: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: ./price_list.yaml + $ref: ./PriceList.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount.yaml b/docs/api/store/components/schemas/Discount.yaml similarity index 97% rename from docs/api/admin/components/schemas/discount.yaml rename to docs/api/store/components/schemas/Discount.yaml index 1950a503cb..72c9365c95 100644 --- a/docs/api/admin/components/schemas/discount.yaml +++ b/docs/api/store/components/schemas/Discount.yaml @@ -1,6 +1,5 @@ title: Discount description: Represents a discount that can be applied to a cart for promotional purposes. -x-resourceId: discount type: object required: - code @@ -28,7 +27,7 @@ properties: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: ./discount_rule.yaml + $ref: ./DiscountRule.yaml is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -43,7 +42,7 @@ properties: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: ./discount.yaml + $ref: ./Discount.yaml starts_at: description: The time at which the discount can be used. type: string diff --git a/docs/api/admin/components/schemas/discount_condition.yaml b/docs/api/store/components/schemas/DiscountCondition.yaml similarity index 97% rename from docs/api/admin/components/schemas/discount_condition.yaml rename to docs/api/store/components/schemas/DiscountCondition.yaml index 794e839eb3..40f5247a38 100644 --- a/docs/api/admin/components/schemas/discount_condition.yaml +++ b/docs/api/store/components/schemas/DiscountCondition.yaml @@ -1,6 +1,5 @@ title: Discount Condition description: Holds rule conditions for when a discount is applicable -x-resourceId: discount_condition type: object required: - type @@ -32,7 +31,7 @@ properties: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: ./discount_rule.yaml + $ref: ./DiscountRule.yaml products: description: >- products associated with this condition if type = products. Available if diff --git a/docs/api/store/components/schemas/discount_condition_customer_group.yaml b/docs/api/store/components/schemas/DiscountConditionCustomerGroup.yaml similarity index 89% rename from docs/api/store/components/schemas/discount_condition_customer_group.yaml rename to docs/api/store/components/schemas/DiscountConditionCustomerGroup.yaml index 51867349ad..143c2c2a50 100644 --- a/docs/api/store/components/schemas/discount_condition_customer_group.yaml +++ b/docs/api/store/components/schemas/DiscountConditionCustomerGroup.yaml @@ -1,6 +1,5 @@ title: Product Tag Discount Condition description: Associates a discount condition with a customer group -x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: ./customer_group.yaml + $ref: ./CustomerGroup.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount_condition_product.yaml b/docs/api/store/components/schemas/DiscountConditionProduct.yaml similarity index 90% rename from docs/api/store/components/schemas/discount_condition_product.yaml rename to docs/api/store/components/schemas/DiscountConditionProduct.yaml index b88eac53c2..ca1540fcbb 100644 --- a/docs/api/store/components/schemas/discount_condition_product.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProduct.yaml @@ -1,6 +1,5 @@ title: Product Discount Condition description: Associates a discount condition with a product -x-resourceId: discount_condition_product type: object required: - product_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: ./product.yaml + $ref: ./Product.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount_condition_product_collection.yaml b/docs/api/store/components/schemas/DiscountConditionProductCollection.yaml similarity index 89% rename from docs/api/admin/components/schemas/discount_condition_product_collection.yaml rename to docs/api/store/components/schemas/DiscountConditionProductCollection.yaml index bc0065ef9f..49e19e9590 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_collection.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProductCollection.yaml @@ -1,6 +1,5 @@ title: Product Collection Discount Condition description: Associates a discount condition with a product collection -x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: ./product_collection.yaml + $ref: ./ProductCollection.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount_condition_product_tag.yaml b/docs/api/store/components/schemas/DiscountConditionProductTag.yaml similarity index 90% rename from docs/api/admin/components/schemas/discount_condition_product_tag.yaml rename to docs/api/store/components/schemas/DiscountConditionProductTag.yaml index d3ba121f43..3b7c0738f0 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_tag.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProductTag.yaml @@ -1,6 +1,5 @@ title: Product Tag Discount Condition description: Associates a discount condition with a product tag -x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: ./product_tag.yaml + $ref: ./ProductTag.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount_condition_product_type.yaml b/docs/api/store/components/schemas/DiscountConditionProductType.yaml similarity index 90% rename from docs/api/store/components/schemas/discount_condition_product_type.yaml rename to docs/api/store/components/schemas/DiscountConditionProductType.yaml index 03a6393c44..471000a1e7 100644 --- a/docs/api/store/components/schemas/discount_condition_product_type.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProductType.yaml @@ -1,6 +1,5 @@ title: Product Type Discount Condition description: Associates a discount condition with a product type -x-resourceId: discount_condition_product type: object required: - product_type_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount_rule.yaml b/docs/api/store/components/schemas/DiscountRule.yaml similarity index 98% rename from docs/api/admin/components/schemas/discount_rule.yaml rename to docs/api/store/components/schemas/DiscountRule.yaml index ab6ab1a80e..1a6ec45afb 100644 --- a/docs/api/admin/components/schemas/discount_rule.yaml +++ b/docs/api/store/components/schemas/DiscountRule.yaml @@ -2,7 +2,6 @@ title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. -x-resourceId: discount_rule type: object required: - type diff --git a/docs/api/admin/components/schemas/draft-order.yaml b/docs/api/store/components/schemas/DraftOrder.yaml similarity index 98% rename from docs/api/admin/components/schemas/draft-order.yaml rename to docs/api/store/components/schemas/DraftOrder.yaml index 1c96c22bc7..5e18ec0f8f 100644 --- a/docs/api/admin/components/schemas/draft-order.yaml +++ b/docs/api/store/components/schemas/DraftOrder.yaml @@ -1,6 +1,5 @@ title: DraftOrder description: Represents a draft order -x-resourceId: draft-order type: object properties: id: diff --git a/docs/api/store/components/schemas/error.yaml b/docs/api/store/components/schemas/Error.yaml similarity index 93% rename from docs/api/store/components/schemas/error.yaml rename to docs/api/store/components/schemas/Error.yaml index cad9495918..787671c4a4 100644 --- a/docs/api/store/components/schemas/error.yaml +++ b/docs/api/store/components/schemas/Error.yaml @@ -1,5 +1,4 @@ title: Response Error -x-resourceId: error type: object properties: code: diff --git a/docs/api/store/components/schemas/fulfillment.yaml b/docs/api/store/components/schemas/Fulfillment.yaml similarity index 96% rename from docs/api/store/components/schemas/fulfillment.yaml rename to docs/api/store/components/schemas/Fulfillment.yaml index d6ee5c6960..0c34d6607b 100644 --- a/docs/api/store/components/schemas/fulfillment.yaml +++ b/docs/api/store/components/schemas/Fulfillment.yaml @@ -7,7 +7,6 @@ description: >- plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. -x-resourceId: fulfillment type: object required: - provider_id @@ -45,7 +44,7 @@ properties: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml items: description: >- The Fulfillment Items in the Fulfillment - these hold information about @@ -53,7 +52,7 @@ properties: `items` is expanded. type: array items: - $ref: ./fulfillment_item.yaml + $ref: ./FulfillmentItem.yaml tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -61,7 +60,7 @@ properties: Available if the relation `tracking_links` is expanded. type: array items: - $ref: ./tracking_link.yaml + $ref: ./TrackingLink.yaml tracking_numbers: deprecated: true description: >- diff --git a/docs/api/admin/components/schemas/fulfillment_item.yaml b/docs/api/store/components/schemas/FulfillmentItem.yaml similarity index 93% rename from docs/api/admin/components/schemas/fulfillment_item.yaml rename to docs/api/store/components/schemas/FulfillmentItem.yaml index f233f45f68..8578f6a4d7 100644 --- a/docs/api/admin/components/schemas/fulfillment_item.yaml +++ b/docs/api/store/components/schemas/FulfillmentItem.yaml @@ -2,7 +2,6 @@ title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. -x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -22,7 +21,7 @@ properties: type: object item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer diff --git a/docs/api/admin/components/schemas/fulfillment_provider.yaml b/docs/api/store/components/schemas/FulfillmentProvider.yaml similarity index 93% rename from docs/api/admin/components/schemas/fulfillment_provider.yaml rename to docs/api/store/components/schemas/FulfillmentProvider.yaml index 584c933111..bbd8801420 100644 --- a/docs/api/admin/components/schemas/fulfillment_provider.yaml +++ b/docs/api/store/components/schemas/FulfillmentProvider.yaml @@ -1,6 +1,5 @@ title: Fulfillment Provider description: Represents a fulfillment provider plugin and holds its installation status. -x-resourceId: fulfillment_provider type: object properties: id: diff --git a/docs/api/store/components/schemas/gift_card.yaml b/docs/api/store/components/schemas/GiftCard.yaml similarity index 94% rename from docs/api/store/components/schemas/gift_card.yaml rename to docs/api/store/components/schemas/GiftCard.yaml index 054f93319f..d169d35e54 100644 --- a/docs/api/store/components/schemas/gift_card.yaml +++ b/docs/api/store/components/schemas/GiftCard.yaml @@ -2,7 +2,6 @@ title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. -x-resourceId: gift_card type: object required: - code @@ -52,6 +51,10 @@ properties: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/gift_card_transaction.yaml b/docs/api/store/components/schemas/GiftCardTransaction.yaml similarity index 97% rename from docs/api/store/components/schemas/gift_card_transaction.yaml rename to docs/api/store/components/schemas/GiftCardTransaction.yaml index fb16341851..df738aa63b 100644 --- a/docs/api/store/components/schemas/gift_card_transaction.yaml +++ b/docs/api/store/components/schemas/GiftCardTransaction.yaml @@ -2,7 +2,6 @@ title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order -x-resourceId: gift_card_transaction type: object required: - gift_card_id diff --git a/docs/api/admin/components/schemas/idempotency_key.yaml b/docs/api/store/components/schemas/IdempotencyKey.yaml similarity index 98% rename from docs/api/admin/components/schemas/idempotency_key.yaml rename to docs/api/store/components/schemas/IdempotencyKey.yaml index 9bff9c0f90..b496aadde3 100644 --- a/docs/api/admin/components/schemas/idempotency_key.yaml +++ b/docs/api/store/components/schemas/IdempotencyKey.yaml @@ -2,7 +2,6 @@ title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. -x-resourceId: idempotency_key type: object required: - idempotency_key diff --git a/docs/api/store/components/schemas/image.yaml b/docs/api/store/components/schemas/Image.yaml similarity index 97% rename from docs/api/store/components/schemas/image.yaml rename to docs/api/store/components/schemas/Image.yaml index 61bc475c32..5250816766 100644 --- a/docs/api/store/components/schemas/image.yaml +++ b/docs/api/store/components/schemas/Image.yaml @@ -1,6 +1,5 @@ title: Image description: Images holds a reference to a URL at which the image file can be found. -x-resourceId: image type: object required: - url diff --git a/docs/api/admin/components/schemas/invite.yaml b/docs/api/store/components/schemas/Invite.yaml similarity index 98% rename from docs/api/admin/components/schemas/invite.yaml rename to docs/api/store/components/schemas/Invite.yaml index aac3ce0b7f..9e16e818ea 100644 --- a/docs/api/admin/components/schemas/invite.yaml +++ b/docs/api/store/components/schemas/Invite.yaml @@ -1,6 +1,5 @@ title: Invite description: Represents an invite -x-resourceId: invite type: object required: - user_email diff --git a/docs/api/admin/components/schemas/line_item.yaml b/docs/api/store/components/schemas/LineItem.yaml similarity index 98% rename from docs/api/admin/components/schemas/line_item.yaml rename to docs/api/store/components/schemas/LineItem.yaml index ae9ed1eaa0..0e0c64de6f 100644 --- a/docs/api/admin/components/schemas/line_item.yaml +++ b/docs/api/store/components/schemas/LineItem.yaml @@ -4,7 +4,6 @@ description: >- 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. -x-resourceId: line_item type: object required: - title @@ -47,12 +46,12 @@ properties: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: ./line_item_tax_line.yaml + $ref: ./LineItemTaxLine.yaml adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: ./line_item_adjustment.yaml + $ref: ./LineItemAdjustment.yaml title: description: >- The title of the Line Item, this should be easily identifiable by the diff --git a/docs/api/store/components/schemas/line_item_adjustment.yaml b/docs/api/store/components/schemas/LineItemAdjustment.yaml similarity index 87% rename from docs/api/store/components/schemas/line_item_adjustment.yaml rename to docs/api/store/components/schemas/LineItemAdjustment.yaml index 677f69388a..28b41b9566 100644 --- a/docs/api/store/components/schemas/line_item_adjustment.yaml +++ b/docs/api/store/components/schemas/LineItemAdjustment.yaml @@ -1,6 +1,5 @@ title: Line Item Adjustment -description: Represents an Line Item Adjustment -x-resourceId: line_item_adjustment +description: Represents a Line Item Adjustment type: object required: - item_id @@ -17,7 +16,7 @@ properties: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml description: type: string description: The line item's adjustment description @@ -28,7 +27,7 @@ properties: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: ./discount.yaml + $ref: ./Discount.yaml amount: type: number description: The adjustment amount diff --git a/docs/api/store/components/schemas/line_item_tax_line.yaml b/docs/api/store/components/schemas/LineItemTaxLine.yaml similarity index 90% rename from docs/api/store/components/schemas/line_item_tax_line.yaml rename to docs/api/store/components/schemas/LineItemTaxLine.yaml index b149f62d42..2ee2e0a546 100644 --- a/docs/api/store/components/schemas/line_item_tax_line.yaml +++ b/docs/api/store/components/schemas/LineItemTaxLine.yaml @@ -1,6 +1,5 @@ title: Line Item Tax Line -description: Represents an Line Item Tax Line -x-resourceId: line_item_tax_line +description: Represents a Line Item Tax Line type: object required: - item_id @@ -17,7 +16,7 @@ properties: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml code: description: A code to identify the tax type by type: string diff --git a/docs/api/store/components/schemas/money_amount.yaml b/docs/api/store/components/schemas/MoneyAmount.yaml similarity index 97% rename from docs/api/store/components/schemas/money_amount.yaml rename to docs/api/store/components/schemas/MoneyAmount.yaml index 929194a759..223ddf5f44 100644 --- a/docs/api/store/components/schemas/money_amount.yaml +++ b/docs/api/store/components/schemas/MoneyAmount.yaml @@ -5,7 +5,6 @@ description: >- with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. -x-resourceId: money_amount type: object required: - currency_code @@ -24,7 +23,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to charge @@ -49,7 +48,7 @@ properties: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: ./price_list.yaml + $ref: ./PriceList.yaml variant_id: description: The id of the Product Variant contained in the Line Item. type: string diff --git a/docs/api/admin/components/schemas/multiple_errors.yaml b/docs/api/store/components/schemas/MultipleErrors.yaml similarity index 82% rename from docs/api/admin/components/schemas/multiple_errors.yaml rename to docs/api/store/components/schemas/MultipleErrors.yaml index 0327c94e70..7ca18cda3b 100644 --- a/docs/api/admin/components/schemas/multiple_errors.yaml +++ b/docs/api/store/components/schemas/MultipleErrors.yaml @@ -1,12 +1,11 @@ title: Multiple Errors -x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: ./error.yaml + $ref: ./Error.yaml message: type: string default: >- diff --git a/docs/api/admin/components/schemas/note.yaml b/docs/api/store/components/schemas/Note.yaml similarity index 97% rename from docs/api/admin/components/schemas/note.yaml rename to docs/api/store/components/schemas/Note.yaml index 16f1e9fe50..2decb4f715 100644 --- a/docs/api/admin/components/schemas/note.yaml +++ b/docs/api/store/components/schemas/Note.yaml @@ -2,7 +2,6 @@ title: Note description: >- Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. -x-resourceId: note type: object required: - value @@ -31,7 +30,7 @@ properties: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: ./user.yaml + $ref: ./User.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/notification.yaml b/docs/api/store/components/schemas/Notification.yaml similarity index 95% rename from docs/api/admin/components/schemas/notification.yaml rename to docs/api/store/components/schemas/Notification.yaml index 9db10fe27a..ddc77a9c73 100644 --- a/docs/api/admin/components/schemas/notification.yaml +++ b/docs/api/store/components/schemas/Notification.yaml @@ -4,7 +4,6 @@ description: >- to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. -x-resourceId: notification type: object required: - resource_type @@ -50,14 +49,14 @@ properties: description: The resends that have been completed after the original Notification. type: array items: - $ref: ./notification_resend.yaml + $ref: ./NotificationResend.yaml provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: ./notification_provider.yaml + $ref: ./NotificationProvider.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/notification_provider.yaml b/docs/api/store/components/schemas/NotificationProvider.yaml similarity index 93% rename from docs/api/store/components/schemas/notification_provider.yaml rename to docs/api/store/components/schemas/NotificationProvider.yaml index dacf80d189..fbc83c6837 100644 --- a/docs/api/store/components/schemas/notification_provider.yaml +++ b/docs/api/store/components/schemas/NotificationProvider.yaml @@ -1,6 +1,5 @@ title: Notification Provider description: Represents a notification provider plugin and holds its installation status. -x-resourceId: notification_provider type: object required: - id diff --git a/docs/api/admin/components/schemas/notification_resend.yaml b/docs/api/store/components/schemas/NotificationResend.yaml similarity index 95% rename from docs/api/admin/components/schemas/notification_resend.yaml rename to docs/api/store/components/schemas/NotificationResend.yaml index 2b15999aa6..cd88d291ae 100644 --- a/docs/api/admin/components/schemas/notification_resend.yaml +++ b/docs/api/store/components/schemas/NotificationResend.yaml @@ -1,6 +1,5 @@ title: Notification Resend description: A resend of a Notification. -x-resourceId: notification_resend type: object properties: id: @@ -44,14 +43,14 @@ properties: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: ./notification.yaml + $ref: ./Notification.yaml provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: ./notification_provider.yaml + $ref: ./NotificationProvider.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/OAuth.yaml b/docs/api/store/components/schemas/OAuth.yaml index 6b6cb8b660..9f22524f3e 100644 --- a/docs/api/store/components/schemas/OAuth.yaml +++ b/docs/api/store/components/schemas/OAuth.yaml @@ -1,6 +1,5 @@ title: OAuth description: Represent an OAuth app -x-resourceId: OAuth type: object required: - id diff --git a/docs/api/admin/components/schemas/order.yaml b/docs/api/store/components/schemas/Order.yaml similarity index 96% rename from docs/api/admin/components/schemas/order.yaml rename to docs/api/store/components/schemas/Order.yaml index 464edc17fb..fbc5185c9b 100644 --- a/docs/api/admin/components/schemas/order.yaml +++ b/docs/api/store/components/schemas/Order.yaml @@ -1,6 +1,5 @@ title: Order description: Represents an order -x-resourceId: order type: object required: - customer_id @@ -76,14 +75,14 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml region_id: type: string description: The region's ID @@ -100,7 +99,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml tax_rate: description: The order's tax rate type: number @@ -127,21 +126,21 @@ properties: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: ./payment.yaml + $ref: ./Payment.yaml fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml returns: type: array description: >- @@ -187,21 +186,21 @@ properties: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: ./order_edit.yaml + $ref: ./OrderEdit.yaml gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: ./gift_card_transaction.yaml + $ref: ./GiftCardTransaction.yaml canceled_at: type: string description: The date the order was canceled on. diff --git a/docs/api/store/components/schemas/order_edit.yaml b/docs/api/store/components/schemas/OrderEdit.yaml similarity index 95% rename from docs/api/store/components/schemas/order_edit.yaml rename to docs/api/store/components/schemas/OrderEdit.yaml index 5574c2b6f2..ea53ce0b14 100644 --- a/docs/api/store/components/schemas/order_edit.yaml +++ b/docs/api/store/components/schemas/OrderEdit.yaml @@ -1,6 +1,5 @@ title: Order Edit description: Order edit keeps track of order items changes. -x-resourceId: order_edit type: object required: - order_id @@ -18,12 +17,12 @@ properties: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: ./order.yaml + $ref: ./Order.yaml changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: ./order_item_change.yaml + $ref: ./OrderItemChange.yaml internal_note: description: An optional note with additional details about the order edit. type: string @@ -106,14 +105,14 @@ properties: type: array description: Available if the relation `items` is expanded. items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: ./payment_collection.yaml + $ref: ./PaymentCollection.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/order_item_change.yaml b/docs/api/store/components/schemas/OrderItemChange.yaml similarity index 93% rename from docs/api/admin/components/schemas/order_item_change.yaml rename to docs/api/store/components/schemas/OrderItemChange.yaml index 9bc3b3a826..49d0ecab5b 100644 --- a/docs/api/admin/components/schemas/order_item_change.yaml +++ b/docs/api/store/components/schemas/OrderItemChange.yaml @@ -1,6 +1,5 @@ title: Order Item Change description: Represents an order edit item change -x-resourceId: order_item_change type: object required: - type @@ -23,21 +22,21 @@ properties: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: ./order_edit.yaml + $ref: ./OrderEdit.yaml original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/payment.yaml b/docs/api/store/components/schemas/Payment.yaml similarity index 98% rename from docs/api/admin/components/schemas/payment.yaml rename to docs/api/store/components/schemas/Payment.yaml index 384e04b16c..d224dca6cf 100644 --- a/docs/api/admin/components/schemas/payment.yaml +++ b/docs/api/store/components/schemas/Payment.yaml @@ -2,7 +2,6 @@ title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. -x-resourceId: payment type: object required: - amount @@ -46,7 +45,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml amount_refunded: description: >- The amount of the original Payment amount that has been refunded back to diff --git a/docs/api/store/components/schemas/payment_collection.yaml b/docs/api/store/components/schemas/PaymentCollection.yaml similarity index 93% rename from docs/api/store/components/schemas/payment_collection.yaml rename to docs/api/store/components/schemas/PaymentCollection.yaml index 3f5663b39a..096abf613c 100644 --- a/docs/api/store/components/schemas/payment_collection.yaml +++ b/docs/api/store/components/schemas/PaymentCollection.yaml @@ -1,6 +1,5 @@ title: Payment Collection description: Payment Collection -x-resourceId: payment_collection type: object required: - type @@ -43,7 +42,7 @@ properties: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: ./region.yaml + $ref: ./Region.yaml currency_code: description: The 3 character ISO code for the currency. type: string @@ -53,17 +52,17 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: ./payment.yaml + $ref: ./Payment.yaml created_by: type: string description: The ID of the user that created the payment collection. diff --git a/docs/api/admin/components/schemas/payment_provider.yaml b/docs/api/store/components/schemas/PaymentProvider.yaml similarity index 94% rename from docs/api/admin/components/schemas/payment_provider.yaml rename to docs/api/store/components/schemas/PaymentProvider.yaml index 081a6b7462..57cf719a28 100644 --- a/docs/api/admin/components/schemas/payment_provider.yaml +++ b/docs/api/store/components/schemas/PaymentProvider.yaml @@ -1,6 +1,5 @@ title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. -x-resourceId: payment_provider type: object required: - id diff --git a/docs/api/store/components/schemas/payment_session.yaml b/docs/api/store/components/schemas/PaymentSession.yaml similarity index 98% rename from docs/api/store/components/schemas/payment_session.yaml rename to docs/api/store/components/schemas/PaymentSession.yaml index ca8c513a26..3d7e87862b 100644 --- a/docs/api/store/components/schemas/payment_session.yaml +++ b/docs/api/store/components/schemas/PaymentSession.yaml @@ -6,7 +6,6 @@ description: >- with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. -x-resourceId: payment_session type: object required: - cart_id diff --git a/docs/api/store/components/schemas/price_list.yaml b/docs/api/store/components/schemas/PriceList.yaml similarity index 95% rename from docs/api/store/components/schemas/price_list.yaml rename to docs/api/store/components/schemas/PriceList.yaml index b774028314..6c1fc7de25 100644 --- a/docs/api/store/components/schemas/price_list.yaml +++ b/docs/api/store/components/schemas/PriceList.yaml @@ -2,7 +2,6 @@ title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. -x-resourceId: price_list type: object required: - name @@ -57,8 +56,8 @@ properties: type: array items: oneOf: - - $ref: ./money_amount.yaml - - $ref: ./customer_group.yaml + - $ref: ./MoneyAmount.yaml + - $ref: ./CustomerGroup.yaml includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean diff --git a/docs/api/store/components/schemas/product.yaml b/docs/api/store/components/schemas/Product.yaml similarity index 96% rename from docs/api/store/components/schemas/product.yaml rename to docs/api/store/components/schemas/Product.yaml index e0116cc51d..5112dc072f 100644 --- a/docs/api/store/components/schemas/product.yaml +++ b/docs/api/store/components/schemas/Product.yaml @@ -3,7 +3,6 @@ description: >- Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. -x-resourceId: product type: object required: - title @@ -48,7 +47,7 @@ properties: description: Images of the Product. Available if the relation `images` is expanded. type: array items: - $ref: ./image.yaml + $ref: ./Image.yaml thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -60,7 +59,7 @@ properties: Available if the relation `options` is expanded. type: array items: - $ref: ./product_option.yaml + $ref: ./ProductOption.yaml variants: description: >- The Product Variants that belong to the Product. Each will have a unique @@ -68,7 +67,7 @@ properties: is expanded. type: array items: - $ref: ./product_variant.yaml + $ref: ./ProductVariant.yaml profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -78,7 +77,7 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: ./shipping_profile.yaml + $ref: ./ShippingProfile.yaml weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -144,14 +143,14 @@ properties: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml tags: description: >- The Product Tags assigned to the Product. Available if the relation `tags` is expanded. type: array items: - $ref: ./product_tag.yaml + $ref: ./ProductTag.yaml discountable: description: >- Whether the Product can be discounted. Discounts will not apply to Line diff --git a/docs/api/admin/components/schemas/product_collection.yaml b/docs/api/store/components/schemas/ProductCollection.yaml similarity index 97% rename from docs/api/admin/components/schemas/product_collection.yaml rename to docs/api/store/components/schemas/ProductCollection.yaml index a3fd98cefb..0f215f050c 100644 --- a/docs/api/admin/components/schemas/product_collection.yaml +++ b/docs/api/store/components/schemas/ProductCollection.yaml @@ -1,6 +1,5 @@ title: Product Collection description: Product Collections represents a group of Products that are related. -x-resourceId: product_collection type: object required: - title diff --git a/docs/api/store/components/schemas/product_option.yaml b/docs/api/store/components/schemas/ProductOption.yaml similarity index 95% rename from docs/api/store/components/schemas/product_option.yaml rename to docs/api/store/components/schemas/ProductOption.yaml index aaaf0d58c1..0179d34d93 100644 --- a/docs/api/store/components/schemas/product_option.yaml +++ b/docs/api/store/components/schemas/ProductOption.yaml @@ -3,7 +3,6 @@ description: >- Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. -x-resourceId: product_option type: object required: - title @@ -23,7 +22,7 @@ properties: Available if the relation `values` is expanded. type: array items: - $ref: ./product_option_value.yaml + $ref: ./ProductOptionValue.yaml product_id: description: The ID of the Product that the Product Option is defined for. type: string diff --git a/docs/api/admin/components/schemas/product_option_value.yaml b/docs/api/store/components/schemas/ProductOptionValue.yaml similarity index 94% rename from docs/api/admin/components/schemas/product_option_value.yaml rename to docs/api/store/components/schemas/ProductOptionValue.yaml index 407e69a536..467e538803 100644 --- a/docs/api/admin/components/schemas/product_option_value.yaml +++ b/docs/api/store/components/schemas/ProductOptionValue.yaml @@ -2,7 +2,6 @@ title: Product Option Value description: >- A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. -x-resourceId: product_option_value type: object required: - value @@ -26,7 +25,7 @@ properties: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: ./product_option.yaml + $ref: ./ProductOption.yaml variant_id: description: >- The ID of the Product Variant that the Product Option Value is defined @@ -35,7 +34,7 @@ properties: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: ./product_variant.yaml + $ref: ./ProductVariant.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/product_tag.yaml b/docs/api/store/components/schemas/ProductTag.yaml similarity index 97% rename from docs/api/admin/components/schemas/product_tag.yaml rename to docs/api/store/components/schemas/ProductTag.yaml index 8240386ddf..615174509c 100644 --- a/docs/api/admin/components/schemas/product_tag.yaml +++ b/docs/api/store/components/schemas/ProductTag.yaml @@ -1,6 +1,5 @@ title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. -x-resourceId: product_tag type: object required: - value diff --git a/docs/api/store/components/schemas/product_tax_rate.yaml b/docs/api/store/components/schemas/ProductTaxRate.yaml similarity index 92% rename from docs/api/store/components/schemas/product_tax_rate.yaml rename to docs/api/store/components/schemas/ProductTaxRate.yaml index db175e899d..a179b64cdd 100644 --- a/docs/api/store/components/schemas/product_tax_rate.yaml +++ b/docs/api/store/components/schemas/ProductTaxRate.yaml @@ -2,7 +2,6 @@ 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 type: object required: - product_id @@ -14,14 +13,14 @@ properties: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: ./product.yaml + $ref: ./Product.yaml rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/product_type.yaml b/docs/api/store/components/schemas/ProductType.yaml similarity index 97% rename from docs/api/store/components/schemas/product_type.yaml rename to docs/api/store/components/schemas/ProductType.yaml index b6e06d4190..88555b5bf4 100644 --- a/docs/api/store/components/schemas/product_type.yaml +++ b/docs/api/store/components/schemas/ProductType.yaml @@ -1,6 +1,5 @@ title: Product Type description: Product Type can be added to Products for filtering and reporting purposes. -x-resourceId: product_type type: object required: - value diff --git a/docs/api/store/components/schemas/product_type_tax_rate.yaml b/docs/api/store/components/schemas/ProductTypeTaxRate.yaml similarity index 91% rename from docs/api/store/components/schemas/product_type_tax_rate.yaml rename to docs/api/store/components/schemas/ProductTypeTaxRate.yaml index 48445a6b80..a11a7ba760 100644 --- a/docs/api/store/components/schemas/product_type_tax_rate.yaml +++ b/docs/api/store/components/schemas/ProductTypeTaxRate.yaml @@ -2,7 +2,6 @@ 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 type: object required: - product_type_id @@ -14,14 +13,14 @@ properties: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml rate_id: description: The id of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/product_variant.yaml b/docs/api/store/components/schemas/ProductVariant.yaml similarity index 97% rename from docs/api/admin/components/schemas/product_variant.yaml rename to docs/api/store/components/schemas/ProductVariant.yaml index a0cb2eacc9..3079f7bb14 100644 --- a/docs/api/admin/components/schemas/product_variant.yaml +++ b/docs/api/store/components/schemas/ProductVariant.yaml @@ -3,7 +3,6 @@ description: >- Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. -x-resourceId: product_variant type: object required: - title @@ -34,7 +33,7 @@ properties: Available if the relation `prices` is expanded. type: array items: - $ref: ./money_amount.yaml + $ref: ./MoneyAmount.yaml sku: description: >- The unique stock keeping unit used to identify the Product Variant. This @@ -130,7 +129,7 @@ properties: the relation `options` is expanded. type: array items: - $ref: ./product_option_value.yaml + $ref: ./ProductOptionValue.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/product_variant_prices_fields.yaml b/docs/api/store/components/schemas/ProductVariantPricesFields.yaml similarity index 96% rename from docs/api/store/components/schemas/product_variant_prices_fields.yaml rename to docs/api/store/components/schemas/ProductVariantPricesFields.yaml index aee4659828..3bece0c504 100644 --- a/docs/api/store/components/schemas/product_variant_prices_fields.yaml +++ b/docs/api/store/components/schemas/ProductVariantPricesFields.yaml @@ -1,6 +1,5 @@ title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. -x-resourceId: product_variant_prices_fields type: object properties: original_price: diff --git a/docs/api/store/components/schemas/publishable_api_key.yaml b/docs/api/store/components/schemas/PublishableApiKey.yaml similarity index 97% rename from docs/api/store/components/schemas/publishable_api_key.yaml rename to docs/api/store/components/schemas/PublishableApiKey.yaml index 061b34b8c8..38818bccaf 100644 --- a/docs/api/store/components/schemas/publishable_api_key.yaml +++ b/docs/api/store/components/schemas/PublishableApiKey.yaml @@ -2,7 +2,6 @@ title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. -x-resourceId: publishable_api_key type: object properties: id: diff --git a/docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml b/docs/api/store/components/schemas/PublishableApiKeySalesChannel.yaml similarity index 89% rename from docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml rename to docs/api/store/components/schemas/PublishableApiKeySalesChannel.yaml index d0ab55c29a..e2461daba5 100644 --- a/docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml +++ b/docs/api/store/components/schemas/PublishableApiKeySalesChannel.yaml @@ -1,6 +1,5 @@ title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels -x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: diff --git a/docs/api/store/components/schemas/refund.yaml b/docs/api/store/components/schemas/Refund.yaml similarity index 98% rename from docs/api/store/components/schemas/refund.yaml rename to docs/api/store/components/schemas/Refund.yaml index fae6a881f3..936eb3842c 100644 --- a/docs/api/store/components/schemas/refund.yaml +++ b/docs/api/store/components/schemas/Refund.yaml @@ -3,7 +3,6 @@ description: >- Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. -x-resourceId: refund type: object required: - order_id diff --git a/docs/api/store/components/schemas/region.yaml b/docs/api/store/components/schemas/Region.yaml similarity index 93% rename from docs/api/store/components/schemas/region.yaml rename to docs/api/store/components/schemas/Region.yaml index 15b245b470..89b86870dc 100644 --- a/docs/api/store/components/schemas/region.yaml +++ b/docs/api/store/components/schemas/Region.yaml @@ -4,7 +4,6 @@ description: >- The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. -x-resourceId: region type: object required: - name @@ -30,7 +29,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -41,7 +40,7 @@ properties: `tax_rates` is expanded. type: array items: - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml tax_code: description: >- The tax code used on purchases in the Region. This may be used by other @@ -62,28 +61,28 @@ properties: `countries` is expanded. type: array items: - $ref: ./country.yaml + $ref: ./Country.yaml tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: ./tax_provider.yaml + $ref: ./TaxProvider.yaml payment_providers: description: >- The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: ./payment_provider.yaml + $ref: ./PaymentProvider.yaml fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean diff --git a/docs/api/store/components/schemas/return.yaml b/docs/api/store/components/schemas/Return.yaml similarity index 97% rename from docs/api/store/components/schemas/return.yaml rename to docs/api/store/components/schemas/Return.yaml index 7ba545dcdc..406389b61d 100644 --- a/docs/api/store/components/schemas/return.yaml +++ b/docs/api/store/components/schemas/Return.yaml @@ -3,7 +3,6 @@ description: >- Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. -x-resourceId: return type: object required: - refund_amount @@ -27,7 +26,7 @@ properties: the relation `items` is expanded. type: array items: - $ref: ./return_item.yaml + $ref: ./ReturnItem.yaml swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -56,7 +55,7 @@ properties: the relation `shipping_method` is expanded. type: array items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml shipping_data: description: >- Data about the return shipment as provided by the Fulfilment Provider that diff --git a/docs/api/admin/components/schemas/return_item.yaml b/docs/api/store/components/schemas/ReturnItem.yaml similarity index 93% rename from docs/api/admin/components/schemas/return_item.yaml rename to docs/api/store/components/schemas/ReturnItem.yaml index 4ecc64bc8d..d56d8604a5 100644 --- a/docs/api/admin/components/schemas/return_item.yaml +++ b/docs/api/store/components/schemas/ReturnItem.yaml @@ -2,7 +2,6 @@ title: Return Item description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. -x-resourceId: return_item type: object required: - return_id @@ -14,14 +13,14 @@ properties: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: ./return.yaml + $ref: ./Return.yaml item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -46,7 +45,7 @@ properties: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml note: description: An optional note with additional details about the Return. type: string diff --git a/docs/api/admin/components/schemas/return_reason.yaml b/docs/api/store/components/schemas/ReturnReason.yaml similarity index 94% rename from docs/api/admin/components/schemas/return_reason.yaml rename to docs/api/store/components/schemas/ReturnReason.yaml index 2e4d4d83ef..ff9a50bf3f 100644 --- a/docs/api/admin/components/schemas/return_reason.yaml +++ b/docs/api/store/components/schemas/ReturnReason.yaml @@ -2,7 +2,6 @@ title: Return Reason description: >- A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. -x-resourceId: return_reason type: object required: - value @@ -30,10 +29,10 @@ properties: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/sales_channel.yaml b/docs/api/store/components/schemas/SalesChannel.yaml similarity index 97% rename from docs/api/admin/components/schemas/sales_channel.yaml rename to docs/api/store/components/schemas/SalesChannel.yaml index 7c4e1f2920..a79b3fd206 100644 --- a/docs/api/admin/components/schemas/sales_channel.yaml +++ b/docs/api/store/components/schemas/SalesChannel.yaml @@ -1,6 +1,5 @@ title: Sales Channel description: A Sales Channel -x-resourceId: sales_channel type: object required: - name diff --git a/docs/api/admin/components/schemas/shipping_method.yaml b/docs/api/store/components/schemas/ShippingMethod.yaml similarity index 96% rename from docs/api/admin/components/schemas/shipping_method.yaml rename to docs/api/store/components/schemas/ShippingMethod.yaml index 4ac18c8e93..9ac6b87cc6 100644 --- a/docs/api/admin/components/schemas/shipping_method.yaml +++ b/docs/api/store/components/schemas/ShippingMethod.yaml @@ -4,7 +4,6 @@ description: >- Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. -x-resourceId: shipping_method type: object required: - shipping_option_id @@ -20,7 +19,7 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -60,7 +59,7 @@ properties: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: ./shipping_method_tax_line.yaml + $ref: ./ShippingMethodTaxLine.yaml price: description: >- The amount to charge for the Shipping Method. The currency of the price is diff --git a/docs/api/store/components/schemas/shipping_method_tax_line.yaml b/docs/api/store/components/schemas/ShippingMethodTaxLine.yaml similarity index 94% rename from docs/api/store/components/schemas/shipping_method_tax_line.yaml rename to docs/api/store/components/schemas/ShippingMethodTaxLine.yaml index 3387bfbfe2..1089796789 100644 --- a/docs/api/store/components/schemas/shipping_method_tax_line.yaml +++ b/docs/api/store/components/schemas/ShippingMethodTaxLine.yaml @@ -1,6 +1,5 @@ title: Shipping Method Tax Line description: Shipping Method Tax Line -x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -17,7 +16,7 @@ properties: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml code: description: A code to identify the tax type by type: string diff --git a/docs/api/store/components/schemas/shipping_option.yaml b/docs/api/store/components/schemas/ShippingOption.yaml similarity index 95% rename from docs/api/store/components/schemas/shipping_option.yaml rename to docs/api/store/components/schemas/ShippingOption.yaml index a0e1c6538a..0efbef070c 100644 --- a/docs/api/store/components/schemas/shipping_option.yaml +++ b/docs/api/store/components/schemas/ShippingOption.yaml @@ -6,7 +6,6 @@ description: >- cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. -x-resourceId: shipping_option type: object required: - name @@ -41,7 +40,7 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: ./shipping_profile.yaml + $ref: ./ShippingProfile.yaml provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -50,7 +49,7 @@ properties: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml price_type: description: >- The type of pricing calculation that is used when creatin Shipping Methods @@ -78,7 +77,7 @@ properties: expanded. type: array items: - $ref: ./shipping_option_requirement.yaml + $ref: ./ShippingOptionRequirement.yaml data: description: >- The data needed for the Fulfillment Provider to identify the Shipping diff --git a/docs/api/admin/components/schemas/shipping_option_requirement.yaml b/docs/api/store/components/schemas/ShippingOptionRequirement.yaml similarity index 94% rename from docs/api/admin/components/schemas/shipping_option_requirement.yaml rename to docs/api/store/components/schemas/ShippingOptionRequirement.yaml index 57d9719312..bebafda0ea 100644 --- a/docs/api/admin/components/schemas/shipping_option_requirement.yaml +++ b/docs/api/store/components/schemas/ShippingOptionRequirement.yaml @@ -2,7 +2,6 @@ title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. -x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -21,7 +20,7 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml type: description: >- The type of the requirement, this defines how the value will be compared diff --git a/docs/api/admin/components/schemas/shipping_profile.yaml b/docs/api/store/components/schemas/ShippingProfile.yaml similarity index 96% rename from docs/api/admin/components/schemas/shipping_profile.yaml rename to docs/api/store/components/schemas/ShippingProfile.yaml index ba479ece92..0afd646078 100644 --- a/docs/api/admin/components/schemas/shipping_profile.yaml +++ b/docs/api/store/components/schemas/ShippingProfile.yaml @@ -2,7 +2,6 @@ title: Shipping Profile description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. -x-resourceId: shipping_profile type: object required: - name @@ -43,7 +42,7 @@ properties: expanded. type: array items: - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/shipping_tax_rate.yaml b/docs/api/store/components/schemas/ShippingTaxRate.yaml similarity index 91% rename from docs/api/admin/components/schemas/shipping_tax_rate.yaml rename to docs/api/store/components/schemas/ShippingTaxRate.yaml index 30058a09af..7ab7938fb0 100644 --- a/docs/api/admin/components/schemas/shipping_tax_rate.yaml +++ b/docs/api/store/components/schemas/ShippingTaxRate.yaml @@ -2,7 +2,6 @@ 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 type: object required: - shipping_option_id @@ -14,14 +13,14 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml rate_id: description: The ID of the Tax Rate type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/staged_job.yaml b/docs/api/store/components/schemas/StagedJob.yaml similarity index 93% rename from docs/api/store/components/schemas/staged_job.yaml rename to docs/api/store/components/schemas/StagedJob.yaml index 055ceaee0e..a31192dbdc 100644 --- a/docs/api/store/components/schemas/staged_job.yaml +++ b/docs/api/store/components/schemas/StagedJob.yaml @@ -1,6 +1,5 @@ title: Staged Job description: A staged job resource -x-resourceId: staged_job type: object required: - event_name diff --git a/docs/api/admin/components/schemas/store.yaml b/docs/api/store/components/schemas/Store.yaml similarity index 96% rename from docs/api/admin/components/schemas/store.yaml rename to docs/api/store/components/schemas/Store.yaml index 98b90e81f4..d96015e522 100644 --- a/docs/api/admin/components/schemas/store.yaml +++ b/docs/api/store/components/schemas/Store.yaml @@ -1,6 +1,5 @@ title: Store description: Holds settings for the Store, such as name, currencies, etc. -x-resourceId: store type: object properties: id: @@ -20,14 +19,14 @@ properties: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml currencies: description: >- The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. type: array items: - $ref: ./currency.yaml + $ref: ./Currency.yaml swap_link_template: description: >- A template to generate Swap links from. Use {{cart_id}} to include the diff --git a/docs/api/store/components/schemas/StorePaymentCollectionSessionsReq.yaml b/docs/api/store/components/schemas/StorePaymentCollectionSessionsReq.yaml new file mode 100644 index 0000000000..121bde5095 --- /dev/null +++ b/docs/api/store/components/schemas/StorePaymentCollectionSessionsReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - provider_id +properties: + provider_id: + type: string + description: The ID of the Payment Provider. diff --git a/docs/api/store/components/schemas/StorePostCartReq.yaml b/docs/api/store/components/schemas/StorePostCartReq.yaml new file mode 100644 index 0000000000..e403744a2b --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCartReq.yaml @@ -0,0 +1,39 @@ +type: object +properties: + region_id: + type: string + description: The ID of the Region to create the Cart in. + sales_channel_id: + type: string + description: '[EXPERIMENTAL] The ID of the Sales channel to create the Cart in.' + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + items: + description: >- + An optional array of `variant_id`, `quantity` pairs to generate Line Items + from. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The id of the Product Variant to generate a Line Item from. + type: string + quantity: + description: The quantity of the Product Variant to add + type: integer + context: + description: >- + An optional object to provide context to the Cart. The `context` field is + automatically populated with `ip` and `user_agent` + type: object + example: + ip: '::1' + user_agent: Chrome diff --git a/docs/api/store/components/schemas/StorePostCartsCartReq.yaml b/docs/api/store/components/schemas/StorePostCartsCartReq.yaml new file mode 100644 index 0000000000..1a3f876ecd --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCartsCartReq.yaml @@ -0,0 +1,62 @@ +type: object +properties: + region_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. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + email: + type: string + description: An email to be used on the Cart. + format: email + sales_channel_id: + type: string + description: The ID of the Sales channel to update the Cart with. + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: ./Address.yaml + description: A full billing address object. + - type: string + description: The billing address ID + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: ./Address.yaml + description: A full shipping address object. + - type: string + description: The shipping address ID + gift_cards: + description: An array of Gift Card codes to add to the Cart. + type: array + items: + required: + - code + 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: + required: + - code + 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 + example: + ip: '::1' + user_agent: Chrome diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerAcceptClaimReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerAcceptClaimReq.yaml new file mode 100644 index 0000000000..6bfeab6613 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerAcceptClaimReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - token +properties: + token: + description: The invite token provided by the admin. + type: string diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml new file mode 100644 index 0000000000..dffdfc21c3 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml @@ -0,0 +1,2 @@ +anyOf: + - $ref: ./AddressFields.yaml diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesReq.yaml new file mode 100644 index 0000000000..8f4dcf9c92 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesReq.yaml @@ -0,0 +1,16 @@ +type: object +required: + - address +properties: + address: + description: The Address to add to the Customer. + allOf: + - $ref: ./AddressFields.yaml + - type: object + required: + - first_name + - last_name + - address_1 + - city + - country_code + - postal_code diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerOrderClaimReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerOrderClaimReq.yaml new file mode 100644 index 0000000000..d9787d6b58 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerOrderClaimReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - order_ids +properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerPasswordTokenReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerPasswordTokenReq.yaml new file mode 100644 index 0000000000..fad16b2e72 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerPasswordTokenReq.yaml @@ -0,0 +1,8 @@ +type: object +required: + - email +properties: + email: + description: The email of the customer. + type: string + format: email diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerReq.yaml new file mode 100644 index 0000000000..1579b30340 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerReq.yaml @@ -0,0 +1,27 @@ +type: object +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: ./AddressFields.yaml + description: The full billing address object + - type: string + description: The ID of an existing billing address + password: + description: The Customer's password. + type: string + phone: + description: The Customer's phone number. + type: string + email: + description: The email of the customer. + type: string + metadata: + description: Metadata about the customer. + type: object diff --git a/docs/api/store/components/schemas/StorePostCustomersReq.yaml b/docs/api/store/components/schemas/StorePostCustomersReq.yaml new file mode 100644 index 0000000000..3504e00533 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersReq.yaml @@ -0,0 +1,24 @@ +type: object +required: + - first_name + - last_name + - email + - password +properties: + first_name: + description: The Customer's first name. + type: string + last_name: + description: The Customer's last name. + type: string + email: + description: The email of the customer. + type: string + format: email + password: + description: The Customer's password. + type: string + format: password + phone: + description: The Customer's phone number. + type: string diff --git a/docs/api/store/components/schemas/StorePostCustomersResetPasswordReq.yaml b/docs/api/store/components/schemas/StorePostCustomersResetPasswordReq.yaml new file mode 100644 index 0000000000..e41c6ff8b0 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersResetPasswordReq.yaml @@ -0,0 +1,17 @@ +type: object +required: + - email + - password + - token +properties: + email: + description: The email of the customer. + type: string + format: email + password: + description: The Customer's password. + type: string + format: password + token: + description: The reset password token + type: string diff --git a/docs/api/store/components/schemas/StorePostOrderEditsOrderEditDecline.yaml b/docs/api/store/components/schemas/StorePostOrderEditsOrderEditDecline.yaml new file mode 100644 index 0000000000..c6d23fec71 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostOrderEditsOrderEditDecline.yaml @@ -0,0 +1,5 @@ +type: object +properties: + declined_reason: + type: string + description: The reason for declining the OrderEdit. diff --git a/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq.yaml b/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq.yaml new file mode 100644 index 0000000000..fd8d3fa660 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - session_ids +properties: + session_ids: + description: List of Payment Session IDs to authorize. + type: array + items: + type: string diff --git a/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml b/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml new file mode 100644 index 0000000000..b7db27a304 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml @@ -0,0 +1,24 @@ +type: object +required: + - sessions +properties: + sessions: + description: >- + An array of payment sessions related to the Payment Collection. If the + session_id is not provided, existing sessions not present will be deleted + and the provided ones will be created. + type: array + items: + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. diff --git a/docs/api/store/components/schemas/StorePostReturnsReq.yaml b/docs/api/store/components/schemas/StorePostReturnsReq.yaml new file mode 100644 index 0000000000..fe17ff6931 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostReturnsReq.yaml @@ -0,0 +1,40 @@ +type: object +required: + - order_id + - items +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: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item from the Order. + type: string + quantity: + description: The quantity to return. + type: integer + reason_id: + description: The ID of the return reason. + type: string + note: + description: A note to add to the item returned. + type: string + 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 + required: + - option_id + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. diff --git a/docs/api/store/components/schemas/StorePostSwapsReq.yaml b/docs/api/store/components/schemas/StorePostSwapsReq.yaml new file mode 100644 index 0000000000..3a246b86e2 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostSwapsReq.yaml @@ -0,0 +1,46 @@ +type: object +required: + - order_id + - return_items + - additional_items +properties: + order_id: + type: string + description: The ID of the Order to create the Swap for. + return_items: + 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. + type: string + quantity: + description: The quantity to swap. + type: integer + reason_id: + description: The ID of the reason of this return. + type: string + note: + description: The note to add to the item being swapped. + type: string + return_shipping_option: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + additional_items: + 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. + type: string + quantity: + description: The quantity to send of the variant. + type: integer diff --git a/docs/api/store/components/schemas/swap.yaml b/docs/api/store/components/schemas/Swap.yaml similarity index 96% rename from docs/api/store/components/schemas/swap.yaml rename to docs/api/store/components/schemas/Swap.yaml index 31694ff199..d5a43a79d8 100644 --- a/docs/api/store/components/schemas/swap.yaml +++ b/docs/api/store/components/schemas/Swap.yaml @@ -7,7 +7,6 @@ description: >- the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. -x-resourceId: swap type: object required: - fulfillment_status @@ -57,7 +56,7 @@ properties: `additional_items` is expanded. type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml return_order: description: >- A return order object. The Return that is issued for the return part of @@ -69,13 +68,13 @@ properties: relation `fulfillments` is expanded. type: array items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. - $ref: ./payment.yaml + $ref: ./Payment.yaml difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May be @@ -91,14 +90,14 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_methods: description: >- The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. type: array items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string diff --git a/docs/api/admin/components/schemas/tax_line.yaml b/docs/api/store/components/schemas/TaxLine.yaml similarity index 97% rename from docs/api/admin/components/schemas/tax_line.yaml rename to docs/api/store/components/schemas/TaxLine.yaml index 3faaf02eb7..3300d86797 100644 --- a/docs/api/admin/components/schemas/tax_line.yaml +++ b/docs/api/store/components/schemas/TaxLine.yaml @@ -1,6 +1,5 @@ title: Tax Line description: Line item that specifies an amount of tax to add to a line item. -x-resourceId: tax_line type: object required: - rate diff --git a/docs/api/admin/components/schemas/tax_provider.yaml b/docs/api/store/components/schemas/TaxProvider.yaml similarity index 94% rename from docs/api/admin/components/schemas/tax_provider.yaml rename to docs/api/store/components/schemas/TaxProvider.yaml index 7f53c424a5..dc2b7ef07e 100644 --- a/docs/api/admin/components/schemas/tax_provider.yaml +++ b/docs/api/store/components/schemas/TaxProvider.yaml @@ -1,6 +1,5 @@ title: Tax Provider description: The tax service used to calculate taxes -x-resourceId: tax_provider type: object properties: id: diff --git a/docs/api/admin/components/schemas/tax_rate.yaml b/docs/api/store/components/schemas/TaxRate.yaml similarity index 98% rename from docs/api/admin/components/schemas/tax_rate.yaml rename to docs/api/store/components/schemas/TaxRate.yaml index cbe718652e..48ff10fd0c 100644 --- a/docs/api/admin/components/schemas/tax_rate.yaml +++ b/docs/api/store/components/schemas/TaxRate.yaml @@ -2,7 +2,6 @@ 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 type: object required: - name diff --git a/docs/api/admin/components/schemas/tracking_link.yaml b/docs/api/store/components/schemas/TrackingLink.yaml similarity index 96% rename from docs/api/admin/components/schemas/tracking_link.yaml rename to docs/api/store/components/schemas/TrackingLink.yaml index 25867d8a97..85a7f696e7 100644 --- a/docs/api/admin/components/schemas/tracking_link.yaml +++ b/docs/api/store/components/schemas/TrackingLink.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: tracking_link type: object required: - tracking_number @@ -27,7 +26,7 @@ properties: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml idempotency_key: type: string description: >- diff --git a/docs/api/store/components/schemas/user.yaml b/docs/api/store/components/schemas/User.yaml similarity index 98% rename from docs/api/store/components/schemas/user.yaml rename to docs/api/store/components/schemas/User.yaml index 042cd46cb2..c35e299a8f 100644 --- a/docs/api/store/components/schemas/user.yaml +++ b/docs/api/store/components/schemas/User.yaml @@ -1,6 +1,5 @@ title: User description: Represents a User who can manage store settings. -x-resourceId: user type: object required: - email diff --git a/docs/api/store/openapi.yaml b/docs/api/store/openapi.yaml index 791c72fb6a..4b57d62e00 100644 --- a/docs/api/store/openapi.yaml +++ b/docs/api/store/openapi.yaml @@ -108,40 +108,28 @@ tags: sessions. - name: Cart description: Cart endpoints that allow handling carts in Medusa. - x-resourceId: cart - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap servers: - url: https://api.medusa-commerce.com/store paths: @@ -149,10 +137,6 @@ paths: $ref: paths/auth.yaml /auth/{email}: $ref: paths/auth_{email}.yaml - /collections/{id}: - $ref: paths/collections_{id}.yaml - /collections: - $ref: paths/collections.yaml /carts/{id}/shipping-methods: $ref: paths/carts_{id}_shipping-methods.yaml /carts/{id}/taxes: @@ -175,8 +159,10 @@ paths: $ref: paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml /carts/{id}/payment-session: $ref: paths/carts_{id}_payment-session.yaml - /gift-cards/{code}: - $ref: paths/gift-cards_{code}.yaml + /collections/{id}: + $ref: paths/collections_{id}.yaml + /collections: + $ref: paths/collections.yaml /customers/me/addresses: $ref: paths/customers_me_addresses.yaml /customers: @@ -193,6 +179,24 @@ paths: $ref: paths/customers_password-token.yaml /customers/password-reset: $ref: paths/customers_password-reset.yaml + /gift-cards/{code}: + $ref: paths/gift-cards_{code}.yaml + /order-edits/{id}/complete: + $ref: paths/order-edits_{id}_complete.yaml + /order-edits/{id}/decline: + $ref: paths/order-edits_{id}_decline.yaml + /order-edits/{id}: + $ref: paths/order-edits_{id}.yaml + /orders/customer/confirm: + $ref: paths/orders_customer_confirm.yaml + /orders/cart/{cart_id}: + $ref: paths/orders_cart_{cart_id}.yaml + /orders/{id}: + $ref: paths/orders_{id}.yaml + /orders: + $ref: paths/orders.yaml + /orders/batch/customer/token: + $ref: paths/orders_batch_customer_token.yaml /payment-collections/{id}/sessions/batch/authorize: $ref: paths/payment-collections_{id}_sessions_batch_authorize.yaml /payment-collections/{id}/sessions/{session_id}/authorize: @@ -205,22 +209,6 @@ paths: $ref: paths/payment-collections_{id}_sessions.yaml /payment-collections/{id}/sessions/{session_id}: $ref: paths/payment-collections_{id}_sessions_{session_id}.yaml - /orders/customer/confirm: - $ref: paths/orders_customer_confirm.yaml - /orders/cart/{cart_id}: - $ref: paths/orders_cart_{cart_id}.yaml - /orders/{id}: - $ref: paths/orders_{id}.yaml - /orders: - $ref: paths/orders.yaml - /orders/batch/customer/token: - $ref: paths/orders_batch_customer_token.yaml - /order-edits/{id}/complete: - $ref: paths/order-edits_{id}_complete.yaml - /order-edits/{id}/decline: - $ref: paths/order-edits_{id}_decline.yaml - /order-edits/{id}: - $ref: paths/order-edits_{id}.yaml /product-types: $ref: paths/product-types.yaml /products/{id}: diff --git a/docs/api/store/paths/auth.yaml b/docs/api/store/paths/auth.yaml index 7b6fdd2ea1..4fca42845f 100644 --- a/docs/api/store/paths/auth.yaml +++ b/docs/api/store/paths/auth.yaml @@ -25,7 +25,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -109,7 +109,7 @@ get: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/carts.yaml b/docs/api/store/paths/carts.yaml index b11e8871e8..da3f3d7945 100644 --- a/docs/api/store/paths/carts.yaml +++ b/docs/api/store/paths/carts.yaml @@ -10,49 +10,7 @@ post: content: application/json: schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Cart in. - sales_channel_id: - type: string - description: >- - [EXPERIMENTAL] The ID of the Sales channel to create the Cart - in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - items: - description: >- - An optional array of `variant_id`, `quantity` pairs to generate - Line Items from. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: >- - The id of the Product Variant to generate a Line Item - from. - type: string - quantity: - description: The quantity of the Product Variant to add - type: integer - context: - description: >- - An optional object to provide context to the Cart. The `context` - field is automatically populated with `ip` and `user_agent` - type: object - example: - ip: '::1' - user_agent: Chrome + $ref: ../components/schemas/StorePostCartReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -73,7 +31,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}.yaml b/docs/api/store/paths/carts_{id}.yaml index 760c22fda0..b051075749 100644 --- a/docs/api/store/paths/carts_{id}.yaml +++ b/docs/api/store/paths/carts_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': @@ -55,68 +55,7 @@ post: content: application/json: schema: - type: object - properties: - region_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. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Cart. - format: email - sales_channel_id: - type: string - description: The ID of the Sales channel to update the Cart with. - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: ../components/schemas/address.yaml - description: A full billing address object. - - type: string - description: The billing address ID - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: ../components/schemas/address.yaml - description: A full shipping address object. - - type: string - description: The shipping address ID - gift_cards: - description: An array of Gift Card codes to add to the Cart. - type: array - items: - required: - - code - 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: - required: - - code - 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 - example: - ip: '::1' - user_agent: Chrome + $ref: ../components/schemas/StorePostCartsCartReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -137,7 +76,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_complete.yaml b/docs/api/store/paths/carts_{id}_complete.yaml index 4baa7467ee..606ec78757 100644 --- a/docs/api/store/paths/carts_{id}_complete.yaml +++ b/docs/api/store/paths/carts_{id}_complete.yaml @@ -57,21 +57,21 @@ post: successfully. properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml - type: object description: >- Cart was successfully authorized but requires further actions. properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml - type: object description: >- When cart is used for a swap and it has been completed successfully. properties: cart: - $ref: ../components/schemas/swap.yaml + $ref: ../components/schemas/Swap.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml b/docs/api/store/paths/carts_{id}_discounts_{code}.yaml index 2dd270334a..c67f1e73e9 100644 --- a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml +++ b/docs/api/store/paths/carts_{id}_discounts_{code}.yaml @@ -35,7 +35,7 @@ delete: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_line-items.yaml b/docs/api/store/paths/carts_{id}_line-items.yaml index 4bee2a8f96..f8fd4e999c 100644 --- a/docs/api/store/paths/carts_{id}_line-items.yaml +++ b/docs/api/store/paths/carts_{id}_line-items.yaml @@ -29,7 +29,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml b/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml index f33aaa5f89..f93ec459e5 100644 --- a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml +++ b/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml @@ -36,7 +36,7 @@ delete: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': @@ -85,7 +85,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_payment-session.yaml b/docs/api/store/paths/carts_{id}_payment-session.yaml index f9d6a4167a..0e1f181270 100644 --- a/docs/api/store/paths/carts_{id}_payment-session.yaml +++ b/docs/api/store/paths/carts_{id}_payment-session.yaml @@ -31,7 +31,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_payment-sessions.yaml b/docs/api/store/paths/carts_{id}_payment-sessions.yaml index 6a6aa6dd63..c8ab8f1845 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions.yaml @@ -31,7 +31,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml index 393b320eed..b0d6b0d8b1 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml @@ -39,7 +39,7 @@ delete: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': @@ -89,7 +89,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml index cabc2984bc..dbd9dfc2d4 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml @@ -41,7 +41,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_shipping-methods.yaml b/docs/api/store/paths/carts_{id}_shipping-methods.yaml index 0ddffc8c5a..23ae878a7b 100644 --- a/docs/api/store/paths/carts_{id}_shipping-methods.yaml +++ b/docs/api/store/paths/carts_{id}_shipping-methods.yaml @@ -29,7 +29,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_taxes.yaml b/docs/api/store/paths/carts_{id}_taxes.yaml index 46a0cb4500..26ac7abf68 100644 --- a/docs/api/store/paths/carts_{id}_taxes.yaml +++ b/docs/api/store/paths/carts_{id}_taxes.yaml @@ -27,7 +27,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/collections.yaml b/docs/api/store/paths/collections.yaml index 19187417c3..33b779fcbc 100644 --- a/docs/api/store/paths/collections.yaml +++ b/docs/api/store/paths/collections.yaml @@ -83,7 +83,7 @@ get: collections: type: array items: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml count: type: integer description: The total number of items available diff --git a/docs/api/store/paths/collections_{id}.yaml b/docs/api/store/paths/collections_{id}.yaml index ff523113e4..160582a68a 100644 --- a/docs/api/store/paths/collections_{id}.yaml +++ b/docs/api/store/paths/collections_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: collection: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/customers.yaml b/docs/api/store/paths/customers.yaml index 370c6e6928..f7b1f5a5e6 100644 --- a/docs/api/store/paths/customers.yaml +++ b/docs/api/store/paths/customers.yaml @@ -6,30 +6,7 @@ post: content: application/json: schema: - type: object - required: - - first_name - - last_name - - email - - password - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - phone: - description: The Customer's phone number. - type: string + $ref: ../components/schemas/StorePostCustomersReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -50,7 +27,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/customers_me.yaml b/docs/api/store/paths/customers_me.yaml index 5dfbcc2e8d..3f0885e0f9 100644 --- a/docs/api/store/paths/customers_me.yaml +++ b/docs/api/store/paths/customers_me.yaml @@ -27,7 +27,7 @@ get: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -49,33 +49,7 @@ post: content: application/json: schema: - type: object - 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_fields.yaml - description: The full billing address object - - type: string - description: The ID of an existing billing address - password: - description: The Customer's password. - type: string - phone: - description: The Customer's phone number. - type: string - email: - description: The email of the customer. - type: string - metadata: - description: Metadata about the customer. - type: object + $ref: ../components/schemas/StorePostCustomersCustomerReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -98,7 +72,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/customers_me_addresses.yaml b/docs/api/store/paths/customers_me_addresses.yaml index e31fb66186..2c1b636fff 100644 --- a/docs/api/store/paths/customers_me_addresses.yaml +++ b/docs/api/store/paths/customers_me_addresses.yaml @@ -7,22 +7,7 @@ post: content: application/json: schema: - type: object - required: - - address - properties: - address: - description: The Address to add to the Customer. - allOf: - - $ref: ../components/schemas/address_fields.yaml - - type: object - required: - - first_name - - last_name - - address_1 - - city - - country_code - - postal_code + $ref: ../components/schemas/StorePostCustomersCustomerAddressesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -45,7 +30,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml b/docs/api/store/paths/customers_me_addresses_{address_id}.yaml index 0434b866da..ae74204d04 100644 --- a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml +++ b/docs/api/store/paths/customers_me_addresses_{address_id}.yaml @@ -34,7 +34,7 @@ delete: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -63,8 +63,8 @@ post: content: application/json: schema: - anyOf: - - $ref: ../components/schemas/address_fields.yaml + $ref: >- + ../components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -89,7 +89,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/customers_me_orders.yaml b/docs/api/store/paths/customers_me_orders.yaml index 377bccbfa1..b697a9eec7 100644 --- a/docs/api/store/paths/customers_me_orders.yaml +++ b/docs/api/store/paths/customers_me_orders.yaml @@ -192,7 +192,7 @@ get: orders: type: array items: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml count: type: integer description: The total number of items available diff --git a/docs/api/store/paths/customers_password-reset.yaml b/docs/api/store/paths/customers_password-reset.yaml index bee027f4c8..0576f92444 100644 --- a/docs/api/store/paths/customers_password-reset.yaml +++ b/docs/api/store/paths/customers_password-reset.yaml @@ -8,23 +8,7 @@ post: content: application/json: schema: - type: object - required: - - email - - password - - token - properties: - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - token: - description: The reset password token - type: string + $ref: ../components/schemas/StorePostCustomersResetPasswordReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -45,7 +29,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/customers_password-token.yaml b/docs/api/store/paths/customers_password-token.yaml index 2949cdd90f..46bb9dce0d 100644 --- a/docs/api/store/paths/customers_password-token.yaml +++ b/docs/api/store/paths/customers_password-token.yaml @@ -9,14 +9,8 @@ post: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The email of the customer. - type: string - format: email + $ref: >- + ../components/schemas/StorePostCustomersCustomerPasswordTokenReq.yaml x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/store/paths/gift-cards_{code}.yaml b/docs/api/store/paths/gift-cards_{code}.yaml index ce5748cb97..1efecec1d2 100644 --- a/docs/api/store/paths/gift-cards_{code}.yaml +++ b/docs/api/store/paths/gift-cards_{code}.yaml @@ -29,7 +29,7 @@ get: type: object properties: gift_card: - $ref: ../components/schemas/gift_card.yaml + $ref: ../components/schemas/GiftCard.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/order-edits_{id}.yaml b/docs/api/store/paths/order-edits_{id}.yaml index 90bf87fb43..65e0def3cb 100644 --- a/docs/api/store/paths/order-edits_{id}.yaml +++ b/docs/api/store/paths/order-edits_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/order-edits_{id}_complete.yaml b/docs/api/store/paths/order-edits_{id}_complete.yaml index 1ff4cf22b8..0e7a856660 100644 --- a/docs/api/store/paths/order-edits_{id}_complete.yaml +++ b/docs/api/store/paths/order-edits_{id}_complete.yaml @@ -29,7 +29,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/order-edits_{id}_decline.yaml b/docs/api/store/paths/order-edits_{id}_decline.yaml index ce8907e40b..7337245d44 100644 --- a/docs/api/store/paths/order-edits_{id}_decline.yaml +++ b/docs/api/store/paths/order-edits_{id}_decline.yaml @@ -13,11 +13,7 @@ post: content: application/json: schema: - type: object - properties: - declined_reason: - type: string - description: The reason for declining the OrderEdit. + $ref: ../components/schemas/StorePostOrderEditsOrderEditDecline.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -38,7 +34,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/orders.yaml b/docs/api/store/paths/orders.yaml index 325ddb75b0..687a2fe232 100644 --- a/docs/api/store/paths/orders.yaml +++ b/docs/api/store/paths/orders.yaml @@ -49,7 +49,7 @@ get: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/orders_batch_customer_token.yaml b/docs/api/store/paths/orders_batch_customer_token.yaml index 945eb8412f..9775479c8b 100644 --- a/docs/api/store/paths/orders_batch_customer_token.yaml +++ b/docs/api/store/paths/orders_batch_customer_token.yaml @@ -8,14 +8,7 @@ post: content: application/json: schema: - required: - - order_ids - properties: - order_ids: - description: The ids of the orders to claim - type: array - items: - type: string + $ref: ../components/schemas/StorePostCustomersCustomerOrderClaimReq.yaml x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/store/paths/orders_cart_{cart_id}.yaml b/docs/api/store/paths/orders_cart_{cart_id}.yaml index 2250a041ce..6e69f5568e 100644 --- a/docs/api/store/paths/orders_cart_{cart_id}.yaml +++ b/docs/api/store/paths/orders_cart_{cart_id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/orders_customer_confirm.yaml b/docs/api/store/paths/orders_customer_confirm.yaml index d841d7f5a0..104581ff0f 100644 --- a/docs/api/store/paths/orders_customer_confirm.yaml +++ b/docs/api/store/paths/orders_customer_confirm.yaml @@ -8,12 +8,7 @@ post: content: application/json: schema: - required: - - token - properties: - token: - description: The invite token provided by the admin. - type: string + $ref: ../components/schemas/StorePostCustomersCustomerAcceptClaimReq.yaml x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/store/paths/orders_{id}.yaml b/docs/api/store/paths/orders_{id}.yaml index 347273607a..df6152833e 100644 --- a/docs/api/store/paths/orders_{id}.yaml +++ b/docs/api/store/paths/orders_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/payment-collections_{id}.yaml b/docs/api/store/paths/payment-collections_{id}.yaml index 6876ea93ee..af7cb5ef33 100644 --- a/docs/api/store/paths/payment-collections_{id}.yaml +++ b/docs/api/store/paths/payment-collections_{id}.yaml @@ -43,7 +43,7 @@ get: type: object properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/payment-collections_{id}_sessions.yaml b/docs/api/store/paths/payment-collections_{id}_sessions.yaml index a18f5574f7..986807d479 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions.yaml @@ -14,12 +14,7 @@ post: content: application/json: schema: - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. + $ref: ../components/schemas/StorePaymentCollectionSessionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -43,7 +38,7 @@ post: schema: properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml index 93c0ec4593..fec0ecf876 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml @@ -14,27 +14,8 @@ post: content: application/json: schema: - properties: - sessions: - description: >- - An array of payment sessions related to the Payment Collection. - If the session_id is not provided, existing sessions not present - will be deleted and the provided ones will be created. - type: array - items: - required: - - provider_id - - amount - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - amount: - type: integer - description: The amount . - session_id: - type: string - description: The ID of the Payment Session to be updated. + $ref: >- + ../components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -59,7 +40,7 @@ post: schema: properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml index 3442c8640a..d5af19cd47 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml @@ -14,12 +14,8 @@ post: content: application/json: schema: - properties: - session_ids: - description: List of Payment Session IDs to authorize. - type: array - items: - type: string + $ref: >- + ../components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -44,7 +40,7 @@ post: schema: properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml index 460ad245e7..a7d20ff59b 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml @@ -18,21 +18,6 @@ post: description: The id of the Payment Session to be refreshed. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - - customer_id - properties: - provider_id: - description: The Payment Provider id. - type: string - customer_id: - description: The Customer id. - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -55,7 +40,7 @@ post: type: object properties: payment_session: - $ref: ../components/schemas/payment_session.yaml + $ref: ../components/schemas/PaymentSession.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml index 34e6dc23e1..dd24e40831 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml @@ -40,7 +40,7 @@ post: schema: properties: payment_session: - $ref: ../components/schemas/payment_session.yaml + $ref: ../components/schemas/PaymentSession.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/product-types.yaml b/docs/api/store/paths/product-types.yaml index 00a5779158..32c4deb44f 100644 --- a/docs/api/store/paths/product-types.yaml +++ b/docs/api/store/paths/product-types.yaml @@ -116,7 +116,7 @@ get: type: object properties: product_types: - $ref: ../components/schemas/product_type.yaml + $ref: ../components/schemas/ProductType.yaml count: type: integer description: The total number of items available diff --git a/docs/api/store/paths/products.yaml b/docs/api/store/paths/products.yaml index 9d542519be..55507c8597 100644 --- a/docs/api/store/paths/products.yaml +++ b/docs/api/store/paths/products.yaml @@ -147,6 +147,11 @@ get: result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -170,16 +175,16 @@ get: type: array items: allOf: - - $ref: ../components/schemas/product.yaml + - $ref: ../components/schemas/Product.yaml - type: object properties: variants: type: array items: allOf: - - $ref: ../components/schemas/product_variant.yaml + - $ref: ../components/schemas/ProductVariant.yaml - $ref: >- - ../components/schemas/product_variant_prices_fields.yaml + ../components/schemas/ProductVariantPricesFields.yaml count: type: integer description: The total number of items available diff --git a/docs/api/store/paths/products_{id}.yaml b/docs/api/store/paths/products_{id}.yaml index f5f090d682..6acbf07a6b 100644 --- a/docs/api/store/paths/products_{id}.yaml +++ b/docs/api/store/paths/products_{id}.yaml @@ -54,16 +54,16 @@ get: properties: product: allOf: - - $ref: ../components/schemas/product.yaml + - $ref: ../components/schemas/Product.yaml - type: object properties: variants: type: array items: allOf: - - $ref: ../components/schemas/product_variant.yaml + - $ref: ../components/schemas/ProductVariant.yaml - $ref: >- - ../components/schemas/product_variant_prices_fields.yaml + ../components/schemas/ProductVariantPricesFields.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/regions.yaml b/docs/api/store/paths/regions.yaml index aac1328eb4..4d90acf272 100644 --- a/docs/api/store/paths/regions.yaml +++ b/docs/api/store/paths/regions.yaml @@ -81,7 +81,7 @@ get: regions: type: array items: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/regions_{id}.yaml b/docs/api/store/paths/regions_{id}.yaml index 1c3c016a5c..4e1a316f1c 100644 --- a/docs/api/store/paths/regions_{id}.yaml +++ b/docs/api/store/paths/regions_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/return-reasons.yaml b/docs/api/store/paths/return-reasons.yaml index 65109419c5..2df1323ec5 100644 --- a/docs/api/store/paths/return-reasons.yaml +++ b/docs/api/store/paths/return-reasons.yaml @@ -24,7 +24,7 @@ get: return_reasons: type: array items: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/return-reasons_{id}.yaml b/docs/api/store/paths/return-reasons_{id}.yaml index 47ce85648e..59140ce303 100644 --- a/docs/api/store/paths/return-reasons_{id}.yaml +++ b/docs/api/store/paths/return-reasons_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: return_reason: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/returns.yaml b/docs/api/store/paths/returns.yaml index 448553452f..c852066b3c 100644 --- a/docs/api/store/paths/returns.yaml +++ b/docs/api/store/paths/returns.yaml @@ -6,48 +6,7 @@ post: content: application/json: schema: - type: object - required: - - order_id - - items - 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: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item from the Order. - type: string - quantity: - description: The quantity to return. - type: integer - reason_id: - description: The ID of the return reason. - type: string - note: - description: A note to add to the item returned. - type: string - 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 - required: - - option_id - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. + $ref: ../components/schemas/StorePostReturnsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -68,7 +27,7 @@ post: type: object properties: return: - $ref: ../components/schemas/return.yaml + $ref: ../components/schemas/Return.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/shipping-options.yaml b/docs/api/store/paths/shipping-options.yaml index 0f6cb8c9a6..379694f682 100644 --- a/docs/api/store/paths/shipping-options.yaml +++ b/docs/api/store/paths/shipping-options.yaml @@ -42,7 +42,7 @@ get: shipping_options: type: array items: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/shipping-options_{cart_id}.yaml b/docs/api/store/paths/shipping-options_{cart_id}.yaml index 409adecec6..1cf6620012 100644 --- a/docs/api/store/paths/shipping-options_{cart_id}.yaml +++ b/docs/api/store/paths/shipping-options_{cart_id}.yaml @@ -31,7 +31,7 @@ get: shipping_options: type: array items: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/swaps.yaml b/docs/api/store/paths/swaps.yaml index a0f6784147..084a9d6669 100644 --- a/docs/api/store/paths/swaps.yaml +++ b/docs/api/store/paths/swaps.yaml @@ -8,54 +8,7 @@ post: content: application/json: schema: - type: object - required: - - order_id - - return_items - - additional_items - properties: - order_id: - type: string - description: The ID of the Order to create the Swap for. - return_items: - 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. - type: string - quantity: - description: The quantity to swap. - type: integer - reason_id: - description: The ID of the reason of this return. - type: string - note: - description: The note to add to the item being swapped. - type: string - return_shipping_option: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - additional_items: - 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. - type: string - quantity: - description: The quantity to send of the variant. - type: integer + $ref: ../components/schemas/StorePostSwapsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -76,7 +29,7 @@ post: type: object properties: swap: - $ref: ../components/schemas/swap.yaml + $ref: ../components/schemas/Swap.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/swaps_{cart_id}.yaml b/docs/api/store/paths/swaps_{cart_id}.yaml index 59611a4b0c..2be992ccfd 100644 --- a/docs/api/store/paths/swaps_{cart_id}.yaml +++ b/docs/api/store/paths/swaps_{cart_id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: swap: - $ref: ../components/schemas/swap.yaml + $ref: ../components/schemas/Swap.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/variants.yaml b/docs/api/store/paths/variants.yaml index 968c25d3bd..298d92ce80 100644 --- a/docs/api/store/paths/variants.yaml +++ b/docs/api/store/paths/variants.yaml @@ -81,8 +81,8 @@ get: type: array items: allOf: - - $ref: ../components/schemas/product_variant.yaml - - $ref: ../components/schemas/product_variant_prices_fields.yaml + - $ref: ../components/schemas/ProductVariant.yaml + - $ref: ../components/schemas/ProductVariantPricesFields.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/variants_{variant_id}.yaml b/docs/api/store/paths/variants_{variant_id}.yaml index b632807cee..4bbb842ac2 100644 --- a/docs/api/store/paths/variants_{variant_id}.yaml +++ b/docs/api/store/paths/variants_{variant_id}.yaml @@ -46,8 +46,8 @@ get: properties: variant: allOf: - - $ref: ../components/schemas/product_variant.yaml - - $ref: ../components/schemas/product_variant_prices_fields.yaml + - $ref: ../components/schemas/ProductVariant.yaml + - $ref: ../components/schemas/ProductVariantPricesFields.yaml '400': $ref: ../components/responses/400_error.yaml '404':