oas: [11/n] improve admin OAS (#8963)

This commit is contained in:
Shahed Nasser
2024-09-03 17:33:45 +03:00
committed by GitHub
parent ee2c297caa
commit 7e278bef76
20 changed files with 138 additions and 145 deletions

View File

@@ -1,8 +1,8 @@
/**
* @oas [post] /admin/orders/{id}
* operationId: PostOrdersId
* summary: Update a Order
* description: Update a order's details.
* summary: Update an Order
* description: Update an order's details.
* x-authenticated: true
* parameters:
* - name: id

View File

@@ -1,8 +1,13 @@
/**
* @oas [post] /admin/orders/{id}/cancel
* operationId: PostOrdersIdCancel
* summary: Add Cancels to Order
* description: Add a list of cancels to a order.
* summary: Cancel Order
* description: >
* Cancel an order. The cancelation fails if:
*
* - The order has captured payments.
* - The order has refund payments.
* - The order has fulfillments that aren't canceled.
* x-authenticated: true
* parameters:
* - name: id

View File

@@ -1,8 +1,8 @@
/**
* @oas [post] /admin/orders/{id}/complete
* operationId: PostOrdersIdComplete
* summary: Add Completes to Order
* description: Add a list of completes to a order.
* summary: Complete Order
* description: Mark an order as completed.
* x-authenticated: true
* parameters:
* - name: id
@@ -61,23 +61,12 @@
* content:
* application/json:
* schema:
* allOf:
* - type: object
* description: SUMMARY
* required:
* - order_id
* properties:
* order_id:
* type: string
* title: order_id
* description: The order's order id.
* - type: object
* description: SUMMARY
* properties:
* additional_data:
* type: object
* description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter.
* description: SUMMARY
* type: object
* description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter.
* properties:
* additional_data:
* type: object
* description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/orders/{id}/fulfillments
* operationId: PostOrdersIdFulfillments
* summary: Add Fulfillments to Order
* description: Add a list of fulfillments to a order.
* summary: Create an Order Fulfillment
* x-sidebar-summary: Create Fulfillment
* description: Create a fulfillment for an order. The creation fails if the order is canceled.
* x-authenticated: true
* parameters:
* - name: id
@@ -63,7 +64,7 @@
* schema:
* allOf:
* - type: object
* description: SUMMARY
* description: The fulfillment's details.
* required:
* - items
* - location_id
@@ -71,10 +72,10 @@
* properties:
* items:
* type: array
* description: The order's items.
* description: The items to fulfill.
* items:
* type: object
* description: The item's items.
* description: An item's details.
* required:
* - id
* - quantity
@@ -86,25 +87,25 @@
* quantity:
* type: number
* title: quantity
* description: The item's quantity.
* description: The item's quantity to fulfill.
* location_id:
* type: string
* title: location_id
* description: The order's location id.
* description: The ID of the location to fulfill the items from. If not provided, the location associated with the shipping option of the order's shipping method is used.
* no_notification:
* type: boolean
* title: no_notification
* description: The order's no notification.
* description: Whether to send the customer a notification about the created fulfillment.
* metadata:
* type: object
* description: The order's metadata.
* description: The order's metadata. Can hold custom key-value pairs.
* - type: object
* description: SUMMARY
* description: The fulfillment's details.
* properties:
* additional_data:
* type: object
* description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter.
* description: SUMMARY
* description: The fulfillment's details.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,8 @@
/**
* @oas [post] /admin/orders/{id}/fulfillments/{fulfillment_id}/cancel
* operationId: PostOrdersIdFulfillmentsFulfillment_idCancel
* summary: Add Cancels to Order
* description: Add a list of cancels to a order.
* summary: Cancel Fulfillment
* description: Cancel an order's fulfillment. The fulfillment can't be canceled if it's shipped.
* x-authenticated: true
* parameters:
* - name: id
@@ -69,19 +69,19 @@
* schema:
* allOf:
* - type: object
* description: SUMMARY
* description: The cancelation details.
* properties:
* no_notification:
* type: boolean
* title: no_notification
* description: The order's no notification.
* description: Whether the customer should receive a notification about this change.
* - type: object
* description: SUMMARY
* description: The cancelation details.
* properties:
* additional_data:
* type: object
* description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter.
* description: SUMMARY
* description: The cancelation details.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/orders/{id}/fulfillments/{fulfillment_id}/shipments
* operationId: PostOrdersIdFulfillmentsFulfillment_idShipments
* summary: Add Shipments to Order
* description: Add a list of shipments to a order.
* summary: Create Shipment for an Order's Fulfillment
* x-sidebar-summary: Create Shipment
* description: Create a shipment for an order's fulfillment.
* x-authenticated: true
* parameters:
* - name: id
@@ -13,7 +14,7 @@
* type: string
* - name: fulfillment_id
* in: path
* description: The order's fulfillment id.
* description: The fulfillment's ID.
* required: true
* schema:
* type: string
@@ -69,17 +70,17 @@
* schema:
* allOf:
* - type: object
* description: SUMMARY
* description: The shipment's details.
* required:
* - items
* - metadata
* properties:
* items:
* type: array
* description: The order's items.
* description: The items to create shipment for.
* items:
* type: object
* description: The item's items.
* description: The details of the item to create shipment for.
* required:
* - id
* - quantity
@@ -91,10 +92,10 @@
* quantity:
* type: number
* title: quantity
* description: The item's quantity.
* description: The item's quantity to ship.
* labels:
* type: array
* description: The order's labels.
* description: The labels to create for the shipment.
* items:
* type: object
* description: The label's labels.
@@ -114,21 +115,21 @@
* label_url:
* type: string
* title: label_url
* description: The label's label url.
* description: The label's url.
* no_notification:
* type: boolean
* title: no_notification
* description: The order's no notification.
* description: Whether to send the customer a notification about the created shipment.
* metadata:
* type: object
* description: The order's metadata.
* description: The shipment's metadata. Can hold custom key-value pairs.
* - type: object
* description: SUMMARY
* description: The shipment's details.
* properties:
* additional_data:
* type: object
* description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter.
* description: SUMMARY
* description: The shipment's details.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -56,7 +56,7 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The payment collection's details.
* required:
* - order_id
* - amount
@@ -64,11 +64,11 @@
* order_id:
* type: string
* title: order_id
* description: The payment collection's order id.
* description: The ID of the associated order.
* amount:
* type: number
* title: amount
* description: The payment collection's amount.
* description: The amount to be paid.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/payment-collections/{id}/mark-as-paid
* operationId: PostPaymentCollectionsIdMarkAsPaid
* summary: Add Mark As Paids to Payment Collection
* description: Add a list of mark as paids to a payment collection.
* summary: Mark a Payment Collection as Paid
* x-sidebar-summary: Mark as Paid
* description: Mark a payment collection as paid. This creates and authorizes a payment session, then capture its payment, using the manual payment provider.
* x-authenticated: true
* parameters:
* - name: id
@@ -62,14 +63,14 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The payment details.
* required:
* - order_id
* properties:
* order_id:
* type: string
* title: order_id
* description: The payment collection's order id.
* description: The ID of the order associated with the payment collection.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,8 @@
/**
* @oas [post] /admin/payments/{id}/capture
* operationId: PostPaymentsIdCapture
* summary: Add Captures to Payment
* description: Add a list of captures to a payment.
* summary: Capture Payment
* description: Capture an amount of a payment. This uses the `capturePayment` method of the payment provider associated with the payment's collection.
* x-authenticated: true
* parameters:
* - name: id
@@ -62,12 +62,12 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The payment's details.
* properties:
* amount:
* type: number
* title: amount
* description: The payment's amount.
* description: The amount to capture.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,8 @@
/**
* @oas [post] /admin/payments/{id}/refund
* operationId: PostPaymentsIdRefund
* summary: Add Refunds to Payment
* description: Add a list of refunds to a payment.
* summary: Refund Payment
* description: Refund an amount of a payment. This uses the `refundPayment` method of the payment provider associated with the payment's collection.
* x-authenticated: true
* parameters:
* - name: id
@@ -62,20 +62,20 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The refund's details.
* properties:
* amount:
* type: number
* title: amount
* description: The payment's amount.
* description: The amount to refund.
* refund_reason_id:
* type: string
* title: refund_reason_id
* description: The payment's refund reason id.
* description: The ID of a refund reason.
* note:
* type: string
* title: note
* description: The payment's note.
* description: A note to attach to the refund.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/price-lists/{id}/prices/batch
* operationId: PostPriceListsIdPricesBatch
* summary: Add Prices to Price List
* description: Add a list of prices to a price list.
* summary: Manage Prices in Price List
* x-sidebar-summary: Manage Prices
* description: Manage the prices of a price list to create, update, or delete them.
* x-authenticated: true
* parameters:
* - name: id
@@ -20,14 +21,14 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The prices to create, update, or delete.
* properties:
* create:
* type: array
* description: The price list's create.
* description: The prices to create.
* items:
* type: object
* description: The create's details.
* description: A price's details.
* required:
* - currency_code
* - amount
@@ -38,32 +39,34 @@
* currency_code:
* type: string
* title: currency_code
* description: The create's currency code.
* description: The price's currency code.
* amount:
* type: number
* title: amount
* description: The create's amount.
* description: The price's amount.
* variant_id:
* type: string
* title: variant_id
* description: The create's variant id.
* description: The ID of the variant this price is for.
* min_quantity:
* type: number
* title: min_quantity
* description: The create's min quantity.
* description: The minimum quantity that must be available of the associated variant in the cart for this price to apply.
* max_quantity:
* type: number
* title: max_quantity
* description: The create's max quantity.
* description: The maximum quantity that must be available of the associated variant in the cart for this price list to apply.
* rules:
* type: object
* description: The create's rules.
* description: Key-value pair rules to apply on the price.
* example:
* region_id: 123
* update:
* type: array
* description: The price list's update.
* description: The prices to update.
* items:
* type: object
* description: The update's details.
* description: The properties to update in a price.
* required:
* - id
* - variant_id
@@ -73,37 +76,39 @@
* id:
* type: string
* title: id
* description: The update's ID.
* description: The price's ID.
* currency_code:
* type: string
* title: currency_code
* description: The update's currency code.
* description: The price's currency code.
* amount:
* type: number
* title: amount
* description: The update's amount.
* description: The price's amount.
* variant_id:
* type: string
* title: variant_id
* description: The update's variant id.
* description: The ID of the variant this price is for.
* min_quantity:
* type: number
* title: min_quantity
* description: The update's min quantity.
* description: The minimum quantity that must be available of the associated variant in the cart for this price to apply.
* max_quantity:
* type: number
* title: max_quantity
* description: The update's max quantity.
* description: The maximum quantity that must be available of the associated variant in the cart for this price list to apply.
* rules:
* type: object
* description: The update's rules.
* description: Key-value pair rules to apply on the price.
* example:
* region_id: 123
* delete:
* type: array
* description: The price list's delete.
* description: The prices to delete.
* items:
* type: string
* title: delete
* description: The delete's details.
* description: A price's ID.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,8 @@
/**
* @oas [post] /admin/price-lists/{id}/products
* operationId: PostPriceListsIdProducts
* summary: Add Products to Price List
* description: Add a list of products to a price list.
* summary: Remove Products from Price List
* description: Remove products from a price list.
* x-authenticated: true
* parameters:
* - name: id
@@ -62,22 +62,15 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The removal details.
* properties:
* add:
* type: array
* description: The price list's add.
* items:
* type: string
* title: add
* description: The add's details.
* remove:
* type: array
* description: The price list's remove.
* description: The products to remove from the price list.
* items:
* type: string
* title: remove
* description: The remove's details.
* description: The ID of a product.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -62,10 +62,7 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* required:
* - parent_category_id
* - metadata
* description: The properties to update in the product category.
* properties:
* name:
* type: string
@@ -78,26 +75,26 @@
* handle:
* type: string
* title: handle
* description: The product category's handle.
* description: The product category's handle. Must be a unique value.
* is_internal:
* type: boolean
* title: is_internal
* description: The product category's is internal.
* description: Whether the product category is only used for internal purposes and shouldn't be shown the customer.
* is_active:
* type: boolean
* title: is_active
* description: The product category's is active.
* description: Whether the product category is active.
* parent_category_id:
* type: string
* title: parent_category_id
* description: The product category's parent category id.
* description: The ID of a parent category.
* metadata:
* type: object
* description: The product category's metadata.
* description: The product category's metadata. Can hold custom key-value pairs.
* rank:
* type: number
* title: rank
* description: The product category's rank.
* description: The product category's rank among other categories.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/product-categories/{id}/products
* operationId: PostProductCategoriesIdProducts
* summary: Add Products to Product Category
* description: Add a list of products to a product category.
* summary: Manage Products in Product Category
* x-sidebar-summary: Manage Products
* description: Manage products of a category to add or remove them.
* x-authenticated: true
* parameters:
* - name: id
@@ -62,22 +63,22 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* description: The products to add or remove from the category.
* properties:
* add:
* type: array
* description: The product category's add.
* description: The products to add.
* items:
* type: string
* title: add
* description: The add's details.
* description: A product ID.
* remove:
* type: array
* description: The product category's remove.
* description: The product to remove.
* items:
* type: string
* title: remove
* description: The remove's details.
* description: A product ID.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -62,9 +62,7 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* required:
* - metadata
* description: The properties to update in the product tag.
* properties:
* value:
* type: string
@@ -72,7 +70,7 @@
* description: The product tag's value.
* metadata:
* type: object
* description: The product tag's metadata.
* description: The product tag's metadata. Can hold custom key-value pairs.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -62,9 +62,7 @@
* application/json:
* schema:
* type: object
* description: SUMMARY
* required:
* - metadata
* description: The properties to update in the product type.
* properties:
* value:
* type: string
@@ -72,7 +70,7 @@
* description: The product type's value.
* metadata:
* type: object
* description: The product type's metadata.
* description: The product type's metadata. Can hold custom key-value pairs.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/products/{id}/options
* operationId: PostProductsIdOptions
* summary: Add Options to Product
* description: Add a list of options to a product.
* summary: Create a Product Option
* x-sidebar-summary: Create Option
* description: Create an option for a product.
* x-authenticated: true
* parameters:
* - name: id
@@ -64,12 +65,12 @@
* allOf:
* - $ref: "#/components/schemas/AdminCreateProductOption"
* - type: object
* description: SUMMARY
* description: The product option's details.
* properties:
* additional_data:
* type: object
* description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter.
* description: SUMMARY
* description: The product option's details.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/products/{id}/options/{option_id}
* operationId: PostProductsIdOptionsOption_id
* summary: Add Options to Product
* description: Add a list of options to a product.
* summary: Update a Product's Option
* x-sidebar-summary: Update Option
* description: Update the details of a product option.
* x-authenticated: true
* parameters:
* - name: id
@@ -13,7 +14,7 @@
* type: string
* - name: option_id
* in: path
* description: The product's option id.
* description: The option's ID.
* required: true
* schema:
* type: string
@@ -70,12 +71,12 @@
* allOf:
* - $ref: "#/components/schemas/AdminUpdateProductOption"
* - type: object
* description: SUMMARY
* description: The properties to update in the product option.
* properties:
* additional_data:
* type: object
* description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter.
* description: SUMMARY
* description: The properties to update in the product option.
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/products/{id}/variants/{variant_id}/inventory-items
* operationId: PostProductsIdVariantsVariant_idInventoryItems
* summary: Add Inventory Items to Product
* description: Add a list of inventory items to a product.
* summary: Associate Variant with Inventory Item
* x-sidebar-summary: Associate Variant's Inventory
* description: Associate with a product variant an inventory item that manages its inventory details.
* x-authenticated: true
* parameters:
* - name: id
@@ -13,7 +14,7 @@
* type: string
* - name: variant_id
* in: path
* description: The product's variant id.
* description: The variant's ID.
* required: true
* schema:
* type: string

View File

@@ -1,8 +1,9 @@
/**
* @oas [post] /admin/products/{id}/variants/{variant_id}/inventory-items/{inventory_item_id}
* operationId: PostProductsIdVariantsVariant_idInventoryItemsInventory_item_id
* summary: Add Inventory Items to Product
* description: Add a list of inventory items to a product.
* summary: Update Product Variant's Inventory Details
* x-sidebary-summary: Update Variant Inventory
* description: Update the inventory item that manages the inventory details of a product variant.
* x-authenticated: true
* parameters:
* - name: id
@@ -13,13 +14,13 @@
* type: string
* - name: variant_id
* in: path
* description: The product's variant id.
* description: The variant's ID.
* required: true
* schema:
* type: string
* - name: inventory_item_id
* in: path
* description: The product's inventory item id.
* description: The inventory item's ID.
* required: true
* schema:
* type: string