chore(docs): Generated API Reference (#2572)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
This commit is contained in:
co-authored by
shahednasser
parent
884322447e
commit
325b1e9017
@@ -1,6 +1,6 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.orderEdit.retrieve(orderEditId)
|
||||
medusa.orderEdits.retrieve(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.orderEdit.complete(orderEditId)
|
||||
medusa.orderEdits.complete(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.orderEdit.decline(orderEditId)
|
||||
medusa.orderEdits.decline(order_edit_id)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id);
|
||||
})
|
||||
|
||||
@@ -9,6 +9,6 @@ medusa.returns.create({
|
||||
}
|
||||
]
|
||||
})
|
||||
.then(({ return }) => {
|
||||
console.log(return.id);
|
||||
.then((data) => {
|
||||
console.log(data.return.id);
|
||||
});
|
||||
|
||||
@@ -16,11 +16,11 @@ properties:
|
||||
description: The ID of the order that is edited
|
||||
example: order_01G2SG30J8C85S4A5CHM2S1NS2
|
||||
order:
|
||||
description: Order object
|
||||
description: Available if the relation `order` is expanded.
|
||||
$ref: ./order.yaml
|
||||
changes:
|
||||
type: array
|
||||
description: Line item changes array.
|
||||
description: Available if the relation `changes` is expanded.
|
||||
items:
|
||||
$ref: ./order_item_change.yaml
|
||||
internal_note:
|
||||
@@ -92,8 +92,32 @@ properties:
|
||||
The difference between the total amount of the order and total amount of
|
||||
edited order.
|
||||
example: 8200
|
||||
status:
|
||||
type: string
|
||||
description: The status of the order edit.
|
||||
enum:
|
||||
- confirmed
|
||||
- declined
|
||||
- requested
|
||||
- created
|
||||
- canceled
|
||||
items:
|
||||
type: array
|
||||
description: Computed line items from the changes.
|
||||
description: Available if the relation `items` is expanded.
|
||||
items:
|
||||
$ref: ./line_item.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
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
|
||||
@@ -11,7 +11,7 @@ properties:
|
||||
example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
type:
|
||||
type: string
|
||||
description: The order's status
|
||||
description: The order item change's status
|
||||
enum:
|
||||
- item_add
|
||||
- item_remove
|
||||
@@ -21,19 +21,36 @@ properties:
|
||||
description: The ID of the order edit
|
||||
example: oe_01G2SG30J8C85S4A5CHM2S1NS2
|
||||
order_edit:
|
||||
description: Order edit object
|
||||
description: Available if the relation `order_edit` is expanded.
|
||||
$ref: ./order_edit.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: Original line item object.
|
||||
description: Available if the relation `original_line_item` is expanded.
|
||||
$ref: ./line_item.yaml
|
||||
line_item_id:
|
||||
type: string
|
||||
description: The ID of the cloned line item.
|
||||
example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
|
||||
line_item:
|
||||
description: Line item object.
|
||||
description: Available if the relation `line_item` is expanded.
|
||||
$ref: ./line_item.yaml
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was deleted.
|
||||
format: date-time
|
||||
metadata:
|
||||
type: object
|
||||
description: An optional key-value map with additional details
|
||||
example:
|
||||
car: white
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
title: Payment Collection
|
||||
description: Payment Collection
|
||||
x-resourceId: payment_collection
|
||||
required:
|
||||
- type
|
||||
- status
|
||||
- amount
|
||||
- region_id
|
||||
- currency_code
|
||||
- created_by
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The payment collection's ID
|
||||
example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK
|
||||
type:
|
||||
type: string
|
||||
description: The type of the payment collection
|
||||
enum:
|
||||
- order_edit
|
||||
status:
|
||||
type: string
|
||||
description: The type of the payment collection
|
||||
enum:
|
||||
- not_paid
|
||||
- awaiting
|
||||
- authorized
|
||||
- partially_authorized
|
||||
- captured
|
||||
- partially_captured
|
||||
- refunded
|
||||
- partially_refunded
|
||||
- canceled
|
||||
- requires_action
|
||||
description:
|
||||
type: string
|
||||
description: Description of the payment collection
|
||||
amount:
|
||||
type: number
|
||||
description: Amount of the payment collection.
|
||||
authorized_amount:
|
||||
type: number
|
||||
description: Authorized amount of the payment collection.
|
||||
captured_amount:
|
||||
type: number
|
||||
description: Captured amount of the payment collection.
|
||||
refunded_amount:
|
||||
type: number
|
||||
description: Refunded amount of the payment collection.
|
||||
region_id:
|
||||
type: string
|
||||
description: The region's ID
|
||||
example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
|
||||
region:
|
||||
description: Available if the relation `region` is expanded.
|
||||
$ref: ./region.yaml
|
||||
currency_code:
|
||||
description: The 3 character ISO code for the currency.
|
||||
type: string
|
||||
example: usd
|
||||
externalDocs:
|
||||
url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
|
||||
description: See a list of codes.
|
||||
currency:
|
||||
description: Available if the relation `currency` is expanded.
|
||||
$ref: ./currency.yaml
|
||||
payment_sessions:
|
||||
type: array
|
||||
description: Available if the relation `payment_sessions` is expanded.
|
||||
items:
|
||||
$ref: ./payment_session.yaml
|
||||
payments:
|
||||
type: array
|
||||
description: Available if the relation `payments` is expanded.
|
||||
items:
|
||||
$ref: ./payment.yaml
|
||||
created_by:
|
||||
type: string
|
||||
description: The ID of the user that created the payment collection.
|
||||
created_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was created.
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was updated.
|
||||
format: date-time
|
||||
deleted_at:
|
||||
type: string
|
||||
description: The date with timezone at which the resource was deleted.
|
||||
format: date-time
|
||||
metadata:
|
||||
type: object
|
||||
description: An optional key-value map with additional details
|
||||
example:
|
||||
car: white
|
||||
@@ -12,7 +12,7 @@ required:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The cart's ID
|
||||
description: The region's ID
|
||||
example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
|
||||
name:
|
||||
description: >-
|
||||
|
||||
@@ -21,6 +21,15 @@ get:
|
||||
- type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: sales_channel_id
|
||||
style: form
|
||||
explode: false
|
||||
description: an array of sales channel IDs to filter the retrieved products by.
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: collection_id
|
||||
style: form
|
||||
@@ -30,6 +39,15 @@ get:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: type_id
|
||||
style: form
|
||||
explode: false
|
||||
description: Type IDs to search for
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: tags
|
||||
style: form
|
||||
@@ -59,11 +77,6 @@ get:
|
||||
description: Search for giftcards using is_giftcard=true.
|
||||
schema:
|
||||
type: boolean
|
||||
- in: query
|
||||
name: type
|
||||
description: type to search for.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: created_at
|
||||
description: Date comparison for when resulting products were created.
|
||||
|
||||
Reference in New Issue
Block a user