chore(oas): PascalCase for schemas + remove x-resourceId (#2847)

### What

Rename all JSDoc OAS `@schema` and `$ref: #/components/schemas/` from snake_case to PascalCase, `foo_bar -> FooBar`

Extra scope: Remove `x-resourceId` from JSDoc OAS.

### Why

Classes use PascalCase as a convention but the OAS @schemas describing them were using snake_case. OAS code generators tend to use the schema name when generating typed models.

In order to avoid mismatch between source code, the OAS, and the generated client code, it is advised to align OAS @schemas formatting to the classes they represent.

Extra scope: x-resourceId is not a widely used OAS property. It's current usage in our OAS does not provide additional value. Therefore, we recommend to remove it in order to have one less item to maintain.

### How

Good old search & replace. Regex search to further make sure we didn't miss any.

The scope is limited to `@schema` definition and their usage in `$ref: #/components/schemas/`.

### Test

* Ran OAS validator.
* Ran docs build script.

Expect no visible changes to the documentation.

Resolves: CORE-852, CORE-859
This commit is contained in:
Patrick
2022-12-20 10:58:57 +00:00
committed by GitHub
parent 2e5ceb7950
commit a027d5ff9e
319 changed files with 654 additions and 747 deletions
+3 -5
View File
@@ -67,10 +67,9 @@ export class Address extends SoftDeletableEntity {
}
/**
* @schema address_fields
* @schema AddressFields
* title: "Address Fields"
* description: "Address fields used when creating/updating an address."
* x-resourceId: address
* type: object
* properties:
* company:
@@ -123,10 +122,9 @@ export class Address extends SoftDeletableEntity {
*/
/**
* @schema address
* @schema Address
* title: "Address"
* description: "An address."
* x-resourceId: address
* type: object
* properties:
* id:
@@ -205,4 +203,4 @@ export class Address extends SoftDeletableEntity {
* type: object
* description: An optional key-value map with additional details
* example: {car: "white"}
*/
*/
+14 -4
View File
@@ -1,5 +1,16 @@
import { AfterLoad, BeforeInsert, Column, Entity, JoinColumn, ManyToOne, } from "typeorm"
import { BatchJobResultError, BatchJobResultStatDescriptor, BatchJobStatus, } from "../types/batch-job"
import {
AfterLoad,
BeforeInsert,
Column,
Entity,
JoinColumn,
ManyToOne,
} from "typeorm"
import {
BatchJobResultError,
BatchJobResultStatDescriptor,
BatchJobStatus,
} from "../types/batch-job"
import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column"
import { SoftDeletableEntity } from "../interfaces/models/soft-deletable-entity"
@@ -92,10 +103,9 @@ export class BatchJob extends SoftDeletableEntity {
}
/**
* @schema batch_job
* @schema BatchJob
* title: "Batch Job"
* description: "A Batch Job."
* x-resourceId: batch_job
* type: object
* required:
* - type
+8 -9
View File
@@ -1,8 +1,7 @@
/**
* @schema cart
* @schema Cart
* title: "Cart"
* description: "Represents a user cart"
* x-resourceId: cart
* type: object
* properties:
* id:
@@ -19,19 +18,19 @@
* example: addr_01G8ZH853YPY9B94857DY91YGW
* billing_address:
* description: Available if the relation `billing_address` is expanded.
* $ref: "#/components/schemas/address"
* $ref: "#/components/schemas/Address"
* shipping_address_id:
* type: string
* description: The shipping address's ID
* example: addr_01G8ZH853YPY9B94857DY91YGW
* shipping_address:
* description: Available if the relation `shipping_address` is expanded.
* $ref: "#/components/schemas/address"
* $ref: "#/components/schemas/Address"
* items:
* description: Available if the relation `items` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* region_id:
* type: string
* description: The region's ID
@@ -60,24 +59,24 @@
* type: object
* payment_session:
* description: The selected payment session in the cart.
* $ref: "#/components/schemas/payment_session"
* $ref: "#/components/schemas/PaymentSession"
* payment_sessions:
* type: array
* description: The payment sessions created on the cart.
* items:
* $ref: "#/components/schemas/payment_session"
* $ref: "#/components/schemas/PaymentSession"
* payment_id:
* type: string
* description: The payment's ID if available
* example: pay_01G8ZCC5W42ZNY842124G7P5R9
* payment:
* description: Available if the relation `payment` is expanded.
* $ref: "#/components/schemas/payment"
* $ref: "#/components/schemas/Payment"
* shipping_methods:
* type: array
* description: The shipping methods added to the cart.
* items:
* $ref: "#/components/schemas/shipping_method"
* $ref: "#/components/schemas/ShippingMethod"
* type:
* type: string
* description: The cart's type.
+1 -2
View File
@@ -35,10 +35,9 @@ export class ClaimImage extends SoftDeletableEntity {
}
/**
* @schema claim_image
* @schema ClaimImage
* title: "Claim Image"
* description: "Represents photo documentation of a claim."
* x-resourceId: claim_image
* type: object
* required:
* - claim_item_id
+4 -5
View File
@@ -90,10 +90,9 @@ export class ClaimItem extends SoftDeletableEntity {
}
/**
* @schema claim_item
* @schema ClaimItem
* title: "Claim Item"
* description: "Represents a claimed item along with information about the reasons for the claim."
* x-resourceId: claim_item
* type: object
* required:
* - claim_order_id
@@ -110,7 +109,7 @@ export class ClaimItem extends SoftDeletableEntity {
* type: array
* description: Available if the relation `images` is expanded.
* items:
* $ref: "#/components/schemas/claim_image"
* $ref: "#/components/schemas/ClaimImage"
* claim_order_id:
* description: The ID of the claim this item is associated with.
* type: string
@@ -123,7 +122,7 @@ export class ClaimItem extends SoftDeletableEntity {
* example: item_01G8ZM25TN49YV9EQBE2NC27KC
* item:
* description: Available if the relation `item` is expanded.
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* variant_id:
* description: "The ID of the product variant that is claimed."
* type: string
@@ -151,7 +150,7 @@ export class ClaimItem extends SoftDeletableEntity {
* description: "User defined tags for easy filtering and grouping. Available if the relation 'tags' is expanded."
* type: array
* items:
* $ref: "#/components/schemas/claim_tag"
* $ref: "#/components/schemas/ClaimTag"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
+6 -7
View File
@@ -131,10 +131,9 @@ export class ClaimOrder extends SoftDeletableEntity {
}
/**
* @schema claim_order
* @schema ClaimOrder
* title: "Claim Order"
* description: "Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns."
* x-resourceId: claim_order
* type: object
* required:
* - type
@@ -174,12 +173,12 @@ export class ClaimOrder extends SoftDeletableEntity {
* description: "The items that have been claimed"
* type: array
* items:
* $ref: "#/components/schemas/claim_item"
* $ref: "#/components/schemas/ClaimItem"
* additional_items:
* description: "Refers to the new items to be shipped when the claim order has the type `replace`"
* type: array
* items:
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* order_id:
* description: "The ID of the order that the claim comes from."
* type: string
@@ -196,17 +195,17 @@ export class ClaimOrder extends SoftDeletableEntity {
* example: addr_01G8ZH853YPY9B94857DY91YGW
* shipping_address:
* description: Available if the relation `shipping_address` is expanded.
* $ref: "#/components/schemas/address"
* $ref: "#/components/schemas/Address"
* shipping_methods:
* description: "The shipping methods that the claim order will be shipped with."
* type: array
* items:
* $ref: "#/components/schemas/shipping_method"
* $ref: "#/components/schemas/ShippingMethod"
* fulfillments:
* description: "The fulfillments of the new items to be shipped"
* type: array
* items:
* $ref: "#/components/schemas/fulfillment"
* $ref: "#/components/schemas/Fulfillment"
* refund_amount:
* description: "The amount that will be refunded in conjunction with the claim"
* type: integer
+1 -2
View File
@@ -20,10 +20,9 @@ export class ClaimTag extends SoftDeletableEntity {
}
/**
* @schema claim_tag
* @schema ClaimTag
* title: "Claim Tag"
* description: "Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping."
* x-resourceId: claim_tag
* type: object
* required:
* - value
+1 -2
View File
@@ -40,10 +40,9 @@ export class Country {
}
/**
* @schema country
* @schema Country
* title: "Country"
* description: "Country details"
* x-resourceId: country
* type: object
* required:
* - iso_2
+1 -2
View File
@@ -21,10 +21,9 @@ export class Currency {
}
/**
* @schema currency
* @schema Currency
* title: "Currency"
* description: "Currency"
* x-resourceId: currency
* type: object
* required:
* - code
@@ -46,10 +46,9 @@ export class CustomShippingOption extends SoftDeletableEntity {
}
/**
* @schema custom_shipping_option
* @schema CustomShippingOption
* title: "Custom Shipping Option"
* description: "Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option"
* x-resourceId: custom_shipping_option
* type: object
* required:
* - price
+3 -4
View File
@@ -30,11 +30,11 @@ export class CustomerGroup extends SoftDeletableEntity {
this.id = generateEntityId(this.id, "cgrp")
}
}
/**
* @schema customer_group
* @schema CustomerGroup
* title: "Customer Group"
* description: "Represents a customer group"
* x-resourceId: customer_group
* type: object
* required:
* - name
@@ -57,7 +57,7 @@ export class CustomerGroup extends SoftDeletableEntity {
* type: array
* description: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded.
* items:
* $ref: "#/components/schemas/price_list"
* $ref: "#/components/schemas/PriceList"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -75,4 +75,3 @@ export class CustomerGroup extends SoftDeletableEntity {
* description: An optional key-value map with additional details
* example: {car: "white"}
*/
+4 -5
View File
@@ -80,10 +80,9 @@ export class Customer extends SoftDeletableEntity {
}
/**
* @schema customer
* @schema Customer
* title: "Customer"
* description: "Represents a customer"
* x-resourceId: customer
* type: object
* required:
* - email
@@ -110,12 +109,12 @@ export class Customer extends SoftDeletableEntity {
* example: addr_01G8ZH853YPY9B94857DY91YGW
* billing_address:
* description: Available if the relation `billing_address` is expanded.
* $ref: "#/components/schemas/address"
* $ref: "#/components/schemas/Address"
* shipping_addresses:
* description: Available if the relation `shipping_addresses` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/address"
* $ref: "#/components/schemas/Address"
* phone:
* type: string
* description: The customer's phone number
@@ -134,7 +133,7 @@ export class Customer extends SoftDeletableEntity {
* description: The customer groups the customer belongs to. Available if the relation `groups` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/customer_group"
* $ref: "#/components/schemas/CustomerGroup"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -38,10 +38,9 @@ export class DiscountConditionCustomerGroup {
}
/**
* @schema discount_condition_customer_group
* @schema DiscountConditionCustomerGroup
* title: "Product Tag Discount Condition"
* description: "Associates a discount condition with a customer group"
* x-resourceId: discount_condition_customer_group
* type: object
* required:
* - customer_group_id
@@ -57,10 +56,10 @@ export class DiscountConditionCustomerGroup {
* example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A
* customer_group:
* description: Available if the relation `customer_group` is expanded.
* $ref: "#/components/schemas/customer_group"
* $ref: "#/components/schemas/CustomerGroup"
* discount_condition:
* description: Available if the relation `discount_condition` is expanded.
* $ref: "#/components/schemas/discount_condition"
* $ref: "#/components/schemas/DiscountCondition"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -38,10 +38,9 @@ export class DiscountConditionProductCollection {
}
/**
* @schema discount_condition_product_collection
* @schema DiscountConditionProductCollection
* title: "Product Collection Discount Condition"
* description: "Associates a discount condition with a product collection"
* x-resourceId: discount_condition_product_collection
* type: object
* required:
* - product_collection_id
@@ -57,10 +56,10 @@ export class DiscountConditionProductCollection {
* example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A
* product_collection:
* description: Available if the relation `product_collection` is expanded.
* $ref: "#/components/schemas/product_collection"
* $ref: "#/components/schemas/ProductCollection"
* discount_condition:
* description: Available if the relation `discount_condition` is expanded.
* $ref: "#/components/schemas/discount_condition"
* $ref: "#/components/schemas/DiscountCondition"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -38,10 +38,9 @@ export class DiscountConditionProductTag {
}
/**
* @schema discount_condition_product_tag
* @schema DiscountConditionProductTag
* title: "Product Tag Discount Condition"
* description: "Associates a discount condition with a product tag"
* x-resourceId: discount_condition_product_tag
* type: object
* required:
* - product_tag_id
@@ -57,10 +56,10 @@ export class DiscountConditionProductTag {
* example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A
* product_tag:
* description: Available if the relation `product_tag` is expanded.
* $ref: "#/components/schemas/product_tag"
* $ref: "#/components/schemas/ProductTag"
* discount_condition:
* description: Available if the relation `discount_condition` is expanded.
* $ref: "#/components/schemas/discount_condition"
* $ref: "#/components/schemas/DiscountCondition"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -38,10 +38,9 @@ export class DiscountConditionProductType {
}
/**
* @schema discount_condition_product_type
* @schema DiscountConditionProductType
* title: "Product Type Discount Condition"
* description: "Associates a discount condition with a product type"
* x-resourceId: discount_condition_product
* type: object
* required:
* - product_type_id
@@ -57,10 +56,10 @@ export class DiscountConditionProductType {
* example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A
* product_type:
* description: Available if the relation `product_type` is expanded.
* $ref: "#/components/schemas/product_type"
* $ref: "#/components/schemas/ProductType"
* discount_condition:
* description: Available if the relation `discount_condition` is expanded.
* $ref: "#/components/schemas/discount_condition"
* $ref: "#/components/schemas/DiscountCondition"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -38,10 +38,9 @@ export class DiscountConditionProduct {
}
/**
* @schema discount_condition_product
* @schema DiscountConditionProduct
* title: "Product Discount Condition"
* description: "Associates a discount condition with a product"
* x-resourceId: discount_condition_product
* type: object
* required:
* - product_id
@@ -57,10 +56,10 @@ export class DiscountConditionProduct {
* example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A
* product:
* description: Available if the relation `product` is expanded.
* $ref: "#/components/schemas/product"
* $ref: "#/components/schemas/Product"
* discount_condition:
* description: Available if the relation `discount_condition` is expanded.
* $ref: "#/components/schemas/discount_condition"
* $ref: "#/components/schemas/DiscountCondition"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -136,10 +136,9 @@ export class DiscountCondition extends SoftDeletableEntity {
}
/**
* @schema discount_condition
* @schema DiscountCondition
* title: "Discount Condition"
* description: "Holds rule conditions for when a discount is applicable"
* x-resourceId: discount_condition
* type: object
* required:
* - type
@@ -171,7 +170,7 @@ export class DiscountCondition extends SoftDeletableEntity {
* example: dru_01F0YESMVK96HVX7N419E3CJ7C
* discount_rule:
* description: Available if the relation `discount_rule` is expanded.
* $ref: "#/components/schemas/discount_rule"
* $ref: "#/components/schemas/DiscountRule"
* products:
* description: products associated with this condition if type = products. Available if the relation `products` is expanded.
* type: array
+1 -2
View File
@@ -50,10 +50,9 @@ export class DiscountRule extends SoftDeletableEntity {
}
/**
* @schema discount_rule
* @schema DiscountRule
* title: "Discount Rule"
* description: "Holds the rules that governs how a Discount is calculated when applied to a Cart."
* x-resourceId: discount_rule
* type: object
* required:
* - type
+3 -4
View File
@@ -89,10 +89,9 @@ export class Discount extends SoftDeletableEntity {
}
/**
* @schema discount
* @schema Discount
* title: "Discount"
* description: "Represents a discount that can be applied to a cart for promotional purposes."
* x-resourceId: discount
* type: object
* required:
* - code
@@ -116,7 +115,7 @@ export class Discount extends SoftDeletableEntity {
* example: dru_01F0YESMVK96HVX7N419E3CJ7C
* rule:
* description: Available if the relation `rule` is expanded.
* $ref: "#/components/schemas/discount_rule"
* $ref: "#/components/schemas/DiscountRule"
* is_disabled:
* description: "Whether the Discount has been disabled. Disabled discounts cannot be applied to carts"
* type: boolean
@@ -127,7 +126,7 @@ export class Discount extends SoftDeletableEntity {
* example: disc_01G8ZH853YPY9B94857DY91YGW
* parent_discount:
* description: Available if the relation `parent_discount` is expanded.
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* starts_at:
* description: "The time at which the discount can be used."
* type: string
+1 -2
View File
@@ -80,10 +80,9 @@ export class DraftOrder extends BaseEntity {
}
/**
* @schema draft-order
* @schema DraftOrder
* title: "DraftOrder"
* description: "Represents a draft order"
* x-resourceId: draft-order
* type: object
* properties:
* id:
@@ -24,10 +24,9 @@ export class FulfillmentItem {
}
/**
* @schema fulfillment_item
* @schema FulfillmentItem
* title: "Fulfillment Item"
* description: "Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item."
* x-resourceId: fulfillment_item
* type: object
* required:
* - fulfillment_id
@@ -47,7 +46,7 @@ export class FulfillmentItem {
* type: object
* item:
* description: Available if the relation `item` is expanded.
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* quantity:
* description: "The quantity of the Line Item that is included in the Fulfillment."
* type: integer
@@ -10,10 +10,9 @@ export class FulfillmentProvider {
}
/**
* @schema fulfillment_provider
* @schema FulfillmentProvider
* title: "Fulfillment Provider"
* description: "Represents a fulfillment provider plugin and holds its installation status."
* x-resourceId: fulfillment_provider
* type: object
* properties:
* id:
+4 -5
View File
@@ -91,10 +91,9 @@ export class Fulfillment extends BaseEntity {
}
/**
* @schema fulfillment
* @schema Fulfillment
* title: "Fulfillment"
* 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."
* x-resourceId: fulfillment
* type: object
* required:
* - provider_id
@@ -130,17 +129,17 @@ export class Fulfillment extends BaseEntity {
* example: manual
* provider:
* description: Available if the relation `provider` is expanded.
* $ref: "#/components/schemas/fulfillment_provider"
* $ref: "#/components/schemas/FulfillmentProvider"
* 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
* items:
* $ref: "#/components/schemas/fulfillment_item"
* $ref: "#/components/schemas/FulfillmentItem"
* tracking_links:
* description: The Tracking Links that can be used to track the status of the Fulfillment, these will usually be provided by the Fulfillment Provider. Available if the relation `tracking_links` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/tracking_link"
* $ref: "#/components/schemas/TrackingLink"
* tracking_numbers:
* deprecated: true
* description: The tracking numbers that can be used to track the status of the fulfillment.
@@ -55,10 +55,9 @@ export class GiftCardTransaction {
}
/**
* @schema gift_card_transaction
* @schema GiftCardTransaction
* title: "Gift Card Transaction"
* description: "Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order"
* x-resourceId: gift_card_transaction
* type: object
* required:
* - gift_card_id
+1 -2
View File
@@ -60,10 +60,9 @@ export class GiftCard extends SoftDeletableEntity {
}
/**
* @schema gift_card
* @schema GiftCard
* title: "Gift Card"
* description: "Gift Cards are redeemable and represent a value that can be used towards the payment of an Order."
* x-resourceId: gift_card
* type: object
* required:
* - code
@@ -50,10 +50,9 @@ export class IdempotencyKey {
}
/**
* @schema idempotency_key
* @schema IdempotencyKey
* title: "Idempotency Key"
* description: "Idempotency Key is used to continue a process in case of any failure that might occur."
* x-resourceId: idempotency_key
* type: object
* required:
* - idempotency_key
@@ -102,4 +101,4 @@ export class IdempotencyKey {
* type: string
* description: "Where to continue from."
* default: started
*/
*/
+1 -2
View File
@@ -19,10 +19,9 @@ export class Image extends SoftDeletableEntity {
}
/**
* @schema image
* @schema Image
* title: "Image"
* description: "Images holds a reference to a URL at which the image file can be found."
* x-resourceId: image
* type: object
* required:
* - url
+1 -2
View File
@@ -38,10 +38,9 @@ export class Invite extends SoftDeletableEntity {
}
/**
* @schema invite
* @schema Invite
* title: "Invite"
* description: "Represents an invite"
* x-resourceId: invite
* type: object
* required:
* - user_email
@@ -54,10 +54,9 @@ export class LineItemAdjustment {
}
/**
* @schema line_item_adjustment
* @schema LineItemAdjustment
* title: "Line Item Adjustment"
* description: "Represents an Line Item Adjustment"
* x-resourceId: line_item_adjustment
* description: "Represents a Line Item Adjustment"
* type: object
* required:
* - item_id
@@ -74,7 +73,7 @@ export class LineItemAdjustment {
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* item:
* description: Available if the relation `item` is expanded.
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* description:
* type: string
* description: The line item's adjustment description
@@ -85,7 +84,7 @@ export class LineItemAdjustment {
* example: disc_01F0YESMW10MGHWJKZSDDMN0VN
* discount:
* description: Available if the relation `discount` is expanded.
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* amount:
* type: number
* description: The adjustment amount
@@ -30,10 +30,9 @@ export class LineItemTaxLine extends TaxLine {
}
/**
* @schema line_item_tax_line
* @schema LineItemTaxLine
* title: "Line Item Tax Line"
* description: "Represents an Line Item Tax Line"
* x-resourceId: line_item_tax_line
* description: "Represents a Line Item Tax Line"
* type: object
* required:
* - item_id
@@ -50,7 +49,7 @@ export class LineItemTaxLine extends TaxLine {
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* item:
* description: Available if the relation `item` is expanded.
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* code:
* description: "A code to identify the tax type by"
* type: string
+3 -4
View File
@@ -174,10 +174,9 @@ export class LineItem extends BaseEntity {
}
/**
* @schema line_item
* @schema LineItem
* title: "Line Item"
* 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."
* x-resourceId: line_item
* type: object
* required:
* - title
@@ -220,12 +219,12 @@ export class LineItem extends BaseEntity {
* description: Available if the relation `tax_lines` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/line_item_tax_line"
* $ref: "#/components/schemas/LineItemTaxLine"
* adjustments:
* description: Available if the relation `adjustments` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/line_item_adjustment"
* $ref: "#/components/schemas/LineItemAdjustment"
* title:
* description: "The title of the Line Item, this should be easily identifiable by the Customer."
* type: string
+3 -4
View File
@@ -68,10 +68,9 @@ export class MoneyAmount extends SoftDeletableEntity {
}
/**
* @schema money_amount
* @schema MoneyAmount
* title: "Money Amount"
* 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."
* x-resourceId: money_amount
* type: object
* required:
* - currency_code
@@ -90,7 +89,7 @@ export class MoneyAmount extends SoftDeletableEntity {
* description: See a list of codes.
* currency:
* description: Available if the relation `currency` is expanded.
* $ref: "#/components/schemas/currency"
* $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."
* type: integer
@@ -109,7 +108,7 @@ export class MoneyAmount extends SoftDeletableEntity {
* example: pl_01G8X3CKJXCG5VXVZ87H9KC09W
* price_list:
* description: Available if the relation `price_list` is expanded.
* $ref: "#/components/schemas/price_list"
* $ref: "#/components/schemas/PriceList"
* variant_id:
* description: "The id of the Product Variant contained in the Line Item."
* type: string
+2 -3
View File
@@ -42,10 +42,9 @@ export class Note extends SoftDeletableEntity {
}
/**
* @schema note
* @schema Note
* title: "Note"
* description: "Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these."
* x-resourceId: note
* type: object
* required:
* - value
@@ -74,7 +73,7 @@ export class Note extends SoftDeletableEntity {
* example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V
* author:
* description: Available if the relation `author` is expanded.
* $ref: "#/components/schemas/user"
* $ref: "#/components/schemas/User"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -10,10 +10,9 @@ export class NotificationProvider {
}
/**
* @schema notification_provider
* @schema NotificationProvider
* title: "Notification Provider"
* description: "Represents a notification provider plugin and holds its installation status."
* x-resourceId: notification_provider
* type: object
* required:
* - id
+6 -8
View File
@@ -65,10 +65,9 @@ export class Notification extends BaseEntity {
}
/**
* @schema notification
* @schema Notification
* title: "Notification"
* 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."
* x-resourceId: notification
* type: object
* required:
* - resource_type
@@ -110,14 +109,14 @@ export class Notification extends BaseEntity {
* description: "The resends that have been completed after the original Notification."
* type: array
* items:
* $ref: "#/components/schemas/notification_resend"
* $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/notification_provider"
* $ref: "#/components/schemas/NotificationProvider"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -129,10 +128,9 @@ export class Notification extends BaseEntity {
*/
/**
* @schema notification_resend
* @schema NotificationResend
* title: "Notification Resend"
* description: "A resend of a Notification."
* x-resourceId: notification_resend
* type: object
* properties:
* id:
@@ -172,14 +170,14 @@ export class Notification extends BaseEntity {
* example: noti_01G53V9Y6CKMCGBM1P0X7C28RX
* parent_notification:
* description: Available if the relation `parent_notification` is expanded.
* $ref: "#/components/schemas/notification"
* $ref: "#/components/schemas/Notification"
* 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/notification_provider"
* $ref: "#/components/schemas/NotificationProvider"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
-1
View File
@@ -34,7 +34,6 @@ export class Oauth {
* @schema OAuth
* title: "OAuth"
* description: "Represent an OAuth app"
* x-resourceId: OAuth
* type: object
* required:
* - id
+5 -6
View File
@@ -122,10 +122,9 @@ export class OrderEdit extends BaseEntity {
}
/**
* @schema order_edit
* @schema OrderEdit
* title: "Order Edit"
* description: "Order edit keeps track of order items changes."
* x-resourceId: order_edit
* type: object
* required:
* - order_id
@@ -143,12 +142,12 @@ export class OrderEdit extends BaseEntity {
* example: order_01G2SG30J8C85S4A5CHM2S1NS2
* order:
* description: Available if the relation `order` is expanded.
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* changes:
* type: array
* description: Available if the relation `changes` is expanded.
* items:
* $ref: "#/components/schemas/order_item_change"
* $ref: "#/components/schemas/OrderItemChange"
* internal_note:
* description: "An optional note with additional details about the order edit."
* type: string
@@ -225,14 +224,14 @@ export class OrderEdit extends BaseEntity {
* type: array
* description: Available if the relation `items` is expanded.
* items:
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* 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: "#/components/schemas/payment_collection"
* $ref: "#/components/schemas/PaymentCollection"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -59,10 +59,9 @@ export class OrderItemChange extends SoftDeletableEntity {
}
/**
* @schema order_item_change
* @schema OrderItemChange
* title: "Order Item Change"
* description: "Represents an order edit item change"
* x-resourceId: order_item_change
* type: object
* required:
* - type
@@ -85,21 +84,21 @@ export class OrderItemChange extends SoftDeletableEntity {
* example: oe_01G2SG30J8C85S4A5CHM2S1NS2
* order_edit:
* description: Available if the relation `order_edit` is expanded.
* $ref: "#/components/schemas/order_edit"
* $ref: "#/components/schemas/OrderEdit"
* original_line_item_id:
* type: string
* description: The ID of the original line item in the order
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* original_line_item:
* description: Available if the relation `original_line_item` is expanded.
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* line_item_id:
* type: string
* description: The ID of the cloned line item.
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* line_item:
* description: Available if the relation `line_item` is expanded.
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
+10 -11
View File
@@ -278,10 +278,9 @@ export class Order extends BaseEntity {
}
/**
* @schema order
* @schema Order
* title: "Order"
* description: "Represents an order"
* x-resourceId: order
* type: object
* required:
* - customer_id
@@ -357,14 +356,14 @@ export class Order extends BaseEntity {
* example: addr_01G8ZH853YPY9B94857DY91YGW
* billing_address:
* description: Available if the relation `billing_address` is expanded.
* $ref: "#/components/schemas/address"
* $ref: "#/components/schemas/Address"
* shipping_address_id:
* type: string
* description: The ID of the shipping address associated with the order
* example: addr_01G8ZH853YPY9B94857DY91YGW
* shipping_address:
* description: Available if the relation `shipping_address` is expanded.
* $ref: "#/components/schemas/address"
* $ref: "#/components/schemas/Address"
* region_id:
* type: string
* description: The region's ID
@@ -381,7 +380,7 @@ export class Order extends BaseEntity {
* description: See a list of codes.
* currency:
* description: Available if the relation `currency` is expanded.
* $ref: "#/components/schemas/currency"
* $ref: "#/components/schemas/Currency"
* tax_rate:
* description: The order's tax rate
* type: number
@@ -402,17 +401,17 @@ export class Order extends BaseEntity {
* type: array
* description: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded.
* items:
* $ref: "#/components/schemas/shipping_method"
* $ref: "#/components/schemas/ShippingMethod"
* payments:
* type: array
* description: The payments used in the order. Available if the relation `payments` is expanded.
* items:
* $ref: "#/components/schemas/payment"
* $ref: "#/components/schemas/Payment"
* fulfillments:
* type: array
* description: The fulfillments used in the order. Available if the relation `fulfillments` is expanded.
* items:
* $ref: "#/components/schemas/fulfillment"
* $ref: "#/components/schemas/Fulfillment"
* returns:
* type: array
* description: The returns associated with the order. Available if the relation `returns` is expanded.
@@ -448,17 +447,17 @@ export class Order extends BaseEntity {
* type: array
* description: The line items that belong to the order. Available if the relation `items` is expanded.
* items:
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* edits:
* type: array
* description: "[EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded."
* items:
* $ref: "#/components/schemas/order_edit"
* $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.
* items:
* $ref: "#/components/schemas/gift_card_transaction"
* $ref: "#/components/schemas/GiftCardTransaction"
* canceled_at:
* type: string
* description: The date the order was canceled on.
@@ -102,10 +102,9 @@ export class PaymentCollection extends SoftDeletableEntity {
}
/**
* @schema payment_collection
* @schema PaymentCollection
* title: "Payment Collection"
* description: "Payment Collection"
* x-resourceId: payment_collection
* type: object
* required:
* - type
@@ -148,7 +147,7 @@ export class PaymentCollection extends SoftDeletableEntity {
* example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G
* region:
* description: Available if the relation `region` is expanded.
* $ref: "#/components/schemas/region"
* $ref: "#/components/schemas/Region"
* currency_code:
* description: "The 3 character ISO code for the currency."
* type: string
@@ -158,17 +157,17 @@ export class PaymentCollection extends SoftDeletableEntity {
* description: See a list of codes.
* currency:
* description: Available if the relation `currency` is expanded.
* $ref: "#/components/schemas/currency"
* $ref: "#/components/schemas/Currency"
* payment_sessions:
* type: array
* description: Available if the relation `payment_sessions` is expanded.
* items:
* $ref: "#/components/schemas/payment_session"
* $ref: "#/components/schemas/PaymentSession"
* payments:
* type: array
* description: Available if the relation `payments` is expanded.
* items:
* $ref: "#/components/schemas/payment"
* $ref: "#/components/schemas/Payment"
* created_by:
* type: string
* description: "The ID of the user that created the payment collection."
@@ -10,10 +10,9 @@ export class PaymentProvider {
}
/**
* @schema payment_provider
* @schema PaymentProvider
* title: "Payment Provider"
* description: "Represents a Payment Provider plugin and holds its installation status."
* x-resourceId: payment_provider
* type: object
* required:
* - id
+10 -3
View File
@@ -1,4 +1,12 @@
import { BeforeInsert, Column, Entity, Index, JoinColumn, ManyToOne, Unique, } from "typeorm"
import {
BeforeInsert,
Column,
Entity,
Index,
JoinColumn,
ManyToOne,
Unique,
} from "typeorm"
import { BaseEntity } from "../interfaces"
import { Cart } from "./cart"
@@ -61,10 +69,9 @@ export class PaymentSession extends BaseEntity {
}
/**
* @schema payment_session
* @schema PaymentSession
* title: "Payment Session"
* description: "Payment Sessions are created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, who is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc."
* x-resourceId: payment_session
* type: object
* required:
* - cart_id
+2 -3
View File
@@ -87,10 +87,9 @@ export class Payment extends BaseEntity {
}
/**
* @schema payment
* @schema Payment
* title: "Payment"
* description: "Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded."
* x-resourceId: payment
* type: object
* required:
* - amount
@@ -134,7 +133,7 @@ export class Payment extends BaseEntity {
* description: See a list of codes.
* currency:
* description: Available if the relation `currency` is expanded.
* $ref: "#/components/schemas/currency"
* $ref: "#/components/schemas/Currency"
* amount_refunded:
* description: "The amount of the original Payment amount that has been refunded back to the Customer."
* type: integer
+4 -5
View File
@@ -70,10 +70,9 @@ export class PriceList extends SoftDeletableEntity {
}
/**
* @schema price_list
* @schema PriceList
* title: "Price List"
* description: "Price Lists represents a set of prices that overrides the default price for one or more product variants."
* x-resourceId: price_list
* type: object
* required:
* - name
@@ -118,14 +117,14 @@ export class PriceList extends SoftDeletableEntity {
* type: array
* items:
* type: object
* description: A customer group object.
* description: A customer group object.
* prices:
* description: The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded.
* type: array
* items:
* oneOf:
* - $ref: "#/components/schemas/money_amount"
* - $ref: "#/components/schemas/customer_group"
* - $ref: "#/components/schemas/MoneyAmount"
* - $ref: "#/components/schemas/CustomerGroup"
* includes_tax:
* description: "[EXPERIMENTAL] Does the price list prices include tax"
* type: boolean
@@ -33,10 +33,9 @@ export class ProductCollection extends SoftDeletableEntity {
}
/**
* @schema product_collection
* @schema ProductCollection
* title: "Product Collection"
* description: "Product Collections represents a group of Products that are related."
* x-resourceId: product_collection
* type: object
* required:
* - title
@@ -46,10 +46,9 @@ export class ProductOptionValue extends SoftDeletableEntity {
}
/**
* @schema product_option_value
* @schema ProductOptionValue
* title: "Product Option Value"
* description: "A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product."
* x-resourceId: product_option_value
* type: object
* required:
* - value
@@ -70,14 +69,14 @@ export class ProductOptionValue extends SoftDeletableEntity {
* example: opt_01F0YESHQBZVKCEXJ24BS6PCX3
* option:
* description: Available if the relation `option` is expanded.
* $ref: "#/components/schemas/product_option"
* $ref: "#/components/schemas/ProductOption"
* variant_id:
* description: "The ID of the Product Variant that the Product Option Value is defined for."
* type: string
* example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6
* variant:
* description: Available if the relation `variant` is expanded.
* $ref: "#/components/schemas/product_variant"
* $ref: "#/components/schemas/ProductVariant"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
+2 -3
View File
@@ -40,10 +40,9 @@ export class ProductOption extends SoftDeletableEntity {
}
/**
* @schema product_option
* @schema ProductOption
* title: "Product Option"
* description: "Product Options define properties that may vary between different variants of a Product. Common Product Options are \"Size\" and \"Color\", but Medusa doesn't limit what Product Options that can be defined."
* x-resourceId: product_option
* type: object
* required:
* - title
@@ -61,7 +60,7 @@ export class ProductOption extends SoftDeletableEntity {
* description: The Product Option Values that are defined for the Product Option. Available if the relation `values` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/product_option_value"
* $ref: "#/components/schemas/ProductOptionValue"
* product_id:
* description: "The ID of the Product that the Product Option is defined for."
* type: string
+1 -2
View File
@@ -19,10 +19,9 @@ export class ProductTag extends SoftDeletableEntity {
}
/**
* @schema product_tag
* @schema ProductTag
* title: "Product Tag"
* description: "Product Tags can be added to Products for easy filtering and grouping."
* x-resourceId: product_tag
* type: object
* required:
* - value
@@ -39,10 +39,9 @@ export class ProductTaxRate {
}
/**
* @schema product_tax_rate
* @schema ProductTaxRate
* title: "Product Tax Rate"
* description: "Associates a tax rate with a product to indicate that the product is taxed in a certain way"
* x-resourceId: product_tax_rate
* type: object
* required:
* - product_id
@@ -54,14 +53,14 @@ export class ProductTaxRate {
* example: prod_01G1G5V2MBA328390B5AXJ610F
* product:
* description: Available if the relation `product` is expanded.
* $ref: "#/components/schemas/product"
* $ref: "#/components/schemas/Product"
* rate_id:
* description: "The ID of the Tax Rate"
* type: string
* example: txr_01G8XDBAWKBHHJRKH0AV02KXBR
* tax_rate:
* description: Available if the relation `tax_rate` is expanded.
* $ref: "#/components/schemas/tax_rate"
* $ref: "#/components/schemas/TaxRate"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -38,10 +38,9 @@ export class ProductTypeTaxRate {
}
/**
* @schema product_type_tax_rate
* @schema ProductTypeTaxRate
* title: "Product Type Tax Rate"
* description: "Associates a tax rate with a product type to indicate that the product type is taxed in a certain way"
* x-resourceId: product_type_tax_rate
* type: object
* required:
* - product_type_id
@@ -53,14 +52,14 @@ export class ProductTypeTaxRate {
* example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A
* product_type:
* description: Available if the relation `product_type` is expanded.
* $ref: "#/components/schemas/product_type"
* $ref: "#/components/schemas/ProductType"
* rate_id:
* description: "The id of the Tax Rate"
* type: string
* example: txr_01G8XDBAWKBHHJRKH0AV02KXBR
* tax_rate:
* description: Available if the relation `tax_rate` is expanded.
* $ref: "#/components/schemas/tax_rate"
* $ref: "#/components/schemas/TaxRate"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
+1 -2
View File
@@ -19,10 +19,9 @@ export class ProductType extends SoftDeletableEntity {
}
/**
* @schema product_type
* @schema ProductType
* title: "Product Type"
* description: "Product Type can be added to Products for filtering and reporting purposes."
* x-resourceId: product_type
* type: object
* required:
* - value
@@ -101,10 +101,9 @@ export class ProductVariant extends SoftDeletableEntity {
}
/**
* @schema product_variant
* @schema ProductVariant
* title: "Product Variant"
* description: "Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations."
* x-resourceId: product_variant
* type: object
* required:
* - title
@@ -130,7 +129,7 @@ export class ProductVariant extends SoftDeletableEntity {
* description: The Money Amounts defined for the Product Variant. Each Money Amount represents a price in a given currency or a price in a specific Region. Available if the relation `prices` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/money_amount"
* $ref: "#/components/schemas/MoneyAmount"
* sku:
* description: "The unique stock keeping unit used to identify the Product Variant. This will usually be a unqiue identifer for the item that is to be shipped, and can be referenced across multiple systems."
* type: string
@@ -199,7 +198,7 @@ export class ProductVariant extends SoftDeletableEntity {
* description: The Product Option Values specified for the Product Variant. Available if the relation `options` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/product_option_value"
* $ref: "#/components/schemas/ProductOptionValue"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -219,10 +218,9 @@ export class ProductVariant extends SoftDeletableEntity {
*/
/**
* @schema product_variant_prices_fields
* @schema ProductVariantPricesFields
* title: "Product Variant Prices Fields"
* description: "Product Variants Prices Fields that are only available in some requests."
* x-resourceId: product_variant_prices_fields
* type: object
* properties:
* original_price:
@@ -231,7 +229,7 @@ export class ProductVariant extends SoftDeletableEntity {
* calculated_price:
* type: number
* description: The calculated price of the variant. Can be a discounted price.
* original_price_incl_tax:
* original_price_incl_tax:
* type: number
* description: The original price of the variant including taxes.
* calculated_price_incl_tax:
@@ -258,4 +256,4 @@ export class ProductVariant extends SoftDeletableEntity {
* code:
* type: string
* description: The code of the tax rate
*/
*/
+7 -8
View File
@@ -174,10 +174,9 @@ export class Product extends SoftDeletableEntity {
}
/**
* @schema product
* @schema Product
* title: "Product"
* description: "Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by."
* x-resourceId: product
* type: object
* required:
* - title
@@ -219,7 +218,7 @@ export class Product extends SoftDeletableEntity {
* description: Images of the Product. Available if the relation `images` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/image"
* $ref: "#/components/schemas/Image"
* thumbnail:
* description: "A URL to an image file that can be used to identify the Product."
* type: string
@@ -228,19 +227,19 @@ export class Product extends SoftDeletableEntity {
* description: The Product Options that are defined for the Product. Product Variants of the Product will have a unique combination of Product Option Values. Available if the relation `options` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/product_option"
* $ref: "#/components/schemas/ProductOption"
* variants:
* description: The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. Available if the relation `variants` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/product_variant"
* $ref: "#/components/schemas/ProductVariant"
* profile_id:
* description: "The ID of the Shipping Profile that the Product belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products."
* type: string
* example: sp_01G1G5V239ENSZ5MV4JAR737BM
* profile:
* description: Available if the relation `profile` is expanded.
* $ref: "#/components/schemas/shipping_profile"
* $ref: "#/components/schemas/ShippingProfile"
* weight:
* description: "The weight of the Product Variant. May be used in shipping rate calculations."
* type: number
@@ -286,12 +285,12 @@ export class Product extends SoftDeletableEntity {
* example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A
* type:
* description: Available if the relation `type` is expanded.
* $ref: "#/components/schemas/product_type"
* $ref: "#/components/schemas/ProductType"
* tags:
* description: The Product Tags assigned to the Product. Available if the relation `tags` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/product_tag"
* $ref: "#/components/schemas/ProductTag"
* discountable:
* description: "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`."
* type: boolean
@@ -13,10 +13,9 @@ export class PublishableApiKeySalesChannel {
}
/**
* @schema publishable_api_key_sales_channel
* @schema PublishableApiKeySalesChannel
* title: "Publishable API key sales channel"
* description: "Holds mapping between Publishable API keys and Sales Channels"
* x-resourceId: publishable_api_key_sales_channel
* type: object
* properties:
* sales_channel_id:
@@ -27,10 +27,9 @@ export class PublishableApiKey extends BaseEntity {
}
/**
* @schema publishable_api_key
* @schema PublishableApiKey
* title: "Publishable API key"
* description: "Publishable API key defines scopes (i.e. resources) that are available within a request."
* x-resourceId: publishable_api_key
* type: object
* properties:
* id:
+1 -2
View File
@@ -68,10 +68,9 @@ export class Refund extends BaseEntity {
}
/**
* @schema refund
* @schema Refund
* title: "Refund"
* description: "Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator."
* x-resourceId: refund
* type: object
* required:
* - order_id
+7 -8
View File
@@ -107,10 +107,9 @@ export class Region extends SoftDeletableEntity {
}
/**
* @schema region
* @schema Region
* title: "Region"
* description: "Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries."
* x-resourceId: region
* type: object
* required:
* - name
@@ -134,7 +133,7 @@ export class Region extends SoftDeletableEntity {
* description: See a list of codes.
* currency:
* description: Available if the relation `currency` is expanded.
* $ref: "#/components/schemas/currency"
* $ref: "#/components/schemas/Currency"
* tax_rate:
* description: "The tax rate that should be charged on purchases in the Region."
* type: number
@@ -143,7 +142,7 @@ export class Region extends SoftDeletableEntity {
* description: The tax rates that are included in the Region. Available if the relation `tax_rates` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/tax_rate"
* $ref: "#/components/schemas/TaxRate"
* tax_code:
* description: "The tax code used on purchases in the Region. This may be used by other systems for accounting purposes."
* type: string
@@ -160,24 +159,24 @@ export class Region extends SoftDeletableEntity {
* description: The countries that are included in the Region. Available if the relation `countries` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/country"
* $ref: "#/components/schemas/Country"
* tax_provider_id:
* type: string
* description: The ID of the tax provider used in this region
* example: null
* tax_provider:
* description: Available if the relation `tax_provider` is expanded.
* $ref: "#/components/schemas/tax_provider"
* $ref: "#/components/schemas/TaxProvider"
* payment_providers:
* description: The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/payment_provider"
* $ref: "#/components/schemas/PaymentProvider"
* fulfillment_providers:
* description: The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/fulfillment_provider"
* $ref: "#/components/schemas/FulfillmentProvider"
* includes_tax:
* description: "[EXPERIMENTAL] Does the prices for the region include tax"
* type: boolean
+4 -5
View File
@@ -48,10 +48,9 @@ export class ReturnItem {
}
/**
* @schema return_item
* @schema ReturnItem
* title: "Return Item"
* description: "Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned."
* x-resourceId: return_item
* type: object
* required:
* - return_id
@@ -63,14 +62,14 @@ export class ReturnItem {
* example: ret_01F0YET7XPCMF8RZ0Y151NZV2V
* return_order:
* description: Available if the relation `return_order` is expanded.
* $ref: "#/components/schemas/return"
* $ref: "#/components/schemas/Return"
* item_id:
* description: "The id of the Line Item that the Return Item references."
* type: string
* example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN
* item:
* description: Available if the relation `item` is expanded.
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* quantity:
* description: "The quantity of the Line Item that is included in the Return."
* type: integer
@@ -93,7 +92,7 @@ export class ReturnItem {
* example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ
* reason:
* description: Available if the relation `reason` is expanded.
* $ref: "#/components/schemas/return_reason"
* $ref: "#/components/schemas/ReturnReason"
* note:
* description: "An optional note with additional details about the Return."
* type: string
+3 -4
View File
@@ -48,10 +48,9 @@ export class ReturnReason extends SoftDeletableEntity {
}
/**
* @schema return_reason
* @schema ReturnReason
* title: "Return Reason"
* description: "A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned."
* x-resourceId: return_reason
* type: object
* required:
* - value
@@ -79,10 +78,10 @@ export class ReturnReason extends SoftDeletableEntity {
* example: null
* parent_return_reason:
* description: Available if the relation `parent_return_reason` is expanded.
* $ref: "#/components/schemas/return_reason"
* $ref: "#/components/schemas/ReturnReason"
* return_reason_children:
* description: Available if the relation `return_reason_children` is expanded.
* $ref: "#/components/schemas/return_reason"
* $ref: "#/components/schemas/ReturnReason"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
+3 -4
View File
@@ -94,10 +94,9 @@ export class Return extends BaseEntity {
}
/**
* @schema return
* @schema Return
* title: "Return"
* description: "Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap."
* x-resourceId: return
* type: object
* required:
* - refund_amount
@@ -119,7 +118,7 @@ export class Return extends BaseEntity {
* description: The Return Items that will be shipped back to the warehouse. Available if the relation `items` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/return_item"
* $ref: "#/components/schemas/ReturnItem"
* swap_id:
* description: "The ID of the Swap that the Return is a part of."
* type: string
@@ -145,7 +144,7 @@ export class Return extends BaseEntity {
* description: The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation `shipping_method` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/shipping_method"
* $ref: "#/components/schemas/ShippingMethod"
* shipping_data:
* description: "Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment."
* type: object
+2 -3
View File
@@ -22,10 +22,9 @@ export class SalesChannel extends SoftDeletableEntity {
}
/**
* @schema sales_channel
* @schema SalesChannel
* title: "Sales Channel"
* description: "A Sales Channel"
* x-resourceId: sales_channel
* type: object
* required:
* - name
@@ -58,4 +57,4 @@ export class SalesChannel extends SoftDeletableEntity {
* type: string
* description: "The date with timezone at which the resource was deleted."
* format: date-time
*/
*/
@@ -30,10 +30,9 @@ export class ShippingMethodTaxLine extends TaxLine {
}
/**
* @schema shipping_method_tax_line
* @schema ShippingMethodTaxLine
* title: "Shipping Method Tax Line"
* description: "Shipping Method Tax Line"
* x-resourceId: shipping_method_tax_line
* type: object
* required:
* - shipping_method_id
@@ -50,7 +49,7 @@ export class ShippingMethodTaxLine extends TaxLine {
* example: sm_01F0YET7DR2E7CYVSDHM593QG2
* shipping_method:
* description: Available if the relation `shipping_method` is expanded.
* $ref: "#/components/schemas/shipping_method"
* $ref: "#/components/schemas/ShippingMethod"
* code:
* description: "A code to identify the tax type by"
* type: string
@@ -75,4 +74,4 @@ export class ShippingMethodTaxLine extends TaxLine {
* type: object
* description: An optional key-value map with additional details
* example: {car: "white"}
*/
*/
@@ -105,10 +105,9 @@ export class ShippingMethod {
}
/**
* @schema shipping_method
* @schema ShippingMethod
* title: "Shipping Method"
* description: "Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment."
* x-resourceId: shipping_method
* type: object
* required:
* - shipping_option_id
@@ -124,7 +123,7 @@ export class ShippingMethod {
* example: so_01G1G5V27GYX4QXNARRQCW1N8T
* shipping_option:
* description: Available if the relation `shipping_option` is expanded.
* $ref: "#/components/schemas/shipping_option"
* $ref: "#/components/schemas/ShippingOption"
* order_id:
* description: "The id of the Order that the Shipping Method is used on."
* type: string
@@ -164,7 +163,7 @@ export class ShippingMethod {
* type: array
* description: Available if the relation `tax_lines` is expanded.
* items:
* $ref: "#/components/schemas/shipping_method_tax_line"
* $ref: "#/components/schemas/ShippingMethodTaxLine"
* price:
* description: "The amount to charge for the Shipping Method. The currency of the price is defined by the Region that the Order that the Shipping Method belongs to is a part of."
* type: integer
@@ -47,10 +47,9 @@ export class ShippingOptionRequirement {
}
/**
* @schema shipping_option_requirement
* @schema ShippingOptionRequirement
* title: "Shipping Option Requirement"
* description: "A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart."
* x-resourceId: shipping_option_requirement
* type: object
* required:
* - shipping_option_id
@@ -67,7 +66,7 @@ export class ShippingOptionRequirement {
* example: so_01G1G5V27GYX4QXNARRQCW1N8T
* shipping_option:
* description: Available if the relation `shipping_option` is expanded.
* $ref: "#/components/schemas/shipping_option"
* $ref: "#/components/schemas/ShippingOption"
* type:
* description: "The type of the requirement, this defines how the value will be compared to the Cart's total. `min_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available."
* type: string
@@ -87,10 +87,9 @@ export class ShippingOption extends SoftDeletableEntity {
}
/**
* @schema shipping_option
* @schema ShippingOption
* title: "Shipping Option"
* description: "Shipping Options represent a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information."
* x-resourceId: shipping_option
* type: object
* required:
* - name
@@ -120,14 +119,14 @@ export class ShippingOption extends SoftDeletableEntity {
* example: sp_01G1G5V239ENSZ5MV4JAR737BM
* profile:
* description: Available if the relation `profile` is expanded.
* $ref: "#/components/schemas/shipping_profile"
* $ref: "#/components/schemas/ShippingProfile"
* provider_id:
* description: "The id of the Fulfillment Provider, that will be used to process Fulfillments from the Shipping Option."
* type: string
* example: manual
* provider:
* description: Available if the relation `provider` is expanded.
* $ref: "#/components/schemas/fulfillment_provider"
* $ref: "#/components/schemas/FulfillmentProvider"
* price_type:
* description: "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations."
* type: string
@@ -147,7 +146,7 @@ export class ShippingOption extends SoftDeletableEntity {
* description: The requirements that must be satisfied for the Shipping Option to be available for a Cart. Available if the relation `requirements` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/shipping_option_requirement"
* $ref: "#/components/schemas/ShippingOptionRequirement"
* data:
* description: "The data needed for the Fulfillment Provider to identify the Shipping Option."
* type: object
@@ -36,10 +36,9 @@ export class ShippingProfile extends SoftDeletableEntity {
}
/**
* @schema shipping_profile
* @schema ShippingProfile
* title: "Shipping Profile"
* description: "Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products."
* x-resourceId: shipping_profile
* type: object
* required:
* - name
@@ -71,7 +70,7 @@ export class ShippingProfile extends SoftDeletableEntity {
* description: The Shipping Options that can be used to fulfill the Products in the Shipping Profile. Available if the relation `shipping_options` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/shipping_option"
* $ref: "#/components/schemas/ShippingOption"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
@@ -38,10 +38,9 @@ export class ShippingTaxRate {
}
/**
* @schema shipping_tax_rate
* @schema ShippingTaxRate
* title: "Shipping Tax Rate"
* description: "Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way"
* x-resourceId: shipping_tax_rate
* type: object
* required:
* - shipping_option_id
@@ -53,14 +52,14 @@ export class ShippingTaxRate {
* example: so_01G1G5V27GYX4QXNARRQCW1N8T
* shipping_option:
* description: Available if the relation `shipping_option` is expanded.
* $ref: "#/components/schemas/shipping_option"
* $ref: "#/components/schemas/ShippingOption"
* rate_id:
* description: "The ID of the Tax Rate"
* type: string
* example: txr_01G8XDBAWKBHHJRKH0AV02KXBR
* tax_rate:
* description: Available if the relation `tax_rate` is expanded.
* $ref: "#/components/schemas/tax_rate"
* $ref: "#/components/schemas/TaxRate"
* created_at:
* type: string
* description: "The date with timezone at which the resource was created."
+2 -3
View File
@@ -21,10 +21,9 @@ export class StagedJob {
}
/**
* @schema staged_job
* @schema StagedJob
* title: "Staged Job"
* description: "A staged job resource"
* x-resourceId: staged_job
* type: object
* required:
* - event_name
@@ -41,4 +40,4 @@ export class StagedJob {
* description: Data necessary for the job
* type: object
* example: {}
*/
*/
+3 -4
View File
@@ -73,10 +73,9 @@ export class Store extends BaseEntity {
}
/**
* @schema store
* @schema Store
* title: "Store"
* description: "Holds settings for the Store, such as name, currencies, etc."
* x-resourceId: store
* type: object
* properties:
* id:
@@ -96,12 +95,12 @@ export class Store extends BaseEntity {
* description: See a list of codes.
* default_currency:
* description: Available if the relation `default_currency` is expanded.
* $ref: "#/components/schemas/currency"
* $ref: "#/components/schemas/Currency"
* currencies:
* description: The currencies that are enabled for the Store. Available if the relation `currencies` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/currency"
* $ref: "#/components/schemas/Currency"
* swap_link_template:
* description: "A template to generate Swap links from. Use {{cart_id}} to include the Swap's `cart_id` in the link."
* type: string
+6 -7
View File
@@ -119,10 +119,9 @@ export class Swap extends SoftDeletableEntity {
}
/**
* @schema swap
* @schema Swap
* title: "Swap"
* description: "Swaps can be created when a Customer wishes to exchange Products that they have purchased to different Products. Swaps consist of a Return of previously purchased Products and a Fulfillment of new Products, the amount paid for the Products being returned will be used towards payment for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference."
* x-resourceId: swap
* type: object
* required:
* - fulfillment_status
@@ -168,7 +167,7 @@ export class Swap extends SoftDeletableEntity {
* description: The new Line Items to ship to the Customer. Available if the relation `additional_items` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* return_order:
* description: A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded.
* type: object
@@ -176,10 +175,10 @@ export class Swap extends SoftDeletableEntity {
* description: The Fulfillments used to send the new Line Items. Available if the relation `fulfillments` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/fulfillment"
* $ref: "#/components/schemas/Fulfillment"
* payment:
* description: The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded.
* $ref: "#/components/schemas/payment"
* $ref: "#/components/schemas/Payment"
* difference_due:
* description: "The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products."
* type: integer
@@ -190,12 +189,12 @@ export class Swap extends SoftDeletableEntity {
* example: addr_01G8ZH853YPY9B94857DY91YGW
* shipping_address:
* description: Available if the relation `shipping_address` is expanded.
* $ref: "#/components/schemas/address"
* $ref: "#/components/schemas/Address"
* shipping_methods:
* description: The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded.
* type: array
* items:
* $ref: "#/components/schemas/shipping_method"
* $ref: "#/components/schemas/ShippingMethod"
* cart_id:
* description: "The id of the Cart that the Customer will use to confirm the Swap."
* type: string
+1 -2
View File
@@ -17,10 +17,9 @@ export class TaxLine extends BaseEntity {
}
/**
* @schema tax_line
* @schema TaxLine
* title: "Tax Line"
* description: "Line item that specifies an amount of tax to add to a line item."
* x-resourceId: tax_line
* type: object
* required:
* - rate
+1 -2
View File
@@ -10,10 +10,9 @@ export class TaxProvider {
}
/**
* @schema tax_provider
* @schema TaxProvider
* title: "Tax Provider"
* description: "The tax service used to calculate taxes"
* x-resourceId: tax_provider
* type: object
* properties:
* id:
+1 -2
View File
@@ -91,10 +91,9 @@ export class TaxRate extends BaseEntity {
}
/**
* @schema tax_rate
* @schema TaxRate
* title: "Tax Rate"
* description: "A Tax Rate can be used to associate a certain rate to charge on products within a given Region"
* x-resourceId: line_item
* type: object
* required:
* - name
+2 -3
View File
@@ -33,10 +33,9 @@ export class TrackingLink extends SoftDeletableEntity {
}
/**
* @schema tracking_link
* @schema TrackingLink
* title: "Tracking Link"
* description: "Tracking Link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment."
* x-resourceId: tracking_link
* type: object
* required:
* - tracking_number
@@ -60,7 +59,7 @@ export class TrackingLink extends SoftDeletableEntity {
* example: ful_01G8ZRTMQCA76TXNAT81KPJZRF
* fulfillment:
* description: Available if the relation `fulfillment` is expanded.
* $ref: "#/components/schemas/fulfillment"
* $ref: "#/components/schemas/Fulfillment"
* idempotency_key:
* type: string
* description: Randomly generated key used to continue the completion of a process in case of failure.
+1 -2
View File
@@ -46,10 +46,9 @@ export class User extends SoftDeletableEntity {
}
/**
* @schema user
* @schema User
* title: "User"
* description: "Represents a User who can manage store settings."
* x-resourceId: user
* type: object
* required:
* - email