chore(docs): Updated API Reference (v2) (#9437)

Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2024-10-03 07:48:54 +00:00
committed by GitHub
co-authored by Shahed Nasser
parent 97c193be1b
commit 21badd069d
894 changed files with 35649 additions and 28168 deletions
@@ -60,7 +60,7 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* x-workflow: deleteCustomersWorkflow
* x-workflow: removeCustomerAccountWorkflow
*
*/
@@ -21,26 +21,6 @@
* required: true
* schema:
* type: string
* - name: expand
* in: query
* description: Comma-separated relations that should be expanded in the returned data.
* required: false
* schema:
* type: string
* title: expand
* description: Comma-separated relations that should be expanded in the returned data.
* - name: fields
* in: query
* description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
* fields. without prefix it will replace the entire default fields.
* required: false
* schema:
* type: string
* title: fields
* description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
* fields. without prefix it will replace the entire default fields.
* externalDocs:
* url: "#select-fields-and-relations"
* security:
* - api_token: []
* - cookie_auth: []
@@ -36,7 +36,7 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* x-workflow: deleteUsersWorkflow
* x-workflow: removeUserAccountWorkflow
*
*/
@@ -3,12 +3,10 @@
* operationId: GetPromotionsIdRule_type
* summary: List Rules of a Promotion
* x-sidebar-summary: List Rules
* description: >
* description: |
* Retrieve a list of rules in a promotion. The type of rules retrieved depend on the value of the `rule_type` path parameter:
*
* - If `rule_type` is `rules`, the promotion's rules are retrivied. - If `rule_type` is `target-rules`, the target rules of the promotion's application method are retrieved.
*
*
* - If `rule_type` is `buy-rules`, the buy rules of the promotion's application method are retrieved.
* x-authenticated: true
* parameters:
@@ -0,0 +1,69 @@
/**
* @oas [get] /admin/shipping-options/{id}
* operationId: GetShippingOptionsId
* summary: Get a Shipping Option
* description: Retrieve a shipping option by its ID. You can expand the shipping option's relations or select the fields that should be returned.
* x-authenticated: true
* parameters:
* - name: id
* in: path
* description: The shipping option's ID.
* required: true
* schema:
* type: string
* - name: expand
* in: query
* description: Comma-separated relations that should be expanded in the returned data.
* required: false
* schema:
* type: string
* title: expand
* description: Comma-separated relations that should be expanded in the returned data.
* - name: fields
* in: query
* description: |-
* Comma-separated fields that should be included in the returned data.
* * if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields.
* * without prefix it will replace the entire default fields.
* required: false
* schema:
* type: string
* title: fields
* description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
* fields. without prefix it will replace the entire default fields.
* externalDocs:
* url: "#select-fields-and-relations"
* security:
* - api_token: []
* - cookie_auth: []
* - jwt_token: []
* x-codeSamples:
* - lang: Shell
* label: cURL
* source: |-
* curl '{backend_url}/admin/shipping-options/{id}' \
* -H 'Authorization: Bearer {access_token}'
* tags:
* - Shipping Options
* responses:
* "200":
* description: OK
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/AdminShippingOptionResponse"
* "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"
*
*/
@@ -63,10 +63,6 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
* x-workflow: confirmClaimRequestWorkflow
*
*/
@@ -63,10 +63,6 @@
* "500":
* $ref: "#/components/responses/500_error"
* x-workflow: confirmExchangeRequestWorkflow
* requestBody:
* content:
* application/json:
* schema: {}
*
*/
@@ -56,10 +56,6 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
* x-workflow: refreshInviteTokensWorkflow
*
*/
@@ -62,10 +62,6 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
*
*/
@@ -35,11 +35,6 @@
* - api_token: []
* - cookie_auth: []
* - jwt_token: []
* requestBody:
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/AdminArchiveOrder"
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -70,10 +70,6 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
* x-workflow: cancelOrderWorkflow
*
*/
@@ -42,11 +42,6 @@
* - api_token: []
* - cookie_auth: []
* - jwt_token: []
* requestBody:
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/AdminMarkOrderFulfillmentDelivered"
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -31,8 +31,8 @@
* description: A price's details.
* required:
* - currency_code
* - amount
* - variant_id
* - amount
* properties:
* currency_code:
* type: string
@@ -33,7 +33,7 @@
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/AdminCreateProduct"
* $ref: "#/components/schemas/AdminCreateProductType"
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -30,9 +30,9 @@
* type: object
* description: The associations to create between a product variant and an inventory item.
* required:
* - required_quantity
* - inventory_item_id
* - variant_id
* - inventory_item_id
* - required_quantity
* properties:
* required_quantity:
* type: number
@@ -53,9 +53,9 @@
* type: object
* description: Update a product variant's association with an inventory item.
* required:
* - required_quantity
* - inventory_item_id
* - variant_id
* - inventory_item_id
* - required_quantity
* properties:
* required_quantity:
* type: number
@@ -76,8 +76,8 @@
* type: object
* description: Delete a product variant's association with an inventory item.
* required:
* - inventory_item_id
* - variant_id
* - inventory_item_id
* properties:
* inventory_item_id:
* type: string
@@ -47,93 +47,12 @@
* type: array
* description: The buy rules to create.
* items:
* type: object
* description: A buy rule's details.
* required:
* - operator
* - attribute
* - values
* properties:
* operator:
* type: string
* description: The operator used to check whether the buy rule applies on a cart. For example, `eq` means that the cart's value for the specified attribute must match the specified value.
* enum:
* - gte
* - lte
* - gt
* - lt
* - eq
* - ne
* - in
* description:
* type: string
* title: description
* description: The buy rule's description.
* attribute:
* type: string
* title: attribute
* description: The attribute to compare against when checking whether a promotion can be applied on a cart.
* example: items.product.id
* values:
* oneOf:
* - type: string
* title: values
* description: The attribute's value.
* example: prod_123
* - type: array
* description: The allowed attribute values.
* items:
* type: string
* title: values
* description: An attribute value.
* example: prod_123
* $ref: "#/components/schemas/AdminCreatePromotionRule"
* update:
* type: array
* description: The buy rules to update.
* items:
* type: object
* description: The properties to update in a buy rule.
* required:
* - id
* - values
* properties:
* id:
* type: string
* title: id
* description: The buy rule's ID.
* operator:
* type: string
* description: The operator used to check whether the buy rule applies on a cart. For example, `eq` means that the cart's value for the specified attribute must match the specified value.
* enum:
* - gte
* - lte
* - gt
* - lt
* - eq
* - ne
* - in
* description:
* type: string
* title: description
* description: The buy rule's description.
* attribute:
* type: string
* title: attribute
* description: The attribute to compare against when checking whether a promotion can be applied on a cart.
* example: items.product.id
* values:
* oneOf:
* - type: string
* title: values
* description: The attribute's value.
* example: prod_123
* - type: array
* description: The allowed attribute values.
* items:
* type: string
* title: values
* description: An attribute value.
* example: prod_123
* $ref: "#/components/schemas/AdminUpdatePromotionRule"
* delete:
* type: array
* description: The buy rules to delete.
@@ -47,93 +47,12 @@
* type: array
* description: The rules to create.
* items:
* type: object
* description: A rule's details.
* required:
* - operator
* - attribute
* - values
* properties:
* operator:
* type: string
* description: The operator used to check whether the rule applies on a cart. For example, `eq` means that the cart's value for the specified attribute must match the specified value.
* enum:
* - gte
* - lte
* - gt
* - lt
* - eq
* - ne
* - in
* description:
* type: string
* title: description
* description: The rule's description.
* attribute:
* type: string
* title: attribute
* description: The attribute to compare against when checking whether a promotion can be applied on a cart.
* example: items.product.id
* values:
* oneOf:
* - type: string
* title: values
* description: The attribute's value.
* example: prod_123
* - type: array
* description: The allowed attribute values.
* items:
* type: string
* title: values
* description: An attribute value.
* example: prod_123
* $ref: "#/components/schemas/AdminCreatePromotionRule"
* update:
* type: array
* description: The rules to update.
* items:
* type: object
* description: The properties to update in a rule.
* required:
* - id
* - values
* properties:
* id:
* type: string
* title: id
* description: The rule's ID.
* operator:
* type: string
* description: The operator used to check whether the rule applies on a cart. For example, `eq` means that the cart's value for the specified attribute must match the specified value.
* enum:
* - gte
* - lte
* - gt
* - lt
* - eq
* - ne
* - in
* description:
* type: string
* title: description
* description: The rule's description.
* attribute:
* type: string
* title: attribute
* description: The attribute to compare against when checking whether a promotion can be applied on a cart.
* example: items.product.id
* values:
* oneOf:
* - type: string
* title: values
* description: The attribute's value.
* example: prod_123
* - type: array
* description: The allowed attribute values.
* items:
* type: string
* title: values
* description: An attribute value.
* example: prod_123
* $ref: "#/components/schemas/AdminUpdatePromotionRule"
* delete:
* type: array
* description: The rules to delete.
@@ -47,93 +47,12 @@
* type: array
* description: The target rules to create.
* items:
* type: object
* description: A target rule's details.
* required:
* - operator
* - attribute
* - values
* properties:
* operator:
* type: string
* description: The operator used to check whether the target rule applies on a cart. For example, `eq` means that the cart's value for the specified attribute must match the specified value.
* enum:
* - gte
* - lte
* - gt
* - lt
* - eq
* - ne
* - in
* description:
* type: string
* title: description
* description: The target rule's description.
* attribute:
* type: string
* title: attribute
* description: The attribute to compare against when checking whether a promotion can be applied on a cart.
* example: items.product.id
* values:
* oneOf:
* - type: string
* title: values
* description: The attribute's value.
* example: prod_123
* - type: array
* description: The allowed attribute values.
* items:
* type: string
* title: values
* description: An attribute value.
* example: prod_123
* $ref: "#/components/schemas/AdminCreatePromotionRule"
* update:
* type: array
* description: The target rules to update.
* items:
* type: object
* description: The properties to update in a target rule.
* required:
* - id
* - values
* properties:
* id:
* type: string
* title: id
* description: The target rule's ID.
* operator:
* type: string
* description: The operator used to check whether the target rule applies on a cart. For example, `eq` means that the cart's value for the specified attribute must match the specified value.
* enum:
* - gte
* - lte
* - gt
* - lt
* - eq
* - ne
* - in
* description:
* type: string
* title: description
* description: The target rule's description.
* attribute:
* type: string
* title: attribute
* description: The attribute to compare against when checking whether a promotion can be applied on a cart.
* example: items.product.id
* values:
* oneOf:
* - type: string
* title: values
* description: The attribute's value.
* example: prod_123
* - type: array
* description: The allowed attribute values.
* items:
* type: string
* title: values
* description: An attribute value.
* example: prod_123
* $ref: "#/components/schemas/AdminUpdatePromotionRule"
* delete:
* type: array
* description: The target rules to delete.
@@ -33,7 +33,7 @@
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/CreateOrderReturnReason"
* $ref: "#/components/schemas/AdminCreateReturnReason"
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -39,7 +39,7 @@
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/UpdateOrderReturnReason"
* $ref: "#/components/schemas/AdminUpdateReturnReason"
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -71,9 +71,9 @@
* type: object
* description: The shipping option's type.
* required:
* - label
* - description
* - code
* - description
* - label
* properties:
* label:
* type: string
@@ -47,89 +47,12 @@
* type: array
* description: The shipping option rules to create.
* items:
* type: object
* description: A shipping option's details.
* required:
* - operator
* - attribute
* - value
* properties:
* operator:
* type: string
* description: The operator used to check whether a rule applies.
* enum:
* - in
* - eq
* - ne
* - gt
* - gte
* - lt
* - lte
* - nin
* attribute:
* type: string
* title: attribute
* description: The name of a property or table that the rule applies to.
* example: customer_group
* value:
* oneOf:
* - type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: array
* description: Values of the attribute that enable this rule.
* items:
* type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* $ref: "#/components/schemas/AdminCreateShippingOptionRule"
* update:
* type: array
* description: The shipping option rules to update.
* items:
* type: object
* description: The properties to update in the shipping option rule.
* required:
* - id
* - operator
* - attribute
* - value
* properties:
* id:
* type: string
* title: id
* description: The rule's ID.
* operator:
* type: string
* description: The operator used to check whether a rule applies.
* enum:
* - in
* - eq
* - ne
* - gt
* - gte
* - lt
* - lte
* - nin
* attribute:
* type: string
* title: attribute
* description: The name of a property or table that the rule applies to.
* example: customer_group
* value:
* oneOf:
* - type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* - type: array
* description: Values of the attribute that enable this rule.
* items:
* type: string
* title: value
* description: A value of the attribute that enables this rule.
* example: cusgroup_123
* $ref: "#/components/schemas/AdminUpdateShippingOptionRule"
* delete:
* type: array
* description: The shipping option rules to delete.
@@ -43,8 +43,8 @@
* type: object
* description: The fulfillment set to create.
* required:
* - name
* - type
* - name
* properties:
* name:
* type: string
@@ -36,10 +36,6 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
*
*/
@@ -36,10 +36,6 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
*
*/
@@ -36,10 +36,6 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
*
*/
@@ -24,8 +24,6 @@
* tags:
* - "[actor_type]"
* responses:
* "200":
* description: OK
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -39,6 +37,11 @@
* "500":
* $ref: "#/components/responses/500_error"
* x-workflow: generateResetPasswordTokenWorkflow
* requestBody:
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/ResetPasswordRequest"
*
*/
@@ -24,8 +24,6 @@
* tags:
* - "[actor_type]"
* responses:
* "200":
* description: OK
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -23,10 +23,6 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
*
*/
@@ -4,7 +4,6 @@
* summary: Create Token
* description: Create a token.
* x-authenticated: false
* parameters: []
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -12,8 +11,6 @@
* tags:
* - Token
* responses:
* "200":
* description: OK
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -30,10 +30,6 @@
* $ref: "#/components/responses/invalid_request_error"
* "500":
* $ref: "#/components/responses/500_error"
* requestBody:
* content:
* application/json:
* schema: {}
*
*/
@@ -71,7 +71,7 @@
* type: string
* title: object
* description: The name of the deleted object.
* default: "line-item"
* default: line-item
* deleted:
* type: boolean
* title: deleted
@@ -69,7 +69,7 @@
* type: string
* title: object
* description: The name of the deleted object.
* default: "address"
* default: address
* deleted:
* type: boolean
* title: deleted
@@ -883,14 +883,6 @@
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/storefront-development/products/price/examples/tax-price
* description: "Storefront guide: How to show product variants' prices with taxes."
* - name: country_code
* in: query
* description: The country code the products are being viewed from. This is required if you're retrieving product variant prices with taxes.
* required: false
* schema:
* type: string
* title: country_code
* description: The country code the products are being viewed from. This is required if you're retrieving product variant prices with taxes.
* - name: province
* in: query
* description: The province the products are being viewed from. This is useful to narrow down the tax context when calculating product variant prices with taxes.
@@ -899,14 +891,6 @@
* type: string
* title: province
* description: The province the products are being viewed from. This is useful to narrow down the tax context when calculating product variant prices with taxes.
* - name: cart_id
* in: query
* description: The ID of the customer's cart. If set, the cart's region and shipping address's country code and province are used instead of the `region_id`, `country_code`, and `province` properties.
* required: false
* schema:
* type: string
* title: cart_id
* description: The ID of the customer's cart. If set, the cart's region and shipping address's country code and province are used instead of the `region_id`, `country_code`, and `province` properties.
* - name: sales_channel_id
* in: query
* required: false
@@ -935,6 +919,38 @@
* type: string
* title: category_id
* description: A product category's ID.
* - name: currency_code
* in: query
* description: The currency code to retrieve prices in.
* required: false
* schema:
* type: string
* title: currency_code
* description: The currency code to retrieve prices in.
* - name: variants
* in: query
* description: Filter the products' variants.
* required: false
* schema:
* type: object
* description: Filter the products' variants.
* x-schemaName: StoreProductVariantParams
* properties:
* options:
* type: object
* description: Filter by the variants' options.
* required:
* - value
* - option_id
* properties:
* option_id:
* type: string
* title: option_id
* description: The ID of the option to filter by.
* value:
* type: string
* title: value
* description: Filter by a value of the option.
* x-codeSamples:
* - lang: Shell
* label: cURL
@@ -34,8 +34,7 @@
* x-codeSamples:
* - lang: Shell
* label: cURL
* source: |-
* curl '{backend_url}/store/regions/{id}'
* source: curl '{backend_url}/store/regions/{id}'
* tags:
* - Regions
* responses:
@@ -2,10 +2,9 @@
* @oas [get] /store/shipping-options
* operationId: GetShippingOptions
* summary: List Shipping Options for Cart
* description: >
* description: |
* Retrieve a list of shipping options for a cart. The cart's ID is set in the required `cart_id` query parameter.
*
*
* The shipping options also be sorted or paginated.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping
@@ -96,8 +96,8 @@
* type: string
* title: type
* description: >
* The error's type. Can be a [MedusaError type](https://docs.medusajs.com/v2/advanced-development/api-routes/errors#medusaerror-types)
* or `payment_authorization_error` or `payment_requires_more_error` for payment-related errors.
* The error's type. Can be a [MedusaError type](https://docs.medusajs.com/v2/advanced-development/api-routes/errors#medusaerror-types) or `payment_authorization_error` or
* `payment_requires_more_error` for payment-related errors.
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -70,6 +70,9 @@
* "500":
* $ref: "#/components/responses/500_error"
* x-workflow: createCustomerAccountWorkflow
* security:
* - cookie_auth: []
* - jwt_token: []
*
*/
@@ -3,7 +3,8 @@
* operationId: PostPaymentCollectionsIdPaymentSessions
* summary: Initialize Payment Session of a Payment Collection
* x-sidebar-summary: Initialize Payment Session
* description: Initialize and add a payment session to a payment collection. This is used during checkout, where you create a payment collection for the cart, then initialize a payment session for the payment provider that the customer chooses.
* description: Initialize and add a payment session to a payment collection. This is used during checkout, where you create a payment collection for the cart, then initialize a payment session for the
* payment provider that the customer chooses.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/payment
* description: "Storefront guide: How to implement payment during checkout."