oas: [10/n] improve admin oas (#8959)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-09-03 13:29:58 +03:00
1 parent c9e0ba72da
commit 8e177538c1
20 files changed
+97 -82

No files matched your search

@@ -2,7 +2,7 @@
* @oas [post] /admin/fulfillments * @oas [post] /admin/fulfillments
* operationId: PostFulfillments * operationId: PostFulfillments
* summary: Create Fulfillment * summary: Create Fulfillment
* description: Create a fulfillment. * description: Create a fulfillment for an order, return, exchange, and more.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: expand * - name: expand
@@ -1,8 +1,12 @@
/** /**
* @oas [post] /admin/fulfillments/{id}/cancel * @oas [post] /admin/fulfillments/{id}/cancel
* operationId: PostFulfillmentsIdCancel * operationId: PostFulfillmentsIdCancel
* summary: Add Cancels to Fulfillment * summary: Cancel a Fulfillment
* description: Add a list of cancels to a fulfillment. * description: >
* Cancel a fulfillment. The fulfillment can't be shipped or delivered.
*
*
* To cancel the fulfillment, the `cancelFulfillment` method of the associated fulfillment provider is used.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -1,8 +1,9 @@
/** /**
* @oas [post] /admin/fulfillments/{id}/shipment * @oas [post] /admin/fulfillments/{id}/shipment
* operationId: PostFulfillmentsIdShipment * operationId: PostFulfillmentsIdShipment
* summary: Add Shipments to Fulfillment * summary: Create a Shipment for a Fulfillment
* description: Add a list of shipments to a fulfillment. * x-sidebar-summary: Create Shipment
* description: Create a shipment for a fulfillment. The fulfillment must not be shipped or canceled.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -2,7 +2,7 @@
* @oas [post] /admin/inventory-items * @oas [post] /admin/inventory-items
* operationId: PostInventoryItems * operationId: PostInventoryItems
* summary: Create Inventory Item * summary: Create Inventory Item
* description: Create a inventory item. * description: Create an inventory item.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: expand * - name: expand
@@ -1,8 +1,8 @@
/** /**
* @oas [post] /admin/inventory-items/{id} * @oas [post] /admin/inventory-items/{id}
* operationId: PostInventoryItemsId * operationId: PostInventoryItemsId
* summary: Update a Inventory Item * summary: Update an Inventory Item
* description: Update a inventory item's details. * description: Update an inventory item's details.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -62,7 +62,7 @@
* application/json: * application/json:
* schema: * schema:
* type: object * type: object
* description: SUMMARY * description: The properties to update in the inventory item.
* required: * required:
* - sku * - sku
* - hs_code * - hs_code
@@ -81,11 +81,11 @@
* sku: * sku:
* type: string * type: string
* title: sku * title: sku
* description: The inventory item's sku. * description: The inventory item's SKU.
* hs_code: * hs_code:
* type: string * type: string
* title: hs_code * title: hs_code
* description: The inventory item's hs code. * description: The inventory item's HS code.
* weight: * weight:
* type: number * type: number
* title: weight * title: weight
@@ -109,7 +109,7 @@
* mid_code: * mid_code:
* type: string * type: string
* title: mid_code * title: mid_code
* description: The inventory item's mid code. * description: The inventory item's MID code.
* material: * material:
* type: string * type: string
* title: material * title: material
@@ -125,14 +125,14 @@
* requires_shipping: * requires_shipping:
* type: boolean * type: boolean
* title: requires_shipping * title: requires_shipping
* description: The inventory item's requires shipping. * description: Whether the inventory item requires shipping.
* thumbnail: * thumbnail:
* type: string * type: string
* title: thumbnail * title: thumbnail
* description: The inventory item's thumbnail. * description: The URL of an image to be used as the inventory item's thumbnail. You can use the Upload API routes to upload an image and get its URL.
* metadata: * metadata:
* type: object * type: object
* description: The inventory item's metadata. * description: The inventory item's metadata. Can be custom data in key-value pairs.
* x-codeSamples: * x-codeSamples:
* - lang: Shell * - lang: Shell
* label: cURL * label: cURL
@@ -1,8 +1,9 @@
/** /**
* @oas [post] /admin/inventory-items/{id}/location-levels * @oas [post] /admin/inventory-items/{id}/location-levels
* operationId: PostInventoryItemsIdLocationLevels * operationId: PostInventoryItemsIdLocationLevels
* summary: Add Location Levels to Inventory Item * summary: Create Inventory Level for Inventory Item
* description: Add a list of location levels to a inventory item. * x-sidebar-summary: Create Inventory Level
* description: Create an inventory level for an inventory item.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -62,22 +63,22 @@
* application/json: * application/json:
* schema: * schema:
* type: object * type: object
* description: SUMMARY * description: The inventory level's details.
* required: * required:
* - location_id * - location_id
* properties: * properties:
* location_id: * location_id:
* type: string * type: string
* title: location_id * title: location_id
* description: The inventory item's location id. * description: The ID of the associated location.
* stocked_quantity: * stocked_quantity:
* type: number * type: number
* title: stocked_quantity * title: stocked_quantity
* description: The inventory item's stocked quantity. * description: The inventory level's stocked quantity.
* incoming_quantity: * incoming_quantity:
* type: number * type: number
* title: incoming_quantity * title: incoming_quantity
* description: The inventory item's incoming quantity. * description: The inventory level's incoming quantity.
* x-codeSamples: * x-codeSamples:
* - lang: Shell * - lang: Shell
* label: cURL * label: cURL
@@ -1,8 +1,9 @@
/** /**
* @oas [post] /admin/inventory-items/{id}/location-levels/{location_id} * @oas [post] /admin/inventory-items/{id}/location-levels/{location_id}
* operationId: PostInventoryItemsIdLocationLevelsLocation_id * operationId: PostInventoryItemsIdLocationLevelsLocation_id
* summary: Add Location Levels to Inventory Item * summary: Update an Inventory Level of an Inventory Item
* description: Add a list of location levels to a inventory item. * x-sidebar-summary: Update Inventory Level
* description: Updates the details of an inventory item's inventory level using its associated location ID.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -13,7 +14,7 @@
* type: string * type: string
* - name: location_id * - name: location_id
* in: path * in: path
* description: The inventory item's location id. * description: The ID of the location associated with the inventory level.
* required: true * required: true
* schema: * schema:
* type: string * type: string
@@ -68,16 +69,16 @@
* application/json: * application/json:
* schema: * schema:
* type: object * type: object
* description: SUMMARY * description: The properties to update in the inventory level.
* properties: * properties:
* stocked_quantity: * stocked_quantity:
* type: number * type: number
* title: stocked_quantity * title: stocked_quantity
* description: The inventory item's stocked quantity. * description: The inventory level's stocked quantity.
* incoming_quantity: * incoming_quantity:
* type: number * type: number
* title: incoming_quantity * title: incoming_quantity
* description: The inventory item's incoming quantity. * description: The inventory level's incoming quantity.
* x-codeSamples: * x-codeSamples:
* - lang: Shell * - lang: Shell
* label: cURL * label: cURL
@@ -1,8 +1,9 @@
/** /**
* @oas [post] /admin/inventory-items/{id}/location-levels/batch * @oas [post] /admin/inventory-items/{id}/location-levels/batch
* operationId: PostInventoryItemsIdLocationLevelsBatch * operationId: PostInventoryItemsIdLocationLevelsBatch
* summary: Add Location Levels to Inventory Item * summary: Manage Inventory Levels of Inventory Item
* description: Add a list of location levels to a inventory item. * x-sidebar-summary: Manage Inventory Levels
* description: Manage the inventory levels of an inventory item to create or delete them.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -20,51 +21,51 @@
* application/json: * application/json:
* schema: * schema:
* type: object * type: object
* description: SUMMARY * description: The inventory levels to create or delete.
* properties: * properties:
* create: * create:
* type: array * type: array
* description: The inventory item's create. * description: The inventory levels to create.
* items: * items:
* type: object * type: object
* description: The create's details. * description: The inventory level's details.
* required: * required:
* - location_id * - location_id
* properties: * properties:
* location_id: * location_id:
* type: string * type: string
* title: location_id * title: location_id
* description: The create's location id. * description: The ID of the associated location.
* stocked_quantity: * stocked_quantity:
* type: number * type: number
* title: stocked_quantity * title: stocked_quantity
* description: The create's stocked quantity. * description: The inventory level's stocked quantity.
* incoming_quantity: * incoming_quantity:
* type: number * type: number
* title: incoming_quantity * title: incoming_quantity
* description: The create's incoming quantity. * description: The inventory level's incoming quantity.
* update: * update:
* type: array * type: array
* description: The inventory item's update. * description: The inventory levels to update.
* items: * items:
* type: object * type: object
* description: The update's details. * description: The inventory level's details.
* properties: * properties:
* stocked_quantity: * stocked_quantity:
* type: number * type: number
* title: stocked_quantity * title: stocked_quantity
* description: The update's stocked quantity. * description: The inventory level's stocked quantity.
* incoming_quantity: * incoming_quantity:
* type: number * type: number
* title: incoming_quantity * title: incoming_quantity
* description: The update's incoming quantity. * description: The inventory level's incoming quantity.
* delete: * delete:
* type: array * type: array
* description: The inventory item's delete. * description: The inventory levels to delete.
* items: * items:
* type: string * type: string
* title: delete * title: delete
* description: The delete's details. * description: The ID of the inventory level to delete.
* x-codeSamples: * x-codeSamples:
* - lang: Shell * - lang: Shell
* label: cURL * label: cURL
@@ -80,7 +81,7 @@
* application/json: * application/json:
* schema: * schema:
* type: object * type: object
* description: SUMMARY * description: The inventory item's details.
* required: * required:
* - inventory_item * - inventory_item
* properties: * properties:
@@ -52,18 +52,18 @@
* application/json: * application/json:
* schema: * schema:
* type: object * type: object
* description: SUMMARY * description: The invite's details.
* required: * required:
* - email * - email
* properties: * properties:
* email: * email:
* type: string * type: string
* title: email * title: email
* description: The invite's email. * description: The email of the user to invite.
* format: email * format: email
* metadata: * metadata:
* type: object * type: object
* description: The invite's metadata. * description: The invite's metadata. Can be custom data in key-value pairs.
* x-codeSamples: * x-codeSamples:
* - lang: Shell * - lang: Shell
* label: cURL * label: cURL
@@ -1,8 +1,8 @@
/** /**
* @oas [post] /admin/invites/{id}/resend * @oas [post] /admin/invites/{id}/resend
* operationId: PostInvitesIdResend * operationId: PostInvitesIdResend
* summary: Add Resends to Invite * summary: Refresh Invite Token
* description: Add a list of resends to a invite. * description: Refresh the token of an invite.
* x-authenticated: false * x-authenticated: false
* parameters: * parameters:
* - name: id * - name: id
@@ -1,8 +1,12 @@
/** /**
* @oas [post] /admin/invites/accept * @oas [post] /admin/invites/accept
* operationId: PostInvitesAccept * operationId: PostInvitesAccept
* summary: Create Invite * summary: Accept Invite
* description: Create a invite. * description: >
* Accept an invite and create a new user.
*
* Since the user isn't created yet, the JWT token used in the authorization header is retrieved from the `/auth/user/emailpass/register` API route (or a provider other than `emailpass`).
* The user can then authenticate using the `/auth/user/emailpass` API route.
* x-authenticated: false * x-authenticated: false
* parameters: * parameters:
* - name: expand * - name: expand
@@ -52,7 +56,7 @@
* application/json: * application/json:
* schema: * schema:
* type: object * type: object
* description: SUMMARY * description: The details of the user to be created.
* required: * required:
* - email * - email
* - first_name * - first_name
@@ -61,16 +65,16 @@
* email: * email:
* type: string * type: string
* title: email * title: email
* description: The invite's email. * description: The user's email.
* format: email * format: email
* first_name: * first_name:
* type: string * type: string
* title: first_name * title: first_name
* description: The invite's first name. * description: The user's first name.
* last_name: * last_name:
* type: string * type: string
* title: last_name * title: last_name
* description: The invite's last name. * description: The user's last name.
* x-codeSamples: * x-codeSamples:
* - lang: Shell * - lang: Shell
* label: cURL * label: cURL
@@ -92,21 +96,21 @@
* schema: * schema:
* oneOf: * oneOf:
* - type: object * - type: object
* description: SUMMARY * description: The created user's details.
* required: * required:
* - user * - user
* properties: * properties:
* user: * user:
* $ref: "#/components/schemas/AdminUser" * $ref: "#/components/schemas/AdminUser"
* - type: object * - type: object
* description: SUMMARY * description: An error's details.
* required: * required:
* - message * - message
* properties: * properties:
* message: * message:
* type: string * type: string
* title: message * title: message
* description: The invite's message. * description: The error message.
* "400": * "400":
* $ref: "#/components/responses/400_error" * $ref: "#/components/responses/400_error"
* "401": * "401":
@@ -2,7 +2,7 @@
* @oas [post] /admin/order-edits * @oas [post] /admin/order-edits
* operationId: PostOrderEdits * operationId: PostOrderEdits
* summary: Create Order Edit * summary: Create Order Edit
* description: Create a order edit. * description: Create an order edit.
* x-authenticated: true * x-authenticated: true
* parameters: [] * parameters: []
* security: * security:
@@ -1,8 +1,8 @@
/** /**
* @oas [post] /admin/order-edits/{id}/confirm * @oas [post] /admin/order-edits/{id}/confirm
* operationId: PostOrderEditsIdConfirm * operationId: PostOrderEditsIdConfirm
* summary: Add Confirms to Order Edit * summary: Confirm Order Edit
* description: Add a list of confirms to a order edit. * description: Confirm an order edit request and apply the changes on the order.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -43,10 +43,6 @@
* "500": * "500":
* $ref: "#/components/responses/500_error" * $ref: "#/components/responses/500_error"
* x-workflow: confirmOrderEditRequestWorkflow * x-workflow: confirmOrderEditRequestWorkflow
* requestBody:
* content:
* application/json:
* schema: {}
* *
*/ */
@@ -2,7 +2,8 @@
* @oas [post] /admin/order-edits/{id}/items * @oas [post] /admin/order-edits/{id}/items
* operationId: PostOrderEditsIdItems * operationId: PostOrderEditsIdItems
* summary: Add Items to Order Edit * summary: Add Items to Order Edit
* description: Add a list of items to a order edit. * x-sidebar-summary: Add Items
* description: Add new items to an order edit. These items will have the action `ITEM_ADD`.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -1,8 +1,12 @@
/** /**
* @oas [post] /admin/order-edits/{id}/items/{action_id} * @oas [post] /admin/order-edits/{id}/items/{action_id}
* operationId: PostOrderEditsIdItemsAction_id * operationId: PostOrderEditsIdItemsAction_id
* summary: Add Items to Order Edit * summary: Update an Item in an Order Edit
* description: Add a list of items to a order edit. * x-sidebar-summary: Update Item
* description: |
* Update an added item in the order edit by the ID of the item's `ITEM_ADD` action.
*
* Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -13,7 +17,7 @@
* type: string * type: string
* - name: action_id * - name: action_id
* in: path * in: path
* description: The order edit's action id. * description: The ID of the new item's `ITEM_ADD` action.
* required: true * required: true
* schema: * schema:
* type: string * type: string
@@ -1,8 +1,9 @@
/** /**
* @oas [post] /admin/order-edits/{id}/items/item/{item_id} * @oas [post] /admin/order-edits/{id}/items/item/{item_id}
* operationId: PostOrderEditsIdItemsItemItem_id * operationId: PostOrderEditsIdItemsItemItem_id
* summary: Add Items to Order Edit * summary: Update Order Item Quantity of Order Edit
* description: Add a list of items to a order edit. * x-sidebar-summary: Update Item Quantity
* description: Update an existing order item's quantity of an order edit.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -1,8 +1,8 @@
/** /**
* @oas [post] /admin/order-edits/{id}/request * @oas [post] /admin/order-edits/{id}/request
* operationId: PostOrderEditsIdRequest * operationId: PostOrderEditsIdRequest
* summary: Add Requests to Order Edit * summary: Request Order Edit
* description: Add a list of requests to a order edit. * description: Change the status of an active order edit to requested.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -43,10 +43,6 @@
* "500": * "500":
* $ref: "#/components/responses/500_error" * $ref: "#/components/responses/500_error"
* x-workflow: requestOrderEditRequestWorkflow * x-workflow: requestOrderEditRequestWorkflow
* requestBody:
* content:
* application/json:
* schema: {}
* *
*/ */
@@ -1,8 +1,9 @@
/** /**
* @oas [post] /admin/order-edits/{id}/shipping-method * @oas [post] /admin/order-edits/{id}/shipping-method
* operationId: PostOrderEditsIdShippingMethod * operationId: PostOrderEditsIdShippingMethod
* summary: Add Shipping Methods to Order Edit * summary: Add Shipping Method to Order Edit
* description: Add a list of shipping methods to a order edit. * x-sidebar-summary: Add Shipping Method
* description: Add a shipping method to an exchange. The shipping method will have a `SHIPPING_ADD` action.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -1,8 +1,12 @@
/** /**
* @oas [post] /admin/order-edits/{id}/shipping-method/{action_id} * @oas [post] /admin/order-edits/{id}/shipping-method/{action_id}
* operationId: PostOrderEditsIdShippingMethodAction_id * operationId: PostOrderEditsIdShippingMethodAction_id
* summary: Add Shipping Methods to Order Edit * summary: Update Shipping Method of an Order Edit
* description: Add a list of shipping methods to a order edit. * x-sidebar-summary: Update Shipping Method
* description: |
* Update a shipping method in the order edit by the ID of the method's `SHIPPING_ADD` action.
*
* Every shipping method has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id
@@ -13,7 +17,7 @@
* type: string * type: string
* - name: action_id * - name: action_id
* in: path * in: path
* description: The order edit's action id. * description: The ID of the shipping method's `SHIPPING_ADD` action.
* required: true * required: true
* schema: * schema:
* type: string * type: string
@@ -1,8 +1,8 @@
/** /**
* @oas [post] /admin/orders/{id}/archive * @oas [post] /admin/orders/{id}/archive
* operationId: PostOrdersIdArchive * operationId: PostOrdersIdArchive
* summary: Add Archives to Order * summary: Archive an Order
* description: Add a list of archives to a order. * description: Change the status of an order to archived.
* x-authenticated: true * x-authenticated: true
* parameters: * parameters:
* - name: id * - name: id