feat(oas) - accurate model OAS representation - F to O (#3210)

### Scope

Models F to O

### What

Refactor OAS for models to accurately represent their shape in API responses.

### Why

About 33% of model fields are not accurately represented in the OAS. Most of the issues are:
- fields that can not be omitted in the response are not declared as `required`
- fields that could return `null` as their value are not declared as `nullable: true`

When using a code generator, these OAS issues would lead to inaccurate response shapes in the generated client.

### How

#### nullable
Fields meeting at least one of the following condition will be represented as `nullable: true` in OAS:
* The field is decorated with `@Column({ nullable: true })`
* The field is decorated with `@OneToOne`, `@ManyToOne`
* The field is decorated with `@DeleteDateColumn`

#### optional
Fields meeting at least one of the following conditions will never be listed as `required` in OAS and will be considered optional and could be omitted in the response:
* The field is decorated with `@OneToOne`, `@ManyToOne`, `@OneToMany`, `@ManyToMany`
* The field is decorated with `@FeatureFlagColumn`
* The field is decorated with `@Column({select: false})`
* The field is representing dynamic values not persisted in the database

Fields not meeting any of the conditions above will be declared as `required` and are expected to be present in the response.

### Test
* Ran OAS validator.
* Ran docs build script.

Expect OAS changes to be reflected in the API documentation.
This commit is contained in:
Patrick
2023-02-09 10:03:11 -05:00
committed by GitHub
parent d859ccf551
commit 507ad00bec
20 changed files with 597 additions and 371 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
feat(oas) - accurate model OAS representation - F to O

View File

@@ -34,21 +34,23 @@ export class FulfillmentItem {
* - quantity
* properties:
* fulfillment_id:
* description: "The id of the Fulfillment that the Fulfillment Item belongs to."
* description: The id of the Fulfillment that the Fulfillment Item belongs to.
* type: string
* example: ful_01G8ZRTMQCA76TXNAT81KPJZRF
* item_id:
* description: "The id of the Line Item that the Fulfillment Item references."
* description: The id of the Line Item that the Fulfillment Item references.
* type: string
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* fulfillment:
* description: A fulfillment object. Available if the relation `fulfillment` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Fulfillment"
* item:
* description: Available if the relation `item` is expanded.
* nullable: true
* $ref: "#/components/schemas/LineItem"
* quantity:
* description: "The quantity of the Line Item that is included in the Fulfillment."
* description: The quantity of the Line Item that is included in the Fulfillment.
* type: integer
* example: 1
*/

View File

@@ -14,13 +14,16 @@ export class FulfillmentProvider {
* title: "Fulfillment Provider"
* description: "Represents a fulfillment provider plugin and holds its installation status."
* type: object
* required:
* - id
* - is_installed
* properties:
* id:
* description: "The id of the fulfillment provider as given by the plugin."
* description: The id of the fulfillment provider as given by the plugin.
* type: string
* example: manual
* is_installed:
* description: "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`."
* description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.
* type: boolean
* example: true
* default: true
*/

View File

@@ -99,44 +99,66 @@ export class Fulfillment extends BaseEntity {
* description: "Fulfillments are created once store operators can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a provider, which is typically an external shipping aggregator, shipping 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."
* type: object
* required:
* - provider_id
* - canceled_at
* - claim_order_id
* - created_at
* - data
* - id
* - idempotency_key
* - location_id
* - metadata
* - no_notification
* - order_id
* - provider_id
* - shipped_at
* - swap_id
* - tracking_numbers
* - updated_at
* properties:
* id:
* description: The fulfillment's ID
* type: string
* description: The cart's ID
* example: ful_01G8ZRTMQCA76TXNAT81KPJZRF
* claim_order_id:
* description: "The id of the Claim that the Fulfillment belongs to."
* description: The id of the Claim that the Fulfillment belongs to.
* nullable: true
* type: string
* example: null
* claim_order:
* description: A claim order object. Available if the relation `claim_order` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/ClaimOrder"
* swap_id:
* description: "The id of the Swap that the Fulfillment belongs to."
* description: The id of the Swap that the Fulfillment belongs to.
* nullable: true
* type: string
* example: null
* swap:
* description: A swap object. Available if the relation `swap` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Swap"
* order_id:
* description: "The id of the Order that the Fulfillment belongs to."
* description: The id of the Order that the Fulfillment belongs to.
* nullable: true
* type: string
* example: order_01G8TJSYT9M6AVS5N4EMNFS1EK
* order:
* description: An order object. Available if the relation `order` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Order"
* provider_id:
* description: "The id of the Fulfillment Provider responsible for handling the fulfillment"
* description: The id of the Fulfillment Provider responsible for handling the fulfillment
* type: string
* example: manual
* location_id:
* description: "The id of the stock location the fulfillment will be shipped from"
* type: string
* example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK
* provider:
* description: Available if the relation `provider` is expanded.
* nullable: true
* $ref: "#/components/schemas/FulfillmentProvider"
* location_id:
* description: The id of the stock location the fulfillment will be shipped from
* nullable: true
* type: string
* example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK
* items:
* description: The Fulfillment Items in the Fulfillment - these hold information about how many of each Line Item has been fulfilled. Available if the relation `items` is expanded.
* type: array
@@ -148,8 +170,8 @@ export class Fulfillment extends BaseEntity {
* items:
* $ref: "#/components/schemas/TrackingLink"
* tracking_numbers:
* deprecated: true
* description: The tracking numbers that can be used to track the status of the fulfillment.
* deprecated: true
* type: array
* items:
* type: string
@@ -158,37 +180,38 @@ export class Fulfillment extends BaseEntity {
* type: object
* example: {}
* shipped_at:
* description: "The date with timezone at which the Fulfillment was shipped."
* description: The date with timezone at which the Fulfillment was shipped.
* nullable: true
* type: string
* format: date-time
* no_notification:
* description: "Flag for describing whether or not notifications related to this should be send."
* description: Flag for describing whether or not notifications related to this should be sent.
* nullable: true
* type: boolean
* example: false
* canceled_at:
* description: "The date with timezone at which the Fulfillment was canceled."
* description: The date with timezone at which the Fulfillment was canceled.
* nullable: true
* type: string
* format: date-time
* idempotency_key:
* type: string
* description: Randomly generated key used to continue the completion of the fulfillment in case of failure.
* nullable: true
* type: string
* externalDocs:
* url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key
* description: Learn more how to use the idempotency key.
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* description: "The date with timezone at which the resource was created."
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* 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
* nullable: true
* type: object
* example: {car: "white"}
*/

View File

@@ -60,41 +60,50 @@ export class GiftCardTransaction {
* description: "Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order"
* type: object
* required:
* - gift_card_id
* - amount
* - created_at
* - gift_card_id
* - id
* - is_taxable
* - order_id
* - tax_rate
* properties:
* id:
* type: string
* description: The gift card transaction's ID
* type: string
* example: gct_01G8X9A7ESKAJXG2H0E6F1MW7A
* gift_card_id:
* description: "The ID of the Gift Card that was used in the transaction."
* description: The ID of the Gift Card that was used in the transaction.
* type: string
* example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ
* gift_card:
* description: A gift card object. Available if the relation `gift_card` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/GiftCard"
* order_id:
* description: "The ID of the Order that the Gift Card was used to pay for."
* description: The ID of the Order that the Gift Card was used to pay for.
* type: string
* example: order_01G8TJSYT9M6AVS5N4EMNFS1EK
* order:
* description: An order object. Available if the relation `order` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Order"
* amount:
* description: "The amount that was used from the Gift Card."
* description: The amount that was used from the Gift Card.
* type: integer
* example: 10
* created_at:
* description: "The date with timezone at which the resource was created."
* description: The date with timezone at which the resource was created.
* type: string
* format: date-time
* is_taxable:
* description: "Whether the transaction is taxable or not."
* description: Whether the transaction is taxable or not.
* nullable: true
* type: boolean
* example: false
* tax_rate:
* description: "The tax rate of the transaction"
* description: The tax rate of the transaction
* nullable: true
* type: number
* example: 0
*/

View File

@@ -68,67 +68,83 @@ export class GiftCard extends SoftDeletableEntity {
* description: "Gift Cards are redeemable and represent a value that can be used towards the payment of an Order."
* type: object
* required:
* - code
* - value
* - balance
* - code
* - created_at
* - deleted_at
* - ends_at
* - id
* - is_disabled
* - metadata
* - order_id
* - region_id
* - tax_rate
* - updated_at
* - value
* properties:
* id:
* description: The gift card's ID
* type: string
* description: The cart's ID
* example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ
* code:
* description: "The unique code that identifies the Gift Card. This is used by the Customer to redeem the value of the Gift Card."
* description: The unique code that identifies the Gift Card. This is used by the Customer to redeem the value of the Gift Card.
* type: string
* example: 3RFT-MH2C-Y4YZ-XMN4
* value:
* description: "The value that the Gift Card represents."
* description: The value that the Gift Card represents.
* type: integer
* example: 10
* balance:
* description: "The remaining value on the Gift Card."
* description: The remaining value on the Gift Card.
* type: integer
* example: 10
* region_id:
* description: The id of the Region in which the Gift Card is available.
* type: string
* description: "The id of the Region in which the Gift Card is available."
* example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
* region:
* description: A region object. Available if the relation `region` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Region"
* order_id:
* description: The id of the Order that the Gift Card was purchased in.
* nullable: true
* type: string
* description: "The id of the Order that the Gift Card was purchased in."
* example: order_01G8TJSYT9M6AVS5N4EMNFS1EK
* order:
* description: An order object. Available if the relation `order` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Order"
* is_disabled:
* description: "Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts."
* description: Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts.
* type: boolean
* example: false
* default: false
* ends_at:
* description: "The time at which the Gift Card can no longer be used."
* description: The time at which the Gift Card can no longer be used.
* nullable: true
* type: string
* format: date-time
* tax_rate:
* description: The gift cards's tax rate that will be applied on calculating totals
* description: The gift card's tax rate that will be applied on calculating totals
* nullable: true
* type: number
* example: 0
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* description: "The date with timezone at which the resource was created."
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* type: string
* description: "The date with timezone at which the resource was updated."
* format: date-time
* deleted_at:
* description: The date with timezone at which the resource was deleted.
* nullable: true
* 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
* nullable: true
* type: object
* example: {car: "white"}
*/

View File

@@ -55,14 +55,23 @@ export class IdempotencyKey {
* description: "Idempotency Key is used to continue a process in case of any failure that might occur."
* type: object
* required:
* - created_at
* - id
* - idempotency_key
* - locked_at
* - recovery_point
* - response_code
* - response_body
* - request_method
* - request_params
* - request_path
* properties:
* id:
* type: string
* description: The idempotency key's ID
* type: string
* example: ikey_01G8X9A7ESKAJXG2H0E6F1MW7A
* idempotency_key:
* description: "The unique randomly generated key used to determine the state of a process."
* description: The unique randomly generated key used to determine the state of a process.
* type: string
* externalDocs:
* url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key
@@ -73,32 +82,38 @@ export class IdempotencyKey {
* format: date-time
* locked_at:
* description: Date which the idempotency key was locked.
* nullable: true
* type: string
* format: date-time
* request_method:
* description: "The method of the request"
* description: The method of the request
* nullable: true
* type: string
* example: POST
* request_params:
* description: The parameters passed to the request
* nullable: true
* type: object
* description: "The parameters passed to the request"
* example:
* id: cart_01G8ZH853Y6TFXWPG5EYE81X63
* request_path:
* description: "The request's path"
* description: The request's path
* nullable: true
* type: string
* example: /store/carts/cart_01G8ZH853Y6TFXWPG5EYE81X63/complete
* response_code:
* description: The response's code.
* nullable: true
* type: string
* description: "The response's code."
* example: 200
* response_body:
* description: The response's body
* nullable: true
* type: object
* description: "The response's body"
* example:
* id: cart_01G8ZH853Y6TFXWPG5EYE81X63
* recovery_point:
* description: Where to continue from.
* type: string
* description: "Where to continue from."
* default: started
*/

View File

@@ -24,6 +24,11 @@ export class Image extends SoftDeletableEntity {
* description: "Images holds a reference to a URL at which the image file can be found."
* type: object
* required:
* - created_at
* - deleted_at
* - id
* - metadata
* - updated_at
* - url
* properties:
* id:
@@ -31,23 +36,25 @@ export class Image extends SoftDeletableEntity {
* description: The image's ID
* example: img_01G749BFYR6T8JTVW6SGW3K3E6
* url:
* description: "The URL at which the image file can be found."
* description: The URL at which the image file can be found.
* type: string
* format: uri
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* description: "The date with timezone at which the resource was created."
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* type: string
* description: "The date with timezone at which the resource was updated."
* format: date-time
* deleted_at:
* description: The date with timezone at which the resource was deleted.
* nullable: true
* 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
* nullable: true
* type: object
* example: {car: "white"}
*/

View File

@@ -43,6 +43,15 @@ export class Invite extends SoftDeletableEntity {
* description: "Represents an invite"
* type: object
* required:
* - accepted
* - created_at
* - deleted_at
* - expires_at
* - id
* - metadata
* - role
* - token
* - updated_at
* - user_email
* properties:
* id:
@@ -50,42 +59,45 @@ export class Invite extends SoftDeletableEntity {
* description: The invite's ID
* example: invite_01G8TKE4XYCTHSCK2GDEP47RE1
* user_email:
* type: string
* description: The email of the user being invited.
* type: string
* format: email
* role:
* type: string
* description: The user's role.
* nullable: true
* type: string
* enum:
* - admin
* - member
* - developer
* default: member
* accepted:
* type: boolean
* description: Whether the invite was accepted or not.
* example: false
* type: boolean
* default: false
* token:
* type: string
* description: The token used to accept the invite.
* expores_at:
* type: string
* expires_at:
* description: The date the invite expires at.
* type: string
* format: date-time
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* description: "The date with timezone at which the resource was created."
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* type: string
* description: "The date with timezone at which the resource was updated."
* format: date-time
* deleted_at:
* description: The date with timezone at which the resource was deleted.
* nullable: true
* 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
* nullable: true
* type: object
* example: {car: "white"}
*/

View File

@@ -59,38 +59,45 @@ export class LineItemAdjustment {
* description: "Represents a Line Item Adjustment"
* type: object
* required:
* - item_id
* - description
* - amount
* - description
* - discount_id
* - id
* - item_id
* - metadata
* properties:
* id:
* description: The Line Item Adjustment's ID
* type: string
* description: The invite's ID
* example: lia_01G8TKE4XYCTHSCK2GDEP47RE1
* item_id:
* type: string
* description: The ID of the line item
* type: string
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* item:
* description: Available if the relation `item` is expanded.
* nullable: true
* $ref: "#/components/schemas/LineItem"
* description:
* type: string
* description: The line item's adjustment description
* type: string
* example: Adjusted item's price.
* discount_id:
* type: string
* description: The ID of the discount associated with the adjustment
* nullable: true
* type: string
* example: disc_01F0YESMW10MGHWJKZSDDMN0VN
* discount:
* description: Available if the relation `discount` is expanded.
* nullable: true
* $ref: "#/components/schemas/Discount"
* amount:
* type: number
* description: The adjustment amount
* type: integer
* example: 1000
* metadata:
* type: object
* description: An optional key-value map with additional details
* nullable: true
* type: object
* example: {car: "white"}
*/

View File

@@ -35,43 +35,51 @@ export class LineItemTaxLine extends TaxLine {
* description: "Represents a Line Item Tax Line"
* type: object
* required:
* - code
* - created_at
* - id
* - item_id
* - rate
* - metadata
* - name
* - rate
* - updated_at
* properties:
* id:
* type: string
* description: The line item tax line's ID
* example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8
* item_id:
* type: string
* description: The ID of the line item
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* item:
* description: Available if the relation `item` is expanded.
* $ref: "#/components/schemas/LineItem"
* example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8
* code:
* description: "A code to identify the tax type by"
* description: A code to identify the tax type by
* nullable: true
* type: string
* example: tax01
* name:
* description: "A human friendly name for the tax"
* description: A human friendly name for the tax
* type: string
* example: Tax Example
* rate:
* description: "The numeric rate to charge tax by"
* description: The numeric rate to charge tax by
* type: number
* example: 10
* created_at:
* item_id:
* description: The ID of the line item
* type: string
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* item:
* description: Available if the relation `item` is expanded.
* nullable: true
* $ref: "#/components/schemas/LineItem"
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* description: "The date with timezone at which the resource was created."
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* type: string
* description: "The date with timezone at which the resource was updated."
* format: date-time
* metadata:
* type: object
* description: An optional key-value map with additional details
* nullable: true
* type: object
* example: {car: "white"}
*/

View File

@@ -6,7 +6,7 @@ import {
Index,
JoinColumn,
ManyToOne,
OneToMany
OneToMany,
} from "typeorm"
import { BaseEntity } from "../interfaces"
@@ -161,42 +161,71 @@ export class LineItem extends BaseEntity {
* description: "Line Items represent purchasable units that can be added to a Cart for 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."
* type: object
* required:
* - allow_discounts
* - cart_id
* - claim_order_id
* - created_at
* - description
* - fulfilled_quantity
* - has_shipping
* - id
* - is_giftcard
* - is_return
* - metadata
* - order_edit_id
* - order_id
* - original_item_id
* - quantity
* - returned_quantity
* - shipped_quantity
* - should_merge
* - swap_id
* - thumbnail
* - title
* - unit_price
* - quantity
* - updated_at
* - variant_id
* properties:
* id:
* description: The line item's ID
* type: string
* description: The cart's ID
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* cart_id:
* description: "The ID of the Cart that the Line Item belongs to."
* description: The ID of the Cart that the Line Item belongs to.
* nullable: true
* type: string
* example: cart_01G8ZH853Y6TFXWPG5EYE81X63
* cart:
* description: A cart object. Available if the relation `cart` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Cart"
* order_id:
* description: "The ID of the Order that the Line Item belongs to."
* description: The ID of the Order that the Line Item belongs to.
* nullable: true
* type: string
* example: order_01G8TJSYT9M6AVS5N4EMNFS1EK
* order:
* description: An order object. Available if the relation `order` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Order"
* swap_id:
* description: "The id of the Swap that the Line Item belongs to."
* description: The id of the Swap that the Line Item belongs to.
* nullable: true
* type: string
* example: null
* swap:
* description: A swap object. Available if the relation `swap` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Swap"
* claim_order_id:
* description: "The id of the Claim that the Line Item belongs to."
* description: The id of the Claim that the Line Item belongs to.
* nullable: true
* type: string
* example: null
* claim_order:
* description: A claim order object. Available if the relation `claim_order` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/ClaimOrder"
* tax_lines:
* description: Available if the relation `tax_lines` is expanded.
* type: array
@@ -207,120 +236,133 @@ export class LineItem extends BaseEntity {
* type: array
* items:
* $ref: "#/components/schemas/LineItemAdjustment"
* original_item_id:
* description: The id of the original line item
* nullable: true
* type: string
* order_edit_id:
* description: The ID of the order edit to which a cloned item belongs
* nullable: true
* type: string
* order_edit:
* description: The order edit joined. Available if the relation `order_edit` is expanded.
* nullable: true
* $ref: "#/components/schemas/OrderEdit"
* title:
* description: "The title of the Line Item, this should be easily identifiable by the Customer."
* description: The title of the Line Item, this should be easily identifiable by the Customer.
* type: string
* example: Medusa Coffee Mug
* description:
* description: "A more detailed description of the contents of the Line Item."
* description: A more detailed description of the contents of the Line Item.
* nullable: true
* type: string
* example: One Size
* thumbnail:
* description: "A URL string to a small image of the contents of the Line Item."
* description: A URL string to a small image of the contents of the Line Item.
* nullable: true
* type: string
* format: uri
* example: https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png
* is_return:
* description: "Is the item being returned"
* description: Is the item being returned
* type: boolean
* example: false
* default: false
* is_giftcard:
* description: "Flag to indicate if the Line Item is a Gift Card."
* description: Flag to indicate if the Line Item is a Gift Card.
* type: boolean
* example: false
* default: false
* should_merge:
* description: "Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item."
* description: Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item.
* type: boolean
* example: false
* default: true
* allow_discounts:
* description: "Flag to indicate if the Line Item should be included when doing discount calculations."
* description: Flag to indicate if the Line Item should be included when doing discount calculations.
* type: boolean
* example: false
* default: true
* has_shipping:
* description: "Flag to indicate if the Line Item has fulfillment associated with it."
* description: Flag to indicate if the Line Item has fulfillment associated with it.
* nullable: true
* type: boolean
* example: false
* unit_price:
* description: "The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to."
* type: boolean
* description: The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to.
* type: integer
* example: 8000
* variant_id:
* description: "The id of the Product Variant contained in the Line Item."
* description: The id of the Product Variant contained in the Line Item.
* nullable: true
* type: string
* example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6
* variant:
* description: A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/ProductVariant"
* quantity:
* description: "The quantity of the content in the Line Item."
* description: The quantity of the content in the Line Item.
* type: integer
* example: 1
* fulfilled_quantity:
* description: "The quantity of the Line Item that has been fulfilled."
* description: The quantity of the Line Item that has been fulfilled.
* nullable: true
* type: integer
* example: 0
* returned_quantity:
* description: "The quantity of the Line Item that has been returned."
* description: The quantity of the Line Item that has been returned.
* nullable: true
* type: integer
* example: 0
* shipped_quantity:
* description: "The quantity of the Line Item that has been shipped."
* description: The quantity of the Line Item that has been shipped.
* nullable: true
* type: integer
* example: 0
* refundable:
* description: "The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration."
* description: The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration.
* type: integer
* example: 0
* subtotal:
* type: integer
* description: The subtotal of the line item
* type: integer
* example: 8000
* tax_total:
* type: integer
* description: The total of tax of the line item
* type: integer
* example: 0
* total:
* type: integer
* description: The total amount of the line item
* type: integer
* example: 8000
* original_total:
* type: integer
* description: The original total amount of the line item
* type: integer
* example: 8000
* original_tax_total:
* type: integer
* description: The original tax total amount of the line item
* type: integer
* example: 0
* discount_total:
* type: integer
* description: The total of discount of the line item
* type: integer
* example: 0
* gift_card_total:
* type: integer
* description: The total of the gift card of the line item
* type: integer
* example: 0
* includes_tax:
* description: "[EXPERIMENTAL] Indicates if the line item unit_price include tax"
* type: boolean
* original_item_id:
* description: "[EXPERIMENTAL] The id of the original line item"
* type: string
* order_edit_id:
* description: "[EXPERIMENTAL] The ID of the order edit to which a cloned item belongs"
* type: string
* order_edit:
* description: "[EXPERIMENTAL] The order edit joined"
* type: object
* default: false
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* description: "The date with timezone at which the resource was created."
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* type: string
* description: "The date with timezone at which the resource was updated."
* format: date-time
* metadata:
* type: object
* description: An optional key-value map with additional details
* nullable: true
* type: object
* example: {car: "white"}
*/

View File

@@ -73,15 +73,24 @@ export class MoneyAmount extends SoftDeletableEntity {
* description: "Money Amounts represents an amount that a given Product Variant can be purcased for. Each Money Amount either has a Currency or Region associated 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."
* type: object
* required:
* - currency_code
* - amount
* - created_at
* - currency_code
* - deleted_at
* - id
* - max_quantity
* - min_quantity
* - price_list_id
* - region_id
* - updated_at
* - variant_id
* properties:
* id:
* type: string
* description: The money amount's ID
* type: string
* example: ma_01F0YESHRFQNH5S8Q0PK84YYZN
* currency_code:
* description: "The 3 character currency code that the Money Amount is given in."
* description: The 3 character currency code that the Money Amount is given in.
* type: string
* example: usd
* externalDocs:
@@ -89,54 +98,60 @@ export class MoneyAmount extends SoftDeletableEntity {
* description: See a list of codes.
* currency:
* description: Available if the relation `currency` is expanded.
* nullable: true
* $ref: "#/components/schemas/Currency"
* amount:
* description: "The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost."
* description: The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost.
* type: integer
* example: 100
* min_quantity:
* description: "The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities."
* description: The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.
* nullable: true
* type: integer
* example: 1
* max_quantity:
* description: "The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities."
* description: The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.
* nullable: true
* type: integer
* example: 1
* price_list_id:
* type: string
* description: The ID of the price list associated with the money amount
* nullable: true
* type: string
* example: pl_01G8X3CKJXCG5VXVZ87H9KC09W
* price_list:
* description: Available if the relation `price_list` is expanded.
* nullable: true
* $ref: "#/components/schemas/PriceList"
* variant_id:
* description: "The id of the Product Variant contained in the Line Item."
* description: The id of the Product Variant contained in the Line Item.
* nullable: true
* type: string
* example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6
* variant:
* description: The Product Variant contained in the Line Item. Available if the relation `variant` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/ProductVariant"
* region_id:
* type: string
* description: The region's ID
* nullable: true
* type: string
* example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
* region:
* description: A region object. Available if the relation `region` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Region"
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* description: "The date with timezone at which the resource was created."
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* type: string
* description: "The date with timezone at which the resource was updated."
* format: date-time
* deleted_at:
* description: The date with timezone at which the resource was deleted.
* nullable: true
* 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"}
*/

View File

@@ -47,47 +47,57 @@ export class Note extends SoftDeletableEntity {
* description: "Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these."
* type: object
* required:
* - value
* - resource_type
* - author_id
* - created_at
* - deleted_at
* - id
* - metadata
* - resource_id
* - resource_type
* - updated_at
* - value
* properties:
* id:
* type: string
* description: The note's ID
* type: string
* example: note_01G8TM8ENBMC7R90XRR1G6H26Q
* resource_type:
* description: "The type of resource that the Note refers to."
* description: The type of resource that the Note refers to.
* type: string
* example: order
* resource_id:
* description: "The ID of the resource that the Note refers to."
* description: The ID of the resource that the Note refers to.
* type: string
* example: order_01G8TJSYT9M6AVS5N4EMNFS1EK
* value:
* description: "The contents of the note."
* description: The contents of the note.
* type: string
* example: This order must be fulfilled on Monday
* author_id:
* type: string
* description: The ID of the author (user)
* nullable: true
* type: string
* example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V
* author:
* description: Available if the relation `author` is expanded.
* nullable: true
* $ref: "#/components/schemas/User"
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* description: "The date with timezone at which the resource was created."
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* type: string
* description: "The date with timezone at which the resource was updated."
* format: date-time
* deleted_at:
* description: The date with timezone at which the resource was deleted.
* nullable: true
* 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
* nullable: true
* type: object
* example: {car: "white"}
*/

View File

@@ -16,13 +16,14 @@ export class NotificationProvider {
* type: object
* required:
* - id
* - is_installed
* properties:
* id:
* description: "The id of the notification provider as given by the plugin."
* description: The id of the notification provider as given by the plugin.
* type: string
* example: sendgrid
* is_installed:
* description: "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`."
* description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.
* type: boolean
* default: true
*/

View File

@@ -70,120 +70,81 @@ export class Notification extends BaseEntity {
* 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."
* type: object
* required:
* - created_at
* - customer_id
* - data
* - event_name
* - id
* - parent_id
* - provider_id
* - resource_type
* - resource_id
* - to
* - updated_at
* properties:
* id:
* type: string
* description: The notification's ID
* type: string
* example: noti_01G53V9Y6CKMCGBM1P0X7C28RX
* event_name:
* description: "The name of the event that the notification was sent for."
* description: The name of the event that the notification was sent for.
* nullable: true
* type: string
* example: order.placed
* resource_type:
* description: "The type of resource that the Notification refers to."
* description: The type of resource that the Notification refers to.
* type: string
* example: order
* resource_id:
* description: "The ID of the resource that the Notification refers to."
* description: The ID of the resource that the Notification refers to.
* type: string
* example: order_01G8TJSYT9M6AVS5N4EMNFS1EK
* customer_id:
* description: "The ID of the Customer that the Notification was sent to."
* description: The ID of the Customer that the Notification was sent to.
* nullable: true
* type: string
* example: cus_01G2SG30J8C85S4A5CHM2S1NS2
* customer:
* description: A customer object. Available if the relation `customer` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Customer"
* to:
* description: "The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id"
* description: The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id
* type: string
* example: "user@example.com"
* example: user@example.com
* data:
* description: "The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend."
* type: object
* example: {}
* resends:
* description: "The resends that have been completed after the original Notification."
* type: array
* items:
* $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/NotificationProvider"
* 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
*/
/**
* @schema NotificationResend
* title: "Notification Resend"
* description: "A resend of a Notification."
* type: object
* properties:
* id:
* description: The notification resend's ID
* type: string
* example: noti_01F0YET45G9NHP08Z66CE4QKBS
* event_name:
* description: "The name of the event that the notification was sent for."
* type: string
* example: order.placed
* resource_type:
* description: "The type of resource that the Notification refers to."
* type: string
* example: order
* resource_id:
* description: "The ID of the resource that the Notification refers to."
* type: string
* example: order_01G8TJSYT9M6AVS5N4EMNFS1EK
* customer_id:
* description: "The ID of the Customer that the Notification was sent to."
* type: string
* example: cus_01G2SG30J8C85S4A5CHM2S1NS2
* customer:
* description: A customer object. Available if the relation `customer` is expanded.
* type: object
* to:
* description: "The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id"
* type: string
* example: "user@example.com"
* data:
* description: "The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend."
* description: The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend.
* type: object
* example: {}
* parent_id:
* description: "The ID of the Notification that was originally sent."
* description: The notification's parent ID
* nullable: true
* type: string
* example: noti_01G53V9Y6CKMCGBM1P0X7C28RX
* parent_notification:
* description: Available if the relation `parent_notification` is expanded.
* nullable: true
* $ref: "#/components/schemas/Notification"
* resends:
* description: The resends that have been completed after the original Notification. Available if the relation `resends` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/Notification"
* provider_id:
* description: "The ID of the Notification Provider that handles the Notification."
* description: The id of the Notification Provider that handles the Notification.
* nullable: true
* type: string
* example: sengrid
* provider:
* description: Available if the relation `provider` is expanded.
* nullable: true
* $ref: "#/components/schemas/NotificationProvider"
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* description: "The date with timezone at which the resource was created."
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* type: string
* description: "The date with timezone at which the resource was updated."
* format: date-time
*/

View File

@@ -36,32 +36,38 @@ export class Oauth {
* description: "Represent an OAuth app"
* type: object
* required:
* - id
* - display_name
* - application_name
* - data
* - display_name
* - id
* - install_url
* - uninstall_url
* properties:
* id:
* type: string
* description: The app's ID
* type: string
* example: example_app
* display_name:
* type: string
* description: The app's display name
* type: string
* example: Example app
* application_name:
* type: string
* description: The app's name
* type: string
* example: example
* install_url:
* type: string
* description: The URL to install the app
* nullable: true
* type: string
* format: uri
* uninstall_url:
* type: string
* description: The URL to uninstall the app
* nullable: true
* type: string
* format: uri
* data:
* type: object
* description: Any data necessary to the app.
* nullable: true
* type: object
* example: {}
*/

View File

@@ -126,93 +126,124 @@ export class OrderEdit extends BaseEntity {
* description: "Order edit keeps track of order items changes."
* type: object
* required:
* - order_id
* - order
* - changes
* - canceled_at
* - canceled_by
* - confirmed_by
* - confirmed_at
* - created_at
* - created_by
* - declined_at
* - declined_by
* - declined_reason
* - id
* - internal_note
* - order_id
* - payment_collection_id
* - requested_at
* - requested_by
* - status
* - updated_at
* properties:
* id:
* type: string
* description: The order edit's ID
* type: string
* example: oe_01G8TJSYT9M6AVS5N4EMNFS1EK
* order_id:
* type: string
* description: The ID of the order that is edited
* type: string
* example: order_01G2SG30J8C85S4A5CHM2S1NS2
* order:
* description: Available if the relation `order` is expanded.
* nullable: true
* $ref: "#/components/schemas/Order"
* changes:
* type: array
* description: Available if the relation `changes` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/OrderItemChange"
* internal_note:
* description: "An optional note with additional details about the order edit."
* description: An optional note with additional details about the order edit.
* nullable: true
* type: string
* example: Included two more items B to the order.
* created_by:
* description: The unique identifier of the user or customer who created the order edit.
* type: string
* description: "The unique identifier of the user or customer who created the order edit."
* requested_by:
* description: The unique identifier of the user or customer who requested the order edit.
* nullable: true
* type: string
* description: "The unique identifier of the user or customer who requested the order edit."
* requested_at:
* description: The date with timezone at which the edit was requested.
* nullable: true
* type: string
* description: "The date with timezone at which the edit was requested."
* format: date-time
* confirmed_by:
* description: The unique identifier of the user or customer who confirmed the order edit.
* nullable: true
* type: string
* description: "The unique identifier of the user or customer who confirmed the order edit."
* confirmed_at:
* description: The date with timezone at which the edit was confirmed.
* nullable: true
* type: string
* description: "The date with timezone at which the edit was confirmed."
* format: date-time
* declined_by:
* description: The unique identifier of the user or customer who declined the order edit.
* nullable: true
* type: string
* description: "The unique identifier of the user or customer who declined the order edit."
* declined_at:
* description: The date with timezone at which the edit was declined.
* nullable: true
* type: string
* description: "The date with timezone at which the edit was declined."
* format: date-time
* declined_reason:
* description: "An optional note why the order edit is declined."
* description: An optional note why the order edit is declined.
* nullable: true
* type: string
* canceled_by:
* description: The unique identifier of the user or customer who cancelled the order edit.
* nullable: true
* type: string
* canceled_at:
* description: The date with timezone at which the edit was cancelled.
* nullable: true
* type: string
* format: date-time
* subtotal:
* type: integer
* description: The total of subtotal
* type: integer
* example: 8000
* discount_total:
* type: integer
* description: The total of discount
* type: integer
* example: 800
* shipping_total:
* type: integer
* description: The total of the shipping amount
* type: integer
* example: 800
* gift_card_total:
* type: integer
* description: The total of the gift card amount
* type: integer
* example: 800
* gift_card_tax_total:
* type: integer
* description: The total of the gift card tax amount
* type: integer
* example: 800
* tax_total:
* type: integer
* description: The total of tax
* type: integer
* example: 0
* total:
* type: integer
* description: The total amount of the edited order.
* type: integer
* example: 8200
* difference_due:
* type: integer
* description: The difference between the total amount of the order and total amount of edited order.
* type: integer
* example: 8200
* status:
* type: string
* description: The status of the order edit.
* type: string
* enum:
* - confirmed
* - declined
@@ -220,23 +251,25 @@ export class OrderEdit extends BaseEntity {
* - created
* - canceled
* items:
* type: array
* description: Available if the relation `items` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/LineItem"
* payment_collection_id:
* type: string
* description: The ID of the payment collection
* nullable: true
* type: string
* example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK
* payment_collection:
* description: Available if the relation `payment_collection` is expanded.
* nullable: true
* $ref: "#/components/schemas/PaymentCollection"
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* description: "The date with timezone at which the resource was created."
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* type: string
* description: "The date with timezone at which the resource was updated."
* format: date-time
*/

View File

@@ -63,55 +63,63 @@ export class OrderItemChange extends SoftDeletableEntity {
* description: "Represents an order edit item change"
* type: object
* required:
* - type
* - created_at
* - deleted_at
* - id
* - line_item_id
* - order_edit_id
* - original_line_item_id
* - type
* - updated_at
* properties:
* id:
* type: string
* description: The order item change's ID
* type: string
* example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK
* type:
* type: string
* description: The order item change's status
* type: string
* enum:
* - item_add
* - item_remove
* - item_update
* order_edit_id:
* type: string
* description: The ID of the order edit
* type: string
* example: oe_01G2SG30J8C85S4A5CHM2S1NS2
* order_edit:
* description: Available if the relation `order_edit` is expanded.
* nullable: true
* $ref: "#/components/schemas/OrderEdit"
* original_line_item_id:
* type: string
* description: The ID of the original line item in the order
* nullable: true
* type: string
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* original_line_item:
* description: Available if the relation `original_line_item` is expanded.
* nullable: true
* $ref: "#/components/schemas/LineItem"
* line_item_id:
* type: string
* description: The ID of the cloned line item.
* nullable: true
* type: string
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* line_item:
* description: Available if the relation `line_item` is expanded.
* nullable: true
* $ref: "#/components/schemas/LineItem"
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* description: "The date with timezone at which the resource was created."
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* type: string
* description: "The date with timezone at which the resource was updated."
* format: date-time
* deleted_at:
* description: The date with timezone at which the resource was deleted.
* nullable: true
* 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"}
*/

View File

@@ -277,18 +277,36 @@ export class Order extends BaseEntity {
* description: "Represents an order"
* type: object
* required:
* - customer_id
* - email
* - region_id
* - billing_address_id
* - canceled_at
* - cart_id
* - created_at
* - currency_code
* - customer_id
* - draft_order_id
* - display_id
* - email
* - external_id
* - fulfillment_status
* - id
* - idempotency_key
* - metadata
* - no_notification
* - object
* - payment_status
* - region_id
* - shipping_address_id
* - status
* - tax_rate
* - updated_at
* properties:
* id:
* type: string
* description: The order's ID
* type: string
* example: order_01G8TJSYT9M6AVS5N4EMNFS1EK
* status:
* type: string
* description: The order's status
* type: string
* enum:
* - pending
* - completed
@@ -297,8 +315,8 @@ export class Order extends BaseEntity {
* - requires_action
* default: pending
* fulfillment_status:
* type: string
* description: The order's fulfillment status
* type: string
* enum:
* - not_fulfilled
* - partially_fulfilled
@@ -311,62 +329,70 @@ export class Order extends BaseEntity {
* - requires_action
* default: not_fulfilled
* payment_status:
* type: string
* description: The order's payment status
* type: string
* enum:
* - not_paid
* - awaiting
* - captured
* - partially_refunded
* - refuneded
* - refunded
* - canceled
* - requires_action
* default: not_paid
* display_id:
* type: integer
* description: The order's display ID
* type: integer
* example: 2
* cart_id:
* type: string
* description: The ID of the cart associated with the order
* nullable: true
* type: string
* example: cart_01G8ZH853Y6TFXWPG5EYE81X63
* cart:
* description: A cart object. Available if the relation `cart` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Cart"
* customer_id:
* type: string
* description: The ID of the customer associated with the order
* type: string
* example: cus_01G2SG30J8C85S4A5CHM2S1NS2
* customer:
* description: A customer object. Available if the relation `customer` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Customer"
* email:
* description: The email associated with the order
* type: string
* format: email
* billing_address_id:
* type: string
* description: The ID of the billing address associated with the order
* nullable: true
* type: string
* example: addr_01G8ZH853YPY9B94857DY91YGW
* billing_address:
* description: Available if the relation `billing_address` is expanded.
* nullable: true
* $ref: "#/components/schemas/Address"
* shipping_address_id:
* type: string
* description: The ID of the shipping address associated with the order
* nullable: true
* type: string
* example: addr_01G8ZH853YPY9B94857DY91YGW
* shipping_address:
* description: Available if the relation `shipping_address` is expanded.
* nullable: true
* $ref: "#/components/schemas/Address"
* region_id:
* type: string
* description: The region's ID
* type: string
* example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
* region:
* description: A region object. Available if the relation `region` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/Region"
* currency_code:
* description: "The 3 character currency code that is used in the order"
* description: The 3 character currency code that is used in the order
* type: string
* example: usd
* externalDocs:
@@ -374,147 +400,164 @@ export class Order extends BaseEntity {
* description: See a list of codes.
* currency:
* description: Available if the relation `currency` is expanded.
* nullable: true
* $ref: "#/components/schemas/Currency"
* tax_rate:
* description: The order's tax rate
* nullable: true
* type: number
* example: 0
* discounts:
* type: array
* description: The discounts used in the order. Available if the relation `discounts` is expanded.
* type: array
* items:
* type: object
* description: A discount object.
* $ref: "#/components/schemas/Discount"
* gift_cards:
* type: array
* description: The gift cards used in the order. Available if the relation `gift_cards` is expanded.
* items:
* type: object
* description: A gift card object.
* shipping_methods:
* type: array
* items:
* $ref: "#/components/schemas/GiftCard"
* shipping_methods:
* description: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/ShippingMethod"
* payments:
* type: array
* description: The payments used in the order. Available if the relation `payments` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/Payment"
* fulfillments:
* type: array
* description: The fulfillments used in the order. Available if the relation `fulfillments` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/Fulfillment"
* returns:
* type: array
* description: The returns associated with the order. Available if the relation `returns` is expanded.
* type: array
* items:
* type: object
* description: A return object.
* $ref: "#/components/schemas/Return"
* claims:
* type: array
* description: The claims associated with the order. Available if the relation `claims` is expanded.
* type: array
* items:
* type: object
* description: A claim order object.
* $ref: "#/components/schemas/ClaimOrder"
* refunds:
* type: array
* description: The refunds associated with the order. Available if the relation `refunds` is expanded.
* items:
* type: object
* description: A refund object.
* swaps:
* type: array
* description: The swaps associated with the order. Available if the relation `swaps` is expanded.
* items:
* type: object
* description: A swap object.
* $ref: "#/components/schemas/Refund"
* swaps:
* description: The swaps associated with the order. Available if the relation `swaps` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/Swap"
* draft_order_id:
* type: string
* description: The ID of the draft order this order is associated with.
* nullable: true
* type: string
* example: null
* draft_order:
* description: A draft order object. Available if the relation `draft_order` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/DraftOrder"
* items:
* type: array
* description: The line items that belong to the order. Available if the relation `items` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/LineItem"
* edits:
* description: Order edits done on the order. Available if the relation `edits` is expanded.
* type: array
* description: "[EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded."
* items:
* $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.
* type: array
* items:
* $ref: "#/components/schemas/GiftCardTransaction"
* canceled_at:
* type: string
* description: The date the order was canceled on.
* nullable: true
* type: string
* format: date-time
* no_notification:
* description: "Flag for describing whether or not notifications related to this should be send."
* description: Flag for describing whether or not notifications related to this should be send.
* nullable: true
* type: boolean
* example: false
* idempotency_key:
* type: string
* description: Randomly generated key used to continue the processing of the order in case of failure.
* nullable: true
* type: string
* externalDocs:
* url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key
* description: Learn more how to use the idempotency key.
* external_id:
* description: The ID of an external order.
* nullable: true
* type: string
* example: null
* sales_channel_id:
* type: string
* description: The ID of the sales channel this order is associated with.
* nullable: true
* type: string
* example: null
* sales_channel:
* description: A sales channel object. Available if the relation `sales_channel` is expanded.
* type: object
* nullable: true
* $ref: "#/components/schemas/SalesChannel"
* shipping_total:
* type: integer
* description: The total of shipping
* example: 1000
* discount_total:
* type: integer
* description: The total of discount
* type: integer
* example: 800
* tax_total:
* type: integer
* description: The total of tax
* type: integer
* example: 0
* refunded_total:
* type: integer
* description: The total amount refunded if the order is returned.
* type: integer
* example: 0
* total:
* type: integer
* description: The total amount of the order
* type: integer
* example: 8200
* subtotal:
* type: integer
* description: The subtotal of the order
* type: integer
* example: 8000
* paid_total:
* type: integer
* description: The total amount paid
* type: integer
* example: 8000
* refundable_amount:
* type: integer
* description: The amount that can be refunded
* type: integer
* example: 8200
* gift_card_total:
* type: integer
* description: The total of gift cards
* type: integer
* example: 0
* gift_card_tax_total:
* type: integer
* description: The total of gift cards with taxes
* type: integer
* example: 0
* created_at:
* description: The date with timezone at which the resource was created.
* type: string
* format: date-time
* updated_at:
* description: The date with timezone at which the resource was updated.
* type: string
* format: date-time
* metadata:
* description: An optional key-value map with additional details
* nullable: true
* type: object
* example: {car: "white"}
*/