From 8a1aac028e1c9e7c3cda465df408568bca48b7b1 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 26 Jul 2023 20:13:44 +0300 Subject: [PATCH] chore(oas): improvements to examples and descriptions (#4545) * improve curl examples in OAS * update tags * fix oas errors * update tags and their descriptions * updated oas of endpoints * improved oas of all admin endpoints * improved store OAS comments * improved models OAS comments * small change --- .../storefront/implement-claim-order.mdx | 2 +- .../client-types/src/lib/models/Address.ts | 4 +- .../src/lib/models/AdminAppsListRes.ts | 3 + .../src/lib/models/AdminAppsRes.ts | 3 + .../src/lib/models/AdminAuthRes.ts | 3 + .../src/lib/models/AdminBatchJobListRes.ts | 5 +- .../src/lib/models/AdminBatchJobRes.ts | 3 + .../src/lib/models/AdminCollectionsListRes.ts | 5 +- .../src/lib/models/AdminCreateUserRequest.ts | 10 +- .../src/lib/models/AdminCurrenciesListRes.ts | 5 +- .../src/lib/models/AdminCurrenciesRes.ts | 3 + .../lib/models/AdminCustomerGroupsListRes.ts | 5 +- .../src/lib/models/AdminCustomerGroupsRes.ts | 3 + .../src/lib/models/AdminCustomersListRes.ts | 5 +- .../src/lib/models/AdminCustomersRes.ts | 3 + ...untsDiscountConditionsConditionBatchReq.ts | 2 +- ...countsDiscountConditionsConditionParams.ts | 4 +- .../AdminDeletePriceListPricesPricesReq.ts | 2 +- ...ctCategoriesCategoryProductsBatchParams.ts | 4 +- ...ePublishableApiKeySalesChannelsBatchReq.ts | 2 +- ...eteSalesChannelsChannelProductsBatchReq.ts | 2 +- ...DeleteTaxRatesTaxRateProductTypesParams.ts | 4 +- ...minDeleteTaxRatesTaxRateProductTypesReq.ts | 2 +- ...dminDeleteTaxRatesTaxRateProductsParams.ts | 4 +- .../AdminDeleteTaxRatesTaxRateProductsReq.ts | 2 +- ...eteTaxRatesTaxRateShippingOptionsParams.ts | 4 +- ...DeleteTaxRatesTaxRateShippingOptionsReq.ts | 2 +- .../AdminDiscountConditionsDeleteRes.ts | 6 +- .../lib/models/AdminDiscountConditionsRes.ts | 3 + .../src/lib/models/AdminDiscountsDeleteRes.ts | 2 +- .../src/lib/models/AdminDiscountsListRes.ts | 2 +- .../src/lib/models/AdminDiscountsRes.ts | 3 + .../lib/models/AdminDraftOrdersDeleteRes.ts | 2 +- .../src/lib/models/AdminDraftOrdersListRes.ts | 5 +- .../src/lib/models/AdminDraftOrdersRes.ts | 3 + .../src/lib/models/AdminExtendedStoresRes.ts | 3 + .../src/lib/models/AdminGetBatchParams.ts | 24 +- .../lib/models/AdminGetCollectionsParams.ts | 16 +- .../lib/models/AdminGetCurrenciesParams.ts | 10 +- .../AdminGetCustomerGroupsGroupParams.ts | 4 +- .../models/AdminGetCustomerGroupsParams.ts | 16 +- .../src/lib/models/AdminGetCustomersParams.ts | 12 +- .../src/lib/models/AdminGetDiscountParams.ts | 4 +- .../AdminGetDiscountsDiscountCodeParams.ts | 4 +- ...countsDiscountConditionsConditionParams.ts | 4 +- .../src/lib/models/AdminGetDiscountsParams.ts | 18 +- .../lib/models/AdminGetDraftOrdersParams.ts | 6 +- .../src/lib/models/AdminGetGiftCardsParams.ts | 6 +- .../AdminGetGroupsGroupCustomersParams.ts | 8 +- ...tInventoryItemsItemLocationLevelsParams.ts | 6 +- .../AdminGetInventoryItemsItemParams.ts | 4 +- .../models/AdminGetInventoryItemsParams.ts | 34 +-- .../src/lib/models/AdminGetNotesParams.ts | 6 +- .../lib/models/AdminGetNotificationsParams.ts | 16 +- .../lib/models/AdminGetOrdersOrderParams.ts | 4 +- .../src/lib/models/AdminGetOrdersParams.ts | 38 +-- .../AdminGetPaymentCollectionsParams.ts | 4 +- .../AdminGetPriceListPaginationParams.ts | 30 ++- ...minGetPriceListsPriceListProductsParams.ts | 34 +-- .../models/AdminGetProductCategoriesParams.ts | 18 +- .../models/AdminGetProductCategoryParams.ts | 4 +- .../lib/models/AdminGetProductTagsParams.ts | 18 +- .../lib/models/AdminGetProductTypesParams.ts | 18 +- .../src/lib/models/AdminGetProductsParams.ts | 42 ++-- .../models/AdminGetProductsVariantsParams.ts | 8 +- .../src/lib/models/AdminGetRegionsParams.ts | 67 ++++- ...inGetRegionsRegionFulfillmentOptionsRes.ts | 3 + .../lib/models/AdminGetReservationsParams.ts | 18 +- .../src/lib/models/AdminGetReturnsParams.ts | 4 +- .../lib/models/AdminGetSalesChannelsParams.ts | 22 +- .../models/AdminGetShippingOptionsParams.ts | 6 +- .../AdminGetStockLocationsLocationParams.ts | 4 +- .../models/AdminGetStockLocationsParams.ts | 18 +- .../src/lib/models/AdminGetSwapsParams.ts | 4 +- .../src/lib/models/AdminGetTaxRatesParams.ts | 12 +- .../models/AdminGetTaxRatesTaxRateParams.ts | 4 +- .../src/lib/models/AdminGetVariantParams.ts | 4 +- .../src/lib/models/AdminGetVariantsParams.ts | 26 +- .../AdminGetVariantsVariantInventoryRes.ts | 3 + .../src/lib/models/AdminGiftCardsDeleteRes.ts | 2 +- .../src/lib/models/AdminGiftCardsListRes.ts | 2 +- .../src/lib/models/AdminGiftCardsRes.ts | 3 + .../lib/models/AdminInventoryItemsListRes.ts | 5 +- ...emsListWithVariantsAndLocationLevelsRes.ts | 5 +- .../src/lib/models/AdminInventoryItemsRes.ts | 3 + .../src/lib/models/AdminInviteDeleteRes.ts | 2 +- .../src/lib/models/AdminListInvitesRes.ts | 3 + .../src/lib/models/AdminNotesListRes.ts | 5 +- .../src/lib/models/AdminNotesRes.ts | 3 + .../lib/models/AdminNotificationsListRes.ts | 5 +- .../src/lib/models/AdminNotificationsRes.ts | 3 + .../src/lib/models/AdminOrderEditsListRes.ts | 5 +- .../src/lib/models/AdminOrderEditsRes.ts | 3 + .../src/lib/models/AdminOrdersListRes.ts | 5 +- .../AdminOrdersOrderLineItemReservationReq.ts | 2 +- .../src/lib/models/AdminOrdersRes.ts | 3 + .../lib/models/AdminPaymentCollectionsRes.ts | 3 + .../lib/models/AdminPaymentProvidersList.ts | 3 + .../src/lib/models/AdminPaymentRes.ts | 3 + .../src/lib/models/AdminPostAppsReq.ts | 2 +- .../src/lib/models/AdminPostAuthReq.ts | 4 +- .../src/lib/models/AdminPostBatchesReq.ts | 4 +- .../AdminPostCollectionsCollectionReq.ts | 4 +- .../src/lib/models/AdminPostCollectionsReq.ts | 4 +- .../models/AdminPostCurrenciesCurrencyReq.ts | 2 +- .../models/AdminPostCustomerGroupsGroupReq.ts | 2 +- .../lib/models/AdminPostCustomerGroupsReq.ts | 2 +- .../AdminPostDiscountsDiscountConditions.ts | 12 +- ...ostDiscountsDiscountConditionsCondition.ts | 10 +- ...sDiscountConditionsConditionBatchParams.ts | 4 +- ...countsDiscountConditionsConditionParams.ts | 4 +- ...inPostDiscountsDiscountConditionsParams.ts | 4 +- ...minPostDiscountsDiscountDynamicCodesReq.ts | 2 +- .../AdminPostDiscountsDiscountParams.ts | 4 +- .../models/AdminPostDiscountsDiscountReq.ts | 36 +-- .../lib/models/AdminPostDiscountsParams.ts | 4 +- .../src/lib/models/AdminPostDiscountsReq.ts | 38 +-- ...stDraftOrdersDraftOrderLineItemsItemReq.ts | 6 +- ...inPostDraftOrdersDraftOrderLineItemsReq.ts | 8 +- ...DraftOrdersDraftOrderRegisterPaymentRes.ts | 3 + .../AdminPostDraftOrdersDraftOrderReq.ts | 8 +- .../src/lib/models/AdminPostDraftOrdersReq.ts | 24 +- .../models/AdminPostGiftCardsGiftCardReq.ts | 4 +- .../src/lib/models/AdminPostGiftCardsReq.ts | 4 +- ...inPostInventoryItemsInventoryItemParams.ts | 4 +- ...ntoryItemsItemLocationLevelsLevelParams.ts | 4 +- ...tInventoryItemsItemLocationLevelsParams.ts | 4 +- ...PostInventoryItemsItemLocationLevelsReq.ts | 6 +- .../models/AdminPostInventoryItemsParams.ts | 4 +- .../lib/models/AdminPostInventoryItemsReq.ts | 24 +- .../models/AdminPostInvitesInviteAcceptReq.ts | 6 +- .../src/lib/models/AdminPostInvitesReq.ts | 4 +- .../src/lib/models/AdminPostNotesNoteReq.ts | 2 +- .../src/lib/models/AdminPostNotesReq.ts | 4 +- ...nPostNotificationsNotificationResendReq.ts | 2 +- .../AdminPostOrderEditsEditLineItemsReq.ts | 4 +- .../models/AdminPostOrderEditsOrderEditReq.ts | 2 +- .../src/lib/models/AdminPostOrderEditsReq.ts | 2 +- ...stOrdersOrderClaimsClaimFulfillmentsReq.ts | 2 +- ...nPostOrdersOrderClaimsClaimShipmentsReq.ts | 2 +- .../models/AdminPostOrdersOrderClaimsReq.ts | 16 +- .../AdminPostOrdersOrderFulfillmentsReq.ts | 4 +- .../models/AdminPostOrdersOrderRefundsReq.ts | 4 +- .../src/lib/models/AdminPostOrdersOrderReq.ts | 24 +- .../models/AdminPostOrdersOrderReturnsReq.ts | 4 +- .../AdminPostOrdersOrderShippingMethodsReq.ts | 2 +- .../models/AdminPostOrdersOrderSwapsParams.ts | 4 +- .../models/AdminPostOrdersOrderSwapsReq.ts | 18 +- ...PostOrdersOrderSwapsSwapFulfillmentsReq.ts | 2 +- .../AdminPostPriceListPricesPricesReq.ts | 6 +- ...dminPostPriceListsPriceListPriceListReq.ts | 12 +- .../models/AdminPostPriceListsPriceListReq.ts | 14 +- ...ctCategoriesCategoryProductsBatchParams.ts | 4 +- .../AdminPostProductCategoriesParams.ts | 4 +- .../models/AdminPostProductCategoriesReq.ts | 10 +- .../AdminPostProductsProductOptionsReq.ts | 2 +- .../lib/models/AdminPostProductsProductReq.ts | 86 ++++--- .../AdminPostProductsProductVariantsReq.ts | 56 +++-- ...inPostProductsProductVariantsVariantReq.ts | 50 ++-- .../src/lib/models/AdminPostProductsReq.ts | 66 ++--- ...tPublishableApiKeySalesChannelsBatchReq.ts | 2 +- ...tPublishableApiKeysPublishableApiKeyReq.ts | 2 +- .../models/AdminPostPublishableApiKeysReq.ts | 2 +- ...ostRegionsRegionFulfillmentProvidersReq.ts | 2 +- ...minPostRegionsRegionPaymentProvidersReq.ts | 2 +- .../lib/models/AdminPostRegionsRegionReq.ts | 20 +- .../src/lib/models/AdminPostRegionsReq.ts | 14 +- .../lib/models/AdminPostReservationsReq.ts | 8 +- .../AdminPostReservationsReservationReq.ts | 4 +- .../models/AdminPostReturnReasonsReasonReq.ts | 4 +- .../lib/models/AdminPostReturnReasonsReq.ts | 4 +- .../lib/models/AdminPostSalesChannelsReq.ts | 2 +- .../AdminPostSalesChannelsSalesChannelReq.ts | 6 +- .../AdminPostShippingOptionsOptionReq.ts | 8 +- .../lib/models/AdminPostShippingOptionsReq.ts | 10 +- .../AdminPostShippingProfilesProfileReq.ts | 4 +- .../lib/models/AdminPostStockLocationsReq.ts | 5 +- .../AdminPostStockLocationsReqAddress.ts | 39 +++ .../src/lib/models/AdminPostStoreReq.ts | 8 +- .../src/lib/models/AdminPostTaxRatesParams.ts | 4 +- .../src/lib/models/AdminPostTaxRatesReq.ts | 10 +- .../models/AdminPostTaxRatesTaxRateParams.ts | 4 +- ...inPostTaxRatesTaxRateProductTypesParams.ts | 4 +- .../AdminPostTaxRatesTaxRateProductsParams.ts | 4 +- .../lib/models/AdminPostTaxRatesTaxRateReq.ts | 10 +- ...ostTaxRatesTaxRateShippingOptionsParams.ts | 4 +- .../models/AdminPriceListDeleteBatchRes.ts | 2 +- .../AdminPriceListDeleteProductPricesRes.ts | 4 +- .../AdminPriceListDeleteVariantPricesRes.ts | 4 +- .../src/lib/models/AdminPriceListRes.ts | 3 + .../src/lib/models/AdminPriceListsListRes.ts | 5 +- .../models/AdminPriceListsProductsListRes.ts | 5 +- .../AdminProductCategoriesCategoryRes.ts | 3 + .../models/AdminProductCategoriesListRes.ts | 5 +- .../src/lib/models/AdminProductTagsListRes.ts | 5 +- .../lib/models/AdminProductTypesListRes.ts | 5 +- .../models/AdminProductsDeleteOptionRes.ts | 3 + .../models/AdminProductsDeleteVariantRes.ts | 3 + .../src/lib/models/AdminProductsListRes.ts | 5 +- .../lib/models/AdminProductsListTagsRes.ts | 3 + .../lib/models/AdminProductsListTypesRes.ts | 3 + .../models/AdminProductsListVariantsRes.ts | 5 +- .../src/lib/models/AdminProductsRes.ts | 3 + .../models/AdminPublishableApiKeyDeleteRes.ts | 4 +- .../models/AdminPublishableApiKeysListRes.ts | 5 +- ...nPublishableApiKeysListSalesChannelsRes.ts | 3 + .../lib/models/AdminPublishableApiKeysRes.ts | 3 + .../src/lib/models/AdminRefundRes.ts | 3 + .../src/lib/models/AdminRegionsListRes.ts | 5 +- .../src/lib/models/AdminRegionsRes.ts | 3 + .../lib/models/AdminReservationsListRes.ts | 5 +- .../src/lib/models/AdminReservationsRes.ts | 3 + .../lib/models/AdminResetPasswordRequest.ts | 6 +- .../models/AdminResetPasswordTokenRequest.ts | 2 +- .../src/lib/models/AdminReturnsCancelRes.ts | 3 + .../src/lib/models/AdminReturnsListRes.ts | 5 +- .../src/lib/models/AdminReturnsRes.ts | 3 + .../lib/models/AdminSalesChannelsListRes.ts | 5 +- .../src/lib/models/AdminSalesChannelsRes.ts | 3 + .../lib/models/AdminShippingOptionsListRes.ts | 5 +- .../src/lib/models/AdminShippingOptionsRes.ts | 3 + .../models/AdminShippingProfilesListRes.ts | 3 + .../lib/models/AdminShippingProfilesRes.ts | 3 + .../lib/models/AdminStockLocationsListRes.ts | 2 +- .../src/lib/models/AdminStockLocationsRes.ts | 3 + .../src/lib/models/AdminStoresRes.ts | 3 + .../src/lib/models/AdminSwapsListRes.ts | 5 +- .../src/lib/models/AdminSwapsRes.ts | 3 + .../src/lib/models/AdminTaxProvidersList.ts | 3 + .../src/lib/models/AdminTaxRatesListRes.ts | 5 +- .../src/lib/models/AdminTaxRatesRes.ts | 3 + .../AdminUpdatePaymentCollectionsReq.ts | 4 +- .../src/lib/models/AdminUpdateUserRequest.ts | 8 +- .../src/lib/models/AdminUploadsRes.ts | 3 + .../src/lib/models/AdminUserRes.ts | 3 + .../src/lib/models/AdminUsersListRes.ts | 3 + .../src/lib/models/AdminVariantsListRes.ts | 5 +- .../src/lib/models/AdminVariantsRes.ts | 3 + .../client-types/src/lib/models/BatchJob.ts | 4 +- .../client-types/src/lib/models/Cart.ts | 26 +- .../client-types/src/lib/models/ClaimImage.ts | 4 +- .../client-types/src/lib/models/ClaimItem.ts | 12 +- .../client-types/src/lib/models/ClaimOrder.ts | 14 +- .../client-types/src/lib/models/Country.ts | 2 +- .../client-types/src/lib/models/Currency.ts | 2 +- .../src/lib/models/CustomShippingOption.ts | 6 +- .../client-types/src/lib/models/Customer.ts | 10 +- .../src/lib/models/CustomerGroup.ts | 6 +- .../lib/models/DecoratedInventoryItemDTO.ts | 6 + .../client-types/src/lib/models/Discount.ts | 10 +- .../src/lib/models/DiscountCondition.ts | 16 +- .../lib/models/DiscountConditionProduct.ts | 6 +- .../DiscountConditionProductCollection.ts | 6 +- .../lib/models/DiscountConditionProductTag.ts | 6 +- .../models/DiscountConditionProductType.ts | 6 +- .../src/lib/models/DiscountRule.ts | 4 +- .../client-types/src/lib/models/DraftOrder.ts | 10 +- .../src/lib/models/ExtendedReservationItem.ts | 4 +- .../src/lib/models/Fulfillment.ts | 24 +- .../src/lib/models/FulfillmentItem.ts | 10 +- .../src/lib/models/FulfillmentProvider.ts | 6 +- .../models/GetOrderEditsOrderEditParams.ts | 4 +- .../src/lib/models/GetOrderEditsParams.ts | 12 +- ...GetPublishableApiKeySalesChannelsParams.ts | 2 +- .../lib/models/GetPublishableApiKeysParams.ts | 10 +- .../client-types/src/lib/models/GiftCard.ts | 8 +- .../src/lib/models/GiftCardTransaction.ts | 8 +- .../client-types/src/lib/models/Image.ts | 2 +- .../client-types/src/lib/models/Invite.ts | 4 +- .../client-types/src/lib/models/LineItem.ts | 34 +-- .../src/lib/models/LineItemAdjustment.ts | 6 +- .../src/lib/models/LineItemTaxLine.ts | 4 +- .../src/lib/models/MoneyAmount.ts | 16 +- .../client-types/src/lib/models/Note.ts | 6 +- .../src/lib/models/Notification.ts | 16 +- .../src/lib/models/NotificationProvider.ts | 6 +- .../client-types/src/lib/models/OAuth.ts | 2 +- .../client-types/src/lib/models/Order.ts | 50 ++-- .../client-types/src/lib/models/OrderEdit.ts | 10 +- .../src/lib/models/OrderItemChange.ts | 8 +- .../client-types/src/lib/models/Payment.ts | 18 +- .../src/lib/models/PaymentCollection.ts | 14 +- .../src/lib/models/PaymentProvider.ts | 6 +- .../src/lib/models/PaymentSession.ts | 8 +- .../client-types/src/lib/models/PriceList.ts | 8 +- .../client-types/src/lib/models/Product.ts | 26 +- .../src/lib/models/ProductCategory.ts | 8 +- .../src/lib/models/ProductCollection.ts | 4 +- .../src/lib/models/ProductOption.ts | 8 +- .../src/lib/models/ProductOptionValue.ts | 12 +- .../client-types/src/lib/models/ProductTag.ts | 2 +- .../src/lib/models/ProductTaxRate.ts | 6 +- .../src/lib/models/ProductType.ts | 2 +- .../src/lib/models/ProductTypeTaxRate.ts | 6 +- .../src/lib/models/ProductVariant.ts | 12 +- .../lib/models/ProductVariantInventoryItem.ts | 6 +- .../src/lib/models/PublishableApiKey.ts | 2 +- .../models/PublishableApiKeySalesChannel.ts | 2 +- .../client-types/src/lib/models/Refund.ts | 10 +- .../client-types/src/lib/models/Region.ts | 18 +- .../src/lib/models/ResponseInventoryItem.ts | 12 +- .../client-types/src/lib/models/Return.ts | 20 +- .../client-types/src/lib/models/ReturnItem.ts | 14 +- .../src/lib/models/ReturnReason.ts | 6 +- .../src/lib/models/SalesChannel.ts | 4 +- .../src/lib/models/SalesChannelLocation.ts | 8 +- .../src/lib/models/ShippingMethod.ts | 30 +-- .../src/lib/models/ShippingMethodTaxLine.ts | 4 +- .../src/lib/models/ShippingOption.ts | 18 +- .../lib/models/ShippingOptionRequirement.ts | 6 +- .../src/lib/models/ShippingProfile.ts | 6 +- .../src/lib/models/ShippingTaxRate.ts | 10 +- .../client-types/src/lib/models/Store.ts | 10 +- .../src/lib/models/StoreAuthRes.ts | 3 + .../models/StoreCartShippingOptionsListRes.ts | 3 + .../src/lib/models/StoreCartsRes.ts | 3 + .../src/lib/models/StoreCollectionsListRes.ts | 5 +- .../src/lib/models/StoreCollectionsRes.ts | 3 + .../src/lib/models/StoreCompleteCartRes.ts | 2 +- .../lib/models/StoreCustomersListOrdersRes.ts | 5 +- .../StoreCustomersListPaymentMethodsRes.ts | 5 +- .../src/lib/models/StoreCustomersRes.ts | 3 + .../models/StoreCustomersResetPasswordRes.ts | 3 + .../lib/models/StoreGetCollectionsParams.ts | 10 +- .../StoreGetCustomersCustomerOrdersParams.ts | 64 +++-- .../src/lib/models/StoreGetOrdersParams.ts | 10 +- .../StoreGetPaymentCollectionsParams.ts | 10 +- ...StoreGetProductCategoriesCategoryParams.ts | 10 +- .../StoreGetProductCategoriesCategoryRes.ts | 3 + .../models/StoreGetProductCategoriesParams.ts | 18 +- .../models/StoreGetProductCategoriesRes.ts | 5 +- .../lib/models/StoreGetProductTagsParams.ts | 18 +- .../lib/models/StoreGetProductTypesParams.ts | 18 +- .../src/lib/models/StoreGetProductsParams.ts | 42 ++-- .../models/StoreGetProductsProductParams.ts | 18 +- .../src/lib/models/StoreGetRegionsParams.ts | 6 +- .../models/StoreGetShippingOptionsParams.ts | 6 +- .../src/lib/models/StoreGetVariantsParams.ts | 34 ++- .../models/StoreGetVariantsVariantParams.ts | 14 +- .../src/lib/models/StoreGiftCardsRes.ts | 3 + .../src/lib/models/StoreOrderEditsRes.ts | 3 + .../src/lib/models/StoreOrdersRes.ts | 3 + .../lib/models/StorePaymentCollectionsRes.ts | 3 + .../StorePaymentCollectionsSessionRes.ts | 3 + .../src/lib/models/StorePostCartReq.ts | 14 +- .../StorePostCartsCartLineItemsItemReq.ts | 2 +- .../src/lib/models/StorePostCartsCartReq.ts | 14 +- .../StorePostCartsCartShippingMethodReq.ts | 4 +- ...torePostCustomersCustomerAcceptClaimReq.ts | 2 +- .../StorePostCustomersCustomerAddressesReq.ts | 2 +- ...StorePostCustomersCustomerOrderClaimReq.ts | 2 +- ...rePostCustomersCustomerPasswordTokenReq.ts | 2 +- .../models/StorePostCustomersCustomerReq.ts | 14 +- .../src/lib/models/StorePostCustomersReq.ts | 10 +- .../StorePostCustomersResetPasswordReq.ts | 4 +- .../StorePostOrderEditsOrderEditDecline.ts | 2 +- ...ePostPaymentCollectionsBatchSessionsReq.ts | 6 +- .../src/lib/models/StorePostReturnsReq.ts | 10 +- .../src/lib/models/StorePostSearchReq.ts | 6 +- .../src/lib/models/StorePostSearchRes.ts | 2 +- .../src/lib/models/StorePostSwapsReq.ts | 12 +- .../src/lib/models/StoreProductTagsListRes.ts | 5 +- .../lib/models/StoreProductTypesListRes.ts | 5 +- .../src/lib/models/StoreProductsListRes.ts | 5 +- .../src/lib/models/StoreProductsRes.ts | 3 + .../src/lib/models/StoreRegionsListRes.ts | 5 +- .../src/lib/models/StoreRegionsRes.ts | 3 + .../lib/models/StoreReturnReasonsListRes.ts | 3 + .../src/lib/models/StoreReturnReasonsRes.ts | 3 + .../src/lib/models/StoreReturnsRes.ts | 3 + .../lib/models/StoreShippingOptionsListRes.ts | 3 + .../src/lib/models/StoreSwapsRes.ts | 3 + .../src/lib/models/StoreVariantsListRes.ts | 3 + .../src/lib/models/StoreVariantsRes.ts | 3 + .../client-types/src/lib/models/Swap.ts | 24 +- .../client-types/src/lib/models/TaxLine.ts | 2 +- .../src/lib/models/TaxProvider.ts | 6 +- .../client-types/src/lib/models/TaxRate.ts | 12 +- .../src/lib/models/TrackingLink.ts | 6 +- .../client-types/src/lib/models/User.ts | 2 +- .../src/lib/models/VariantInventory.ts | 26 +- .../client-types/src/lib/models/index.ts | 1 + packages/medusa/oas/admin.oas.base.yaml | 231 +++++++++++++++--- packages/medusa/oas/store.oas.base.yaml | 107 ++++++-- .../api/routes/admin/apps/authorize-app.ts | 10 +- .../medusa/src/api/routes/admin/apps/index.ts | 2 + .../medusa/src/api/routes/admin/apps/list.ts | 6 +- .../api/routes/admin/auth/create-session.ts | 18 +- .../api/routes/admin/auth/delete-session.ts | 9 +- .../src/api/routes/admin/auth/get-session.ts | 6 +- .../medusa/src/api/routes/admin/auth/index.ts | 1 + .../routes/admin/batch/cancel-batch-job.ts | 8 +- .../routes/admin/batch/confirm-batch-job.ts | 8 +- .../routes/admin/batch/create-batch-job.ts | 16 +- .../api/routes/admin/batch/get-batch-job.ts | 8 +- .../src/api/routes/admin/batch/index.ts | 4 +- .../api/routes/admin/batch/list-batch-jobs.ts | 34 +-- .../routes/admin/collections/add-products.ts | 29 ++- .../admin/collections/create-collection.ts | 16 +- .../admin/collections/delete-collection.ts | 10 +- .../admin/collections/get-collection.ts | 10 +- .../src/api/routes/admin/collections/index.ts | 6 +- .../admin/collections/list-collections.ts | 24 +- .../admin/collections/remove-products.ts | 29 ++- .../admin/collections/update-collection.ts | 18 +- .../src/api/routes/admin/currencies/index.ts | 6 +- .../admin/currencies/list-currencies.ts | 21 +- .../admin/currencies/update-currency.ts | 11 +- .../customer-groups/add-customers-batch.ts | 14 +- .../customer-groups/create-customer-group.ts | 12 +- .../customer-groups/delete-customer-group.ts | 8 +- .../customer-groups/delete-customers-batch.ts | 14 +- .../get-customer-group-customers.ts | 16 +- .../customer-groups/get-customer-group.ts | 12 +- .../api/routes/admin/customer-groups/index.ts | 4 +- .../customer-groups/list-customer-groups.ts | 26 +- .../customer-groups/update-customer-group.ts | 14 +- .../routes/admin/customers/create-customer.ts | 16 +- .../routes/admin/customers/get-customer.ts | 12 +- .../src/api/routes/admin/customers/index.ts | 4 +- .../routes/admin/customers/list-customers.ts | 24 +- .../routes/admin/customers/update-customer.ts | 18 +- .../api/routes/admin/discounts/add-region.ts | 10 +- .../add-resources-to-condition-batch.ts | 21 +- .../admin/discounts/create-condition.ts | 30 +-- .../routes/admin/discounts/create-discount.ts | 55 +++-- .../admin/discounts/create-dynamic-code.ts | 16 +- .../admin/discounts/delete-condition.ts | 14 +- .../routes/admin/discounts/delete-discount.ts | 8 +- .../admin/discounts/delete-dynamic-code.ts | 10 +- .../delete-resources-from-condition-batch.ts | 24 +- .../routes/admin/discounts/get-condition.ts | 14 +- .../admin/discounts/get-discount-by-code.ts | 10 +- .../routes/admin/discounts/get-discount.ts | 10 +- .../src/api/routes/admin/discounts/index.ts | 12 +- .../routes/admin/discounts/list-discounts.ts | 24 +- .../routes/admin/discounts/remove-region.ts | 8 +- .../admin/discounts/update-condition.ts | 31 +-- .../routes/admin/discounts/update-discount.ts | 53 ++-- .../admin/draft-orders/create-draft-order.ts | 34 +-- .../admin/draft-orders/create-line-item.ts | 18 +- .../admin/draft-orders/delete-draft-order.ts | 8 +- .../admin/draft-orders/delete-line-item.ts | 10 +- .../admin/draft-orders/get-draft-order.ts | 8 +- .../api/routes/admin/draft-orders/index.ts | 7 +- .../admin/draft-orders/list-draft-orders.ts | 12 +- .../admin/draft-orders/register-payment.ts | 13 +- .../admin/draft-orders/update-draft-order.ts | 18 +- .../admin/draft-orders/update-line-item.ts | 16 +- .../admin/gift-cards/create-gift-card.ts | 12 +- .../admin/gift-cards/delete-gift-card.ts | 8 +- .../routes/admin/gift-cards/get-gift-card.ts | 8 +- .../src/api/routes/admin/gift-cards/index.ts | 5 +- .../admin/gift-cards/list-gift-cards.ts | 12 +- .../admin/gift-cards/update-gift-card.ts | 14 +- .../inventory-items/create-inventory-item.ts | 38 +-- .../inventory-items/create-location-level.ts | 20 +- .../inventory-items/delete-inventory-item.ts | 6 +- .../inventory-items/delete-location-level.ts | 4 +- .../inventory-items/get-inventory-item.ts | 10 +- .../api/routes/admin/inventory-items/index.ts | 9 +- .../inventory-items/list-inventory-items.ts | 50 ++-- .../inventory-items/list-location-levels.ts | 16 +- .../inventory-items/update-inventory-item.ts | 12 +- .../inventory-items/update-location-level.ts | 16 +- .../api/routes/admin/invites/accept-invite.ts | 21 +- .../api/routes/admin/invites/create-invite.ts | 13 +- .../api/routes/admin/invites/delete-invite.ts | 8 +- .../src/api/routes/admin/invites/index.ts | 3 +- .../api/routes/admin/invites/list-invites.ts | 6 +- .../api/routes/admin/invites/resend-invite.ts | 9 +- .../src/api/routes/admin/notes/create-note.ts | 18 +- .../src/api/routes/admin/notes/delete-note.ts | 8 +- .../src/api/routes/admin/notes/get-note.ts | 10 +- .../src/api/routes/admin/notes/index.ts | 4 +- .../src/api/routes/admin/notes/list-notes.ts | 12 +- .../src/api/routes/admin/notes/update-note.ts | 16 +- .../api/routes/admin/notifications/index.ts | 4 +- .../admin/notifications/list-notifications.ts | 22 +- .../notifications/resend-notification.ts | 10 +- .../routes/admin/order-edits/add-line-item.ts | 15 +- .../admin/order-edits/cancel-order-edit.ts | 10 +- .../admin/order-edits/confirm-order-edit.ts | 10 +- .../admin/order-edits/create-order-edit.ts | 12 +- .../admin/order-edits/delete-line-item.ts | 15 +- .../delete-order-edit-item-change.ts | 12 +- .../admin/order-edits/delete-order-edit.ts | 8 +- .../admin/order-edits/get-order-edit.ts | 12 +- .../src/api/routes/admin/order-edits/index.ts | 4 +- .../admin/order-edits/list-order-edit.ts | 20 +- .../admin/order-edits/request-confirmation.ts | 11 +- .../update-order-edit-line-item.ts | 15 +- .../admin/order-edits/update-order-edit.ts | 14 +- .../admin/orders/add-shipping-method.ts | 14 +- .../api/routes/admin/orders/archive-order.ts | 12 +- .../api/routes/admin/orders/cancel-claim.ts | 17 +- .../admin/orders/cancel-fulfillment-claim.ts | 20 +- .../admin/orders/cancel-fulfillment-swap.ts | 18 +- .../routes/admin/orders/cancel-fulfillment.ts | 18 +- .../api/routes/admin/orders/cancel-order.ts | 12 +- .../api/routes/admin/orders/cancel-swap.ts | 19 +- .../routes/admin/orders/capture-payment.ts | 14 +- .../api/routes/admin/orders/complete-order.ts | 12 +- .../admin/orders/create-claim-shipment.ts | 24 +- .../api/routes/admin/orders/create-claim.ts | 34 +-- .../routes/admin/orders/create-fulfillment.ts | 21 +- .../create-reservation-for-line-item.ts | 12 +- .../routes/admin/orders/create-shipment.ts | 18 +- .../admin/orders/create-swap-shipment.ts | 18 +- .../api/routes/admin/orders/create-swap.ts | 35 +-- .../api/routes/admin/orders/fulfill-claim.ts | 21 +- .../api/routes/admin/orders/fulfill-swap.ts | 23 +- .../src/api/routes/admin/orders/get-order.ts | 12 +- .../routes/admin/orders/get-reservations.ts | 10 +- .../src/api/routes/admin/orders/index.ts | 4 +- .../api/routes/admin/orders/list-orders.ts | 44 ++-- .../admin/orders/process-swap-payment.ts | 22 +- .../api/routes/admin/orders/refund-payment.ts | 20 +- .../api/routes/admin/orders/request-return.ts | 21 +- .../api/routes/admin/orders/update-claim.ts | 16 +- .../api/routes/admin/orders/update-order.ts | 40 +-- .../delete-payment-collection.ts | 12 +- .../get-payment-collection.ts | 14 +- .../routes/admin/payment-collections/index.ts | 1 + .../mark-authorized-payment-collection.ts | 10 +- .../update-payment-collection.ts | 22 +- .../routes/admin/payments/capture-payment.ts | 8 +- .../api/routes/admin/payments/get-payment.ts | 8 +- .../src/api/routes/admin/payments/index.ts | 2 + .../routes/admin/payments/refund-payment.ts | 16 +- .../admin/price-lists/add-prices-batch.ts | 22 +- .../admin/price-lists/create-price-list.ts | 29 +-- .../admin/price-lists/delete-price-list.ts | 10 +- .../admin/price-lists/delete-prices-batch.ts | 14 +- .../price-lists/delete-product-prices.ts | 14 +- .../price-lists/delete-variant-prices.ts | 12 +- .../admin/price-lists/get-price-list.ts | 8 +- .../src/api/routes/admin/price-lists/index.ts | 19 +- .../price-lists/list-price-list-products.ts | 42 ++-- .../admin/price-lists/list-price-lists.ts | 33 +-- .../admin/price-lists/update-price-list.ts | 25 +- .../product-categories/add-products-batch.ts | 14 +- .../create-product-category.ts | 23 +- .../delete-product-category.ts | 7 +- .../delete-products-batch.ts | 11 +- .../get-product-category.ts | 11 +- .../routes/admin/product-categories/index.ts | 4 +- .../list-product-categories.ts | 25 +- .../update-product-category.ts | 7 +- .../api/routes/admin/product-tags/index.ts | 3 +- .../admin/product-tags/list-product-tags.ts | 24 +- .../api/routes/admin/product-types/index.ts | 3 +- .../admin/product-types/list-product-types.ts | 24 +- .../api/routes/admin/products/add-option.ts | 15 +- .../routes/admin/products/create-product.ts | 79 +++--- .../routes/admin/products/create-variant.ts | 70 +++--- .../routes/admin/products/delete-option.ts | 8 +- .../routes/admin/products/delete-product.ts | 8 +- .../routes/admin/products/delete-variant.ts | 8 +- .../api/routes/admin/products/get-product.ts | 8 +- .../src/api/routes/admin/products/index.ts | 11 +- .../routes/admin/products/list-products.ts | 58 +++-- .../admin/products/list-tag-usage-count.ts | 6 +- .../api/routes/admin/products/list-types.ts | 6 +- .../routes/admin/products/list-variants.ts | 16 +- .../api/routes/admin/products/set-metadata.ts | 16 +- .../routes/admin/products/update-option.ts | 12 +- .../routes/admin/products/update-product.ts | 99 ++++---- .../routes/admin/products/update-variant.ts | 63 ++--- .../add-channels-batch.ts | 14 +- .../create-publishable-api-key.ts | 12 +- .../delete-channels-batch.ts | 16 +- .../delete-publishable-api-key.ts | 10 +- .../get-publishable-api-key.ts | 10 +- .../admin/publishable-api-keys/index.ts | 9 +- ...list-publishable-api-key-sales-channels.ts | 12 +- .../list-publishable-api-keys.ts | 18 +- .../revoke-publishable-api-key.ts | 10 +- .../update-publishable-api-key.ts | 14 +- .../api/routes/admin/regions/add-country.ts | 12 +- .../admin/regions/add-fulfillment-provider.ts | 14 +- .../admin/regions/add-payment-provider.ts | 14 +- .../api/routes/admin/regions/create-region.ts | 33 +-- .../api/routes/admin/regions/delete-region.ts | 8 +- .../admin/regions/get-fulfillment-options.ts | 8 +- .../api/routes/admin/regions/get-region.ts | 8 +- .../src/api/routes/admin/regions/index.ts | 5 +- .../api/routes/admin/regions/list-regions.ts | 73 +++++- .../routes/admin/regions/remove-country.ts | 10 +- .../regions/remove-fulfillment-provider.ts | 10 +- .../admin/regions/remove-payment-provider.ts | 10 +- .../api/routes/admin/regions/update-region.ts | 36 +-- .../admin/reservations/create-reservation.ts | 22 +- .../admin/reservations/delete-reservation.ts | 6 +- .../admin/reservations/get-reservation.ts | 8 +- .../api/routes/admin/reservations/index.ts | 8 +- .../admin/reservations/list-reservations.ts | 25 +- .../admin/reservations/update-reservation.ts | 14 +- .../admin/return-reasons/create-reason.ts | 16 +- .../admin/return-reasons/delete-reason.ts | 8 +- .../routes/admin/return-reasons/get-reason.ts | 8 +- .../admin/return-reasons/list-reasons.ts | 6 +- .../admin/return-reasons/update-reason.ts | 16 +- .../api/routes/admin/returns/cancel-return.ts | 8 +- .../src/api/routes/admin/returns/index.ts | 5 +- .../api/routes/admin/returns/list-returns.ts | 10 +- .../routes/admin/returns/receive-return.ts | 10 +- .../admin/sales-channels/add-product-batch.ts | 14 +- .../associate-stock-location.ts | 10 +- .../sales-channels/create-sales-channel.ts | 14 +- .../sales-channels/delete-products-batch.ts | 16 +- .../sales-channels/delete-sales-channel.ts | 8 +- .../admin/sales-channels/get-sales-channel.ts | 8 +- .../api/routes/admin/sales-channels/index.ts | 4 +- .../sales-channels/list-sales-channels.ts | 28 +-- .../sales-channels/remove-stock-location.ts | 12 +- .../sales-channels/update-sales-channel.ts | 18 +- .../create-shipping-option.ts | 27 +- .../delete-shipping-option.ts | 10 +- .../shipping-options/get-shipping-option.ts | 8 +- .../routes/admin/shipping-options/index.ts | 4 +- .../shipping-options/list-shipping-options.ts | 12 +- .../update-shipping-option.ts | 23 +- .../create-shipping-profile.ts | 10 +- .../delete-shipping-profile.ts | 8 +- .../shipping-profiles/get-shipping-profile.ts | 8 +- .../routes/admin/shipping-profiles/index.ts | 2 + .../list-shipping-profiles.ts | 6 +- .../update-shipping-profile.ts | 14 +- .../stock-locations/create-stock-location.ts | 58 ++++- .../stock-locations/delete-stock-location.ts | 24 +- .../stock-locations/get-stock-location.ts | 10 +- .../api/routes/admin/stock-locations/index.ts | 3 +- .../stock-locations/list-stock-locations.ts | 24 +- .../stock-locations/update-stock-location.ts | 12 +- .../api/routes/admin/store/add-currency.ts | 8 +- .../src/api/routes/admin/store/get-store.ts | 6 +- .../src/api/routes/admin/store/index.ts | 4 + .../admin/store/list-payment-providers.ts | 6 +- .../routes/admin/store/list-tax-providers.ts | 6 +- .../api/routes/admin/store/remove-currency.ts | 10 +- .../api/routes/admin/store/update-store.ts | 24 +- .../src/api/routes/admin/swaps/get-swap.ts | 8 +- .../src/api/routes/admin/swaps/index.ts | 4 +- .../src/api/routes/admin/swaps/list-swaps.ts | 10 +- .../admin/tax-rates/add-to-product-types.ts | 14 +- .../routes/admin/tax-rates/add-to-products.ts | 16 +- .../tax-rates/add-to-shipping-options.ts | 16 +- .../routes/admin/tax-rates/create-tax-rate.ts | 26 +- .../routes/admin/tax-rates/delete-tax-rate.ts | 8 +- .../routes/admin/tax-rates/get-tax-rate.ts | 12 +- .../src/api/routes/admin/tax-rates/index.ts | 4 +- .../routes/admin/tax-rates/list-tax-rates.ts | 18 +- .../tax-rates/remove-from-product-types.ts | 20 +- .../admin/tax-rates/remove-from-products.ts | 20 +- .../tax-rates/remove-from-shipping-options.ts | 20 +- .../routes/admin/tax-rates/update-tax-rate.ts | 26 +- .../admin/uploads/create-protected-upload.ts | 8 +- .../api/routes/admin/uploads/create-upload.ts | 10 +- .../api/routes/admin/uploads/delete-upload.ts | 8 +- .../routes/admin/uploads/get-download-url.ts | 8 +- .../src/api/routes/admin/uploads/index.ts | 1 + .../src/api/routes/admin/users/create-user.ts | 22 +- .../src/api/routes/admin/users/delete-user.ts | 8 +- .../src/api/routes/admin/users/get-user.ts | 8 +- .../src/api/routes/admin/users/index.ts | 2 + .../src/api/routes/admin/users/list-users.ts | 6 +- .../admin/users/reset-password-token.ts | 16 +- .../api/routes/admin/users/reset-password.ts | 22 +- .../src/api/routes/admin/users/update-user.ts | 20 +- .../routes/admin/variants/get-inventory.ts | 72 ++++-- .../api/routes/admin/variants/get-variant.ts | 18 +- .../src/api/routes/admin/variants/index.ts | 4 +- .../routes/admin/variants/list-variants.ts | 80 ++++-- .../api/routes/store/auth/create-session.ts | 11 +- .../api/routes/store/auth/delete-session.ts | 6 +- .../src/api/routes/store/auth/exists.ts | 11 +- .../src/api/routes/store/auth/get-session.ts | 6 +- .../medusa/src/api/routes/store/auth/index.ts | 1 + .../routes/store/carts/add-shipping-method.ts | 14 +- .../api/routes/store/carts/calculate-taxes.ts | 11 +- .../api/routes/store/carts/complete-cart.ts | 30 ++- .../src/api/routes/store/carts/create-cart.ts | 33 ++- .../store/carts/create-line-item/index.ts | 4 +- .../store/carts/create-payment-sessions.ts | 9 +- .../api/routes/store/carts/delete-discount.ts | 11 +- .../routes/store/carts/delete-line-item.ts | 10 +- .../store/carts/delete-payment-session.ts | 10 +- .../src/api/routes/store/carts/get-cart.ts | 8 +- .../src/api/routes/store/carts/index.ts | 7 +- .../store/carts/refresh-payment-session.ts | 10 +- .../routes/store/carts/set-payment-session.ts | 11 +- .../src/api/routes/store/carts/update-cart.ts | 28 ++- .../routes/store/carts/update-line-item.ts | 14 +- .../store/carts/update-payment-session.ts | 13 +- .../store/collections/get-collection.ts | 8 +- .../src/api/routes/store/collections/index.ts | 4 +- .../store/collections/list-collections.ts | 16 +- .../routes/store/customers/create-address.ts | 30 ++- .../routes/store/customers/create-customer.ts | 26 +- .../routes/store/customers/delete-address.ts | 8 +- .../routes/store/customers/get-customer.ts | 6 +- .../store/customers/get-payment-methods.ts | 10 +- .../src/api/routes/store/customers/index.ts | 8 +- .../api/routes/store/customers/list-orders.ts | 41 ++-- .../store/customers/reset-password-token.ts | 14 +- .../routes/store/customers/reset-password.ts | 20 +- .../routes/store/customers/update-address.ts | 14 +- .../routes/store/customers/update-customer.ts | 24 +- .../routes/store/gift-cards/get-gift-card.ts | 4 +- .../src/api/routes/store/gift-cards/index.ts | 1 + .../store/order-edits/complete-order-edit.ts | 11 +- .../store/order-edits/decline-order-edit.ts | 10 +- .../store/order-edits/get-order-edit.ts | 8 +- .../src/api/routes/store/order-edits/index.ts | 1 + .../store/orders/confirm-order-request.ts | 13 +- .../routes/store/orders/get-order-by-cart.ts | 6 +- .../src/api/routes/store/orders/get-order.ts | 12 +- .../src/api/routes/store/orders/index.ts | 1 + .../api/routes/store/orders/lookup-order.ts | 16 +- .../api/routes/store/orders/request-order.ts | 22 +- .../authorize-batch-payment-sessions.ts | 6 +- .../authorize-payment-session.ts | 6 +- .../get-payment-collection.ts | 8 +- .../routes/store/payment-collections/index.ts | 2 + .../manage-batch-payment-sessions.ts | 65 +++-- .../manage-payment-session.ts | 14 +- .../refresh-payment-session.ts | 6 +- .../get-product-category.ts | 14 +- .../routes/store/product-categories/index.ts | 4 +- .../list-product-categories.ts | 24 +- .../api/routes/store/product-tags/index.ts | 3 +- .../store/product-tags/list-product-tags.ts | 22 +- .../api/routes/store/product-types/index.ts | 3 +- .../store/product-types/list-product-types.ts | 23 +- .../api/routes/store/products/get-product.ts | 28 ++- .../src/api/routes/store/products/index.ts | 6 +- .../routes/store/products/list-products.ts | 75 ++++-- .../src/api/routes/store/products/search.ts | 15 +- .../api/routes/store/regions/get-region.ts | 8 +- .../src/api/routes/store/regions/index.ts | 4 +- .../api/routes/store/regions/list-regions.ts | 14 +- .../routes/store/return-reasons/get-reason.ts | 6 +- .../api/routes/store/return-reasons/index.ts | 2 + .../store/return-reasons/list-reasons.ts | 4 +- .../api/routes/store/returns/create-return.ts | 19 +- .../src/api/routes/store/returns/index.ts | 1 + .../routes/store/shipping-options/index.ts | 2 + .../store/shipping-options/list-options.ts | 10 +- .../shipping-options/list-shipping-options.ts | 11 +- .../src/api/routes/store/swaps/create-swap.ts | 33 ++- .../routes/store/swaps/get-swap-by-cart.ts | 6 +- .../src/api/routes/store/swaps/index.ts | 1 + .../api/routes/store/variants/get-variant.ts | 24 +- .../src/api/routes/store/variants/index.ts | 2 + .../routes/store/variants/list-variants.ts | 72 ++++-- packages/medusa/src/models/address.ts | 5 +- packages/medusa/src/models/batch-job.ts | 5 +- packages/medusa/src/models/cart.ts | 38 ++- packages/medusa/src/models/claim-image.ts | 5 +- packages/medusa/src/models/claim-item.ts | 17 +- packages/medusa/src/models/claim-order.ts | 23 +- packages/medusa/src/models/country.ts | 3 +- packages/medusa/src/models/currency.ts | 3 +- .../src/models/custom-shipping-option.ts | 8 +- packages/medusa/src/models/customer-group.ts | 8 +- packages/medusa/src/models/customer.ts | 14 +- .../discount-condition-product-collection.ts | 8 +- .../models/discount-condition-product-tag.ts | 8 +- .../models/discount-condition-product-type.ts | 8 +- .../src/models/discount-condition-product.ts | 8 +- .../medusa/src/models/discount-condition.ts | 24 +- packages/medusa/src/models/discount-rule.ts | 5 +- packages/medusa/src/models/discount.ts | 13 +- packages/medusa/src/models/draft-order.ts | 12 +- .../medusa/src/models/fulfillment-item.ts | 12 +- .../medusa/src/models/fulfillment-provider.ts | 7 +- packages/medusa/src/models/fulfillment.ts | 30 ++- .../src/models/gift-card-transaction.ts | 10 +- packages/medusa/src/models/gift-card.ts | 10 +- packages/medusa/src/models/image.ts | 2 +- packages/medusa/src/models/invite.ts | 4 +- .../medusa/src/models/line-item-adjustment.ts | 8 +- .../medusa/src/models/line-item-tax-line.ts | 5 +- packages/medusa/src/models/line-item.ts | 43 ++-- packages/medusa/src/models/money-amount.ts | 20 +- packages/medusa/src/models/note.ts | 7 +- .../src/models/notification-provider.ts | 7 +- packages/medusa/src/models/notification.ts | 20 +- packages/medusa/src/models/oauth.ts | 2 +- packages/medusa/src/models/order-edit.ts | 14 +- .../medusa/src/models/order-item-change.ts | 11 +- packages/medusa/src/models/order.ts | 71 ++++-- .../medusa/src/models/payment-collection.ts | 18 +- .../medusa/src/models/payment-provider.ts | 7 +- packages/medusa/src/models/payment-session.ts | 9 +- packages/medusa/src/models/payment.ts | 22 +- packages/medusa/src/models/price-list.ts | 11 +- .../medusa/src/models/product-category.ts | 14 +- .../medusa/src/models/product-collection.ts | 5 +- .../medusa/src/models/product-option-value.ts | 14 +- packages/medusa/src/models/product-option.ts | 10 +- packages/medusa/src/models/product-tag.ts | 2 +- .../medusa/src/models/product-tax-rate.ts | 8 +- .../src/models/product-type-tax-rate.ts | 8 +- packages/medusa/src/models/product-type.ts | 2 +- .../models/product-variant-inventory-item.ts | 7 +- packages/medusa/src/models/product-variant.ts | 16 +- packages/medusa/src/models/product.ts | 36 ++- .../publishable-api-key-sales-channel.ts | 4 +- .../medusa/src/models/publishable-api-key.ts | 2 +- packages/medusa/src/models/refund.ts | 12 +- packages/medusa/src/models/region.ts | 25 +- packages/medusa/src/models/return-item.ts | 17 +- packages/medusa/src/models/return-reason.ts | 8 +- packages/medusa/src/models/return.ts | 25 +- .../src/models/sales-channel-location.ts | 9 +- packages/medusa/src/models/sales-channel.ts | 5 +- .../src/models/shipping-method-tax-line.ts | 5 +- packages/medusa/src/models/shipping-method.ts | 38 +-- .../src/models/shipping-option-requirement.ts | 7 +- packages/medusa/src/models/shipping-option.ts | 23 +- .../medusa/src/models/shipping-profile.ts | 9 +- .../medusa/src/models/shipping-tax-rate.ts | 12 +- packages/medusa/src/models/store.ts | 13 +- packages/medusa/src/models/swap.ts | 32 ++- packages/medusa/src/models/tax-line.ts | 2 +- packages/medusa/src/models/tax-provider.ts | 7 +- packages/medusa/src/models/tax-rate.ts | 16 +- packages/medusa/src/models/tracking-link.ts | 7 +- packages/medusa/src/models/user.ts | 2 +- 831 files changed, 5871 insertions(+), 4324 deletions(-) create mode 100644 packages/generated/client-types/src/lib/models/AdminPostStockLocationsReqAddress.ts diff --git a/docs/content/modules/orders/storefront/implement-claim-order.mdx b/docs/content/modules/orders/storefront/implement-claim-order.mdx index 632ff90580..a411117d43 100644 --- a/docs/content/modules/orders/storefront/implement-claim-order.mdx +++ b/docs/content/modules/orders/storefront/implement-claim-order.mdx @@ -83,7 +83,7 @@ To allow the customer to claim an order, send a request to the Claim an Order en ```ts -medusa.orders.claimOrders({ +medusa.orders.requestCustomerOrders({ order_ids: [ order_id, ], diff --git a/packages/generated/client-types/src/lib/models/Address.ts b/packages/generated/client-types/src/lib/models/Address.ts index 6348254225..18e3d8b84f 100644 --- a/packages/generated/client-types/src/lib/models/Address.ts +++ b/packages/generated/client-types/src/lib/models/Address.ts @@ -7,7 +7,7 @@ import type { Country } from "./Country" import type { Customer } from "./Customer" /** - * An address. + * An address is used across the Medusa backend within other schemas and object types. For example, a customer's billing and shipping addresses both use the Address entity. */ export interface Address { /** @@ -51,7 +51,7 @@ export interface Address { */ country_code: string | null /** - * A country object. Available if the relation `country` is expanded. + * A country object. */ country?: Country | null /** diff --git a/packages/generated/client-types/src/lib/models/AdminAppsListRes.ts b/packages/generated/client-types/src/lib/models/AdminAppsListRes.ts index ccfedb1ee6..d89fcd9273 100644 --- a/packages/generated/client-types/src/lib/models/AdminAppsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminAppsListRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { OAuth } from "./OAuth" export interface AdminAppsListRes { + /** + * An array of app details. + */ apps: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminAppsRes.ts b/packages/generated/client-types/src/lib/models/AdminAppsRes.ts index e783308835..beef1fa087 100644 --- a/packages/generated/client-types/src/lib/models/AdminAppsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminAppsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { OAuth } from "./OAuth" export interface AdminAppsRes { + /** + * App details. + */ apps: OAuth } diff --git a/packages/generated/client-types/src/lib/models/AdminAuthRes.ts b/packages/generated/client-types/src/lib/models/AdminAuthRes.ts index 12f20cb09e..c0a61b4245 100644 --- a/packages/generated/client-types/src/lib/models/AdminAuthRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminAuthRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { User } from "./User" export interface AdminAuthRes { + /** + * User details. + */ user: User } diff --git a/packages/generated/client-types/src/lib/models/AdminBatchJobListRes.ts b/packages/generated/client-types/src/lib/models/AdminBatchJobListRes.ts index e6578e8f86..cacc1bc2b5 100644 --- a/packages/generated/client-types/src/lib/models/AdminBatchJobListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminBatchJobListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { BatchJob } from "./BatchJob" export interface AdminBatchJobListRes { + /** + * An array of batch job details. + */ batch_jobs: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of batch jobs skipped when retrieving the batch jobs. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminBatchJobRes.ts b/packages/generated/client-types/src/lib/models/AdminBatchJobRes.ts index cdbe6fd8a6..5787752761 100644 --- a/packages/generated/client-types/src/lib/models/AdminBatchJobRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminBatchJobRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { BatchJob } from "./BatchJob" export interface AdminBatchJobRes { + /** + * Batch job details. + */ batch_job: BatchJob } diff --git a/packages/generated/client-types/src/lib/models/AdminCollectionsListRes.ts b/packages/generated/client-types/src/lib/models/AdminCollectionsListRes.ts index bbf89400e0..e0c5956360 100644 --- a/packages/generated/client-types/src/lib/models/AdminCollectionsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminCollectionsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductCollection } from "./ProductCollection" export interface AdminCollectionsListRes { + /** + * an array of collection details + */ collections: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of product collections skipped when retrieving the product collections. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminCreateUserRequest.ts b/packages/generated/client-types/src/lib/models/AdminCreateUserRequest.ts index 1fdd7561da..452b65389d 100644 --- a/packages/generated/client-types/src/lib/models/AdminCreateUserRequest.ts +++ b/packages/generated/client-types/src/lib/models/AdminCreateUserRequest.ts @@ -5,23 +5,23 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminCreateUserRequest { /** - * The Users email. + * The User's email. */ email: string /** - * The name of the User. + * The first name of the User. */ first_name?: string /** - * The name of the User. + * The last name of the User. */ last_name?: string /** - * Userrole assigned to the user. + * The role assigned to the user. These roles don't provide any different privileges. */ role?: "admin" | "member" | "developer" /** - * The Users password. + * The User's password. */ password: string } diff --git a/packages/generated/client-types/src/lib/models/AdminCurrenciesListRes.ts b/packages/generated/client-types/src/lib/models/AdminCurrenciesListRes.ts index dd9ee0a5bd..6efe903f9b 100644 --- a/packages/generated/client-types/src/lib/models/AdminCurrenciesListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminCurrenciesListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Currency } from "./Currency" export interface AdminCurrenciesListRes { + /** + * An array of currency details. + */ currencies: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of currencies skipped when retrieving the currencies. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminCurrenciesRes.ts b/packages/generated/client-types/src/lib/models/AdminCurrenciesRes.ts index 5b4aa5d913..00ac125a74 100644 --- a/packages/generated/client-types/src/lib/models/AdminCurrenciesRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminCurrenciesRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Currency } from "./Currency" export interface AdminCurrenciesRes { + /** + * Currency details. + */ currency: Currency } diff --git a/packages/generated/client-types/src/lib/models/AdminCustomerGroupsListRes.ts b/packages/generated/client-types/src/lib/models/AdminCustomerGroupsListRes.ts index 0810772d49..3d36ee4284 100644 --- a/packages/generated/client-types/src/lib/models/AdminCustomerGroupsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminCustomerGroupsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { CustomerGroup } from "./CustomerGroup" export interface AdminCustomerGroupsListRes { + /** + * An array of customer group details. + */ customer_groups: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of customer groups skipped when retrieving the customer groups. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminCustomerGroupsRes.ts b/packages/generated/client-types/src/lib/models/AdminCustomerGroupsRes.ts index 42a3f1a63f..309e4e711d 100644 --- a/packages/generated/client-types/src/lib/models/AdminCustomerGroupsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminCustomerGroupsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { CustomerGroup } from "./CustomerGroup" export interface AdminCustomerGroupsRes { + /** + * Customer group details. + */ customer_group: CustomerGroup } diff --git a/packages/generated/client-types/src/lib/models/AdminCustomersListRes.ts b/packages/generated/client-types/src/lib/models/AdminCustomersListRes.ts index 9fb32a36f5..191207e4eb 100644 --- a/packages/generated/client-types/src/lib/models/AdminCustomersListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminCustomersListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Customer } from "./Customer" export interface AdminCustomersListRes { + /** + * An array of customer details. + */ customers: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of customers skipped when retrieving the customers. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminCustomersRes.ts b/packages/generated/client-types/src/lib/models/AdminCustomersRes.ts index 5bdfbab740..0e0219e853 100644 --- a/packages/generated/client-types/src/lib/models/AdminCustomersRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminCustomersRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Customer } from "./Customer" export interface AdminCustomersRes { + /** + * Customer details. + */ customer: SetRelation } diff --git a/packages/generated/client-types/src/lib/models/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.ts b/packages/generated/client-types/src/lib/models/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.ts index 6da57dd19e..0f30e23b8c 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeleteDiscountsDiscountConditionsConditionBatchReq { /** - * The resources to be deleted from the discount condition + * The resources to be removed from the discount condition */ resources: Array<{ /** diff --git a/packages/generated/client-types/src/lib/models/AdminDeleteDiscountsDiscountConditionsConditionParams.ts b/packages/generated/client-types/src/lib/models/AdminDeleteDiscountsDiscountConditionsConditionParams.ts index b62e5d42e9..dc7fa56b61 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeleteDiscountsDiscountConditionsConditionParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeleteDiscountsDiscountConditionsConditionParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeleteDiscountsDiscountConditionsConditionParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned discount. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned discount. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminDeletePriceListPricesPricesReq.ts b/packages/generated/client-types/src/lib/models/AdminDeletePriceListPricesPricesReq.ts index 93e9e7a362..0d905722b8 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeletePriceListPricesPricesReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeletePriceListPricesPricesReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeletePriceListPricesPricesReq { /** - * The price id's of the Money Amounts to delete. + * The price IDs of the Money Amounts to delete. */ price_ids?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminDeleteProductCategoriesCategoryProductsBatchParams.ts b/packages/generated/client-types/src/lib/models/AdminDeleteProductCategoriesCategoryProductsBatchParams.ts index f7ca72d6c5..06b1006a4e 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeleteProductCategoriesCategoryProductsBatchParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeleteProductCategoriesCategoryProductsBatchParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeleteProductCategoriesCategoryProductsBatchParams { /** - * (Comma separated) Category fields to be expanded in the response. + * Comma-separated relations that should be expanded in the returned product category. */ expand?: string /** - * (Comma separated) Category fields to be retrieved in the response. + * Comma-separated fields that should be included in the returned product category. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminDeletePublishableApiKeySalesChannelsBatchReq.ts b/packages/generated/client-types/src/lib/models/AdminDeletePublishableApiKeySalesChannelsBatchReq.ts index bc2e57a16f..dc2f9e9a79 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeletePublishableApiKeySalesChannelsBatchReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeletePublishableApiKeySalesChannelsBatchReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeletePublishableApiKeySalesChannelsBatchReq { /** - * The IDs of the sales channels to delete from the publishable api key + * The IDs of the sales channels to remove from the publishable API key */ sales_channel_ids: Array<{ /** diff --git a/packages/generated/client-types/src/lib/models/AdminDeleteSalesChannelsChannelProductsBatchReq.ts b/packages/generated/client-types/src/lib/models/AdminDeleteSalesChannelsChannelProductsBatchReq.ts index 15e2fb3d30..b603e2dd78 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeleteSalesChannelsChannelProductsBatchReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeleteSalesChannelsChannelProductsBatchReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeleteSalesChannelsChannelProductsBatchReq { /** - * The IDs of the products to delete from the Sales Channel. + * The IDs of the products to remove from the Sales Channel. */ product_ids: Array<{ /** diff --git a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductTypesParams.ts b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductTypesParams.ts index abb8eb9b4e..69ea01ed1e 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductTypesParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductTypesParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeleteTaxRatesTaxRateProductTypesParams { /** - * Which fields should be included in the result. + * Comma-separated fields that should be included in the returned tax rate. */ fields?: Array /** - * Which fields should be expanded and retrieved in the result. + * Comma-separated relations that should be expanded in the returned tax rate. */ expand?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductTypesReq.ts b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductTypesReq.ts index 7f9e7519e8..43f862d7ce 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductTypesReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductTypesReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeleteTaxRatesTaxRateProductTypesReq { /** - * The IDs of the types of products to remove association with this tax rate + * The IDs of the product types to remove their association with this tax rate. */ product_types: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductsParams.ts b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductsParams.ts index 2848c7686c..49fb7867a2 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeleteTaxRatesTaxRateProductsParams { /** - * Which fields should be included in the result. + * Comma-separated fields that should be included in the returned tax rate. */ fields?: Array /** - * Which fields should be expanded and retrieved in the result. + * Comma-separated relations that should be expanded in the returned tax rate. */ expand?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductsReq.ts b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductsReq.ts index e7ce8b1464..4c17f49616 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateProductsReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeleteTaxRatesTaxRateProductsReq { /** - * The IDs of the products to remove association with this tax rate + * The IDs of the products to remove their association with this tax rate. */ products: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateShippingOptionsParams.ts b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateShippingOptionsParams.ts index c248705f8a..cb78843a2c 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateShippingOptionsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateShippingOptionsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeleteTaxRatesTaxRateShippingOptionsParams { /** - * Which fields should be included in the result. + * Comma-separated fields that should be included in the returned tax rate. */ fields?: Array /** - * Which fields should be expanded and retrieved in the result. + * Comma-separated relations that should be expanded in the returned tax rate. */ expand?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateShippingOptionsReq.ts b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateShippingOptionsReq.ts index 0fb215cb48..0872cc7bd7 100644 --- a/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateShippingOptionsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminDeleteTaxRatesTaxRateShippingOptionsReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminDeleteTaxRatesTaxRateShippingOptionsReq { /** - * The IDs of the shipping options to remove association with this tax rate + * The IDs of the shipping options to remove their association with this tax rate. */ shipping_options: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminDiscountConditionsDeleteRes.ts b/packages/generated/client-types/src/lib/models/AdminDiscountConditionsDeleteRes.ts index 54fd92dd43..8b5755212e 100644 --- a/packages/generated/client-types/src/lib/models/AdminDiscountConditionsDeleteRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminDiscountConditionsDeleteRes.ts @@ -7,7 +7,7 @@ import type { Discount } from "./Discount" export interface AdminDiscountConditionsDeleteRes { /** - * The ID of the deleted DiscountCondition + * The ID of the deleted Discount Condition */ id: string /** @@ -15,11 +15,11 @@ export interface AdminDiscountConditionsDeleteRes { */ object: string /** - * Whether the discount condition was deleted successfully or not. + * Whether the discount condition was deleted successfully. */ deleted: boolean /** - * The Discount to which the condition used to belong + * The Discount to which the condition used to belong to. */ discount: Discount } diff --git a/packages/generated/client-types/src/lib/models/AdminDiscountConditionsRes.ts b/packages/generated/client-types/src/lib/models/AdminDiscountConditionsRes.ts index 6f602ca72d..b863927a77 100644 --- a/packages/generated/client-types/src/lib/models/AdminDiscountConditionsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminDiscountConditionsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { DiscountCondition } from "./DiscountCondition" export interface AdminDiscountConditionsRes { + /** + * Discount condition details. + */ discount_condition: SetRelation } diff --git a/packages/generated/client-types/src/lib/models/AdminDiscountsDeleteRes.ts b/packages/generated/client-types/src/lib/models/AdminDiscountsDeleteRes.ts index c87c7bdbf0..7e03d5fa8e 100644 --- a/packages/generated/client-types/src/lib/models/AdminDiscountsDeleteRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminDiscountsDeleteRes.ts @@ -13,7 +13,7 @@ export interface AdminDiscountsDeleteRes { */ object: string /** - * Whether the discount was deleted successfully or not. + * Whether the discount was deleted successfully. */ deleted: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminDiscountsListRes.ts b/packages/generated/client-types/src/lib/models/AdminDiscountsListRes.ts index 0a3640362f..041b6daaa5 100644 --- a/packages/generated/client-types/src/lib/models/AdminDiscountsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminDiscountsListRes.ts @@ -20,7 +20,7 @@ export interface AdminDiscountsListRes { */ count: number /** - * The number of items skipped before these items + * The number of discounts skipped when retrieving the discounts. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminDiscountsRes.ts b/packages/generated/client-types/src/lib/models/AdminDiscountsRes.ts index 7e6ae42801..d469dfc7ce 100644 --- a/packages/generated/client-types/src/lib/models/AdminDiscountsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminDiscountsRes.ts @@ -8,6 +8,9 @@ import type { DiscountRule } from "./DiscountRule" import type { Region } from "./Region" export interface AdminDiscountsRes { + /** + * Discount details. + */ discount: Merge< SetRelation, { diff --git a/packages/generated/client-types/src/lib/models/AdminDraftOrdersDeleteRes.ts b/packages/generated/client-types/src/lib/models/AdminDraftOrdersDeleteRes.ts index 30552960fb..d6fd836f64 100644 --- a/packages/generated/client-types/src/lib/models/AdminDraftOrdersDeleteRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminDraftOrdersDeleteRes.ts @@ -13,7 +13,7 @@ export interface AdminDraftOrdersDeleteRes { */ object: string /** - * Whether the draft order was deleted successfully or not. + * Whether the draft order was deleted successfully. */ deleted: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminDraftOrdersListRes.ts b/packages/generated/client-types/src/lib/models/AdminDraftOrdersListRes.ts index 4f312f6e1e..d39c50f3f5 100644 --- a/packages/generated/client-types/src/lib/models/AdminDraftOrdersListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminDraftOrdersListRes.ts @@ -8,6 +8,9 @@ import type { DraftOrder } from "./DraftOrder" import type { LineItem } from "./LineItem" export interface AdminDraftOrdersListRes { + /** + * An array of draft order's details. + */ draft_orders: Array< Merge< SetRelation, @@ -26,7 +29,7 @@ export interface AdminDraftOrdersListRes { */ count: number /** - * The number of items skipped before these items + * The number of draft orders skipped when retrieving the draft orders. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminDraftOrdersRes.ts b/packages/generated/client-types/src/lib/models/AdminDraftOrdersRes.ts index b2be42c75a..5524379835 100644 --- a/packages/generated/client-types/src/lib/models/AdminDraftOrdersRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminDraftOrdersRes.ts @@ -13,6 +13,9 @@ import type { Region } from "./Region" import type { ShippingMethod } from "./ShippingMethod" export interface AdminDraftOrdersRes { + /** + * Draft order's details. + */ draft_order: Merge< SetRelation, { diff --git a/packages/generated/client-types/src/lib/models/AdminExtendedStoresRes.ts b/packages/generated/client-types/src/lib/models/AdminExtendedStoresRes.ts index 0a23998ff0..c7e0dda843 100644 --- a/packages/generated/client-types/src/lib/models/AdminExtendedStoresRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminExtendedStoresRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ExtendedStoreDTO } from "./ExtendedStoreDTO" export interface AdminExtendedStoresRes { + /** + * Store details. + */ store: SetRelation } diff --git a/packages/generated/client-types/src/lib/models/AdminGetBatchParams.ts b/packages/generated/client-types/src/lib/models/AdminGetBatchParams.ts index cd927e758f..9650e54470 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetBatchParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetBatchParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetBatchParams { /** - * The number of batch jobs to return. + * Limit the number of batch jobs returned. */ limit?: number /** - * The number of batch jobs to skip before results. + * The number of batch jobs to skip when retrieving the batch jobs. */ offset?: number /** @@ -21,7 +21,7 @@ export interface AdminGetBatchParams { */ type?: Array /** - * Date comparison for when resulting collections was confirmed, i.e. less than, greater than etc. + * Filter by a confirmation date range. */ confirmed_at?: { /** @@ -42,7 +42,7 @@ export interface AdminGetBatchParams { gte?: string } /** - * Date comparison for when resulting collections was pre processed, i.e. less than, greater than etc. + * Filter by a pre-processing date range. */ pre_processed_at?: { /** @@ -63,7 +63,7 @@ export interface AdminGetBatchParams { gte?: string } /** - * Date comparison for when resulting collections was completed, i.e. less than, greater than etc. + * Filter by a completion date range. */ completed_at?: { /** @@ -84,7 +84,7 @@ export interface AdminGetBatchParams { gte?: string } /** - * Date comparison for when resulting collections was failed, i.e. less than, greater than etc. + * Filter by a failure date range. */ failed_at?: { /** @@ -105,7 +105,7 @@ export interface AdminGetBatchParams { gte?: string } /** - * Date comparison for when resulting collections was canceled, i.e. less than, greater than etc. + * Filter by a cancelation date range. */ canceled_at?: { /** @@ -126,19 +126,19 @@ export interface AdminGetBatchParams { gte?: string } /** - * Field used to order retrieved batch jobs + * A batch-job field to sort-order the retrieved batch jobs by. */ order?: string /** - * (Comma separated) Which fields should be expanded in each order of the result. + * Comma-separated relations that should be expanded in the returned batch jobs. */ expand?: string /** - * (Comma separated) Which fields should be included in each order of the result. + * Comma-separated fields that should be included in the returned batch jobs. */ fields?: string /** - * Date comparison for when resulting collections was created, i.e. less than, greater than etc. + * Filter by a creation date range. */ created_at?: { /** @@ -159,7 +159,7 @@ export interface AdminGetBatchParams { gte?: string } /** - * Date comparison for when resulting collections was updated, i.e. less than, greater than etc. + * Filter by an update date range. */ updated_at?: { /** diff --git a/packages/generated/client-types/src/lib/models/AdminGetCollectionsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetCollectionsParams.ts index ea9c10e4a6..b83fb938db 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetCollectionsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetCollectionsParams.ts @@ -9,27 +9,27 @@ export interface AdminGetCollectionsParams { */ limit?: number /** - * The number of collections to skip before the results. + * The number of collections to skip when retrieving the collections. */ offset?: number /** - * The title of collections to return. + * Filter collections by their title. */ title?: string /** - * The handle of collections to return. + * Filter collections by their handle. */ handle?: string /** - * a search term to search titles and handles. + * a term to search collections by their title or handle. */ q?: string /** - * The discount condition id on which to filter the product collections. + * Filter collections by a discount condition ID associated with them. */ discount_condition_id?: string /** - * Date comparison for when resulting collections were created. + * Filter by a creation date range. */ created_at?: { /** @@ -50,7 +50,7 @@ export interface AdminGetCollectionsParams { gte?: string } /** - * Date comparison for when resulting collections were updated. + * Filter by an update date range. */ updated_at?: { /** @@ -71,7 +71,7 @@ export interface AdminGetCollectionsParams { gte?: string } /** - * Date comparison for when resulting collections were deleted. + * Filter by a deletion date range. */ deleted_at?: { /** diff --git a/packages/generated/client-types/src/lib/models/AdminGetCurrenciesParams.ts b/packages/generated/client-types/src/lib/models/AdminGetCurrenciesParams.ts index 2f7d092580..7e6edb2b0d 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetCurrenciesParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetCurrenciesParams.ts @@ -5,23 +5,23 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetCurrenciesParams { /** - * Code of the currency to search for. + * filter by currency code. */ code?: string /** - * Search for tax inclusive currencies. + * filter currencies by whether they include taxes or not. */ includes_tax?: boolean /** - * order to retrieve products in. + * A field to sort order the retrieved currencies by. */ order?: string /** - * How many products to skip in the result. + * The number of currencies to skip when retrieving the currencies. */ offset?: number /** - * Limit the number of products returned. + * The number of currencies to return. */ limit?: number } diff --git a/packages/generated/client-types/src/lib/models/AdminGetCustomerGroupsGroupParams.ts b/packages/generated/client-types/src/lib/models/AdminGetCustomerGroupsGroupParams.ts index c1f86ee484..b4ef4933e9 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetCustomerGroupsGroupParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetCustomerGroupsGroupParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetCustomerGroupsGroupParams { /** - * (Comma separated) Which fields should be expanded in the customer group. + * Comma-separated relations that should be expanded in the returned customer group. */ expand?: string /** - * (Comma separated) Which fields should be included in the customer group. + * Comma-separated fields that should be included in the returned customer group. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetCustomerGroupsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetCustomerGroupsParams.ts index 1deec360c9..70f2def536 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetCustomerGroupsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetCustomerGroupsParams.ts @@ -5,19 +5,19 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetCustomerGroupsParams { /** - * Query used for searching customer group names. + * term to search customer groups by name. */ q?: string /** - * How many groups to skip in the result. + * The number of customer groups to skip when retrieving the customer groups. */ offset?: number /** - * the field used to order the customer groups. + * A field to sort order the retrieved customer groups by. */ order?: string /** - * The discount condition id on which to filter the customer groups. + * Filter by discount condition ID. */ discount_condition_id?: string /** @@ -49,7 +49,7 @@ export interface AdminGetCustomerGroupsParams { */ name?: Array /** - * Date comparison for when resulting customer groups were created. + * Filter by a creation date range. */ created_at?: { /** @@ -70,7 +70,7 @@ export interface AdminGetCustomerGroupsParams { gte?: string } /** - * Date comparison for when resulting customer groups were updated. + * Filter by an update date range. */ updated_at?: { /** @@ -91,11 +91,11 @@ export interface AdminGetCustomerGroupsParams { gte?: string } /** - * Limit the number of customer groups returned. + * The number of customer groups to return. */ limit?: number /** - * (Comma separated) Which fields should be expanded in each customer groups of the result. + * Comma-separated relations that should be expanded in the returned customer groups. */ expand?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetCustomersParams.ts b/packages/generated/client-types/src/lib/models/AdminGetCustomersParams.ts index 3519953c4f..b08cc560c6 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetCustomersParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetCustomersParams.ts @@ -5,19 +5,23 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetCustomersParams { /** - * The number of items to return. + * The number of customers to return. */ limit?: number /** - * The items to skip before result. + * The number of customers to skip when retrieving the customers. */ offset?: number /** - * (Comma separated) Which fields should be expanded in each customer. + * Comma-separated relations that should be expanded in the returned customer. */ expand?: string /** - * a search term to search email, first_name, and last_name. + * term to search customers' email, first_name, and last_name fields. */ q?: string + /** + * Filter by customer group IDs. + */ + groups?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminGetDiscountParams.ts b/packages/generated/client-types/src/lib/models/AdminGetDiscountParams.ts index 9b53b95705..7604d4eeb2 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetDiscountParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetDiscountParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetDiscountParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned discount. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned discount. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetDiscountsDiscountCodeParams.ts b/packages/generated/client-types/src/lib/models/AdminGetDiscountsDiscountCodeParams.ts index 95bb527fec..1182abcc57 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetDiscountsDiscountCodeParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetDiscountsDiscountCodeParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetDiscountsDiscountCodeParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned discount. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned discount. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetDiscountsDiscountConditionsConditionParams.ts b/packages/generated/client-types/src/lib/models/AdminGetDiscountsDiscountConditionsConditionParams.ts index 8c323dfb00..0fc5dbc132 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetDiscountsDiscountConditionsConditionParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetDiscountsDiscountConditionsConditionParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetDiscountsDiscountConditionsConditionParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned discount condition. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned discount condition. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetDiscountsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetDiscountsParams.ts index af1843ec84..baf5329143 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetDiscountsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetDiscountsParams.ts @@ -5,40 +5,40 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetDiscountsParams { /** - * Search query applied on the code field. + * term to search discounts' code field. */ q?: string /** - * Discount Rules filters to apply on the search + * Filter discounts by rule fields. */ rule?: { /** - * The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. + * Filter discounts by type. */ type?: "fixed" | "percentage" | "free_shipping" /** - * The value that the discount represents; this will depend on the type of the discount + * Filter discounts by allocation type. */ allocation?: "total" | "item" } /** - * Return only dynamic discounts. + * Filter discounts by whether they're dynamic or not. */ is_dynamic?: boolean /** - * Return only disabled discounts. + * Filter discounts by whether they're disabled or not. */ is_disabled?: boolean /** - * The number of items in the response + * The number of discounts to return */ limit?: number /** - * The offset of items in response + * The number of discounts to skip when retrieving the discounts. */ offset?: number /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in each returned discount. */ expand?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetDraftOrdersParams.ts b/packages/generated/client-types/src/lib/models/AdminGetDraftOrdersParams.ts index 1b8f307772..81ef0dadca 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetDraftOrdersParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetDraftOrdersParams.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetDraftOrdersParams { /** - * The number of items to skip before the results. + * The number of draft orders to skip when retrieving the draft orders. */ offset?: number /** - * Limit the number of items returned. + * Limit the number of draft orders returned. */ limit?: number /** - * a search term to search emails in carts associated with draft orders and display IDs of draft orders + * a term to search draft orders' display IDs and emails in the draft order's cart */ q?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetGiftCardsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetGiftCardsParams.ts index 27e55700aa..4c2505c73e 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetGiftCardsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetGiftCardsParams.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetGiftCardsParams { /** - * The number of items to skip before the results. + * The number of gift cards to skip when retrieving the gift cards. */ offset?: number /** - * Limit the number of items returned. + * Limit the number of gift cards returned. */ limit?: number /** - * a search term to search by code or display ID + * a term to search gift cards' code or display ID */ q?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetGroupsGroupCustomersParams.ts b/packages/generated/client-types/src/lib/models/AdminGetGroupsGroupCustomersParams.ts index 187bddb845..196d4d8c55 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetGroupsGroupCustomersParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetGroupsGroupCustomersParams.ts @@ -5,19 +5,19 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetGroupsGroupCustomersParams { /** - * The number of items to return. + * The number of customers to return. */ limit?: number /** - * The items to skip before result. + * The number of customers to skip when retrieving the customers. */ offset?: number /** - * (Comma separated) Which fields should be expanded in each customer. + * Comma-separated relations that should be expanded in the returned customers. */ expand?: string /** - * a search term to search email, first_name, and last_name. + * a term to search customers by email, first_name, and last_name. */ q?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsItemLocationLevelsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsItemLocationLevelsParams.ts index 012ec18862..e7bd69675e 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsItemLocationLevelsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsItemLocationLevelsParams.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetInventoryItemsItemLocationLevelsParams { /** - * Locations ids to search for. + * Filter by location IDs. */ location_id?: Array /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned inventory levels. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned inventory levels. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsItemParams.ts b/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsItemParams.ts index 06c07c4887..97265df4d5 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsItemParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsItemParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetInventoryItemsItemParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned inventory item. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned inventory item. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsParams.ts index 2d16f2abe5..cbd0a5c72b 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetInventoryItemsParams.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetInventoryItemsParams { /** - * How many inventory items to skip in the result. + * The number of inventory items to skip when retrieving the inventory items. */ offset?: number /** @@ -13,63 +13,63 @@ export interface AdminGetInventoryItemsParams { */ limit?: number /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in each returned inventory item. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned inventory item. */ fields?: string /** - * Query used for searching product inventory items and their properties. + * term to search inventory item's sku, title, and description. */ q?: string /** - * Locations ids to search for. + * Filter by location IDs. */ location_id?: Array /** - * id to search for. + * Filter by the inventory ID */ - id?: string + id?: string | Array /** - * sku to search for. + * Filter by SKU */ sku?: string /** - * origin_country to search for. + * Filter by origin country */ origin_country?: string /** - * mid_code to search for. + * Filter by MID code */ mid_code?: string /** - * material to search for. + * Filter by material */ material?: string /** - * hs_code to search for. + * Filter by HS Code */ hs_code?: string /** - * weight to search for. + * Filter by weight */ weight?: string /** - * length to search for. + * Filter by length */ length?: string /** - * height to search for. + * Filter by height */ height?: string /** - * width to search for. + * Filter by width */ width?: string /** - * requires_shipping to search for. + * Filter by whether the item requires shipping */ requires_shipping?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetNotesParams.ts b/packages/generated/client-types/src/lib/models/AdminGetNotesParams.ts index 7f0a7ba661..04d3e03bc3 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetNotesParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetNotesParams.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetNotesParams { /** - * The number of notes to get + * Limit the number of notes returned. */ limit?: number /** - * The offset at which to get notes + * The number of notes to skip when retrieving the notes. */ offset?: number /** - * The ID which the notes belongs to + * Filter by resource ID */ resource_id?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetNotificationsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetNotificationsParams.ts index b76904bf41..ffe77976a4 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetNotificationsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetNotificationsParams.ts @@ -5,35 +5,35 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetNotificationsParams { /** - * The number of notifications to skip before starting to collect the notifications set + * The number of inventory items to skip when retrieving the inventory items. */ offset?: number /** - * The number of notifications to return + * Limit the number of notifications returned. */ limit?: number /** - * Comma separated fields to include in the result set + * Comma-separated fields that should be included in each returned notification. */ fields?: string /** - * Comma separated fields to populate + * Comma-separated relations that should be expanded in each returned notification. */ expand?: string /** - * The name of the event that the notification was sent for. + * Filter by the name of the event that triggered sending this notification. */ event_name?: string /** - * The type of resource that the Notification refers to. + * Filter by the resource type. */ resource_type?: string /** - * The ID of the resource that the Notification refers to. + * Filter by the resource ID. */ resource_id?: string /** - * 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 + * Filter by the address that the Notification was sent to. This will usually be an email address, but it can also represent other addresses such as a chat bot user id. */ to?: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminGetOrdersOrderParams.ts b/packages/generated/client-types/src/lib/models/AdminGetOrdersOrderParams.ts index 2be23e0894..4ff7a0f90e 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetOrdersOrderParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetOrdersOrderParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetOrdersOrderParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned order. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned order. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetOrdersParams.ts b/packages/generated/client-types/src/lib/models/AdminGetOrdersParams.ts index 217ac93471..93261dcd51 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetOrdersParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetOrdersParams.ts @@ -5,21 +5,21 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetOrdersParams { /** - * Query used for searching orders by shipping address first name, orders' email, and orders' display ID + * term to search orders' shipping address, first name, email, and display ID */ q?: string /** - * ID of the order to search for. + * Filter by ID. */ id?: string /** - * Status to search for + * Filter by status */ status?: Array< "pending" | "completed" | "archived" | "canceled" | "requires_action" > /** - * Fulfillment status to search for. + * Filter by fulfillment status */ fulfillment_status?: Array< | "not_fulfilled" @@ -33,7 +33,7 @@ export interface AdminGetOrdersParams { | "requires_action" > /** - * Payment status to search for. + * Filter by payment status */ payment_status?: Array< | "captured" @@ -45,35 +45,35 @@ export interface AdminGetOrdersParams { | "requires_action" > /** - * Display ID to search for. + * Filter by display ID */ display_id?: string /** - * to search for. + * Filter by cart ID */ cart_id?: string /** - * to search for. + * Filter by customer ID */ customer_id?: string /** - * to search for. + * Filter by email */ email?: string /** - * Regions to search orders by + * Filter by region IDs. */ region_id?: string | Array /** - * Currency code to search for + * Filter by currency codes. */ currency_code?: string /** - * to search for. + * Filter by tax rate. */ tax_rate?: string /** - * Date comparison for when resulting orders were created. + * Filter by a creation date range. */ created_at?: { /** @@ -94,7 +94,7 @@ export interface AdminGetOrdersParams { gte?: string } /** - * Date comparison for when resulting orders were updated. + * Filter by an update date range. */ updated_at?: { /** @@ -115,7 +115,7 @@ export interface AdminGetOrdersParams { gte?: string } /** - * Date comparison for when resulting orders were canceled. + * Filter by a cancelation date range. */ canceled_at?: { /** @@ -136,11 +136,11 @@ export interface AdminGetOrdersParams { gte?: string } /** - * Filter by Sales Channels + * Filter by Sales Channel IDs */ sales_channel_id?: Array /** - * How many orders to skip before the results. + * The number of orders to skip when retrieving the orders. */ offset?: number /** @@ -148,11 +148,11 @@ export interface AdminGetOrdersParams { */ limit?: number /** - * (Comma separated) Which fields should be expanded in each order of the result. + * Comma-separated relations that should be expanded in the returned order. */ expand?: string /** - * (Comma separated) Which fields should be included in each order of the result. + * Comma-separated fields that should be included in the returned order. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetPaymentCollectionsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetPaymentCollectionsParams.ts index adc0782d75..15a20c361a 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetPaymentCollectionsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetPaymentCollectionsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetPaymentCollectionsParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned payment collection. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned payment collection. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetPriceListPaginationParams.ts b/packages/generated/client-types/src/lib/models/AdminGetPriceListPaginationParams.ts index 2e179f8c4a..0cba82b4e8 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetPriceListPaginationParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetPriceListPaginationParams.ts @@ -5,47 +5,51 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetPriceListPaginationParams { /** - * The number of items to get + * Limit the number of price lists returned. */ limit?: number /** - * The offset at which to get items + * The number of price lists to skip when retrieving the price lists. */ offset?: number /** - * (Comma separated) Which fields should be expanded in each item of the result. + * Comma-separated relations that should be expanded in the returned price lists. */ expand?: string /** - * field to order results by. + * Comma-separated fields that should be included in the returned price lists. + */ + fields?: string + /** + * A price-list field to sort-order the retrieved price lists by. */ order?: string /** - * ID to search for. + * Filter by ID */ id?: string /** - * query to search in price list description, price list name, and customer group name fields. + * term to search price lists' description, name, and customer group's name. */ q?: string /** - * Status to search for. + * Filter by status. */ status?: Array<"active" | "draft"> /** - * price list name to search for. + * Filter by name */ name?: string /** - * Customer Group IDs to search for. + * Filter by customer-group IDs. */ customer_groups?: Array /** - * Type to search for. + * Filter by type. */ type?: Array<"sale" | "override"> /** - * Date comparison for when resulting price lists were created. + * Filter by a creation date range. */ created_at?: { /** @@ -66,7 +70,7 @@ export interface AdminGetPriceListPaginationParams { gte?: string } /** - * Date comparison for when resulting price lists were updated. + * Filter by an update date range. */ updated_at?: { /** @@ -87,7 +91,7 @@ export interface AdminGetPriceListPaginationParams { gte?: string } /** - * Date comparison for when resulting price lists were deleted. + * Filter by a deletion date range. */ deleted_at?: { /** diff --git a/packages/generated/client-types/src/lib/models/AdminGetPriceListsPriceListProductsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetPriceListsPriceListProductsParams.ts index 664bf18d9e..24552c84ef 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetPriceListsPriceListProductsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetPriceListsPriceListProductsParams.ts @@ -5,51 +5,51 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetPriceListsPriceListProductsParams { /** - * Query used for searching product title and description, variant title and sku, and collection title. + * term used to search products' title, description, product variant's title and sku, and product collection's title. */ q?: string /** - * ID of the product to search for. + * Filter by product ID */ id?: string /** - * Product status to search for + * Filter by product status */ status?: Array<"draft" | "proposed" | "published" | "rejected"> /** - * Collection IDs to search for + * Filter by product collection ID. Only products in the specified collections are retrieved. */ collection_id?: Array /** - * Tag IDs to search for + * Filter by tag IDs. Only products having the specified tags are retrieved. */ tags?: Array /** - * product title to search for. + * Filter by title */ title?: string /** - * product description to search for. + * Filter by description */ description?: string /** - * product handle to search for. + * Filter by handle */ handle?: string /** - * Search for giftcards using is_giftcard=true. + * A boolean value to filter by whether the product is a gift card or not. */ is_giftcard?: string /** - * to search for. + * Filter product type. */ type?: string /** - * field to sort results by. + * A product field to sort-order the retrieved products by. */ order?: string /** - * Date comparison for when resulting products were created. + * Filter by a creation date range. */ created_at?: { /** @@ -70,7 +70,7 @@ export interface AdminGetPriceListsPriceListProductsParams { gte?: string } /** - * Date comparison for when resulting products were updated. + * Filter by an update date range. */ updated_at?: { /** @@ -91,7 +91,7 @@ export interface AdminGetPriceListsPriceListProductsParams { gte?: string } /** - * Date comparison for when resulting products were deleted. + * Filter by a deletion date range. */ deleted_at?: { /** @@ -112,7 +112,7 @@ export interface AdminGetPriceListsPriceListProductsParams { gte?: string } /** - * How many products to skip in the result. + * The number of products to skip when retrieving the products. */ offset?: number /** @@ -120,11 +120,11 @@ export interface AdminGetPriceListsPriceListProductsParams { */ limit?: number /** - * (Comma separated) Which fields should be expanded in each product of the result. + * Comma-separated relations that should be expanded in the returned products. */ expand?: string /** - * (Comma separated) Which fields should be included in each product of the result. + * Comma-separated fields that should be included in the returned products. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetProductCategoriesParams.ts b/packages/generated/client-types/src/lib/models/AdminGetProductCategoriesParams.ts index 059d8b1ca2..19e17727d4 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetProductCategoriesParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetProductCategoriesParams.ts @@ -5,31 +5,31 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetProductCategoriesParams { /** - * Query used for searching product category names or handles. + * term to search product categories' names and handles. */ q?: string /** - * Query used for searching product category by handle. + * Filter by handle. */ handle?: string /** - * Search for only internal categories. + * Filter by whether the category is internal or not. */ is_internal?: boolean /** - * Search for only active categories + * Filter by whether the category is active or not. */ is_active?: boolean /** - * Include all nested descendants of category + * If set to `true`, all nested descendants of a category are included in the response. */ include_descendants_tree?: boolean /** - * Returns categories scoped by parent + * Filter by the ID of a parent category. */ parent_category_id?: string /** - * How many product categories to skip in the result. + * The number of product categories to skip when retrieving the product categories. */ offset?: number /** @@ -37,11 +37,11 @@ export interface AdminGetProductCategoriesParams { */ limit?: number /** - * (Comma separated) Which fields should be expanded in the product category. + * Comma-separated relations that should be expanded in the returned product categories. */ expand?: string /** - * (Comma separated) Which fields should be included in the product category. + * Comma-separated fields that should be included in the returned product categories. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetProductCategoryParams.ts b/packages/generated/client-types/src/lib/models/AdminGetProductCategoryParams.ts index ef5f10292e..f1eda6da87 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetProductCategoryParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetProductCategoryParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetProductCategoryParams { /** - * (Comma separated) Which fields should be expanded in the results. + * Comma-separated relations that should be expanded in the returned product category. */ expand?: string /** - * (Comma separated) Which fields should be included in the results. + * Comma-separated fields that should be included in the returned product category. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetProductTagsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetProductTagsParams.ts index a385a5da1f..fb9add9d96 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetProductTagsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetProductTagsParams.ts @@ -5,35 +5,35 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetProductTagsParams { /** - * The number of tags to return. + * Limit the number of product tags returned. */ limit?: number /** - * The number of items to skip before the results. + * The number of product tags to skip when retrieving the product tags. */ offset?: number /** - * The field to sort items by. + * A product tag field to sort-order the retrieved product tags by. */ order?: string /** - * The discount condition id on which to filter the tags. + * Filter by the ID of a discount condition. Only product tags that this discount condition is applied to will be retrieved. */ discount_condition_id?: string /** - * The tag values to search for + * Filter by tag value. */ value?: Array /** - * A query string to search values for + * term to search product tags' values. */ q?: string /** - * The tag IDs to search for + * Filter by tag IDs. */ id?: Array /** - * Date comparison for when resulting product tags were created. + * Filter by a creation date range. */ created_at?: { /** @@ -54,7 +54,7 @@ export interface AdminGetProductTagsParams { gte?: string } /** - * Date comparison for when resulting product tags were updated. + * Filter by an update date range. */ updated_at?: { /** diff --git a/packages/generated/client-types/src/lib/models/AdminGetProductTypesParams.ts b/packages/generated/client-types/src/lib/models/AdminGetProductTypesParams.ts index 79f1375429..5d732a7622 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetProductTypesParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetProductTypesParams.ts @@ -5,35 +5,35 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetProductTypesParams { /** - * The number of types to return. + * Limit the number of product types returned. */ limit?: number /** - * The number of items to skip before the results. + * The number of product types to skip when retrieving the product types. */ offset?: number /** - * The field to sort items by. + * A product type field to sort-order the retrieved product types by. */ order?: string /** - * The discount condition id on which to filter the product types. + * Filter by the ID of a discount condition. Only product types that this discount condition is applied to will be retrieved. */ discount_condition_id?: string /** - * The type values to search for + * Filter by value. */ value?: Array /** - * The type IDs to search for + * Filter by product type IDs. */ id?: Array /** - * A query string to search values for + * term to search product types' values. */ q?: string /** - * Date comparison for when resulting product types were created. + * Filter by a creation date range. */ created_at?: { /** @@ -54,7 +54,7 @@ export interface AdminGetProductTypesParams { gte?: string } /** - * Date comparison for when resulting product types were updated. + * Filter by an update date range. */ updated_at?: { /** diff --git a/packages/generated/client-types/src/lib/models/AdminGetProductsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetProductsParams.ts index 3e3aef9aa5..e226243141 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetProductsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetProductsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetProductsParams { /** - * Query used for searching product title and description, variant title and sku, and collection title. + * term to search products' title, description, variants' title and sku, and collections' title. */ q?: string /** - * The discount condition id on which to filter the product. + * Filter by the ID of a discount condition. Only products that this discount condition is applied to will be retrieved. */ discount_condition_id?: string /** @@ -17,55 +17,55 @@ export interface AdminGetProductsParams { */ id?: string | Array /** - * Status to search for + * Filter by status. */ status?: Array<"draft" | "proposed" | "published" | "rejected"> /** - * Collection ids to search for. + * Filter by product collection IDs. Only products that are associated with the specified collections will be retrieved. */ collection_id?: Array /** - * Tag IDs to search for + * Filter by product tag IDs. Only products that are associated with the specified tags will be retrieved. */ tags?: Array /** - * Price List IDs to search for + * Filter by IDs of price lists. Only products that these price lists are applied to will be retrieved. */ price_list_id?: Array /** - * Sales Channel IDs to filter products by + * Filter by sales channel IDs. Only products that are available in the specified sales channels will be retrieved. */ sales_channel_id?: Array /** - * Type IDs to filter products by + * Filter by product type IDs. Only products that are associated with the specified types will be retrieved. */ type_id?: Array /** - * Category IDs to filter products by + * Filter by product category IDs. Only products that are associated with the specified categories will be retrieved. */ category_id?: Array /** - * Include category children when filtering by category_id + * whether to include product category children when filtering by `category_id` */ include_category_children?: boolean /** - * title to search for. + * Filter by title. */ title?: string /** - * description to search for. + * Filter by description. */ description?: string /** - * handle to search for. + * Filter by handle. */ handle?: string /** - * Search for giftcards using is_giftcard=true. + * Whether to retrieve gift cards or regular products. */ is_giftcard?: boolean /** - * Date comparison for when resulting products were created. + * Filter by a creation date range. */ created_at?: { /** @@ -86,7 +86,7 @@ export interface AdminGetProductsParams { gte?: string } /** - * Date comparison for when resulting products were updated. + * Filter by an update date range. */ updated_at?: { /** @@ -107,7 +107,7 @@ export interface AdminGetProductsParams { gte?: string } /** - * Date comparison for when resulting products were deleted. + * Filter by a deletion date range. */ deleted_at?: { /** @@ -128,7 +128,7 @@ export interface AdminGetProductsParams { gte?: string } /** - * How many products to skip in the result. + * The number of products to skip when retrieving the products. */ offset?: number /** @@ -136,15 +136,15 @@ export interface AdminGetProductsParams { */ limit?: number /** - * (Comma separated) Which fields should be expanded in each product of the result. + * Comma-separated relations that should be expanded in the returned products. */ expand?: string /** - * (Comma separated) Which fields should be included in each product of the result. + * Comma-separated fields that should be included in the returned products. */ fields?: string /** - * the field used to order the products. + * A product field to sort-order the retrieved products by. */ order?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetProductsVariantsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetProductsVariantsParams.ts index fbe85ebedf..eb9af1f272 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetProductsVariantsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetProductsVariantsParams.ts @@ -5,19 +5,19 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetProductsVariantsParams { /** - * Comma separated string of the column to select. + * Comma-separated fields that should be included in the returned product variants. */ fields?: string /** - * Comma separated string of the relations to include. + * Comma-separated relations that should be expanded in the returned product variants. */ expand?: string /** - * How many items to skip before the results. + * The number of product variants to skip when retrieving the product variants. */ offset?: number /** - * Limit the number of items returned. + * Limit the number of product variants returned. */ limit?: number } diff --git a/packages/generated/client-types/src/lib/models/AdminGetRegionsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetRegionsParams.ts index e1f66ea21a..5b43587868 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetRegionsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetRegionsParams.ts @@ -5,23 +5,74 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetRegionsParams { /** - * limit the number of regions in response + * Limit the number of regions returned. */ limit?: number /** - * Offset of regions in response (used for pagination) + * The number of regions to skip when retrieving the regions. */ offset?: number /** - * Date comparison for when resulting region was created, i.e. less than, greater than etc. + * Filter by a creation date range. */ - created_at?: Record + created_at?: { + /** + * filter by dates less than this date + */ + lt?: string + /** + * filter by dates greater than this date + */ + gt?: string + /** + * filter by dates less than or equal to this date + */ + lte?: string + /** + * filter by dates greater than or equal to this date + */ + gte?: string + } /** - * Date comparison for when resulting region was updated, i.e. less than, greater than etc. + * Filter by an update date range. */ - updated_at?: Record + updated_at?: { + /** + * filter by dates less than this date + */ + lt?: string + /** + * filter by dates greater than this date + */ + gt?: string + /** + * filter by dates less than or equal to this date + */ + lte?: string + /** + * filter by dates greater than or equal to this date + */ + gte?: string + } /** - * Date comparison for when resulting region was deleted, i.e. less than, greater than etc. + * Filter by a deletion date range. */ - deleted_at?: Record + deleted_at?: { + /** + * filter by dates less than this date + */ + lt?: string + /** + * filter by dates greater than this date + */ + gt?: string + /** + * filter by dates less than or equal to this date + */ + lte?: string + /** + * filter by dates greater than or equal to this date + */ + gte?: string + } } diff --git a/packages/generated/client-types/src/lib/models/AdminGetRegionsRegionFulfillmentOptionsRes.ts b/packages/generated/client-types/src/lib/models/AdminGetRegionsRegionFulfillmentOptionsRes.ts index 2176a8ef5e..582695c38a 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetRegionsRegionFulfillmentOptionsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetRegionsRegionFulfillmentOptionsRes.ts @@ -4,6 +4,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetRegionsRegionFulfillmentOptionsRes { + /** + * Fulfillment providers details. + */ fulfillment_options: Array<{ /** * ID of the fulfillment provider diff --git a/packages/generated/client-types/src/lib/models/AdminGetReservationsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetReservationsParams.ts index c85d612237..ea08342c05 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetReservationsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetReservationsParams.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetReservationsParams { /** - * Location ids to search for. + * Filter by location ID */ location_id?: Array /** - * Inventory Item ids to search for. + * Filter by inventory item ID. */ inventory_item_id?: Array /** - * Line Item ids to search for. + * Filter by line item ID. */ line_item_id?: Array /** @@ -38,7 +38,7 @@ export interface AdminGetReservationsParams { gte?: number } /** - * A param for search reservation descriptions + * Filter by description. */ description?: | string @@ -57,7 +57,7 @@ export interface AdminGetReservationsParams { ends_with?: string } /** - * Date comparison for when resulting reservations were created. + * Filter by a creation date range. */ created_at?: { /** @@ -78,19 +78,19 @@ export interface AdminGetReservationsParams { gte?: string } /** - * How many Reservations to skip in the result. + * The number of reservations to skip when retrieving the reservations. */ offset?: number /** - * Limit the number of Reservations returned. + * Limit the number of reservations returned. */ limit?: number /** - * (Comma separated) Which fields should be expanded in the product category. + * Comma-separated relations that should be expanded in the returned reservations. */ expand?: string /** - * (Comma separated) Which fields should be included in the product category. + * Comma-separated fields that should be included in the returned reservations. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetReturnsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetReturnsParams.ts index 98e7834202..5e1d091e0e 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetReturnsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetReturnsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetReturnsParams { /** - * The upper limit for the amount of responses returned. + * Limit the number of Returns returned. */ limit?: number /** - * The offset of the list returned. + * The number of Returns to skip when retrieving the Returns. */ offset?: number } diff --git a/packages/generated/client-types/src/lib/models/AdminGetSalesChannelsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetSalesChannelsParams.ts index 116085e0fe..7155957c3d 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetSalesChannelsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetSalesChannelsParams.ts @@ -5,27 +5,27 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetSalesChannelsParams { /** - * ID of the sales channel + * Filter by a sales channel ID. */ id?: string /** - * Name of the sales channel + * Filter by name. */ name?: string /** - * Description of the sales channel + * Filter by description. */ description?: string /** - * Query used for searching sales channels' names and descriptions. + * term used to search sales channels' names and descriptions. */ q?: string /** - * The field to order the results by. + * A sales-channel field to sort-order the retrieved sales channels by. */ order?: string /** - * Date comparison for when resulting collections were created. + * Filter by a creation date range. */ created_at?: { /** @@ -46,7 +46,7 @@ export interface AdminGetSalesChannelsParams { gte?: string } /** - * Date comparison for when resulting collections were updated. + * Filter by an update date range. */ updated_at?: { /** @@ -67,7 +67,7 @@ export interface AdminGetSalesChannelsParams { gte?: string } /** - * Date comparison for when resulting collections were deleted. + * Filter by a deletion date range. */ deleted_at?: { /** @@ -88,7 +88,7 @@ export interface AdminGetSalesChannelsParams { gte?: string } /** - * How many sales channels to skip in the result. + * The number of sales channels to skip when retrieving the sales channels. */ offset?: number /** @@ -96,11 +96,11 @@ export interface AdminGetSalesChannelsParams { */ limit?: number /** - * (Comma separated) Which fields should be expanded in each sales channel of the result. + * Comma-separated relations that should be expanded in the returned sales channels. */ expand?: string /** - * (Comma separated) Which fields should be included in each sales channel of the result. + * Comma-separated fields that should be included in the returned sales channels. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetShippingOptionsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetShippingOptionsParams.ts index 22468180f1..6aea6c537d 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetShippingOptionsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetShippingOptionsParams.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetShippingOptionsParams { /** - * Region ID to fetch options from + * Filter by a region ID. */ region_id?: string /** - * Flag for fetching return options only + * Filter by whether the shipping option is used for returns or orders. */ is_return?: boolean /** - * Flag for fetching admin specific options + * Filter by whether the shipping option is used only by admins or not. */ admin_only?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminGetStockLocationsLocationParams.ts b/packages/generated/client-types/src/lib/models/AdminGetStockLocationsLocationParams.ts index 95d1e9e933..30aa17f42e 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetStockLocationsLocationParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetStockLocationsLocationParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetStockLocationsLocationParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned stock location. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned stock location. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetStockLocationsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetStockLocationsParams.ts index 54e85e34b4..d5045a765d 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetStockLocationsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetStockLocationsParams.ts @@ -5,19 +5,19 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetStockLocationsParams { /** - * ID of the stock location + * Filter by ID. */ id?: string /** - * Name of the stock location + * Filter by name. */ name?: string /** - * The field to order the results by. + * A stock-location field to sort-order the retrieved stock locations by. */ order?: string /** - * Date comparison for when resulting collections were created. + * Filter by a creation date range. */ created_at?: { /** @@ -38,7 +38,7 @@ export interface AdminGetStockLocationsParams { gte?: string } /** - * Date comparison for when resulting collections were updated. + * Filter by an update date range. */ updated_at?: { /** @@ -59,7 +59,7 @@ export interface AdminGetStockLocationsParams { gte?: string } /** - * Date comparison for when resulting collections were deleted. + * Filter by a deletion date range. */ deleted_at?: { /** @@ -80,7 +80,7 @@ export interface AdminGetStockLocationsParams { gte?: string } /** - * How many stock locations to skip in the result. + * The number of stock locations to skip when retrieving the stock locations. */ offset?: number /** @@ -88,11 +88,11 @@ export interface AdminGetStockLocationsParams { */ limit?: number /** - * (Comma separated) Which fields should be expanded in each stock location of the result. + * Comma-separated relations that should be expanded in the returned stock locations. */ expand?: string /** - * (Comma separated) Which fields should be included in each stock location of the result. + * Comma-separated fields that should be included in the returned stock locations. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetSwapsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetSwapsParams.ts index 36e1f3b4d9..be8aa9ecec 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetSwapsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetSwapsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetSwapsParams { /** - * The upper limit for the amount of responses returned. + * Limit the number of swaps returned. */ limit?: number /** - * The offset of the list returned. + * The number of swaps to skip when retrieving the swaps. */ offset?: number } diff --git a/packages/generated/client-types/src/lib/models/AdminGetTaxRatesParams.ts b/packages/generated/client-types/src/lib/models/AdminGetTaxRatesParams.ts index 72bab1a626..682301eef5 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetTaxRatesParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetTaxRatesParams.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetTaxRatesParams { /** - * Name of tax rate to retrieve + * Filter by name. */ name?: string /** - * Filter by Region ID + * Filter by Region IDs */ region_id?: string | Array /** - * code to search for. + * Filter by code. */ code?: string /** @@ -40,7 +40,7 @@ export interface AdminGetTaxRatesParams { gte?: number } /** - * How many tax rates to skip before retrieving the result. + * The number of tax rates to skip when retrieving the tax rates. */ offset?: number /** @@ -48,11 +48,11 @@ export interface AdminGetTaxRatesParams { */ limit?: number /** - * Which fields should be included in each item. + * Comma-separated fields that should be included in the returned tax rate. */ fields?: Array /** - * Which fields should be expanded and retrieved for each item. + * Comma-separated relations that should be expanded in the returned tax rate. */ expand?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminGetTaxRatesTaxRateParams.ts b/packages/generated/client-types/src/lib/models/AdminGetTaxRatesTaxRateParams.ts index ad4294445c..3d80642a14 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetTaxRatesTaxRateParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetTaxRatesTaxRateParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetTaxRatesTaxRateParams { /** - * Which fields should be included in the result. + * Comma-separated fields that should be included in the returned tax rate. */ fields?: Array /** - * Which fields should be expanded and retrieved in the result. + * Comma-separated relations that should be expanded in the returned tax rate. */ expand?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminGetVariantParams.ts b/packages/generated/client-types/src/lib/models/AdminGetVariantParams.ts index d21af3e97a..0e0ad74f93 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetVariantParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetVariantParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetVariantParams { /** - * (Comma separated) Which fields should be expanded the order of the result. + * "Comma-separated relations that should be expanded in the returned product variant." */ expand?: string /** - * (Comma separated) Which fields should be included the order of the result. + * "Comma-separated fields that should be included in the returned product variant." */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminGetVariantsParams.ts b/packages/generated/client-types/src/lib/models/AdminGetVariantsParams.ts index 3d9839540a..084ab62e93 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetVariantsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetVariantsParams.ts @@ -5,47 +5,43 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminGetVariantsParams { /** - * A Product Variant id to filter by. + * Filter by product variant IDs. */ - id?: string + id?: string | Array /** - * A comma separated list of Product Variant ids to filter by. - */ - ids?: string - /** - * A comma separated list of Product Variant relations to load. + * "Comma-separated relations that should be expanded in the returned product variants." */ expand?: string /** - * A comma separated list of Product Variant fields to include. + * "Comma-separated fields that should be included in the returned product variants." */ fields?: string /** - * How many product variants to skip in the result. + * The number of product variants to skip when retrieving the product variants. */ offset?: number /** - * Maximum number of Product Variants to return. + * Limit the number of product variants returned. */ limit?: number /** - * The id of the cart to use for price selection. + * The ID of the cart to use for the price selection context. */ cart_id?: string /** - * The id of the region to use for price selection. + * The ID of the region to use for the price selection context. */ region_id?: string /** - * The currency code to use for price selection. + * The 3 character ISO currency code to use for the price selection context. */ currency_code?: string /** - * The id of the customer to use for price selection. + * The ID of the customer to use for the price selection context. */ customer_id?: string /** - * product variant title to search for. + * Filter by title. */ title?: string | Array /** diff --git a/packages/generated/client-types/src/lib/models/AdminGetVariantsVariantInventoryRes.ts b/packages/generated/client-types/src/lib/models/AdminGetVariantsVariantInventoryRes.ts index 5a3a0de385..eba3d094e7 100644 --- a/packages/generated/client-types/src/lib/models/AdminGetVariantsVariantInventoryRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminGetVariantsVariantInventoryRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { VariantInventory } from "./VariantInventory" export interface AdminGetVariantsVariantInventoryRes { + /** + * The product variant's. + */ variant?: VariantInventory } diff --git a/packages/generated/client-types/src/lib/models/AdminGiftCardsDeleteRes.ts b/packages/generated/client-types/src/lib/models/AdminGiftCardsDeleteRes.ts index ef72aafe86..1d9acb0cda 100644 --- a/packages/generated/client-types/src/lib/models/AdminGiftCardsDeleteRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminGiftCardsDeleteRes.ts @@ -13,7 +13,7 @@ export interface AdminGiftCardsDeleteRes { */ object: string /** - * Whether the gift card was deleted successfully or not. + * Whether the gift card was deleted successfully. */ deleted: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminGiftCardsListRes.ts b/packages/generated/client-types/src/lib/models/AdminGiftCardsListRes.ts index ad04c9d194..964e17f9b2 100644 --- a/packages/generated/client-types/src/lib/models/AdminGiftCardsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminGiftCardsListRes.ts @@ -23,7 +23,7 @@ export interface AdminGiftCardsListRes { */ count: number /** - * The number of items skipped before these items + * The number of gift cards skipped when retrieving the gift cards. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminGiftCardsRes.ts b/packages/generated/client-types/src/lib/models/AdminGiftCardsRes.ts index 09b0e20d0e..5464dae1ab 100644 --- a/packages/generated/client-types/src/lib/models/AdminGiftCardsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminGiftCardsRes.ts @@ -7,6 +7,9 @@ import type { GiftCard } from "./GiftCard" import type { Region } from "./Region" export interface AdminGiftCardsRes { + /** + * A gift card's details. + */ gift_card: Merge< SetRelation, { diff --git a/packages/generated/client-types/src/lib/models/AdminInventoryItemsListRes.ts b/packages/generated/client-types/src/lib/models/AdminInventoryItemsListRes.ts index 7680e9c95c..111730da1a 100644 --- a/packages/generated/client-types/src/lib/models/AdminInventoryItemsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminInventoryItemsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { InventoryItemDTO } from "./InventoryItemDTO" export interface AdminInventoryItemsListRes { + /** + * an array of Inventory Item details + */ inventory_items: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of inventory items skipped when retrieving the inventory items. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.ts b/packages/generated/client-types/src/lib/models/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.ts index 9eb7b92633..26dbdd9fc3 100644 --- a/packages/generated/client-types/src/lib/models/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { DecoratedInventoryItemDTO } from "./DecoratedInventoryItemDTO" export interface AdminInventoryItemsListWithVariantsAndLocationLevelsRes { + /** + * an array of Inventory Item details + */ inventory_items: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of inventory items skipped when retrieving the inventory items. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminInventoryItemsRes.ts b/packages/generated/client-types/src/lib/models/AdminInventoryItemsRes.ts index db1b66b658..6c42896ef9 100644 --- a/packages/generated/client-types/src/lib/models/AdminInventoryItemsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminInventoryItemsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { InventoryItemDTO } from "./InventoryItemDTO" export interface AdminInventoryItemsRes { + /** + * Inventory Item details + */ inventory_item: InventoryItemDTO } diff --git a/packages/generated/client-types/src/lib/models/AdminInviteDeleteRes.ts b/packages/generated/client-types/src/lib/models/AdminInviteDeleteRes.ts index ef99f45d10..909da10c5e 100644 --- a/packages/generated/client-types/src/lib/models/AdminInviteDeleteRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminInviteDeleteRes.ts @@ -13,7 +13,7 @@ export interface AdminInviteDeleteRes { */ object: string /** - * Whether or not the Invite was deleted. + * Whether or not the invite was deleted. */ deleted: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminListInvitesRes.ts b/packages/generated/client-types/src/lib/models/AdminListInvitesRes.ts index bb7dd0f389..35b501cd61 100644 --- a/packages/generated/client-types/src/lib/models/AdminListInvitesRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminListInvitesRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Invite } from "./Invite" export interface AdminListInvitesRes { + /** + * An array of invites + */ invites: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminNotesListRes.ts b/packages/generated/client-types/src/lib/models/AdminNotesListRes.ts index 8266de998a..2591863464 100644 --- a/packages/generated/client-types/src/lib/models/AdminNotesListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminNotesListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Note } from "./Note" export interface AdminNotesListRes { + /** + * An array of notes + */ notes: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of notes skipped when retrieving the notes. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminNotesRes.ts b/packages/generated/client-types/src/lib/models/AdminNotesRes.ts index 5f9340b04c..048644a86f 100644 --- a/packages/generated/client-types/src/lib/models/AdminNotesRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminNotesRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Note } from "./Note" export interface AdminNotesRes { + /** + * Note details. + */ note: Note } diff --git a/packages/generated/client-types/src/lib/models/AdminNotificationsListRes.ts b/packages/generated/client-types/src/lib/models/AdminNotificationsListRes.ts index 62f853ab3b..d4f8fe624b 100644 --- a/packages/generated/client-types/src/lib/models/AdminNotificationsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminNotificationsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Notification } from "./Notification" export interface AdminNotificationsListRes { + /** + * an array of notifications + */ notifications: Array> /** * The total number of notifications */ count?: number /** - * The number of notifications skipped before these notifications + * The number of notifications skipped when retrieving the notifications. */ offset?: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminNotificationsRes.ts b/packages/generated/client-types/src/lib/models/AdminNotificationsRes.ts index 98dd0662c3..c99ef6d83c 100644 --- a/packages/generated/client-types/src/lib/models/AdminNotificationsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminNotificationsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Notification } from "./Notification" export interface AdminNotificationsRes { + /** + * Notification details + */ notification: SetRelation } diff --git a/packages/generated/client-types/src/lib/models/AdminOrderEditsListRes.ts b/packages/generated/client-types/src/lib/models/AdminOrderEditsListRes.ts index 63ae56cc53..bd6a33a8b7 100644 --- a/packages/generated/client-types/src/lib/models/AdminOrderEditsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminOrderEditsListRes.ts @@ -8,6 +8,9 @@ import type { OrderEdit } from "./OrderEdit" import type { OrderItemChange } from "./OrderItemChange" export interface AdminOrderEditsListRes { + /** + * An array of order edit details + */ order_edits: Array< Merge< SetRelation< @@ -58,7 +61,7 @@ export interface AdminOrderEditsListRes { */ count: number /** - * The number of items skipped before these items + * The number of order edits skipped when retrieving the order edits. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminOrderEditsRes.ts b/packages/generated/client-types/src/lib/models/AdminOrderEditsRes.ts index 67b0ab9912..a9539b39b4 100644 --- a/packages/generated/client-types/src/lib/models/AdminOrderEditsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminOrderEditsRes.ts @@ -8,6 +8,9 @@ import type { OrderEdit } from "./OrderEdit" import type { OrderItemChange } from "./OrderItemChange" export interface AdminOrderEditsRes { + /** + * Order edit details + */ order_edit: Merge< SetRelation< OrderEdit, diff --git a/packages/generated/client-types/src/lib/models/AdminOrdersListRes.ts b/packages/generated/client-types/src/lib/models/AdminOrdersListRes.ts index b5513fc881..943b309ffa 100644 --- a/packages/generated/client-types/src/lib/models/AdminOrdersListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminOrdersListRes.ts @@ -19,6 +19,9 @@ import type { ShippingMethod } from "./ShippingMethod" import type { Swap } from "./Swap" export interface AdminOrdersListRes { + /** + * An array of order details. + */ orders: Array< Merge< SetRelation< @@ -168,7 +171,7 @@ export interface AdminOrdersListRes { */ count: number /** - * The number of items skipped before these items + * The number of orders skipped when retrieving the orders. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminOrdersOrderLineItemReservationReq.ts b/packages/generated/client-types/src/lib/models/AdminOrdersOrderLineItemReservationReq.ts index ae709f7d82..151d62ef2f 100644 --- a/packages/generated/client-types/src/lib/models/AdminOrdersOrderLineItemReservationReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminOrdersOrderLineItemReservationReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminOrdersOrderLineItemReservationReq { /** - * The id of the location of the reservation + * The ID of the location of the reservation */ location_id: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminOrdersRes.ts b/packages/generated/client-types/src/lib/models/AdminOrdersRes.ts index 275bd55a5f..3ee3d9ed9b 100644 --- a/packages/generated/client-types/src/lib/models/AdminOrdersRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminOrdersRes.ts @@ -19,6 +19,9 @@ import type { ShippingMethod } from "./ShippingMethod" import type { Swap } from "./Swap" export interface AdminOrdersRes { + /** + * Order details. + */ order: Merge< SetRelation< Order, diff --git a/packages/generated/client-types/src/lib/models/AdminPaymentCollectionsRes.ts b/packages/generated/client-types/src/lib/models/AdminPaymentCollectionsRes.ts index e958305dd3..47c6434dc9 100644 --- a/packages/generated/client-types/src/lib/models/AdminPaymentCollectionsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPaymentCollectionsRes.ts @@ -7,6 +7,9 @@ import type { PaymentCollection } from "./PaymentCollection" import type { Region } from "./Region" export interface AdminPaymentCollectionsRes { + /** + * Payment Collection details. + */ payment_collection: Merge< SetRelation, { diff --git a/packages/generated/client-types/src/lib/models/AdminPaymentProvidersList.ts b/packages/generated/client-types/src/lib/models/AdminPaymentProvidersList.ts index 579ed3cfae..9a3138c329 100644 --- a/packages/generated/client-types/src/lib/models/AdminPaymentProvidersList.ts +++ b/packages/generated/client-types/src/lib/models/AdminPaymentProvidersList.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PaymentProvider } from "./PaymentProvider" export interface AdminPaymentProvidersList { + /** + * An array of payment providers details. + */ payment_providers: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPaymentRes.ts b/packages/generated/client-types/src/lib/models/AdminPaymentRes.ts index 8108bc4365..3e4c33a873 100644 --- a/packages/generated/client-types/src/lib/models/AdminPaymentRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPaymentRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Payment } from "./Payment" export interface AdminPaymentRes { + /** + * Payment details + */ payment: Payment } diff --git a/packages/generated/client-types/src/lib/models/AdminPostAppsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostAppsReq.ts index 30a1753831..7b9592218b 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostAppsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostAppsReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostAppsReq { /** - * Name of the application for the token to be generated for. + * Name of the application for to generate the token for. */ application_name: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostAuthReq.ts b/packages/generated/client-types/src/lib/models/AdminPostAuthReq.ts index 236f078c1f..4035adb976 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostAuthReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostAuthReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostAuthReq { /** - * The User's email. + * The user's email. */ email: string /** - * The User's password. + * The user's password. */ password: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostBatchesReq.ts b/packages/generated/client-types/src/lib/models/AdminPostBatchesReq.ts index c4ca690185..07ad34cc60 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostBatchesReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostBatchesReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostBatchesReq { /** - * The type of batch job to start. + * The type of batch job to start, which is defined by the `batchType` property of the associated batch job strategy. */ type: string /** @@ -13,7 +13,7 @@ export interface AdminPostBatchesReq { */ context: Record /** - * Set a batch job in dry_run mode to get some information on what will be done without applying any modifications. + * Set a batch job in dry_run mode, which would delay executing the batch job until it's confirmed. */ dry_run?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostCollectionsCollectionReq.ts b/packages/generated/client-types/src/lib/models/AdminPostCollectionsCollectionReq.ts index dcb88e6f74..e13e3e1eb3 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostCollectionsCollectionReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostCollectionsCollectionReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostCollectionsCollectionReq { /** - * The title to identify the Collection by. + * The title of the collection. */ title?: string /** - * An optional handle to be used in slugs, if none is provided we will kebab-case the title. + * An optional handle to be used in slugs. If none is provided, the kebab-case version of the title will be used. */ handle?: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostCollectionsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostCollectionsReq.ts index d72d5e1c87..6c1b69c449 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostCollectionsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostCollectionsReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostCollectionsReq { /** - * The title to identify the Collection by. + * The title of the collection. */ title: string /** - * An optional handle to be used in slugs, if none is provided we will kebab-case the title. + * An optional handle to be used in slugs. If none is provided, the kebab-case version of the title will be used. */ handle?: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostCurrenciesCurrencyReq.ts b/packages/generated/client-types/src/lib/models/AdminPostCurrenciesCurrencyReq.ts index 5cce163d95..1d4f3c5348 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostCurrenciesCurrencyReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostCurrenciesCurrencyReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostCurrenciesCurrencyReq { /** - * [EXPERIMENTAL] Tax included in prices of currency. + * Tax included in prices of currency. */ includes_tax?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostCustomerGroupsGroupReq.ts b/packages/generated/client-types/src/lib/models/AdminPostCustomerGroupsGroupReq.ts index c82f91792d..5c66766aed 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostCustomerGroupsGroupReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostCustomerGroupsGroupReq.ts @@ -9,7 +9,7 @@ export interface AdminPostCustomerGroupsGroupReq { */ name?: string /** - * Metadata for the customer. + * Metadata of the customer group. */ metadata?: Record } diff --git a/packages/generated/client-types/src/lib/models/AdminPostCustomerGroupsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostCustomerGroupsReq.ts index 57ad452d1a..f02e319bbe 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostCustomerGroupsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostCustomerGroupsReq.ts @@ -9,7 +9,7 @@ export interface AdminPostCustomerGroupsReq { */ name: string /** - * Metadata for the customer. + * Metadata of the customer group. */ metadata?: Record } diff --git a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditions.ts b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditions.ts index a1a55cdcdd..c9cf5ef192 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditions.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditions.ts @@ -5,27 +5,27 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostDiscountsDiscountConditions { /** - * Operator of the condition + * Operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that discountable resources are everything but the specified resources. */ operator: "in" | "not_in" /** - * list of product IDs if the condition is applied on products. + * list of product IDs if the condition's type is `products`. */ products?: Array /** - * list of product type IDs if the condition is applied on product types. + * list of product type IDs if the condition's type is `product_types`. */ product_types?: Array /** - * list of product collection IDs if the condition is applied on product collections. + * list of product collection IDs if the condition's type is `product_collections`. */ product_collections?: Array /** - * list of product tag IDs if the condition is applied on product tags. + * list of product tag IDs if the condition's type is `product_tags`. */ product_tags?: Array /** - * list of customer group IDs if the condition is applied on customer groups. + * list of customer group IDs if the condition's type is `customer_groups`. */ customer_groups?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsCondition.ts b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsCondition.ts index 2cb0eb0861..405ec1e128 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsCondition.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsCondition.ts @@ -5,23 +5,23 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostDiscountsDiscountConditionsCondition { /** - * list of product IDs if the condition is applied on products. + * list of product IDs if the condition's type is `products`. */ products?: Array /** - * list of product type IDs if the condition is applied on product types. + * list of product type IDs if the condition's type is `product_types`. */ product_types?: Array /** - * list of product collection IDs if the condition is applied on product collections. + * list of product collection IDs if the condition's type is `product_collections`. */ product_collections?: Array /** - * list of product tag IDs if the condition is applied on product tags. + * list of product tag IDs if the condition's type is `product_tags` */ product_tags?: Array /** - * list of customer group IDs if the condition is applied on customer groups. + * list of customer group IDs if the condition's type is `customer_groups`. */ customer_groups?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsConditionBatchParams.ts b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsConditionBatchParams.ts index ca2f266413..a5e948165c 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsConditionBatchParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsConditionBatchParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostDiscountsDiscountConditionsConditionBatchParams { /** - * (Comma separated) Which relations should be expanded in each discount of the result. + * Comma-separated relations that should be expanded in the returned discount. */ expand?: string /** - * (Comma separated) Which fields should be included in each discount of the result. + * Comma-separated fields that should be included in the returned discount. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsConditionParams.ts b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsConditionParams.ts index f2d903588f..4a96d9df59 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsConditionParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsConditionParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostDiscountsDiscountConditionsConditionParams { /** - * (Comma separated) Which fields should be expanded in each item of the result. + * Comma-separated relations that should be expanded in the returned discount. */ expand?: string /** - * (Comma separated) Which fields should be included in each item of the result. + * Comma-separated fields that should be included in the returned discount. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsParams.ts b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsParams.ts index 3993b90062..902e9ffd71 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountConditionsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostDiscountsDiscountConditionsParams { /** - * (Comma separated) Which fields should be expanded in each product of the result. + * Comma-separated relations that should be expanded in the returned discount. */ expand?: string /** - * (Comma separated) Which fields should be included in each product of the result. + * Comma-separated fields that should be included in the returned discount. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountDynamicCodesReq.ts b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountDynamicCodesReq.ts index 0ba8640b2d..7e6eaf748e 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountDynamicCodesReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountDynamicCodesReq.ts @@ -9,7 +9,7 @@ export interface AdminPostDiscountsDiscountDynamicCodesReq { */ code: string /** - * Maximum times the discount can be used + * Maximum number of times the discount code can be used */ usage_limit?: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountParams.ts b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountParams.ts index 65f67d43c2..3d4d6de533 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostDiscountsDiscountParams { /** - * (Comma separated) Which fields should be expanded in each item of the result. + * Comma-separated relations that should be expanded in the returned discount. */ expand?: string /** - * (Comma separated) Which fields should be included in each item of the result. + * Comma-separated fields that should be retrieved in the returned discount. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountReq.ts b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountReq.ts index 77ef1554ac..c34f2bdd25 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDiscountsDiscountReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostDiscountsDiscountReq { /** - * A unique code that will be used to redeem the Discount + * A unique code that will be used to redeem the discount */ code?: string /** - * The Discount Rule that defines how Discounts are calculated + * The discount rule that defines how discounts are calculated */ rule?: { /** @@ -21,69 +21,69 @@ export interface AdminPostDiscountsDiscountReq { */ description?: string /** - * The value that the discount represents; this will depend on the type of the discount + * The value that the discount represents. This will depend on the type of the discount. */ value?: number /** - * The scope that the discount should apply to. + * The scope that the discount should apply to. `total` indicates that the discount should be applied on the cart total, and `item` indicates that the discount should be applied to each discountable item in the cart. */ allocation?: "total" | "item" /** - * A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. + * A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided based on the discount condition's type. */ conditions?: Array<{ /** - * The ID of the Rule + * The ID of the condition */ id?: string /** - * Operator of the condition + * Operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that discountable resources are everything but the specified resources. */ operator: "in" | "not_in" /** - * list of product IDs if the condition is applied on products. + * list of product IDs if the condition's type is `products`. */ products?: Array /** - * list of product type IDs if the condition is applied on product types. + * list of product type IDs if the condition's type is `product_types`. */ product_types?: Array /** - * list of product collection IDs if the condition is applied on product collections. + * list of product collection IDs if the condition's type is `product_collections`. */ product_collections?: Array /** - * list of product tag IDs if the condition is applied on product tags. + * list of product tag IDs if the condition's type is `product_tags`. */ product_tags?: Array /** - * list of customer group IDs if the condition is applied on customer groups. + * list of customer group IDs if the condition's type is `customer_groups`. */ customer_groups?: Array }> } /** - * Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers. + * Whether the discount code is disabled on creation. If set to `true`, it will not be available for customers. */ is_disabled?: boolean /** - * The time at which the Discount should be available. + * The date and time at which the discount should be available. */ starts_at?: string /** - * The time at which the Discount should no longer be available. + * The date and time at which the discount should no longer be available. */ ends_at?: string /** - * Duration the discount runs between + * The duration the discount runs between */ valid_duration?: string /** - * Maximum times the discount can be used + * Maximum number of times the discount can be used */ usage_limit?: number /** - * A list of Region ids representing the Regions in which the Discount can be used. + * A list of region IDs representing the Regions in which the Discount can be used. */ regions?: Array /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostDiscountsParams.ts b/packages/generated/client-types/src/lib/models/AdminPostDiscountsParams.ts index b75dd298e7..538fd8b097 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDiscountsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDiscountsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostDiscountsParams { /** - * (Comma separated) Which fields should be expanded in the results. + * Comma-separated relations that should be expanded in the returned discount. */ expand?: string /** - * (Comma separated) Which fields should be retrieved in the results. + * Comma-separated fields that should be retrieved in the returned discount. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostDiscountsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostDiscountsReq.ts index 255b940d4d..53a94cb781 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDiscountsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDiscountsReq.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostDiscountsReq { /** - * A unique code that will be used to redeem the Discount + * A unique code that will be used to redeem the discount */ code: string /** - * Whether the Discount should have multiple instances of itself, each with a different code. This can be useful for automatically generated codes that all have to follow a common set of rules. + * Whether the discount should have multiple instances of itself, each with a different code. This can be useful for automatically generated discount codes that all have to follow a common set of rules. */ is_dynamic?: boolean /** - * The Discount Rule that defines how Discounts are calculated + * The discount rule that defines how discounts are calculated */ rule: { /** @@ -21,69 +21,69 @@ export interface AdminPostDiscountsReq { */ description?: string /** - * The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. + * The type of the discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. */ type: "fixed" | "percentage" | "free_shipping" /** - * The value that the discount represents; this will depend on the type of the discount + * The value that the discount represents. This will depend on the type of the discount. */ value: number /** - * The scope that the discount should apply to. + * The scope that the discount should apply to. `total` indicates that the discount should be applied on the cart total, and `item` indicates that the discount should be applied to each discountable item in the cart. */ allocation: "total" | "item" /** - * A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. + * A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided based on the discount condition's type. */ conditions?: Array<{ /** - * Operator of the condition + * Operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that discountable resources are everything but the specified resources. */ operator: "in" | "not_in" /** - * list of product IDs if the condition is applied on products. + * list of product IDs if the condition's type is `products`. */ products?: Array /** - * list of product type IDs if the condition is applied on product types. + * list of product type IDs if the condition's type is `product_types`. */ product_types?: Array /** - * list of product collection IDs if the condition is applied on product collections. + * list of product collection IDs if the condition's type is `product_collections`. */ product_collections?: Array /** - * list of product tag IDs if the condition is applied on product tags. + * list of product tag IDs if the condition's type is `product_tags`. */ product_tags?: Array /** - * list of customer group IDs if the condition is applied on customer groups. + * list of customer group IDs if the condition's type is `customer_groups`. */ customer_groups?: Array }> } /** - * Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers. + * Whether the discount code is disabled on creation. If set to `true`, it will not be available for customers. */ is_disabled?: boolean /** - * The time at which the Discount should be available. + * The date and time at which the discount should be available. */ starts_at?: string /** - * The time at which the Discount should no longer be available. + * The date and time at which the discount should no longer be available. */ ends_at?: string /** - * Duration the discount runs between + * The duration the discount runs between */ valid_duration?: string /** - * A list of Region ids representing the Regions in which the Discount can be used. + * A list of region IDs representing the Regions in which the Discount can be used. */ regions: Array /** - * Maximum times the discount can be used + * Maximum number of times the discount can be used */ usage_limit?: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderLineItemsItemReq.ts b/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderLineItemsItemReq.ts index 4f787328ab..7aa9bfd5df 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderLineItemsItemReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderLineItemsItemReq.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostDraftOrdersDraftOrderLineItemsItemReq { /** - * The potential custom price of the item. + * The custom price of the line item. If a `variant_id` is supplied, the price provided here will override the variant's price. */ unit_price?: number /** - * The potential custom title of the item. + * The title of the line item if `variant_id` is not provided. */ title?: string /** - * The quantity of the Line Item. + * The quantity of the line item. */ quantity?: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderLineItemsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderLineItemsReq.ts index 4cbbf062de..33a2fd389d 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderLineItemsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderLineItemsReq.ts @@ -5,19 +5,19 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostDraftOrdersDraftOrderLineItemsReq { /** - * The ID of the Product Variant to generate the Line Item from. + * The ID of the Product Variant associated with the line item. If the line item is custom, the `variant_id` should be omitted. */ variant_id?: string /** - * The potential custom price of the item. + * The custom price of the line item. If a `variant_id` is supplied, the price provided here will override the variant's price. */ unit_price?: number /** - * The potential custom title of the item. + * The title of the line item if `variant_id` is not provided. */ title?: string /** - * The quantity of the Line Item. + * The quantity of the line item. */ quantity: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderRegisterPaymentRes.ts b/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderRegisterPaymentRes.ts index e9d714eb59..ab9b0845f8 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderRegisterPaymentRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderRegisterPaymentRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Order } from "./Order" export interface AdminPostDraftOrdersDraftOrderRegisterPaymentRes { + /** + * Order's details. + */ order: Order } diff --git a/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderReq.ts b/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderReq.ts index 047869bf63..ee6f6bf805 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersDraftOrderReq.ts @@ -15,7 +15,7 @@ export interface AdminPostDraftOrdersDraftOrderReq { */ country_code?: string /** - * An email to be used on the Draft Order. + * An email to be used in the Draft Order. */ email?: string /** @@ -23,7 +23,7 @@ export interface AdminPostDraftOrdersDraftOrderReq { */ billing_address?: AddressPayload | string /** - * The Address to be used for shipping. + * The Address to be used for shipping purposes. */ shipping_address?: AddressPayload | string /** @@ -36,11 +36,11 @@ export interface AdminPostDraftOrdersDraftOrderReq { code: string }> /** - * An optional flag passed to the resulting order to determine use of notifications. + * An optional flag passed to the resulting order that indicates whether the customer should receive notifications about order updates. */ no_notification_order?: boolean /** - * The ID of the Customer to associate the Draft Order with. + * The ID of the customer this draft order is associated with. */ customer_id?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersReq.ts b/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersReq.ts index 3c2d54deaf..10f7ed2dc5 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostDraftOrdersReq.ts @@ -7,7 +7,7 @@ import type { AddressPayload } from "./AddressPayload" export interface AdminPostDraftOrdersReq { /** - * The status of the draft order + * The status of the draft order. The draft order's default status is `open`. It's changed to `completed` when its payment is marked as paid. */ status?: "open" | "completed" /** @@ -19,31 +19,31 @@ export interface AdminPostDraftOrdersReq { */ billing_address?: AddressPayload | string /** - * The Address to be used for shipping. + * The Address to be used for shipping purposes. */ shipping_address?: AddressPayload | string /** - * The Line Items that have been received. + * The draft order's line items. */ items?: Array<{ /** - * The ID of the Product Variant to generate the Line Item from. + * The ID of the Product Variant associated with the line item. If the line item is custom, the `variant_id` should be omitted. */ variant_id?: string /** - * The potential custom price of the item. + * The custom price of the line item. If a `variant_id` is supplied, the price provided here will override the variant's price. */ unit_price?: number /** - * The potential custom title of the item. + * The title of the line item if `variant_id` is not provided. */ title?: string /** - * The quantity of the Line Item. + * The quantity of the line item. */ quantity: number /** - * The optional key-value map with additional details about the Line Item. + * The optional key-value map with additional details about the line item. */ metadata?: Record }> @@ -52,7 +52,7 @@ export interface AdminPostDraftOrdersReq { */ region_id: string /** - * The discounts to add on the draft order + * The discounts to add to the draft order */ discounts?: Array<{ /** @@ -61,11 +61,11 @@ export interface AdminPostDraftOrdersReq { code: string }> /** - * The ID of the customer to add on the draft order + * The ID of the customer this draft order is associated with. */ customer_id?: string /** - * An optional flag passed to the resulting order to determine use of notifications. + * An optional flag passed to the resulting order that indicates whether the customer should receive notifications about order updates. */ no_notification_order?: boolean /** @@ -81,7 +81,7 @@ export interface AdminPostDraftOrdersReq { */ data?: Record /** - * The potential custom price of the shipping + * The price of the shipping method. */ price?: number }> diff --git a/packages/generated/client-types/src/lib/models/AdminPostGiftCardsGiftCardReq.ts b/packages/generated/client-types/src/lib/models/AdminPostGiftCardsGiftCardReq.ts index 66acf91061..01f370e596 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostGiftCardsGiftCardReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostGiftCardsGiftCardReq.ts @@ -9,11 +9,11 @@ export interface AdminPostGiftCardsGiftCardReq { */ balance?: number /** - * Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers. + * Whether the Gift Card is disabled on creation. If set to `true`, the gift card will not be available for customers. */ is_disabled?: boolean /** - * The time at which the Gift Card should no longer be available. + * The date and time at which the Gift Card should no longer be available. */ ends_at?: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostGiftCardsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostGiftCardsReq.ts index ffb6ad6ee5..622ebea381 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostGiftCardsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostGiftCardsReq.ts @@ -9,11 +9,11 @@ export interface AdminPostGiftCardsReq { */ value?: number /** - * Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers. + * Whether the Gift Card is disabled on creation. If set to `true`, the gift card will not be available for customers. */ is_disabled?: boolean /** - * The time at which the Gift Card should no longer be available. + * The date and time at which the Gift Card should no longer be available. */ ends_at?: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsInventoryItemParams.ts b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsInventoryItemParams.ts index ecb7b99d42..2ded3d6c5b 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsInventoryItemParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsInventoryItemParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostInventoryItemsInventoryItemParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned inventory level. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned inventory level. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsLevelParams.ts b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsLevelParams.ts index 65d834b8af..cc3a095183 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsLevelParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsLevelParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostInventoryItemsItemLocationLevelsLevelParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned inventory level. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned inventory level. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsParams.ts b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsParams.ts index 136b724c61..6cdca2d190 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostInventoryItemsItemLocationLevelsParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned inventory item. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned inventory item. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsReq.ts index ecd59f931c..2089a7fd03 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsItemLocationLevelsReq.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostInventoryItemsItemLocationLevelsReq { /** - * the item location ID + * the ID of the stock location */ location_id: string /** - * the stock quantity of an inventory item at the given location ID + * the stock quantity of the inventory item at this location */ stocked_quantity: number /** - * the incoming stock quantity of an inventory item at the given location ID + * the incoming stock quantity of the inventory item at this location */ incoming_quantity?: number } diff --git a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsParams.ts b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsParams.ts index e3c39151c1..c4377f6ac4 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostInventoryItemsParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned inventory item. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned inventory item. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsReq.ts index 5b295b4ba7..e4a8b54eff 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostInventoryItemsReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostInventoryItemsReq { /** - * The unique SKU for the Product Variant. + * The unique SKU of the associated Product Variant. */ sku?: string /** @@ -21,47 +21,47 @@ export interface AdminPostInventoryItemsReq { */ barcode?: string /** - * The Harmonized System code for the Product Variant. + * The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. */ hs_code?: string /** - * The amount of stock kept for the Product Variant. + * The amount of stock kept of the associated Product Variant. */ inventory_quantity?: number /** - * Whether the Product Variant can be purchased when out of stock. + * Whether the associated Product Variant can be purchased when out of stock. */ allow_backorder?: boolean /** - * Whether Medusa should keep track of the inventory for this Product Variant. + * Whether Medusa should keep track of the inventory for the associated Product Variant. */ manage_inventory?: boolean /** - * The wieght of the Product Variant. + * The weight of the Inventory Item. May be used in shipping rate calculations. */ weight?: number /** - * The length of the Product Variant. + * The length of the Inventory Item. May be used in shipping rate calculations. */ length?: number /** - * The height of the Product Variant. + * The height of the Inventory Item. May be used in shipping rate calculations. */ height?: number /** - * The width of the Product Variant. + * The width of the Inventory Item. May be used in shipping rate calculations. */ width?: number /** - * The country of origin of the Product Variant. + * The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. */ origin_country?: string /** - * The Manufacturer Identification code for the Product Variant. + * The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. */ mid_code?: string /** - * The material composition of the Product Variant. + * The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. */ material?: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostInvitesInviteAcceptReq.ts b/packages/generated/client-types/src/lib/models/AdminPostInvitesInviteAcceptReq.ts index 4356d7c388..6d62461d66 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostInvitesInviteAcceptReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostInvitesInviteAcceptReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostInvitesInviteAcceptReq { /** - * The invite token provided by the admin. + * The token of the invite to accept. This is a unique token generated when the invite was created or resent. */ token: string /** - * The User to create. + * The details of the user to create. */ user: { /** @@ -21,7 +21,7 @@ export interface AdminPostInvitesInviteAcceptReq { */ last_name: string /** - * The desired password for the User + * The password for the User */ password: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostInvitesReq.ts b/packages/generated/client-types/src/lib/models/AdminPostInvitesReq.ts index 0603931677..82b68ab695 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostInvitesReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostInvitesReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostInvitesReq { /** - * The email for the user to be created. + * The email associated with the invite. Once the invite is accepted, the email will be associated with the created user. */ user: string /** - * The role of the user to be created. + * The role of the user to be created. This does not actually change the privileges of the user that is eventually created. */ role: "admin" | "member" | "developer" } diff --git a/packages/generated/client-types/src/lib/models/AdminPostNotesNoteReq.ts b/packages/generated/client-types/src/lib/models/AdminPostNotesNoteReq.ts index a10eaddfa5..56f5559e0e 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostNotesNoteReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostNotesNoteReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostNotesNoteReq { /** - * The updated description of the Note. + * The description of the Note. */ value: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostNotesReq.ts b/packages/generated/client-types/src/lib/models/AdminPostNotesReq.ts index 4f28baaf39..b577cfd0d4 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostNotesReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostNotesReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostNotesReq { /** - * The ID of the resource which the Note relates to. + * The ID of the resource which the Note relates to. For example, an order ID. */ resource_id: string /** - * The type of resource which the Note relates to. + * The type of resource which the Note relates to. For example, `order`. */ resource_type: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostNotificationsNotificationResendReq.ts b/packages/generated/client-types/src/lib/models/AdminPostNotificationsNotificationResendReq.ts index 46957337e9..3d429724b6 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostNotificationsNotificationResendReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostNotificationsNotificationResendReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostNotificationsNotificationResendReq { /** - * A new address or user identifier that the Notification should be sent to + * A new address or user identifier that the Notification should be sent to. If not provided, the previous `to` field of the notification will be used. */ to?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrderEditsEditLineItemsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrderEditsEditLineItemsReq.ts index 042bd1fe45..561fff1bda 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrderEditsEditLineItemsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrderEditsEditLineItemsReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostOrderEditsEditLineItemsReq { /** - * The ID of the variant ID to add + * The ID of the product variant associated with the item. */ variant_id: string /** - * The quantity to add + * The quantity of the item. */ quantity: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrderEditsOrderEditReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrderEditsOrderEditReq.ts index e81439f090..23b0a62cf6 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrderEditsOrderEditReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrderEditsOrderEditReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostOrderEditsOrderEditReq { /** - * An optional note to create or update for the order edit. + * An optional note to create or update in the order edit. */ internal_note?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrderEditsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrderEditsReq.ts index 57d3c93cdf..159c81cc67 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrderEditsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrderEditsReq.ts @@ -9,7 +9,7 @@ export interface AdminPostOrderEditsReq { */ order_id: string /** - * An optional note to create for the order edit. + * An optional note to associate with the order edit. */ internal_note?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.ts index e166049775..f7bf353b37 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.ts @@ -9,7 +9,7 @@ export interface AdminPostOrdersOrderClaimsClaimFulfillmentsReq { */ metadata?: Record /** - * If set to true no notification will be send related to this Claim. + * If set to `true`, no notification will be sent to the customer related to this Claim. */ no_notification?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsClaimShipmentsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsClaimShipmentsReq.ts index e057408585..64b5371aaa 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsClaimShipmentsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsClaimShipmentsReq.ts @@ -9,7 +9,7 @@ export interface AdminPostOrdersOrderClaimsClaimShipmentsReq { */ fulfillment_id: string /** - * The tracking numbers for the shipment. + * An array of tracking numbers for the shipment. */ tracking_numbers?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsReq.ts index 49a1018bb8..35dd628ec3 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderClaimsReq.ts @@ -31,7 +31,7 @@ export interface AdminPostOrdersOrderClaimsReq { */ reason?: "missing_item" | "wrong_item" | "production_failure" | "other" /** - * A list o tags to add to the Claim Item + * A list of tags to add to the Claim Item */ tags?: Array /** @@ -40,7 +40,7 @@ export interface AdminPostOrdersOrderClaimsReq { images?: any }> /** - * Optional details for the Return Shipping Method, if the items are to be sent back. + * Optional details for the Return Shipping Method, if the items are to be sent back. Providing this field will result in a return being created and associated with the claim. */ return_shipping?: { /** @@ -53,20 +53,20 @@ export interface AdminPostOrdersOrderClaimsReq { price?: number } /** - * The new items to send to the Customer when the Claim type is Replace. + * The new items to send to the Customer. This is only used if the claim's type is `replace`. */ additional_items?: Array<{ /** - * The ID of the Product Variant to ship. + * The ID of the Product Variant. */ variant_id: string /** - * The quantity of the Product Variant to ship. + * The quantity of the Product Variant. */ quantity: number }> /** - * The Shipping Methods to send the additional Line Items with. + * The Shipping Methods to send the additional Line Items with. This is only used if the claim's type is `replace`. */ shipping_methods?: Array<{ /** @@ -87,11 +87,11 @@ export interface AdminPostOrdersOrderClaimsReq { data?: Record }> /** - * An optional shipping address to send the claim to. Defaults to the parent order's shipping address + * An optional shipping address to send the claimed items to. If not provided, the parent order's shipping address will be used. */ shipping_address?: AddressPayload /** - * The amount to refund the Customer when the Claim type is `refund`. + * The amount to refund the customer. This is used when the claim's type is `refund`. */ refund_amount?: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderFulfillmentsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderFulfillmentsReq.ts index ab50f692c7..e06e86a10c 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderFulfillmentsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderFulfillmentsReq.ts @@ -9,7 +9,7 @@ export interface AdminPostOrdersOrderFulfillmentsReq { */ items: Array<{ /** - * The ID of Line Item to fulfill. + * The ID of the Line Item to fulfill. */ item_id: string /** @@ -18,7 +18,7 @@ export interface AdminPostOrdersOrderFulfillmentsReq { quantity: number }> /** - * If set to true no notification will be send related to this Swap. + * If set to `true`, no notification will be sent to the customer related to this fulfillment. */ no_notification?: boolean /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderRefundsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderRefundsReq.ts index 772f4c2107..ea31abd484 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderRefundsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderRefundsReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostOrdersOrderRefundsReq { /** - * The amount to refund. + * The amount to refund. It should be less than or equal the `refundable_amount` of the order. */ amount: number /** @@ -17,7 +17,7 @@ export interface AdminPostOrdersOrderRefundsReq { */ note?: string /** - * If set to true no notification will be send related to this Refund. + * If set to `true`, no notification will be sent to the customer related to this Refund. */ no_notification?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderReq.ts index 6028d0e56e..1fec3477a3 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderReq.ts @@ -9,43 +9,43 @@ import type { LineItem } from "./LineItem" export interface AdminPostOrdersOrderReq { /** - * the email for the order + * the email associated with the order */ email?: string /** - * Billing address + * The order's billing address */ billing_address?: AddressPayload /** - * Shipping address + * The order's shipping address */ shipping_address?: AddressPayload /** - * The Line Items for the order + * The line items of the order */ items?: Array /** - * ID of the region where the order belongs + * ID of the region that the order is associated with. */ region?: string /** - * Discounts applied to the order + * The discounts applied to the order */ discounts?: Array /** - * ID of the customer + * The ID of the customer associated with the order. */ customer_id?: string /** - * payment method chosen for the order + * The payment method chosen for the order. */ payment_method?: { /** - * ID of the payment provider + * The ID of the payment provider. */ provider_id?: string /** - * Data relevant for the given payment method + * Any data relevant for the given payment method. */ data?: Record } @@ -66,7 +66,7 @@ export interface AdminPostOrdersOrderReq { */ price?: number /** - * Data relevant to the specific shipping method. + * Any data relevant to the specific shipping method. */ data?: Record /** @@ -75,7 +75,7 @@ export interface AdminPostOrdersOrderReq { items?: Array } /** - * A flag to indicate if no notifications should be emitted related to the updated order. + * If set to `true`, no notification will be sent to the customer related to this order. */ no_notification?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderReturnsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderReturnsReq.ts index 42e6dcc9d1..ba0313ae80 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderReturnsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderReturnsReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostOrdersOrderReturnsReq { /** - * The Line Items that will be returned. + * The line items that will be returned. */ items: Array<{ /** @@ -47,7 +47,7 @@ export interface AdminPostOrdersOrderReturnsReq { */ receive_now?: boolean /** - * A flag to indicate if no notifications should be emitted related to the requested Return. + * If set to `true`, no notification will be sent to the customer related to this Return. */ no_notification?: boolean /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderShippingMethodsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderShippingMethodsReq.ts index 694698ac16..297f1f1ddd 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderShippingMethodsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderShippingMethodsReq.ts @@ -13,7 +13,7 @@ export interface AdminPostOrdersOrderShippingMethodsReq { */ option_id: string /** - * The data required for the Shipping Option to create a Shipping Method. This will depend on the Fulfillment Provider. + * The data required for the Shipping Option to create a Shipping Method. This depends on the Fulfillment Provider. */ date?: Record } diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsParams.ts b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsParams.ts index 429473a62e..26d57f9aa9 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostOrdersOrderSwapsParams { /** - * (Comma separated) Which fields should be expanded the order of the result. + * Comma-separated relations that should be expanded in the returned order. */ expand?: string /** - * (Comma separated) Which fields should be included the order of the result. + * Comma-separated fields that should be included in the returned order. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsReq.ts index 635f93cf2e..599ab7489a 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostOrdersOrderSwapsReq { /** - * The Line Items to return as part of the Swap. + * The Line Items to associate with the swap's return. */ return_items: Array<{ /** - * The ID of the Line Item that will be claimed. + * The ID of the Line Item that will be returned. */ item_id: string /** @@ -26,7 +26,7 @@ export interface AdminPostOrdersOrderSwapsReq { note?: string }> /** - * How the Swap will be returned. + * The shipping method associated with the swap's return. */ return_shipping?: { /** @@ -43,20 +43,20 @@ export interface AdminPostOrdersOrderSwapsReq { */ additional_items?: Array<{ /** - * The ID of the Product Variant to ship. + * The ID of the Product Variant. */ variant_id: string /** - * The quantity of the Product Variant to ship. + * The quantity of the Product Variant. */ quantity: number }> /** - * The custom shipping options to potentially create a Shipping Method from. + * An array of custom shipping options to potentially create a Shipping Method from to send the additional items. */ custom_shipping_options?: Array<{ /** - * The ID of the Shipping Option to override with a custom price. + * The ID of the Shipping Option. */ option_id: string /** @@ -65,11 +65,11 @@ export interface AdminPostOrdersOrderSwapsReq { price: number }> /** - * If set to true no notification will be send related to this Swap. + * If set to `true`, no notification will be sent to the customer related to this Swap. */ no_notification?: boolean /** - * If true, swaps can be completed with items out of stock + * If set to `true`, swaps can be completed with items out of stock */ allow_backorder?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.ts index cfe29e4256..2a983f8de2 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.ts @@ -9,7 +9,7 @@ export interface AdminPostOrdersOrderSwapsSwapFulfillmentsReq { */ metadata?: Record /** - * If set to true no notification will be send related to this Claim. + * If set to `true`, no notification will be sent to the customer related to this swap. */ no_notification?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostPriceListPricesPricesReq.ts b/packages/generated/client-types/src/lib/models/AdminPostPriceListPricesPricesReq.ts index 992f29028c..16fdf4e165 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostPriceListPricesPricesReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostPriceListPricesPricesReq.ts @@ -13,11 +13,11 @@ export interface AdminPostPriceListPricesPricesReq { */ id?: string /** - * The ID of the Region for which the price is used. Only required if currecny_code is not provided. + * The ID of the Region for which the price is used. This is only required if `currecny_code` is not provided. */ region_id?: string /** - * The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * The 3 character ISO currency code for which the price will be used. This is only required if `region_id` is not provided. */ currency_code?: string /** @@ -38,7 +38,7 @@ export interface AdminPostPriceListPricesPricesReq { max_quantity?: number }> /** - * If true the prices will replace all existing prices associated with the Price List. + * If set to `true`, the prices will replace all existing prices associated with the Price List. */ override?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostPriceListsPriceListPriceListReq.ts b/packages/generated/client-types/src/lib/models/AdminPostPriceListsPriceListPriceListReq.ts index 5c34c7a5d0..6ef6750078 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostPriceListsPriceListPriceListReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostPriceListsPriceListPriceListReq.ts @@ -9,7 +9,7 @@ export interface AdminPostPriceListsPriceListPriceListReq { */ name?: string /** - * A description of the Price List. + * The description of the Price List. */ description?: string /** @@ -25,7 +25,7 @@ export interface AdminPostPriceListsPriceListPriceListReq { */ type?: "sale" | "override" /** - * The status of the Price List. + * The status of the Price List. If the status is set to `draft`, the prices created in the price list will not be available of the customer. */ status?: "active" | "draft" /** @@ -37,11 +37,11 @@ export interface AdminPostPriceListsPriceListPriceListReq { */ id?: string /** - * The ID of the Region for which the price is used. Only required if currecny_code is not provided. + * The ID of the Region for which the price is used. This is only required if `currecny_code` is not provided. */ region_id?: string /** - * The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * The 3 character ISO currency code for which the price will be used. This is only required if `region_id` is not provided. */ currency_code?: string /** @@ -62,7 +62,7 @@ export interface AdminPostPriceListsPriceListPriceListReq { max_quantity?: number }> /** - * A list of customer groups that the Price List applies to. + * An array of customer groups that the Price List applies to. */ customer_groups?: Array<{ /** @@ -71,7 +71,7 @@ export interface AdminPostPriceListsPriceListPriceListReq { id: string }> /** - * [EXPERIMENTAL] Tax included in prices of price list + * Tax included in prices of price list */ includes_tax?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostPriceListsPriceListReq.ts b/packages/generated/client-types/src/lib/models/AdminPostPriceListsPriceListReq.ts index 0d9b3854b9..20db6307a3 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostPriceListsPriceListReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostPriceListsPriceListReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostPriceListsPriceListReq { /** - * The name of the Price List + * The name of the Price List. */ name: string /** - * A description of the Price List. + * The description of the Price List. */ description: string /** @@ -25,7 +25,7 @@ export interface AdminPostPriceListsPriceListReq { */ type: "sale" | "override" /** - * The status of the Price List. + * The status of the Price List. If the status is set to `draft`, the prices created in the price list will not be available of the customer. */ status?: "active" | "draft" /** @@ -33,11 +33,11 @@ export interface AdminPostPriceListsPriceListReq { */ prices: Array<{ /** - * The ID of the Region for which the price is used. Only required if currecny_code is not provided. + * The ID of the Region for which the price is used. This is only required if `currecny_code` is not provided. */ region_id?: string /** - * The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * The 3 character ISO currency code for which the price will be used. This is only required if `region_id` is not provided. */ currency_code?: string /** @@ -58,7 +58,7 @@ export interface AdminPostPriceListsPriceListReq { max_quantity?: number }> /** - * A list of customer groups that the Price List applies to. + * An array of customer groups that the Price List applies to. */ customer_groups?: Array<{ /** @@ -67,7 +67,7 @@ export interface AdminPostPriceListsPriceListReq { id: string }> /** - * [EXPERIMENTAL] Tax included in prices of price list + * Tax included in prices of price list */ includes_tax?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesCategoryProductsBatchParams.ts b/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesCategoryProductsBatchParams.ts index 2f761d2a59..29c097339c 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesCategoryProductsBatchParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesCategoryProductsBatchParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostProductCategoriesCategoryProductsBatchParams { /** - * (Comma separated) Category fields to be expanded in the response. + * Comma-separated relations that should be expanded in the returned product category. */ expand?: string /** - * (Comma separated) Category fields to be retrieved in the response. + * Comma-separated fields that should be included in the returned product category. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesParams.ts b/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesParams.ts index 4e1c9ba9e9..5a4b2bad21 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostProductCategoriesParams { /** - * (Comma separated) Which fields should be expanded in the results. + * Comma-separated relations that should be expanded in the returned product category. */ expand?: string /** - * (Comma separated) Which fields should be retrieved in the results. + * Comma-separated fields that should be included in the returned product category. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesReq.ts b/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesReq.ts index b676357468..c38e72bfeb 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostProductCategoriesReq.ts @@ -5,23 +5,23 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostProductCategoriesReq { /** - * The name to identify the Product Category by. + * The name of the product category */ name: string /** - * An optional text field to describe the Product Category by. + * The description of the product category. */ description?: string /** - * An optional handle to be used in slugs, if none is provided we will kebab-case the title. + * The handle of the product category. If none is provided, the kebab-case version of the name will be used. This field can be used as a slug in URLs. */ handle?: string /** - * A flag to make product category an internal category for admins + * If set to `true`, the product category will only be available to admins. */ is_internal?: boolean /** - * A flag to make product category visible/hidden in the store front + * If set to `false`, the product category will not be available in the storefront. */ is_active?: boolean /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostProductsProductOptionsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostProductsProductOptionsReq.ts index e878fa3cdb..3f63474876 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostProductsProductOptionsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostProductsProductOptionsReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostProductsProductOptionsReq { /** - * The title the Product Option will be identified by i.e. "Size" + * The title the Product Option. */ title: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostProductsProductReq.ts b/packages/generated/client-types/src/lib/models/AdminPostProductsProductReq.ts index e60e5f8908..8d45b02c06 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostProductsProductReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostProductsProductReq.ts @@ -13,27 +13,27 @@ export interface AdminPostProductsProductReq { */ subtitle?: string /** - * A description of the Product. + * The description of the Product. */ description?: string /** - * A flag to indicate if discounts can be applied to the LineItems generated from this Product + * A flag to indicate if discounts can be applied to the Line Items generated from this Product */ discountable?: boolean /** - * Images of the Product. + * An array of images of the Product. Each value in the array is a URL to the image. You can use the upload endpoints to upload the image and obtain a URL. */ images?: Array /** - * The thumbnail to use for the Product. + * The thumbnail to use for the Product. The value is a URL to the thumbnail. You can use the upload endpoints to upload the thumbnail and obtain a URL. */ thumbnail?: string /** - * A unique handle to identify the Product by. + * A unique handle to identify the Product by. If not provided, the kebab-case version of the product title will be used. This can be used as a slug in URLs. */ handle?: string /** - * The status of the product. + * The status of the product. The product is shown to the customer only if its status is `published`. */ status?: "draft" | "proposed" | "published" | "rejected" /** @@ -41,7 +41,7 @@ export interface AdminPostProductsProductReq { */ type?: { /** - * The ID of the Product Type. + * The ID of an existing Product Type. If not provided, a new product type will be created. */ id?: string /** @@ -50,24 +50,24 @@ export interface AdminPostProductsProductReq { value: string } /** - * The ID of the Collection the Product should belong to. + * The ID of the Product Collection the Product belongs to. */ collection_id?: string /** - * Tags to associate the Product with. + * Product Tags to associate the Product with. */ tags?: Array<{ /** - * The ID of an existing Tag. + * The ID of an existing Product Tag. If not provided, a new product tag will be created. */ id?: string /** - * The value of the Tag, these will be upserted. + * The value of the Tag. If the `id` is provided, the value of the existing tag will be updated. */ value: string }> /** - * [EXPERIMENTAL] Sales channels to associate the Product with. + * Sales channels to associate the Product with. */ sales_channels?: Array<{ /** @@ -76,124 +76,130 @@ export interface AdminPostProductsProductReq { id: string }> /** - * Categories to add the Product to. + * Product categories to add the Product to. */ categories?: Array /** - * A list of Product Variants to create with the Product. + * An array of Product Variants to create with the Product. Each product variant must have a unique combination of Product Option values. */ variants?: Array<{ /** - * The ID of the Product Variant. + * The id of an existing product variant. If provided, the details of the product variant will be updated. If not, a new product variant will be created. */ id?: string /** - * The title to identify the Product Variant by. + * The title of the product variant. */ title?: string /** - * The unique SKU for the Product Variant. + * The unique SKU of the product variant. */ sku?: string /** - * The EAN number of the item. + * The EAN number of the product variant. */ ean?: string /** - * The UPC number of the item. + * The UPC number of the product variant. */ upc?: string /** - * A generic GTIN field for the Product Variant. + * A generic GTIN field of the product variant. */ barcode?: string /** - * The Harmonized System code for the Product Variant. + * The Harmonized System code of the product variant. */ hs_code?: string /** - * The amount of stock kept for the Product Variant. + * The amount of stock kept of the product variant. */ inventory_quantity?: number /** - * Whether the Product Variant can be purchased when out of stock. + * Whether the product variant can be purchased when out of stock. */ allow_backorder?: boolean /** - * Whether Medusa should keep track of the inventory for this Product Variant. + * Whether Medusa should keep track of the inventory of this product variant. */ manage_inventory?: boolean /** - * The wieght of the Product Variant. + * The weight of the product variant. */ weight?: number /** - * The length of the Product Variant. + * The length of the product variant. */ length?: number /** - * The height of the Product Variant. + * The height of the product variant. */ height?: number /** - * The width of the Product Variant. + * The width of the product variant. */ width?: number /** - * The country of origin of the Product Variant. + * The country of origin of the product variant. */ origin_country?: string /** - * The Manufacturer Identification code for the Product Variant. + * The Manufacturer Identification code of the product variant. */ mid_code?: string /** - * The material composition of the Product Variant. + * The material composition of the product variant. */ material?: string /** * An optional set of key-value pairs with additional information. */ metadata?: Record + /** + * An array of product variant prices. A product variant can have different prices for each region or currency code. + */ prices?: Array<{ /** - * The ID of the Price. + * The ID of the Price. If provided, the existing price will be updated. Otherwise, a new price will be created. */ id?: string /** - * The ID of the Region for which the price is used. Only required if currency_code is not provided. + * The ID of the Region the price will be used in. This is only required if `currency_code` is not provided. */ region_id?: string /** - * The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided. */ currency_code?: string /** - * The amount to charge for the Product Variant. + * The price amount. */ amount: number /** - * The minimum quantity for which the price will be used. + * The minimum quantity required to be added to the cart for the price to be used. */ min_quantity?: number /** - * The maximum quantity for which the price will be used. + * The maximum quantity required to be added to the cart for the price to be used. */ max_quantity?: number }> + /** + * An array of Product Option values that the variant corresponds to. + */ options?: Array<{ /** * The ID of the Option. */ option_id: string /** - * The value to give for the Product Option at the same index in the Product's `options` field. + * The value of the Product Option. */ value: string }> }> /** - * The wieght of the Product. + * The weight of the Product. */ weight?: number /** @@ -213,7 +219,7 @@ export interface AdminPostProductsProductReq { */ origin_country?: string /** - * The Manufacturer Identification code for the Product. + * The Manufacturer Identification code of the Product. */ mid_code?: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostProductsProductVariantsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostProductsProductVariantsReq.ts index e46f5d7cb7..4c50aa10e9 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostProductsProductVariantsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostProductsProductVariantsReq.ts @@ -5,106 +5,108 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostProductsProductVariantsReq { /** - * The title to identify the Product Variant by. + * The title of the product variant. */ title: string /** - * The unique SKU for the Product Variant. + * The unique SKU of the product variant. */ sku?: string /** - * The EAN number of the item. + * The EAN number of the product variant. */ ean?: string /** - * The UPC number of the item. + * The UPC number of the product variant. */ upc?: string /** - * A generic GTIN field for the Product Variant. + * A generic GTIN field of the product variant. */ barcode?: string /** - * The Harmonized System code for the Product Variant. + * The Harmonized System code of the product variant. */ hs_code?: string /** - * The amount of stock kept for the Product Variant. + * The amount of stock kept of the product variant. */ inventory_quantity?: number /** - * Whether the Product Variant can be purchased when out of stock. + * Whether the product variant can be purchased when out of stock. */ allow_backorder?: boolean /** - * Whether Medusa should keep track of the inventory for this Product Variant. + * Whether Medusa should keep track of the inventory of this product variant. */ manage_inventory?: boolean /** - * The wieght of the Product Variant. + * The wieght of the product variant. */ weight?: number /** - * The length of the Product Variant. + * The length of the product variant. */ length?: number /** - * The height of the Product Variant. + * The height of the product variant. */ height?: number /** - * The width of the Product Variant. + * The width of the product variant. */ width?: number /** - * The country of origin of the Product Variant. + * The country of origin of the product variant. */ origin_country?: string /** - * The Manufacturer Identification code for the Product Variant. + * The Manufacturer Identification code of the product variant. */ mid_code?: string /** - * The material composition of the Product Variant. + * The material composition of the product variant. */ material?: string /** * An optional set of key-value pairs with additional information. */ metadata?: Record + /** + * An array of product variant prices. A product variant can have different prices for each region or currency code. + */ prices: Array<{ /** - * The ID of the price. - */ - id?: string - /** - * The ID of the Region for which the price is used. Only required if currency_code is not provided. + * The ID of the Region the price will be used in. This is only required if `currency_code` is not provided. */ region_id?: string /** - * The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided. */ currency_code?: string /** - * The amount to charge for the Product Variant. + * The price amount. */ amount: number /** - * The minimum quantity for which the price will be used. + * The minimum quantity required to be added to the cart for the price to be used. */ min_quantity?: number /** - * The maximum quantity for which the price will be used. + * The maximum quantity required to be added to the cart for the price to be used. */ max_quantity?: number }> + /** + * An array of Product Option values that the variant corresponds to. + */ options: Array<{ /** - * The ID of the Product Option to set the value for. + * The ID of the Product Option. */ option_id: string /** - * The value to give for the Product Option. + * A value to give to the Product Option. */ value: string }> diff --git a/packages/generated/client-types/src/lib/models/AdminPostProductsProductVariantsVariantReq.ts b/packages/generated/client-types/src/lib/models/AdminPostProductsProductVariantsVariantReq.ts index 37dba2387c..ae32cf1be0 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostProductsProductVariantsVariantReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostProductsProductVariantsVariantReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostProductsProductVariantsVariantReq { /** - * The title to identify the Product Variant by. + * The title of the product variant. */ title?: string /** - * The unique SKU for the Product Variant. + * The unique SKU of the product variant. */ sku?: string /** @@ -21,90 +21,96 @@ export interface AdminPostProductsProductVariantsVariantReq { */ upc?: string /** - * A generic GTIN field for the Product Variant. + * A generic GTIN field of the product variant. */ barcode?: string /** - * The Harmonized System code for the Product Variant. + * The Harmonized System code of the product variant. */ hs_code?: string /** - * The amount of stock kept for the Product Variant. + * The amount of stock kept of the product variant. */ inventory_quantity?: number /** - * Whether the Product Variant can be purchased when out of stock. + * Whether the product variant can be purchased when out of stock. */ allow_backorder?: boolean /** - * Whether Medusa should keep track of the inventory for this Product Variant. + * Whether Medusa should keep track of the inventory of this product variant. */ manage_inventory?: boolean /** - * The weight of the Product Variant. + * The weight of the product variant. */ weight?: number /** - * The length of the Product Variant. + * The length of the product variant. */ length?: number /** - * The height of the Product Variant. + * The height of the product variant. */ height?: number /** - * The width of the Product Variant. + * The width of the product variant. */ width?: number /** - * The country of origin of the Product Variant. + * The country of origin of the product variant. */ origin_country?: string /** - * The Manufacturer Identification code for the Product Variant. + * The Manufacturer Identification code of the product variant. */ mid_code?: string /** - * The material composition of the Product Variant. + * The material composition of the product variant. */ material?: string /** * An optional set of key-value pairs with additional information. */ metadata?: Record + /** + * An array of product variant prices. A product variant can have different prices for each region or currency code. + */ prices?: Array<{ /** - * The ID of the price. + * The ID of the price. If provided, the existing price will be updated. Otherwise, a new price will be created. */ id?: string /** - * The ID of the Region for which the price is used. Only required if currency_code is not provided. + * The ID of the Region the price will be used in. This is only required if `currency_code` is not provided. */ region_id?: string /** - * The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided. */ currency_code?: string /** - * The amount to charge for the Product Variant. + * The price amount. */ amount: number /** - * The minimum quantity for which the price will be used. + * The minimum quantity required to be added to the cart for the price to be used. */ min_quantity?: number /** - * The maximum quantity for which the price will be used. + * The maximum quantity required to be added to the cart for the price to be used. */ max_quantity?: number }> + /** + * An array of Product Option values that the variant corresponds to. + */ options?: Array<{ /** - * The ID of the Product Option to set the value for. + * The ID of the Product Option. */ option_id: string /** - * The value to give for the Product Option. + * The value of the Product Option. */ value: string }> diff --git a/packages/generated/client-types/src/lib/models/AdminPostProductsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostProductsReq.ts index 3a5bc1911d..251679ba24 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostProductsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostProductsReq.ts @@ -13,7 +13,7 @@ export interface AdminPostProductsReq { */ subtitle?: string /** - * A description of the Product. + * The description of the Product. */ description?: string /** @@ -21,23 +21,23 @@ export interface AdminPostProductsReq { */ is_giftcard?: boolean /** - * A flag to indicate if discounts can be applied to the LineItems generated from this Product + * A flag to indicate if discounts can be applied to the Line Items generated from this Product */ discountable?: boolean /** - * Images of the Product. + * An array of images of the Product. Each value in the array is a URL to the image. You can use the upload endpoints to upload the image and obtain a URL. */ images?: Array /** - * The thumbnail to use for the Product. + * The thumbnail to use for the Product. The value is a URL to the thumbnail. You can use the upload endpoints to upload the thumbnail and obtain a URL. */ thumbnail?: string /** - * A unique handle to identify the Product by. + * A unique handle to identify the Product by. If not provided, the kebab-case version of the product title will be used. This can be used as a slug in URLs. */ handle?: string /** - * The status of the product. + * The status of the product. The product is shown to the customer only if its status is `published`. */ status?: "draft" | "proposed" | "published" | "rejected" /** @@ -45,7 +45,7 @@ export interface AdminPostProductsReq { */ type?: { /** - * The ID of the Product Type. + * The ID of an existing Product Type. If not provided, a new product type will be created. */ id?: string /** @@ -54,24 +54,24 @@ export interface AdminPostProductsReq { value: string } /** - * The ID of the Collection the Product should belong to. + * The ID of the Product Collection the Product belongs to. */ collection_id?: string /** - * Tags to associate the Product with. + * Product Tags to associate the Product with. */ tags?: Array<{ /** - * The ID of an existing Tag. + * The ID of an existing Product Tag. If not provided, a new product tag will be created. */ id?: string /** - * The value of the Tag, these will be upserted. + * The value of the Tag. If the `id` is provided, the value of the existing tag will be updated. */ value: string }> /** - * [EXPERIMENTAL] Sales channels to associate the Product with. + * Sales channels to associate the Product with. */ sales_channels?: Array<{ /** @@ -80,28 +80,28 @@ export interface AdminPostProductsReq { id: string }> /** - * Categories to add the Product to. + * Product categories to add the Product to. */ categories?: Array /** - * The Options that the Product should have. These define on which properties the Product's Product Variants will differ. + * The Options that the Product should have. A new product option will be created for every item in the array. */ options?: Array<{ /** - * The title to identify the Product Option by. + * The title of the Product Option. */ title: string }> /** - * A list of Product Variants to create with the Product. + * An array of Product Variants to create with the Product. Each product variant must have a unique combination of Product Option values. */ variants?: Array<{ /** - * The title to identify the Product Variant by. + * The title of the Product Variant. */ title: string /** - * The unique SKU for the Product Variant. + * The unique SKU of the Product Variant. */ sku?: string /** @@ -113,15 +113,15 @@ export interface AdminPostProductsReq { */ upc?: string /** - * A generic GTIN field for the Product Variant. + * A generic GTIN field of the Product Variant. */ barcode?: string /** - * The Harmonized System code for the Product Variant. + * The Harmonized System code of the Product Variant. */ hs_code?: string /** - * The amount of stock kept for the Product Variant. + * The amount of stock kept of the Product Variant. */ inventory_quantity?: number /** @@ -129,7 +129,7 @@ export interface AdminPostProductsReq { */ allow_backorder?: boolean /** - * Whether Medusa should keep track of the inventory for this Product Variant. + * Whether Medusa should keep track of the inventory of this Product Variant. */ manage_inventory?: boolean /** @@ -153,7 +153,7 @@ export interface AdminPostProductsReq { */ origin_country?: string /** - * The Manufacturer Identification code for the Product Variant. + * The Manufacturer Identification code of the Product Variant. */ mid_code?: string /** @@ -164,28 +164,34 @@ export interface AdminPostProductsReq { * An optional set of key-value pairs with additional information. */ metadata?: Record + /** + * An array of product variant prices. A product variant can have different prices for each region or currency code. + */ prices?: Array<{ /** - * The ID of the Region for which the price is used. Only required if currency_code is not provided. + * The ID of the Region the price will be used in. This is only required if `currency_code` is not provided. */ region_id?: string /** - * The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided. */ currency_code?: string /** - * The amount to charge for the Product Variant. + * The price amount. */ amount: number /** - * The minimum quantity for which the price will be used. + * The minimum quantity required to be added to the cart for the price to be used. */ min_quantity?: number /** - * The maximum quantity for which the price will be used. + * The maximum quantity required to be added to the cart for the price to be used. */ max_quantity?: number }> + /** + * An array of Product Option values that the variant corresponds to. The option values should be added into the array in the same index as in the `options` field of the product. + */ options?: Array<{ /** * The value to give for the Product Option at the same index in the Product's `options` field. @@ -210,7 +216,7 @@ export interface AdminPostProductsReq { */ width?: number /** - * The Harmonized System code for the Product Variant. + * The Harmonized System code of the Product. */ hs_code?: string /** @@ -218,7 +224,7 @@ export interface AdminPostProductsReq { */ origin_country?: string /** - * The Manufacturer Identification code for the Product. + * The Manufacturer Identification code of the Product. */ mid_code?: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeySalesChannelsBatchReq.ts b/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeySalesChannelsBatchReq.ts index e3a97c02f9..ede163465f 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeySalesChannelsBatchReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeySalesChannelsBatchReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostPublishableApiKeySalesChannelsBatchReq { /** - * The IDs of the sales channels to add to the publishable api key + * The IDs of the sales channels to add to the publishable API key */ sales_channel_ids: Array<{ /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeysPublishableApiKeyReq.ts b/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeysPublishableApiKeyReq.ts index 8e2f2924b1..34fd55ce40 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeysPublishableApiKeyReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeysPublishableApiKeyReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostPublishableApiKeysPublishableApiKeyReq { /** - * A title to update for the key. + * The title of the Publishable API Key. */ title?: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeysReq.ts b/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeysReq.ts index 74402363da..2e3c0c4d54 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeysReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostPublishableApiKeysReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostPublishableApiKeysReq { /** - * A title for the publishable api key + * The title of the publishable API key */ title: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionFulfillmentProvidersReq.ts b/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionFulfillmentProvidersReq.ts index 02c6fe3704..7274cab75c 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionFulfillmentProvidersReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionFulfillmentProvidersReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostRegionsRegionFulfillmentProvidersReq { /** - * The ID of the Fulfillment Provider to add. + * The ID of the Fulfillment Provider. */ provider_id: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionPaymentProvidersReq.ts b/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionPaymentProvidersReq.ts index d995ed78a3..b9524becc2 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionPaymentProvidersReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionPaymentProvidersReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostRegionsRegionPaymentProvidersReq { /** - * The ID of the Payment Provider to add. + * The ID of the Payment Provider. */ provider_id: string } diff --git a/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionReq.ts b/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionReq.ts index 1b3533e0b7..010edf3023 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostRegionsRegionReq.ts @@ -9,43 +9,43 @@ export interface AdminPostRegionsRegionReq { */ name?: string /** - * The 3 character ISO currency code to use for the Region. + * The 3 character ISO currency code to use in the Region. */ currency_code?: string /** - * If true Medusa will automatically calculate taxes for carts in this region. If false you have to manually call POST /carts/:id/taxes. + * If set to `true`, the Medusa backend will automatically calculate taxes for carts in this region. If set to `false`, the taxes must be calculated manually. */ automatic_taxes?: boolean /** - * Whether gift cards in this region should be applied sales tax when purchasing a gift card + * If set to `true`, taxes will be applied on gift cards. */ gift_cards_taxable?: boolean /** - * The ID of the tax provider to use; if null the system tax provider is used + * The ID of the tax provider to use. If none provided, the system tax provider is used. */ tax_provider_id?: string /** - * An optional tax code the Region. + * The tax code of the Region. */ tax_code?: string /** - * The tax rate to use on Orders in the Region. + * The tax rate to use in the Region. */ tax_rate?: number /** - * [EXPERIMENTAL] Tax included in prices of region + * Whether taxes are included in the prices of the region. */ includes_tax?: boolean /** - * A list of Payment Provider IDs that should be enabled for the Region + * A list of Payment Provider IDs that can be used in the Region */ payment_providers?: Array /** - * A list of Fulfillment Provider IDs that should be enabled for the Region + * A list of Fulfillment Provider IDs that can be used in the Region */ fulfillment_providers?: Array /** - * A list of countries' 2 ISO Characters that should be included in the Region. + * A list of countries' 2 ISO characters that should be included in the Region. */ countries?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPostRegionsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostRegionsReq.ts index abbd2e4a56..a3f146225d 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostRegionsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostRegionsReq.ts @@ -9,31 +9,31 @@ export interface AdminPostRegionsReq { */ name: string /** - * The 3 character ISO currency code to use for the Region. + * The 3 character ISO currency code to use in the Region. */ currency_code: string /** - * An optional tax code the Region. + * The tax code of the Region. */ tax_code?: string /** - * The tax rate to use on Orders in the Region. + * The tax rate to use in the Region. */ tax_rate: number /** - * A list of Payment Provider IDs that should be enabled for the Region + * A list of Payment Provider IDs that can be used in the Region */ payment_providers: Array /** - * A list of Fulfillment Provider IDs that should be enabled for the Region + * A list of Fulfillment Provider IDs that can be used in the Region */ fulfillment_providers: Array /** - * A list of countries' 2 ISO Characters that should be included in the Region. + * A list of countries' 2 ISO characters that should be included in the Region. */ countries: Array /** - * [EXPERIMENTAL] Tax included in prices of region + * Whether taxes are included in the prices of the region. */ includes_tax?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostReservationsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostReservationsReq.ts index 15e7cf730b..0c7d8c7597 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostReservationsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostReservationsReq.ts @@ -5,19 +5,19 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostReservationsReq { /** - * The id of the location of the reservation + * The ID of the line item of the reservation. */ line_item_id?: string /** - * The id of the location of the reservation + * The ID of the location of the reservation. */ location_id: string /** - * The id of the inventory item the reservation relates to + * The ID of the inventory item the reservation is associated with. */ inventory_item_id: string /** - * The id of the reservation item + * The quantity to reserve. */ quantity: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostReservationsReservationReq.ts b/packages/generated/client-types/src/lib/models/AdminPostReservationsReservationReq.ts index a1f85d3360..00686df56d 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostReservationsReservationReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostReservationsReservationReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostReservationsReservationReq { /** - * The id of the location of the reservation + * The ID of the location associated with the reservation. */ location_id?: string /** - * The id of the reservation item + * The quantity to reserve. */ quantity?: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostReturnReasonsReasonReq.ts b/packages/generated/client-types/src/lib/models/AdminPostReturnReasonsReasonReq.ts index 3a99e53e62..5ae9bce9a3 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostReturnReasonsReasonReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostReturnReasonsReasonReq.ts @@ -9,11 +9,11 @@ export interface AdminPostReturnReasonsReasonReq { */ label?: string /** - * The value that the Return Reason will be identified by. Must be unique. + * A unique value of the return reason. */ value?: string /** - * An optional description to for the Reason. + * The description of the Reason. */ description?: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostReturnReasonsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostReturnReasonsReq.ts index d90ff8dc7b..ad093a2a85 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostReturnReasonsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostReturnReasonsReq.ts @@ -9,7 +9,7 @@ export interface AdminPostReturnReasonsReq { */ label: string /** - * The value that the Return Reason will be identified by. Must be unique. + * A unique value of the return reason. */ value: string /** @@ -17,7 +17,7 @@ export interface AdminPostReturnReasonsReq { */ parent_return_reason_id?: string /** - * An optional description to for the Reason. + * The description of the Reason. */ description?: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostSalesChannelsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostSalesChannelsReq.ts index 12ea1138fa..c316e642e4 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostSalesChannelsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostSalesChannelsReq.ts @@ -13,7 +13,7 @@ export interface AdminPostSalesChannelsReq { */ description?: string /** - * Whether the Sales Channel is disabled or not. + * Whether the Sales Channel is disabled. */ is_disabled?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostSalesChannelsSalesChannelReq.ts b/packages/generated/client-types/src/lib/models/AdminPostSalesChannelsSalesChannelReq.ts index ece48bfc8c..25065f50e4 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostSalesChannelsSalesChannelReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostSalesChannelsSalesChannelReq.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostSalesChannelsSalesChannelReq { /** - * Name of the sales channel. + * The name of the sales channel */ name?: string /** - * Sales Channel description. + * The description of the sales channel. */ description?: string /** - * Indication of if the sales channel is active. + * Whether the Sales Channel is disabled. */ is_disabled?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostShippingOptionsOptionReq.ts b/packages/generated/client-types/src/lib/models/AdminPostShippingOptionsOptionReq.ts index 7ec8f3d7f2..ad393120d2 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostShippingOptionsOptionReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostShippingOptionsOptionReq.ts @@ -9,11 +9,11 @@ export interface AdminPostShippingOptionsOptionReq { */ name?: string /** - * The amount to charge for the Shipping Option. + * The amount to charge for the Shipping Option. If the `price_type` of the shipping option is `calculated`, this amount will not actually be used. */ amount?: number /** - * If true, the option can be used for draft orders + * If set to `true`, the shipping option can only be used when creating draft orders. */ admin_only?: boolean /** @@ -25,7 +25,7 @@ export interface AdminPostShippingOptionsOptionReq { */ requirements: Array<{ /** - * The ID of the requirement + * The ID of an existing requirement. If an ID is passed, the existing requirement's details are updated. Otherwise, a new requirement is created. */ id?: string /** @@ -38,7 +38,7 @@ export interface AdminPostShippingOptionsOptionReq { amount: number }> /** - * [EXPERIMENTAL] Tax included in prices of shipping option + * Tax included in prices of shipping option */ includes_tax?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostShippingOptionsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostShippingOptionsReq.ts index 7c0820e127..3732f64450 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostShippingOptionsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostShippingOptionsReq.ts @@ -25,11 +25,11 @@ export interface AdminPostShippingOptionsReq { */ data: Record /** - * The type of the Shipping Option price. + * The type of the Shipping Option price. `flat_rate` indicates fixed pricing, whereas `calculated` indicates that the price will be calculated each time by the fulfillment provider. */ price_type: "flat_rate" | "calculated" /** - * The amount to charge for the Shipping Option. + * The amount to charge for the Shipping Option. If the `price_type` is set to `calculated`, this amount will not actually be used. */ amount?: number /** @@ -46,11 +46,11 @@ export interface AdminPostShippingOptionsReq { amount: number }> /** - * Whether the Shipping Option defines a return shipment. + * Whether the Shipping Option can be used for returns or during checkout. */ is_return?: boolean /** - * If true, the option can be used for draft orders + * If set to `true`, the shipping option can only be used when creating draft orders. */ admin_only?: boolean /** @@ -58,7 +58,7 @@ export interface AdminPostShippingOptionsReq { */ metadata?: Record /** - * [EXPERIMENTAL] Tax included in prices of shipping option + * Tax included in prices of shipping option */ includes_tax?: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPostShippingProfilesProfileReq.ts b/packages/generated/client-types/src/lib/models/AdminPostShippingProfilesProfileReq.ts index b62599af6e..f735a73794 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostShippingProfilesProfileReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostShippingProfilesProfileReq.ts @@ -17,11 +17,11 @@ export interface AdminPostShippingProfilesProfileReq { */ type?: "default" | "gift_card" | "custom" /** - * An optional array of product ids to associate with the Shipping Profile + * product IDs to associate with the Shipping Profile */ products?: any[] /** - * An optional array of shipping option ids to associate with the Shipping Profile + * Shipping option IDs to associate with the Shipping Profile */ shipping_options?: any[] } diff --git a/packages/generated/client-types/src/lib/models/AdminPostStockLocationsReq.ts b/packages/generated/client-types/src/lib/models/AdminPostStockLocationsReq.ts index 69fb25caa6..27d68aa3d6 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostStockLocationsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostStockLocationsReq.ts @@ -11,12 +11,15 @@ export interface AdminPostStockLocationsReq { */ name: string /** - * the stock location address ID + * the ID of an existing stock location address to associate with the stock location. Only required if `address` is not provided. */ address_id?: string /** * An optional key-value map with additional details */ metadata?: Record + /** + * A new stock location address to create and associate with the stock location. Only required if `address_id` is not provided. + */ address?: StockLocationAddressInput } diff --git a/packages/generated/client-types/src/lib/models/AdminPostStockLocationsReqAddress.ts b/packages/generated/client-types/src/lib/models/AdminPostStockLocationsReqAddress.ts new file mode 100644 index 0000000000..aa811a9a1d --- /dev/null +++ b/packages/generated/client-types/src/lib/models/AdminPostStockLocationsReqAddress.ts @@ -0,0 +1,39 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import { SetRelation, Merge } from "../core/ModelUtils" + +export interface AdminPostStockLocationsReqAddress { + /** + * Stock location address + */ + address_1: string + /** + * Stock location address' complement + */ + address_2?: string + /** + * Stock location address' company + */ + company?: string + /** + * Stock location address' city + */ + city?: string + /** + * The 2 character ISO code for the country. + */ + country_code: string + /** + * Stock location address' phone number + */ + phone?: string + /** + * Stock location address' postal code + */ + postal_code?: string + /** + * Stock location address' province + */ + province?: string +} diff --git a/packages/generated/client-types/src/lib/models/AdminPostStoreReq.ts b/packages/generated/client-types/src/lib/models/AdminPostStoreReq.ts index 5dac1fd606..2defa77d97 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostStoreReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostStoreReq.ts @@ -9,11 +9,11 @@ export interface AdminPostStoreReq { */ name?: string /** - * A template for Swap links - use `{{cart_id}}` to insert the Swap Cart id + * A template for Swap links - use `{{cart_id}}` to insert the Swap Cart ID */ swap_link_template?: string /** - * A template for payment links links - use `{{cart_id}}` to insert the Cart id + * A template for payment links - use `{{cart_id}}` to insert the Cart ID */ payment_link_template?: string /** @@ -21,11 +21,11 @@ export interface AdminPostStoreReq { */ invite_link_template?: string /** - * The default currency code for the Store. + * The default currency code of the Store. */ default_currency_code?: string /** - * Array of currencies in 2 character ISO code format. + * Array of available currencies in the store. Each currency is in 3 character ISO code format. */ currencies?: Array /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesParams.ts b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesParams.ts index 17609cb1a3..fa05e26829 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostTaxRatesParams { /** - * Which fields should be included in the result. + * Comma-separated fields that should be included in the returned tax rate. */ fields?: Array /** - * Which fields should be expanded and retrieved in the result. + * Comma-separated relations that should be expanded in the returned tax rate. */ expand?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesReq.ts b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesReq.ts index 154e5e0a63..c9234e0746 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesReq.ts @@ -5,23 +5,23 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostTaxRatesReq { /** - * A code to identify the tax type by + * The code of the tax rate. */ code: string /** - * A human friendly name for the tax + * The name of the tax rate. */ name: string /** - * The ID of the Region that the rate belongs to + * The ID of the Region that the tax rate belongs to. */ region_id: string /** - * The numeric rate to charge + * The numeric rate to charge. */ rate?: number /** - * The IDs of the products associated with this tax rate + * The IDs of the products associated with this tax rate. */ products?: Array /** diff --git a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateParams.ts b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateParams.ts index 74ebc917a4..803380a99f 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostTaxRatesTaxRateParams { /** - * Which fields should be included in the result. + * Comma-separated fields that should be included in the returned tax rate. */ fields?: Array /** - * Which fields should be expanded and retrieved in the result. + * Comma-separated relations that should be expanded in the returned tax rate. */ expand?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateProductTypesParams.ts b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateProductTypesParams.ts index a5b959baa5..935ea8c109 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateProductTypesParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateProductTypesParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostTaxRatesTaxRateProductTypesParams { /** - * Which fields should be included in the result. + * Comma-separated fields that should be included in the returned tax rate. */ fields?: Array /** - * Which fields should be expanded and retrieved in the result. + * Comma-separated relations that should be expanded in the returned tax rate. */ expand?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateProductsParams.ts b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateProductsParams.ts index 5eab00e425..aab9ac4131 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateProductsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateProductsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostTaxRatesTaxRateProductsParams { /** - * Which fields should be included in the result. + * Comma-separated fields that should be included in the returned tax rate. */ fields?: Array /** - * Which fields should be expanded and retrieved in the result. + * Comma-separated relations that should be expanded in the returned tax rate. */ expand?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateReq.ts b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateReq.ts index 5eb163b0ef..c7e22cb8c5 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateReq.ts @@ -5,19 +5,19 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostTaxRatesTaxRateReq { /** - * A code to identify the tax type by + * The code of the tax rate. */ code?: string /** - * A human friendly name for the tax + * The name of the tax rate. */ name?: string /** - * The ID of the Region that the rate belongs to + * The ID of the Region that the tax rate belongs to. */ region_id?: string /** - * The numeric rate to charge + * The numeric rate to charge. */ rate?: number /** @@ -29,7 +29,7 @@ export interface AdminPostTaxRatesTaxRateReq { */ shipping_options?: Array /** - * The IDs of the types of products associated with this tax rate + * The IDs of the types of product types associated with this tax rate */ product_types?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateShippingOptionsParams.ts b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateShippingOptionsParams.ts index 871965abca..5435785324 100644 --- a/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateShippingOptionsParams.ts +++ b/packages/generated/client-types/src/lib/models/AdminPostTaxRatesTaxRateShippingOptionsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPostTaxRatesTaxRateShippingOptionsParams { /** - * Which fields should be included in the result. + * Comma-separated fields that should be included in the returned tax rate. */ fields?: Array /** - * Which fields should be expanded and retrieved in the result. + * Comma-separated relations that should be expanded in the returned tax rate. */ expand?: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPriceListDeleteBatchRes.ts b/packages/generated/client-types/src/lib/models/AdminPriceListDeleteBatchRes.ts index 7811a92a83..9db449fa2c 100644 --- a/packages/generated/client-types/src/lib/models/AdminPriceListDeleteBatchRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPriceListDeleteBatchRes.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPriceListDeleteBatchRes { ids: Array /** - * The type of the object that was deleted. + * The type of the object that was deleted. A price is also named `money-amount`. */ object: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPriceListDeleteProductPricesRes.ts b/packages/generated/client-types/src/lib/models/AdminPriceListDeleteProductPricesRes.ts index 22ebe740ec..2549a47111 100644 --- a/packages/generated/client-types/src/lib/models/AdminPriceListDeleteProductPricesRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPriceListDeleteProductPricesRes.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPriceListDeleteProductPricesRes { /** - * The price ids that have been deleted. + * The IDs of the deleted prices. */ ids: Array /** - * The type of the object that was deleted. + * The type of the object that was deleted. A price is also named `money-amount`. */ object: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPriceListDeleteVariantPricesRes.ts b/packages/generated/client-types/src/lib/models/AdminPriceListDeleteVariantPricesRes.ts index 6791e4c243..f6d6715f66 100644 --- a/packages/generated/client-types/src/lib/models/AdminPriceListDeleteVariantPricesRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPriceListDeleteVariantPricesRes.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPriceListDeleteVariantPricesRes { /** - * The price ids that have been deleted. + * The IDs of the deleted prices. */ ids: Array /** - * The type of the object that was deleted. + * The type of the object that was deleted. A price is also named `money-amount`. */ object: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminPriceListRes.ts b/packages/generated/client-types/src/lib/models/AdminPriceListRes.ts index 9a6f9d5176..09c926e5f6 100644 --- a/packages/generated/client-types/src/lib/models/AdminPriceListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPriceListRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PriceList } from "./PriceList" export interface AdminPriceListRes { + /** + * Price List details. + */ price_list: SetRelation } diff --git a/packages/generated/client-types/src/lib/models/AdminPriceListsListRes.ts b/packages/generated/client-types/src/lib/models/AdminPriceListsListRes.ts index e016dbf66e..b7302073c4 100644 --- a/packages/generated/client-types/src/lib/models/AdminPriceListsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPriceListsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PriceList } from "./PriceList" export interface AdminPriceListsListRes { + /** + * An array of price lists details. + */ price_lists: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of price lists skipped when retrieving the price lists. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminPriceListsProductsListRes.ts b/packages/generated/client-types/src/lib/models/AdminPriceListsProductsListRes.ts index 9008f06b3b..091f67a9c2 100644 --- a/packages/generated/client-types/src/lib/models/AdminPriceListsProductsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPriceListsProductsListRes.ts @@ -7,6 +7,9 @@ import type { Product } from "./Product" import type { ProductVariant } from "./ProductVariant" export interface AdminPriceListsProductsListRes { + /** + * An array of products details. + */ products: Array< Merge< SetRelation< @@ -29,7 +32,7 @@ export interface AdminPriceListsProductsListRes { */ count: number /** - * The number of items skipped before these items + * The number of price lists skipped when retrieving the price lists. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminProductCategoriesCategoryRes.ts b/packages/generated/client-types/src/lib/models/AdminProductCategoriesCategoryRes.ts index 68eefd2adb..0a4de72a53 100644 --- a/packages/generated/client-types/src/lib/models/AdminProductCategoriesCategoryRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminProductCategoriesCategoryRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductCategory } from "./ProductCategory" export interface AdminProductCategoriesCategoryRes { + /** + * Product category details. + */ product_category: SetRelation< ProductCategory, "category_children" | "parent_category" diff --git a/packages/generated/client-types/src/lib/models/AdminProductCategoriesListRes.ts b/packages/generated/client-types/src/lib/models/AdminProductCategoriesListRes.ts index fb7e2055f9..f3c23dbc90 100644 --- a/packages/generated/client-types/src/lib/models/AdminProductCategoriesListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminProductCategoriesListRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductCategory } from "./ProductCategory" export interface AdminProductCategoriesListRes { + /** + * An array of product category details. + */ product_categories: Array< SetRelation > @@ -14,7 +17,7 @@ export interface AdminProductCategoriesListRes { */ count: number /** - * The number of items skipped before these items + * The number of product categories skipped when retrieving the product categories. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminProductTagsListRes.ts b/packages/generated/client-types/src/lib/models/AdminProductTagsListRes.ts index 6d12dfb585..44f13e066d 100644 --- a/packages/generated/client-types/src/lib/models/AdminProductTagsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminProductTagsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductTag } from "./ProductTag" export interface AdminProductTagsListRes { + /** + * An array of product tag details. + */ product_tags: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of product tags skipped when retrieving the product tags. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminProductTypesListRes.ts b/packages/generated/client-types/src/lib/models/AdminProductTypesListRes.ts index 84e91c46eb..a93ac137a4 100644 --- a/packages/generated/client-types/src/lib/models/AdminProductTypesListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminProductTypesListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductType } from "./ProductType" export interface AdminProductTypesListRes { + /** + * An array of product types details. + */ product_types: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of product types skipped when retrieving the product types. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminProductsDeleteOptionRes.ts b/packages/generated/client-types/src/lib/models/AdminProductsDeleteOptionRes.ts index 85c9c3ab81..cef61c03a2 100644 --- a/packages/generated/client-types/src/lib/models/AdminProductsDeleteOptionRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminProductsDeleteOptionRes.ts @@ -19,6 +19,9 @@ export interface AdminProductsDeleteOptionRes { * Whether or not the items were deleted. */ deleted: boolean + /** + * Product details. + */ product: Merge< SetRelation< PricedProduct, diff --git a/packages/generated/client-types/src/lib/models/AdminProductsDeleteVariantRes.ts b/packages/generated/client-types/src/lib/models/AdminProductsDeleteVariantRes.ts index 4bc42f01cb..2cc095fb1c 100644 --- a/packages/generated/client-types/src/lib/models/AdminProductsDeleteVariantRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminProductsDeleteVariantRes.ts @@ -19,6 +19,9 @@ export interface AdminProductsDeleteVariantRes { * Whether or not the items were deleted. */ deleted: boolean + /** + * Product details. + */ product: Merge< SetRelation< PricedProduct, diff --git a/packages/generated/client-types/src/lib/models/AdminProductsListRes.ts b/packages/generated/client-types/src/lib/models/AdminProductsListRes.ts index 25602e690b..4757967b88 100644 --- a/packages/generated/client-types/src/lib/models/AdminProductsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminProductsListRes.ts @@ -7,6 +7,9 @@ import type { PricedProduct } from "./PricedProduct" import type { ProductVariant } from "./ProductVariant" export interface AdminProductsListRes { + /** + * An array of products details. + */ products: Array< Merge< SetRelation< @@ -25,7 +28,7 @@ export interface AdminProductsListRes { */ count: number /** - * The number of items skipped before these items + * The number of products skipped when retrieving the products. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminProductsListTagsRes.ts b/packages/generated/client-types/src/lib/models/AdminProductsListTagsRes.ts index 2bee9cc7a3..c009eebc8e 100644 --- a/packages/generated/client-types/src/lib/models/AdminProductsListTagsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminProductsListTagsRes.ts @@ -4,6 +4,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminProductsListTagsRes { + /** + * An array of product tags details. + */ tags: Array<{ /** * The ID of the tag. diff --git a/packages/generated/client-types/src/lib/models/AdminProductsListTypesRes.ts b/packages/generated/client-types/src/lib/models/AdminProductsListTypesRes.ts index fd182fce98..f755281b97 100644 --- a/packages/generated/client-types/src/lib/models/AdminProductsListTypesRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminProductsListTypesRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductType } from "./ProductType" export interface AdminProductsListTypesRes { + /** + * An array of product types details. + */ types: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminProductsListVariantsRes.ts b/packages/generated/client-types/src/lib/models/AdminProductsListVariantsRes.ts index b4d8646f69..b6d86fb593 100644 --- a/packages/generated/client-types/src/lib/models/AdminProductsListVariantsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminProductsListVariantsRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductVariant } from "./ProductVariant" export interface AdminProductsListVariantsRes { + /** + * An array of product variants details. + */ variants: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of product variants skipped when retrieving the product variants. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminProductsRes.ts b/packages/generated/client-types/src/lib/models/AdminProductsRes.ts index c98cac915d..272d837ff3 100644 --- a/packages/generated/client-types/src/lib/models/AdminProductsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminProductsRes.ts @@ -7,6 +7,9 @@ import type { PricedProduct } from "./PricedProduct" import type { ProductVariant } from "./ProductVariant" export interface AdminProductsRes { + /** + * Product details. + */ product: Merge< SetRelation< PricedProduct, diff --git a/packages/generated/client-types/src/lib/models/AdminPublishableApiKeyDeleteRes.ts b/packages/generated/client-types/src/lib/models/AdminPublishableApiKeyDeleteRes.ts index 02f0b2b5fe..6d8f6257df 100644 --- a/packages/generated/client-types/src/lib/models/AdminPublishableApiKeyDeleteRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPublishableApiKeyDeleteRes.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminPublishableApiKeyDeleteRes { /** - * The ID of the deleted PublishableApiKey. + * The ID of the deleted publishable API key. */ id: string /** @@ -13,7 +13,7 @@ export interface AdminPublishableApiKeyDeleteRes { */ object: string /** - * Whether the PublishableApiKeys was deleted. + * Whether the publishable API key was deleted. */ deleted: boolean } diff --git a/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysListRes.ts b/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysListRes.ts index e27602698e..ff1a800a37 100644 --- a/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PublishableApiKey } from "./PublishableApiKey" export interface AdminPublishableApiKeysListRes { + /** + * An array of publishable API keys details. + */ publishable_api_keys: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of publishable API keys skipped when retrieving the publishable API keys. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysListSalesChannelsRes.ts b/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysListSalesChannelsRes.ts index 6dcd379dc7..e279e53042 100644 --- a/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysListSalesChannelsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysListSalesChannelsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { SalesChannel } from "./SalesChannel" export interface AdminPublishableApiKeysListSalesChannelsRes { + /** + * An array of sales channels details. + */ sales_channels: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysRes.ts b/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysRes.ts index 78f6662b0e..42170e7911 100644 --- a/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminPublishableApiKeysRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PublishableApiKey } from "./PublishableApiKey" export interface AdminPublishableApiKeysRes { + /** + * Publishable API key details. + */ publishable_api_key: PublishableApiKey } diff --git a/packages/generated/client-types/src/lib/models/AdminRefundRes.ts b/packages/generated/client-types/src/lib/models/AdminRefundRes.ts index b643a32884..4028ea04b8 100644 --- a/packages/generated/client-types/src/lib/models/AdminRefundRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminRefundRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Refund } from "./Refund" export interface AdminRefundRes { + /** + * Refund details + */ refund: Refund } diff --git a/packages/generated/client-types/src/lib/models/AdminRegionsListRes.ts b/packages/generated/client-types/src/lib/models/AdminRegionsListRes.ts index 2d64a10313..bac8373004 100644 --- a/packages/generated/client-types/src/lib/models/AdminRegionsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminRegionsListRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Region } from "./Region" export interface AdminRegionsListRes { + /** + * An array of regions details. + */ regions: Array< SetRelation< Region, @@ -17,7 +20,7 @@ export interface AdminRegionsListRes { */ count: number /** - * The number of items skipped before these items + * The number of regions skipped when retrieving the regions. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminRegionsRes.ts b/packages/generated/client-types/src/lib/models/AdminRegionsRes.ts index a8a0a61974..7c40be80cf 100644 --- a/packages/generated/client-types/src/lib/models/AdminRegionsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminRegionsRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Region } from "./Region" export interface AdminRegionsRes { + /** + * Region details. + */ region: SetRelation< Region, "countries" | "fulfillment_providers" | "payment_providers" diff --git a/packages/generated/client-types/src/lib/models/AdminReservationsListRes.ts b/packages/generated/client-types/src/lib/models/AdminReservationsListRes.ts index 3b3ff52777..d386c42bab 100644 --- a/packages/generated/client-types/src/lib/models/AdminReservationsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminReservationsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ExtendedReservationItem } from "./ExtendedReservationItem" export interface AdminReservationsListRes { + /** + * An array of reservations details. + */ reservations: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of reservations skipped when retrieving the reservations. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminReservationsRes.ts b/packages/generated/client-types/src/lib/models/AdminReservationsRes.ts index b06581aed7..641d721663 100644 --- a/packages/generated/client-types/src/lib/models/AdminReservationsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminReservationsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ReservationItemDTO } from "./ReservationItemDTO" export interface AdminReservationsRes { + /** + * Reservation details. + */ reservation: ReservationItemDTO } diff --git a/packages/generated/client-types/src/lib/models/AdminResetPasswordRequest.ts b/packages/generated/client-types/src/lib/models/AdminResetPasswordRequest.ts index fcdbdf44de..b4109024b9 100644 --- a/packages/generated/client-types/src/lib/models/AdminResetPasswordRequest.ts +++ b/packages/generated/client-types/src/lib/models/AdminResetPasswordRequest.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminResetPasswordRequest { /** - * The Users email. + * The User's email. */ email?: string /** - * The token generated from the 'password-token' endpoint. + * The password-reset token generated when the password reset was requested. */ token: string /** - * The Users new password. + * The User's new password. */ password: string } diff --git a/packages/generated/client-types/src/lib/models/AdminResetPasswordTokenRequest.ts b/packages/generated/client-types/src/lib/models/AdminResetPasswordTokenRequest.ts index 1555b3ae9c..fa0133e47c 100644 --- a/packages/generated/client-types/src/lib/models/AdminResetPasswordTokenRequest.ts +++ b/packages/generated/client-types/src/lib/models/AdminResetPasswordTokenRequest.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminResetPasswordTokenRequest { /** - * The Users email. + * The User's email. */ email: string } diff --git a/packages/generated/client-types/src/lib/models/AdminReturnsCancelRes.ts b/packages/generated/client-types/src/lib/models/AdminReturnsCancelRes.ts index f634eec7bc..be3adcbd9b 100644 --- a/packages/generated/client-types/src/lib/models/AdminReturnsCancelRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminReturnsCancelRes.ts @@ -15,6 +15,9 @@ import type { ShippingMethod } from "./ShippingMethod" import type { Swap } from "./Swap" export interface AdminReturnsCancelRes { + /** + * Order details. + */ order: Merge< SetRelation< Order, diff --git a/packages/generated/client-types/src/lib/models/AdminReturnsListRes.ts b/packages/generated/client-types/src/lib/models/AdminReturnsListRes.ts index c4ff9c03b9..ef46aed547 100644 --- a/packages/generated/client-types/src/lib/models/AdminReturnsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminReturnsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Return } from "./Return" export interface AdminReturnsListRes { + /** + * An array of returns details. + */ returns: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of returns skipped when retrieving the returns. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminReturnsRes.ts b/packages/generated/client-types/src/lib/models/AdminReturnsRes.ts index 22d7ec3fb1..bba79e52ca 100644 --- a/packages/generated/client-types/src/lib/models/AdminReturnsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminReturnsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Return } from "./Return" export interface AdminReturnsRes { + /** + * Return details. + */ return: Return } diff --git a/packages/generated/client-types/src/lib/models/AdminSalesChannelsListRes.ts b/packages/generated/client-types/src/lib/models/AdminSalesChannelsListRes.ts index b989cc84bd..79a35f744f 100644 --- a/packages/generated/client-types/src/lib/models/AdminSalesChannelsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminSalesChannelsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { SalesChannel } from "./SalesChannel" export interface AdminSalesChannelsListRes { + /** + * An array of sales channels details. + */ sales_channels: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of items skipped before the returned results */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminSalesChannelsRes.ts b/packages/generated/client-types/src/lib/models/AdminSalesChannelsRes.ts index c89fb5f52b..d823bfb037 100644 --- a/packages/generated/client-types/src/lib/models/AdminSalesChannelsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminSalesChannelsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { SalesChannel } from "./SalesChannel" export interface AdminSalesChannelsRes { + /** + * Sales Channel's details. + */ sales_channel: SalesChannel } diff --git a/packages/generated/client-types/src/lib/models/AdminShippingOptionsListRes.ts b/packages/generated/client-types/src/lib/models/AdminShippingOptionsListRes.ts index 4ed29401dc..221b08f07f 100644 --- a/packages/generated/client-types/src/lib/models/AdminShippingOptionsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminShippingOptionsListRes.ts @@ -7,6 +7,9 @@ import type { Region } from "./Region" import type { ShippingOption } from "./ShippingOption" export interface AdminShippingOptionsListRes { + /** + * An array of shipping options details. + */ shipping_options: Array< Merge< SetRelation, @@ -23,7 +26,7 @@ export interface AdminShippingOptionsListRes { */ count: number /** - * The number of items skipped before these items + * The number of shipping options skipped when retrieving the shipping options. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminShippingOptionsRes.ts b/packages/generated/client-types/src/lib/models/AdminShippingOptionsRes.ts index 9613dda08d..410d619dda 100644 --- a/packages/generated/client-types/src/lib/models/AdminShippingOptionsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminShippingOptionsRes.ts @@ -7,6 +7,9 @@ import type { Region } from "./Region" import type { ShippingOption } from "./ShippingOption" export interface AdminShippingOptionsRes { + /** + * Shipping option details. + */ shipping_option: Merge< SetRelation, { diff --git a/packages/generated/client-types/src/lib/models/AdminShippingProfilesListRes.ts b/packages/generated/client-types/src/lib/models/AdminShippingProfilesListRes.ts index 09c5416d4f..51f85653ba 100644 --- a/packages/generated/client-types/src/lib/models/AdminShippingProfilesListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminShippingProfilesListRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ShippingProfile } from "./ShippingProfile" export interface AdminShippingProfilesListRes { + /** + * An array of shipping profiles details. + */ shipping_profiles: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminShippingProfilesRes.ts b/packages/generated/client-types/src/lib/models/AdminShippingProfilesRes.ts index 0844d0e775..f3e44ad469 100644 --- a/packages/generated/client-types/src/lib/models/AdminShippingProfilesRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminShippingProfilesRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ShippingProfile } from "./ShippingProfile" export interface AdminShippingProfilesRes { + /** + * Shipping profile details. + */ shipping_profile: SetRelation< ShippingProfile, "products" | "shipping_options" diff --git a/packages/generated/client-types/src/lib/models/AdminStockLocationsListRes.ts b/packages/generated/client-types/src/lib/models/AdminStockLocationsListRes.ts index 79293f758f..c39ffdb49e 100644 --- a/packages/generated/client-types/src/lib/models/AdminStockLocationsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminStockLocationsListRes.ts @@ -12,7 +12,7 @@ export interface AdminStockLocationsListRes { */ count: number /** - * The number of items skipped before these items + * The number of stock locations skipped when retrieving the stock locations. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminStockLocationsRes.ts b/packages/generated/client-types/src/lib/models/AdminStockLocationsRes.ts index aecc99b29e..3d5e311375 100644 --- a/packages/generated/client-types/src/lib/models/AdminStockLocationsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminStockLocationsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { StockLocationExpandedDTO } from "./StockLocationExpandedDTO" export interface AdminStockLocationsRes { + /** + * Stock location details. + */ stock_location: StockLocationExpandedDTO } diff --git a/packages/generated/client-types/src/lib/models/AdminStoresRes.ts b/packages/generated/client-types/src/lib/models/AdminStoresRes.ts index c4b33013a5..8c95953131 100644 --- a/packages/generated/client-types/src/lib/models/AdminStoresRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminStoresRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Store } from "./Store" export interface AdminStoresRes { + /** + * Store details. + */ store: Store } diff --git a/packages/generated/client-types/src/lib/models/AdminSwapsListRes.ts b/packages/generated/client-types/src/lib/models/AdminSwapsListRes.ts index cd9e0ccac5..4baaf5005c 100644 --- a/packages/generated/client-types/src/lib/models/AdminSwapsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminSwapsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Swap } from "./Swap" export interface AdminSwapsListRes { + /** + * An array of swaps details. + */ swaps: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of swaps skipped when retrieving the swaps. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminSwapsRes.ts b/packages/generated/client-types/src/lib/models/AdminSwapsRes.ts index 24731dc765..1bc5212477 100644 --- a/packages/generated/client-types/src/lib/models/AdminSwapsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminSwapsRes.ts @@ -10,6 +10,9 @@ import type { ShippingMethod } from "./ShippingMethod" import type { Swap } from "./Swap" export interface AdminSwapsRes { + /** + * Swap details. + */ swap: Merge< SetRelation< Swap, diff --git a/packages/generated/client-types/src/lib/models/AdminTaxProvidersList.ts b/packages/generated/client-types/src/lib/models/AdminTaxProvidersList.ts index ef0a471749..357b2db8b5 100644 --- a/packages/generated/client-types/src/lib/models/AdminTaxProvidersList.ts +++ b/packages/generated/client-types/src/lib/models/AdminTaxProvidersList.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { TaxProvider } from "./TaxProvider" export interface AdminTaxProvidersList { + /** + * An array of tax providers details. + */ tax_providers: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminTaxRatesListRes.ts b/packages/generated/client-types/src/lib/models/AdminTaxRatesListRes.ts index 8d84df91a2..520eb90159 100644 --- a/packages/generated/client-types/src/lib/models/AdminTaxRatesListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminTaxRatesListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { TaxRate } from "./TaxRate" export interface AdminTaxRatesListRes { + /** + * An array of tax rate details. + */ tax_rates: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of tax rates to skip when retrieving the tax rates. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminTaxRatesRes.ts b/packages/generated/client-types/src/lib/models/AdminTaxRatesRes.ts index 83b4743bfe..069bb0e29a 100644 --- a/packages/generated/client-types/src/lib/models/AdminTaxRatesRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminTaxRatesRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { TaxRate } from "./TaxRate" export interface AdminTaxRatesRes { + /** + * Tax rate details. + */ tax_rate: TaxRate } diff --git a/packages/generated/client-types/src/lib/models/AdminUpdatePaymentCollectionsReq.ts b/packages/generated/client-types/src/lib/models/AdminUpdatePaymentCollectionsReq.ts index c07f844099..a4bf4d3a7f 100644 --- a/packages/generated/client-types/src/lib/models/AdminUpdatePaymentCollectionsReq.ts +++ b/packages/generated/client-types/src/lib/models/AdminUpdatePaymentCollectionsReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminUpdatePaymentCollectionsReq { /** - * An optional description to create or update the payment collection. + * A description to create or update the payment collection. */ description?: string /** - * An optional set of key-value pairs to hold additional information. + * A set of key-value pairs to hold additional information. */ metadata?: Record } diff --git a/packages/generated/client-types/src/lib/models/AdminUpdateUserRequest.ts b/packages/generated/client-types/src/lib/models/AdminUpdateUserRequest.ts index 021aaff98f..0956ac2b50 100644 --- a/packages/generated/client-types/src/lib/models/AdminUpdateUserRequest.ts +++ b/packages/generated/client-types/src/lib/models/AdminUpdateUserRequest.ts @@ -5,19 +5,19 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminUpdateUserRequest { /** - * The name of the User. + * The first name of the User. */ first_name?: string /** - * The name of the User. + * The last name of the User. */ last_name?: string /** - * Userrole assigned to the user. + * The role assigned to the user. These roles don't provide any different privileges. */ role?: "admin" | "member" | "developer" /** - * The api token of the User. + * The API token of the User. */ api_token?: string /** diff --git a/packages/generated/client-types/src/lib/models/AdminUploadsRes.ts b/packages/generated/client-types/src/lib/models/AdminUploadsRes.ts index eefe6299c8..02e2392d07 100644 --- a/packages/generated/client-types/src/lib/models/AdminUploadsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminUploadsRes.ts @@ -4,6 +4,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminUploadsRes { + /** + * Uploaded files details. + */ uploads: Array<{ /** * The URL of the uploaded file. diff --git a/packages/generated/client-types/src/lib/models/AdminUserRes.ts b/packages/generated/client-types/src/lib/models/AdminUserRes.ts index 6008b95bdc..f9427aa223 100644 --- a/packages/generated/client-types/src/lib/models/AdminUserRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminUserRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { User } from "./User" export interface AdminUserRes { + /** + * User details. + */ user: User } diff --git a/packages/generated/client-types/src/lib/models/AdminUsersListRes.ts b/packages/generated/client-types/src/lib/models/AdminUsersListRes.ts index f1133fb232..07376ce6dc 100644 --- a/packages/generated/client-types/src/lib/models/AdminUsersListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminUsersListRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { User } from "./User" export interface AdminUsersListRes { + /** + * An array of users details. + */ users: Array } diff --git a/packages/generated/client-types/src/lib/models/AdminVariantsListRes.ts b/packages/generated/client-types/src/lib/models/AdminVariantsListRes.ts index 791be5604f..957f9f5827 100644 --- a/packages/generated/client-types/src/lib/models/AdminVariantsListRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminVariantsListRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PricedVariant } from "./PricedVariant" export interface AdminVariantsListRes { + /** + * An array of product variant details. + */ variants: Array< SetRelation > @@ -14,7 +17,7 @@ export interface AdminVariantsListRes { */ count: number /** - * The number of items skipped before these items + * The number of product variants skipped when retrieving the product variants. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/AdminVariantsRes.ts b/packages/generated/client-types/src/lib/models/AdminVariantsRes.ts index 5e506f4a72..b75cd79441 100644 --- a/packages/generated/client-types/src/lib/models/AdminVariantsRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminVariantsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PricedVariant } from "./PricedVariant" export interface AdminVariantsRes { + /** + * Product variant's details. + */ variant: SetRelation } diff --git a/packages/generated/client-types/src/lib/models/BatchJob.ts b/packages/generated/client-types/src/lib/models/BatchJob.ts index f0b5573b67..1119b4a64e 100644 --- a/packages/generated/client-types/src/lib/models/BatchJob.ts +++ b/packages/generated/client-types/src/lib/models/BatchJob.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { User } from "./User" /** - * A Batch Job. + * A Batch Job indicates an asynchronus task stored in the Medusa backend. Its status determines whether it has been executed or not. */ export interface BatchJob { /** @@ -33,7 +33,7 @@ export interface BatchJob { */ created_by: string | null /** - * A user object. Available if the relation `created_by_user` is expanded. + * The details of the user that created the batch job. */ created_by_user?: User | null /** diff --git a/packages/generated/client-types/src/lib/models/Cart.ts b/packages/generated/client-types/src/lib/models/Cart.ts index 9e0b0f657e..a158634c11 100644 --- a/packages/generated/client-types/src/lib/models/Cart.ts +++ b/packages/generated/client-types/src/lib/models/Cart.ts @@ -15,7 +15,7 @@ import type { SalesChannel } from "./SalesChannel" import type { ShippingMethod } from "./ShippingMethod" /** - * Represents a user cart + * A cart represents a virtual shopping bag. It can be used to complete an order, a swap, or a claim. */ export interface Cart { /** @@ -31,7 +31,7 @@ export interface Cart { */ billing_address_id: string | null /** - * Available if the relation `billing_address` is expanded. + * The details of the billing address associated with the cart. */ billing_address?: Address | null /** @@ -39,11 +39,11 @@ export interface Cart { */ shipping_address_id: string | null /** - * Available if the relation `shipping_address` is expanded. + * The details of the shipping address associated with the cart. */ shipping_address?: Address | null /** - * Available if the relation `items` is expanded. + * The line items added to the cart. */ items?: Array /** @@ -51,15 +51,15 @@ export interface Cart { */ region_id: string /** - * A region object. Available if the relation `region` is expanded. + * The details of the region associated with the cart. */ region?: Region | null /** - * Available if the relation `discounts` is expanded. + * An array of details of all discounts applied to the cart. */ discounts?: Array /** - * Available if the relation `gift_cards` is expanded. + * An array of details of all gift cards applied to the cart. */ gift_cards?: Array /** @@ -67,15 +67,15 @@ export interface Cart { */ customer_id: string | null /** - * A customer object. Available if the relation `customer` is expanded. + * The details of the customer the cart belongs to. */ customer?: Customer | null /** - * The selected payment session in the cart. + * The details of the selected payment session in the cart. */ payment_session: PaymentSession | null /** - * The payment sessions created on the cart. + * The details of all payment sessions created on the cart. */ payment_sessions?: Array /** @@ -83,11 +83,11 @@ export interface Cart { */ payment_id: string | null /** - * Available if the relation `payment` is expanded. + * The details of the payment associated with the cart. */ payment?: Payment | null /** - * The shipping methods added to the cart. + * The details of the shipping methods added to the cart. */ shipping_methods?: Array /** @@ -115,7 +115,7 @@ export interface Cart { */ sales_channel_id?: string | null /** - * A sales channel object. Available if the relation `sales_channel` is expanded. + * The details of the sales channel associated with the cart. */ sales_channel?: SalesChannel | null /** diff --git a/packages/generated/client-types/src/lib/models/ClaimImage.ts b/packages/generated/client-types/src/lib/models/ClaimImage.ts index 196c4cf4a5..7d9bf3da77 100644 --- a/packages/generated/client-types/src/lib/models/ClaimImage.ts +++ b/packages/generated/client-types/src/lib/models/ClaimImage.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ClaimItem } from "./ClaimItem" /** - * Represents photo documentation of a claim. + * The details of an image attached to a claim. */ export interface ClaimImage { /** @@ -18,7 +18,7 @@ export interface ClaimImage { */ claim_item_id: string /** - * A claim item object. Available if the relation `claim_item` is expanded. + * The details of the claim item this image is associated with. */ claim_item?: ClaimItem | null /** diff --git a/packages/generated/client-types/src/lib/models/ClaimItem.ts b/packages/generated/client-types/src/lib/models/ClaimItem.ts index af9c01d0b5..1216b12597 100644 --- a/packages/generated/client-types/src/lib/models/ClaimItem.ts +++ b/packages/generated/client-types/src/lib/models/ClaimItem.ts @@ -10,7 +10,7 @@ import type { LineItem } from "./LineItem" import type { ProductVariant } from "./ProductVariant" /** - * Represents a claimed item along with information about the reasons for the claim. + * A claim item is an item created as part of a claim. It references an item in the order that should be exchanged or refunded. */ export interface ClaimItem { /** @@ -18,7 +18,7 @@ export interface ClaimItem { */ id: string /** - * Available if the relation `images` is expanded. + * The claim images that are attached to the claim item. */ images?: Array /** @@ -26,7 +26,7 @@ export interface ClaimItem { */ claim_order_id: string /** - * A claim order object. Available if the relation `claim_order` is expanded. + * The details of the claim this item belongs to. */ claim_order?: ClaimOrder | null /** @@ -34,7 +34,7 @@ export interface ClaimItem { */ item_id: string /** - * Available if the relation `item` is expanded. + * The details of the line item in the original order that this claim item refers to. */ item?: LineItem | null /** @@ -42,7 +42,7 @@ export interface ClaimItem { */ variant_id: string /** - * A variant object. Available if the relation `variant` is expanded. + * The details of the product variant to potentially replace the item in the original order. */ variant?: ProductVariant | null /** @@ -58,7 +58,7 @@ export interface ClaimItem { */ quantity: number /** - * User defined tags for easy filtering and grouping. Available if the relation 'tags' is expanded. + * User defined tags for easy filtering and grouping. */ tags?: Array /** diff --git a/packages/generated/client-types/src/lib/models/ClaimOrder.ts b/packages/generated/client-types/src/lib/models/ClaimOrder.ts index a84a58a6cf..ae13d6d87c 100644 --- a/packages/generated/client-types/src/lib/models/ClaimOrder.ts +++ b/packages/generated/client-types/src/lib/models/ClaimOrder.ts @@ -12,7 +12,7 @@ import type { Return } from "./Return" import type { ShippingMethod } from "./ShippingMethod" /** - * 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. + * A Claim represents a group of faulty or missing items. It consists of claim items that refer to items in the original order that should be replaced or refunded. It also includes details related to shipping and fulfillment. */ export interface ClaimOrder { /** @@ -41,11 +41,11 @@ export interface ClaimOrder { | "canceled" | "requires_action" /** - * The items that have been claimed + * The details of the items that should be replaced or refunded. */ claim_items?: Array /** - * Refers to the new items to be shipped when the claim order has the type `replace` + * The details of the new items to be shipped when the claim's type is `replace` */ additional_items?: Array /** @@ -53,11 +53,11 @@ export interface ClaimOrder { */ order_id: string /** - * An order object. Available if the relation `order` is expanded. + * The details of the order that this claim was created for. */ order?: Order | null /** - * A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded + * The details of the return associated with the claim if the claim's type is `replace`. */ return_order?: Return | null /** @@ -65,11 +65,11 @@ export interface ClaimOrder { */ shipping_address_id: string | null /** - * Available if the relation `shipping_address` is expanded. + * The details of the address that new items should be shipped to. */ shipping_address?: Address | null /** - * The shipping methods that the claim order will be shipped with. + * The details of the shipping methods that the claim order will be shipped with. */ shipping_methods?: Array /** diff --git a/packages/generated/client-types/src/lib/models/Country.ts b/packages/generated/client-types/src/lib/models/Country.ts index 865115c082..c74d141a9f 100644 --- a/packages/generated/client-types/src/lib/models/Country.ts +++ b/packages/generated/client-types/src/lib/models/Country.ts @@ -38,7 +38,7 @@ export interface Country { */ region_id: string | null /** - * A region object. Available if the relation `region` is expanded. + * The details of the region the country is associated with. */ region?: Region | null } diff --git a/packages/generated/client-types/src/lib/models/Currency.ts b/packages/generated/client-types/src/lib/models/Currency.ts index 251f031945..2a68ebdb6b 100644 --- a/packages/generated/client-types/src/lib/models/Currency.ts +++ b/packages/generated/client-types/src/lib/models/Currency.ts @@ -24,7 +24,7 @@ export interface Currency { */ name: string /** - * [EXPERIMENTAL] Does the currency prices include tax + * Whether the currency prices include tax */ includes_tax?: boolean } diff --git a/packages/generated/client-types/src/lib/models/CustomShippingOption.ts b/packages/generated/client-types/src/lib/models/CustomShippingOption.ts index 209536ec38..332bceaa00 100644 --- a/packages/generated/client-types/src/lib/models/CustomShippingOption.ts +++ b/packages/generated/client-types/src/lib/models/CustomShippingOption.ts @@ -7,7 +7,7 @@ import type { Cart } from "./Cart" import type { ShippingOption } from "./ShippingOption" /** - * 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 + * Custom Shipping Options are overriden Shipping Options. Admins can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option. */ export interface CustomShippingOption { /** @@ -23,7 +23,7 @@ export interface CustomShippingOption { */ shipping_option_id: string /** - * A shipping option object. Available if the relation `shipping_option` is expanded. + * The details of the overriden shipping options. */ shipping_option?: ShippingOption | null /** @@ -31,7 +31,7 @@ export interface CustomShippingOption { */ cart_id: string | null /** - * A cart object. Available if the relation `cart` is expanded. + * The details of the cart this shipping option belongs to. */ cart?: Cart | null /** diff --git a/packages/generated/client-types/src/lib/models/Customer.ts b/packages/generated/client-types/src/lib/models/Customer.ts index ed09b51340..72d9249f73 100644 --- a/packages/generated/client-types/src/lib/models/Customer.ts +++ b/packages/generated/client-types/src/lib/models/Customer.ts @@ -8,7 +8,7 @@ import type { CustomerGroup } from "./CustomerGroup" import type { Order } from "./Order" /** - * Represents a customer + * A customer can make purchases in your store and manage their profile. */ export interface Customer { /** @@ -32,11 +32,11 @@ export interface Customer { */ billing_address_id: string | null /** - * Available if the relation `billing_address` is expanded. + * The details of the billing address associated with the customer. */ billing_address?: Address | null /** - * Available if the relation `shipping_addresses` is expanded. + * The details of the shipping addresses associated with the customer. */ shipping_addresses?: Array
/** @@ -48,11 +48,11 @@ export interface Customer { */ has_account: boolean /** - * Available if the relation `orders` is expanded. + * The details of the orders this customer placed. */ orders?: Array /** - * The customer groups the customer belongs to. Available if the relation `groups` is expanded. + * The customer groups the customer belongs to. */ groups?: Array /** diff --git a/packages/generated/client-types/src/lib/models/CustomerGroup.ts b/packages/generated/client-types/src/lib/models/CustomerGroup.ts index cc6a203da3..195f05c3f8 100644 --- a/packages/generated/client-types/src/lib/models/CustomerGroup.ts +++ b/packages/generated/client-types/src/lib/models/CustomerGroup.ts @@ -7,7 +7,7 @@ import type { Customer } from "./Customer" import type { PriceList } from "./PriceList" /** - * Represents a customer group + * A customer group that can be used to organize customers into groups of similar traits. */ export interface CustomerGroup { /** @@ -19,11 +19,11 @@ export interface CustomerGroup { */ name: string /** - * The customers that belong to the customer group. Available if the relation `customers` is expanded. + * The details of the customers that belong to the customer group. */ customers?: Array /** - * The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. + * The price lists that are associated with the customer group. */ price_lists?: Array /** diff --git a/packages/generated/client-types/src/lib/models/DecoratedInventoryItemDTO.ts b/packages/generated/client-types/src/lib/models/DecoratedInventoryItemDTO.ts index 25810b4144..f1dcc26069 100644 --- a/packages/generated/client-types/src/lib/models/DecoratedInventoryItemDTO.ts +++ b/packages/generated/client-types/src/lib/models/DecoratedInventoryItemDTO.ts @@ -8,7 +8,13 @@ import type { InventoryLevelDTO } from "./InventoryLevelDTO" import type { ProductVariant } from "./ProductVariant" export type DecoratedInventoryItemDTO = InventoryItemDTO & { + /** + * An array of location level details + */ location_levels?: Array + /** + * An array of product variant details + */ variants?: Array /** * The total quantity of the item in stock across levels diff --git a/packages/generated/client-types/src/lib/models/Discount.ts b/packages/generated/client-types/src/lib/models/Discount.ts index 99a2972e26..013bc686cf 100644 --- a/packages/generated/client-types/src/lib/models/Discount.ts +++ b/packages/generated/client-types/src/lib/models/Discount.ts @@ -7,7 +7,7 @@ import type { DiscountRule } from "./DiscountRule" import type { Region } from "./Region" /** - * Represents a discount that can be applied to a cart for promotional purposes. + * A discount can be applied to a cart for promotional purposes. */ export interface Discount { /** @@ -23,11 +23,11 @@ export interface Discount { */ is_dynamic: boolean /** - * The Discount Rule that governs the behaviour of the Discount + * The ID of the discount rule that defines how the discount will be applied to a cart. */ rule_id: string | null /** - * Available if the relation `rule` is expanded. + * The details of the discount rule that defines how the discount will be applied to a cart.. */ rule?: DiscountRule | null /** @@ -39,7 +39,7 @@ export interface Discount { */ parent_discount_id: string | null /** - * Available if the relation `parent_discount` is expanded. + * The details of the parent discount that this discount was created from. */ parent_discount?: Discount | null /** @@ -55,7 +55,7 @@ export interface Discount { */ valid_duration: string | null /** - * The Regions in which the Discount can be used. Available if the relation `regions` is expanded. + * The details of the regions in which the Discount can be used. */ regions?: Array /** diff --git a/packages/generated/client-types/src/lib/models/DiscountCondition.ts b/packages/generated/client-types/src/lib/models/DiscountCondition.ts index 2f1f10b166..5e5c339a65 100644 --- a/packages/generated/client-types/src/lib/models/DiscountCondition.ts +++ b/packages/generated/client-types/src/lib/models/DiscountCondition.ts @@ -19,7 +19,7 @@ export interface DiscountCondition { */ id: string /** - * The type of the Condition + * The type of the condition. The type affects the available resources associated with the condition. For example, if the type is `products`, that means the `products` relation will hold the products associated with this condition and other relations will be empty. */ type: | "products" @@ -28,7 +28,7 @@ export interface DiscountCondition { | "product_tags" | "customer_groups" /** - * The operator of the Condition + * The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that discountable resources are everything but the specified resources. */ operator: "in" | "not_in" /** @@ -36,27 +36,27 @@ export interface DiscountCondition { */ discount_rule_id: string /** - * Available if the relation `discount_rule` is expanded. + * The details of the discount rule associated with the condition. */ discount_rule?: DiscountRule | null /** - * products associated with this condition if type = products. Available if the relation `products` is expanded. + * products associated with this condition if `type` is `products`. */ products?: Array /** - * Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. + * Product types associated with this condition if `type` is `product_types`. */ product_types?: Array /** - * Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. + * Product tags associated with this condition if `type` is `product_tags`. */ product_tags?: Array /** - * Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. + * Product collections associated with this condition if `type` is `product_collections`. */ product_collections?: Array /** - * Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. + * Customer groups associated with this condition if `type` is `customer_groups`. */ customer_groups?: Array /** diff --git a/packages/generated/client-types/src/lib/models/DiscountConditionProduct.ts b/packages/generated/client-types/src/lib/models/DiscountConditionProduct.ts index baf61641f7..d0ca1b0914 100644 --- a/packages/generated/client-types/src/lib/models/DiscountConditionProduct.ts +++ b/packages/generated/client-types/src/lib/models/DiscountConditionProduct.ts @@ -7,7 +7,7 @@ import type { DiscountCondition } from "./DiscountCondition" import type { Product } from "./Product" /** - * Associates a discount condition with a product + * This represents the association between a discount condition and a product */ export interface DiscountConditionProduct { /** @@ -19,11 +19,11 @@ export interface DiscountConditionProduct { */ condition_id: string /** - * Available if the relation `product` is expanded. + * The details of the product. */ product?: Product | null /** - * Available if the relation `discount_condition` is expanded. + * The details of the discount condition. */ discount_condition?: DiscountCondition | null /** diff --git a/packages/generated/client-types/src/lib/models/DiscountConditionProductCollection.ts b/packages/generated/client-types/src/lib/models/DiscountConditionProductCollection.ts index ae5bfe4c32..6b9a4e2c41 100644 --- a/packages/generated/client-types/src/lib/models/DiscountConditionProductCollection.ts +++ b/packages/generated/client-types/src/lib/models/DiscountConditionProductCollection.ts @@ -7,7 +7,7 @@ import type { DiscountCondition } from "./DiscountCondition" import type { ProductCollection } from "./ProductCollection" /** - * Associates a discount condition with a product collection + * This represents the association between a discount condition and a product collection */ export interface DiscountConditionProductCollection { /** @@ -19,11 +19,11 @@ export interface DiscountConditionProductCollection { */ condition_id: string /** - * Available if the relation `product_collection` is expanded. + * The details of the product collection. */ product_collection?: ProductCollection | null /** - * Available if the relation `discount_condition` is expanded. + * The details of the discount condition. */ discount_condition?: DiscountCondition | null /** diff --git a/packages/generated/client-types/src/lib/models/DiscountConditionProductTag.ts b/packages/generated/client-types/src/lib/models/DiscountConditionProductTag.ts index 37163a82b3..7aa312cc4b 100644 --- a/packages/generated/client-types/src/lib/models/DiscountConditionProductTag.ts +++ b/packages/generated/client-types/src/lib/models/DiscountConditionProductTag.ts @@ -7,7 +7,7 @@ import type { DiscountCondition } from "./DiscountCondition" import type { ProductTag } from "./ProductTag" /** - * Associates a discount condition with a product tag + * This represents the association between a discount condition and a product tag */ export interface DiscountConditionProductTag { /** @@ -19,11 +19,11 @@ export interface DiscountConditionProductTag { */ condition_id: string /** - * Available if the relation `product_tag` is expanded. + * The details of the product tag. */ product_tag?: ProductTag | null /** - * Available if the relation `discount_condition` is expanded. + * The details of the discount condition. */ discount_condition?: DiscountCondition | null /** diff --git a/packages/generated/client-types/src/lib/models/DiscountConditionProductType.ts b/packages/generated/client-types/src/lib/models/DiscountConditionProductType.ts index 4e9f4489d7..3355f66cd1 100644 --- a/packages/generated/client-types/src/lib/models/DiscountConditionProductType.ts +++ b/packages/generated/client-types/src/lib/models/DiscountConditionProductType.ts @@ -7,7 +7,7 @@ import type { DiscountCondition } from "./DiscountCondition" import type { ProductType } from "./ProductType" /** - * Associates a discount condition with a product type + * This represents the association between a discount condition and a product type */ export interface DiscountConditionProductType { /** @@ -19,11 +19,11 @@ export interface DiscountConditionProductType { */ condition_id: string /** - * Available if the relation `product_type` is expanded. + * The details of the product type. */ product_type?: ProductType | null /** - * Available if the relation `discount_condition` is expanded. + * The details of the discount condition. */ discount_condition?: DiscountCondition | null /** diff --git a/packages/generated/client-types/src/lib/models/DiscountRule.ts b/packages/generated/client-types/src/lib/models/DiscountRule.ts index 71643f7b47..a88d088e52 100644 --- a/packages/generated/client-types/src/lib/models/DiscountRule.ts +++ b/packages/generated/client-types/src/lib/models/DiscountRule.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { DiscountCondition } from "./DiscountCondition" /** - * Holds the rules that governs how a Discount is calculated when applied to a Cart. + * A discount rule defines how a Discount is calculated when applied to a Cart. */ export interface DiscountRule { /** @@ -30,7 +30,7 @@ export interface DiscountRule { */ allocation: "total" | "item" | null /** - * A set of conditions that can be used to limit when the discount can be used. Available if the relation `conditions` is expanded. + * The details of the discount conditions associated with the rule. They can be used to limit when the discount can be used. */ conditions?: Array /** diff --git a/packages/generated/client-types/src/lib/models/DraftOrder.ts b/packages/generated/client-types/src/lib/models/DraftOrder.ts index 31388848d4..2cf57959b9 100644 --- a/packages/generated/client-types/src/lib/models/DraftOrder.ts +++ b/packages/generated/client-types/src/lib/models/DraftOrder.ts @@ -7,7 +7,7 @@ import type { Cart } from "./Cart" import type { Order } from "./Order" /** - * Represents a draft order + * A draft order is created by an admin without direct involvement of the customer. Once its payment is marked as captured, it is transformed into an order. */ export interface DraftOrder { /** @@ -15,7 +15,7 @@ export interface DraftOrder { */ id: string /** - * The status of the draft order + * The status of the draft order. It's changed to `completed` when it's transformed to an order. */ status: "open" | "completed" /** @@ -27,15 +27,15 @@ export interface DraftOrder { */ cart_id: string | null /** - * A cart object. Available if the relation `cart` is expanded. + * The details of the cart associated with the draft order. */ cart?: Cart | null /** - * The ID of the order associated with the draft order. + * The ID of the order created from the draft order when its payment is captured. */ order_id: string | null /** - * An order object. Available if the relation `order` is expanded. + * The details of the order created from the draft order when its payment is captured. */ order?: Order | null /** diff --git a/packages/generated/client-types/src/lib/models/ExtendedReservationItem.ts b/packages/generated/client-types/src/lib/models/ExtendedReservationItem.ts index f6aa77f3e5..cc48153907 100644 --- a/packages/generated/client-types/src/lib/models/ExtendedReservationItem.ts +++ b/packages/generated/client-types/src/lib/models/ExtendedReservationItem.ts @@ -9,11 +9,11 @@ import type { ReservationItemDTO } from "./ReservationItemDTO" export type ExtendedReservationItem = ReservationItemDTO & { /** - * optional line item + * The line item associated with the reservation. */ line_item?: LineItem /** - * inventory item from inventory module + * The inventory item associated with the reservation. */ inventory_item?: InventoryItemDTO } diff --git a/packages/generated/client-types/src/lib/models/Fulfillment.ts b/packages/generated/client-types/src/lib/models/Fulfillment.ts index 968c884c4c..8d8bee6415 100644 --- a/packages/generated/client-types/src/lib/models/Fulfillment.ts +++ b/packages/generated/client-types/src/lib/models/Fulfillment.ts @@ -11,7 +11,7 @@ import type { Swap } from "./Swap" import type { TrackingLink } from "./TrackingLink" /** - * 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. + * A Fulfillment is created once an admin can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a fulfillment provider, which typically integrates a third-party shipping service. Fulfillments can be associated with orders, claims, swaps, and returns. */ export interface Fulfillment { /** @@ -19,47 +19,47 @@ export interface Fulfillment { */ id: string /** - * The id of the Claim that the Fulfillment belongs to. + * The ID of the Claim that the Fulfillment belongs to. */ claim_order_id: string | null /** - * A claim order object. Available if the relation `claim_order` is expanded. + * The details of the claim that the fulfillment may belong to. */ claim_order?: ClaimOrder | null /** - * The id of the Swap that the Fulfillment belongs to. + * The ID of the Swap that the Fulfillment belongs to. */ swap_id: string | null /** - * A swap object. Available if the relation `swap` is expanded. + * The details of the swap that the fulfillment may belong to. */ swap?: Swap | null /** - * The id of the Order that the Fulfillment belongs to. + * The ID of the Order that the Fulfillment belongs to. */ order_id: string | null /** - * An order object. Available if the relation `order` is expanded. + * The details of the order that the fulfillment may belong to. */ order?: Order | null /** - * The id of the Fulfillment Provider responsible for handling the fulfillment + * The ID of the Fulfillment Provider responsible for handling the fulfillment. */ provider_id: string /** - * Available if the relation `provider` is expanded. + * The details of the fulfillment provider responsible for handling the fulfillment. */ provider?: FulfillmentProvider | null /** - * The id of the stock location the fulfillment will be shipped from + * The ID of the stock location the fulfillment will be shipped from */ location_id: string | null /** - * 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. + * The Fulfillment Items in the Fulfillment. These hold information about how many of each Line Item has been fulfilled. */ items?: Array /** - * 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. + * The Tracking Links that can be used to track the status of the Fulfillment. These will usually be provided by the Fulfillment Provider. */ tracking_links?: Array /** diff --git a/packages/generated/client-types/src/lib/models/FulfillmentItem.ts b/packages/generated/client-types/src/lib/models/FulfillmentItem.ts index 078e3f18d5..5cf71623a9 100644 --- a/packages/generated/client-types/src/lib/models/FulfillmentItem.ts +++ b/packages/generated/client-types/src/lib/models/FulfillmentItem.ts @@ -7,23 +7,23 @@ import type { Fulfillment } from "./Fulfillment" import type { LineItem } from "./LineItem" /** - * Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. + * This represents the association between a Line Item and a Fulfillment. */ export interface FulfillmentItem { /** - * The id of the Fulfillment that the Fulfillment Item belongs to. + * The ID of the Fulfillment that the Fulfillment Item belongs to. */ fulfillment_id: string /** - * The id of the Line Item that the Fulfillment Item references. + * The ID of the Line Item that the Fulfillment Item references. */ item_id: string /** - * A fulfillment object. Available if the relation `fulfillment` is expanded. + * The details of the fulfillment. */ fulfillment?: Fulfillment | null /** - * Available if the relation `item` is expanded. + * The details of the line item. */ item?: LineItem | null /** diff --git a/packages/generated/client-types/src/lib/models/FulfillmentProvider.ts b/packages/generated/client-types/src/lib/models/FulfillmentProvider.ts index 07331eca23..201a90d3c7 100644 --- a/packages/generated/client-types/src/lib/models/FulfillmentProvider.ts +++ b/packages/generated/client-types/src/lib/models/FulfillmentProvider.ts @@ -4,15 +4,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Represents a fulfillment provider plugin and holds its installation status. + * A fulfillment provider represents a fulfillment service installed in the Medusa backend, either through a plugin or backend customizations. It holds the fulfillment service's installation status. */ export interface FulfillmentProvider { /** - * The id of the fulfillment provider as given by the plugin. + * The ID of the fulfillment provider as given by the fulfillment service. */ id: string /** - * 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`. + * Whether the fulfillment service is installed in the current version. If a fulfillment service is no longer installed, the `is_installed` attribute is set to `false`. */ is_installed: boolean } diff --git a/packages/generated/client-types/src/lib/models/GetOrderEditsOrderEditParams.ts b/packages/generated/client-types/src/lib/models/GetOrderEditsOrderEditParams.ts index 95638b4052..d50d55ed01 100644 --- a/packages/generated/client-types/src/lib/models/GetOrderEditsOrderEditParams.ts +++ b/packages/generated/client-types/src/lib/models/GetOrderEditsOrderEditParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface GetOrderEditsOrderEditParams { /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in each returned order edit. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned order edit. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/GetOrderEditsParams.ts b/packages/generated/client-types/src/lib/models/GetOrderEditsParams.ts index 24b2673788..4b5253901f 100644 --- a/packages/generated/client-types/src/lib/models/GetOrderEditsParams.ts +++ b/packages/generated/client-types/src/lib/models/GetOrderEditsParams.ts @@ -5,27 +5,27 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface GetOrderEditsParams { /** - * Query used for searching order edit internal note. + * term to search order edits' internal note. */ q?: string /** - * List order edits by order id. + * Filter by order ID */ order_id?: string /** - * The number of items in the response + * Limit the number of order edits returned. */ limit?: number /** - * The offset of items in response + * The number of order edits to skip when retrieving the order edits. */ offset?: number /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in each returned order edit. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in each returned order edit. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/GetPublishableApiKeySalesChannelsParams.ts b/packages/generated/client-types/src/lib/models/GetPublishableApiKeySalesChannelsParams.ts index dd4b063063..5586dafeb4 100644 --- a/packages/generated/client-types/src/lib/models/GetPublishableApiKeySalesChannelsParams.ts +++ b/packages/generated/client-types/src/lib/models/GetPublishableApiKeySalesChannelsParams.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface GetPublishableApiKeySalesChannelsParams { /** - * Query used for searching sales channels' names and descriptions. + * query to search sales channels' names and descriptions. */ q?: string } diff --git a/packages/generated/client-types/src/lib/models/GetPublishableApiKeysParams.ts b/packages/generated/client-types/src/lib/models/GetPublishableApiKeysParams.ts index 1aa28dbe79..85c138862c 100644 --- a/packages/generated/client-types/src/lib/models/GetPublishableApiKeysParams.ts +++ b/packages/generated/client-types/src/lib/models/GetPublishableApiKeysParams.ts @@ -5,23 +5,23 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface GetPublishableApiKeysParams { /** - * Query used for searching publishable api keys by title. + * term to search publishable API keys' titles. */ q?: string /** - * The number of items in the response + * Limit the number of publishable API keys returned. */ limit?: number /** - * The offset of items in response + * The number of publishable API keys to skip when retrieving the publishable API keys. */ offset?: number /** - * Comma separated list of relations to include in the results. + * Comma-separated relations that should be expanded in the returned publishable API keys. */ expand?: string /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be included in the returned publishable API keys. */ fields?: string } diff --git a/packages/generated/client-types/src/lib/models/GiftCard.ts b/packages/generated/client-types/src/lib/models/GiftCard.ts index 5141049537..82fd096920 100644 --- a/packages/generated/client-types/src/lib/models/GiftCard.ts +++ b/packages/generated/client-types/src/lib/models/GiftCard.ts @@ -27,19 +27,19 @@ export interface GiftCard { */ balance: number /** - * The id of the Region in which the Gift Card is available. + * The ID of the region this gift card is available in. */ region_id: string /** - * A region object. Available if the relation `region` is expanded. + * The details of the region this gift card is available in. */ region?: Region | null /** - * The id of the Order that the Gift Card was purchased in. + * The ID of the order that the gift card was purchased in. */ order_id: string | null /** - * An order object. Available if the relation `order` is expanded. + * The details of the order that the gift card was purchased in. */ order?: Order | null /** diff --git a/packages/generated/client-types/src/lib/models/GiftCardTransaction.ts b/packages/generated/client-types/src/lib/models/GiftCardTransaction.ts index bbf91060c9..d334e4a98c 100644 --- a/packages/generated/client-types/src/lib/models/GiftCardTransaction.ts +++ b/packages/generated/client-types/src/lib/models/GiftCardTransaction.ts @@ -7,7 +7,7 @@ import type { GiftCard } from "./GiftCard" import type { Order } from "./Order" /** - * Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order + * Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order. */ export interface GiftCardTransaction { /** @@ -19,15 +19,15 @@ export interface GiftCardTransaction { */ gift_card_id: string /** - * A gift card object. Available if the relation `gift_card` is expanded. + * The details of the gift card associated used in this transaction. */ gift_card?: GiftCard | null /** - * The ID of the Order that the Gift Card was used to pay for. + * The ID of the order that the gift card was used for payment. */ order_id: string /** - * An order object. Available if the relation `order` is expanded. + * The details of the order that the gift card was used for payment. */ order?: Order | null /** diff --git a/packages/generated/client-types/src/lib/models/Image.ts b/packages/generated/client-types/src/lib/models/Image.ts index ae6995ca4f..063e675c80 100644 --- a/packages/generated/client-types/src/lib/models/Image.ts +++ b/packages/generated/client-types/src/lib/models/Image.ts @@ -4,7 +4,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Images holds a reference to a URL at which the image file can be found. + * An Image is used to store details about uploaded images. Images are uploaded by the File Service, and the URL is provided by the File Service. */ export interface Image { /** diff --git a/packages/generated/client-types/src/lib/models/Invite.ts b/packages/generated/client-types/src/lib/models/Invite.ts index f80989cf48..cc8cd085d5 100644 --- a/packages/generated/client-types/src/lib/models/Invite.ts +++ b/packages/generated/client-types/src/lib/models/Invite.ts @@ -4,7 +4,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Represents an invite + * An invite is created when an admin user invites a new user to join the store's team. Once the invite is accepted, it's deleted. */ export interface Invite { /** @@ -16,7 +16,7 @@ export interface Invite { */ user_email: string /** - * The user's role. + * The user's role. These roles don't change the privileges of the user. */ role: "admin" | "member" | "developer" | null /** diff --git a/packages/generated/client-types/src/lib/models/LineItem.ts b/packages/generated/client-types/src/lib/models/LineItem.ts index 9cf620b78b..6bf31421bf 100644 --- a/packages/generated/client-types/src/lib/models/LineItem.ts +++ b/packages/generated/client-types/src/lib/models/LineItem.ts @@ -13,7 +13,7 @@ import type { ProductVariant } from "./ProductVariant" import type { Swap } from "./Swap" /** - * 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. + * Line Items are created when a product is added to a Cart. When Line Items are purchased they will get copied to the resulting order, swap, or claim, and can eventually be referenced in Fulfillments and Returns. Line items may also be used for order edits. */ export interface LineItem { /** @@ -21,59 +21,59 @@ export interface LineItem { */ id: string /** - * The ID of the Cart that the Line Item belongs to. + * The ID of the cart that the line item may belongs to. */ cart_id: string | null /** - * A cart object. Available if the relation `cart` is expanded. + * The details of the cart that the line item may belongs to. */ cart?: Cart | null /** - * The ID of the Order that the Line Item belongs to. + * The ID of the order that the line item may belongs to. */ order_id: string | null /** - * An order object. Available if the relation `order` is expanded. + * The details of the order that the line item may belongs to. */ order?: Order | null /** - * The id of the Swap that the Line Item belongs to. + * The ID of the swap that the line item may belong to. */ swap_id: string | null /** - * A swap object. Available if the relation `swap` is expanded. + * The details of the swap that the line item may belong to. */ swap?: Swap | null /** - * The id of the Claim that the Line Item belongs to. + * The ID of the claim that the line item may belong to. */ claim_order_id: string | null /** - * A claim order object. Available if the relation `claim_order` is expanded. + * The details of the claim that the line item may belong to. */ claim_order?: ClaimOrder | null /** - * Available if the relation `tax_lines` is expanded. + * The details of the item's tax lines. */ tax_lines?: Array /** - * Available if the relation `adjustments` is expanded. + * The details of the item's adjustments, which are available when a discount is applied on the item. */ adjustments?: Array /** - * The id of the original line item + * The ID of the original line item. This is useful if the line item belongs to a resource that references an order, such as a return or an order edit. */ original_item_id: string | null /** - * The ID of the order edit to which a cloned item belongs + * The ID of the order edit that the item may belong to. */ order_edit_id: string | null /** - * The order edit joined. Available if the relation `order_edit` is expanded. + * The details of the order edit. */ order_edit?: OrderEdit | null /** - * The title of the Line Item, this should be easily identifiable by the Customer. + * The title of the Line Item. */ title: string /** @@ -113,7 +113,7 @@ export interface LineItem { */ variant_id: string | null /** - * A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + * The details of the product variant that this item was created from. */ variant?: ProductVariant | null /** @@ -169,7 +169,7 @@ export interface LineItem { */ gift_card_total?: number /** - * [EXPERIMENTAL] Indicates if the line item unit_price include tax + * Indicates if the line item unit_price include tax */ includes_tax?: boolean /** diff --git a/packages/generated/client-types/src/lib/models/LineItemAdjustment.ts b/packages/generated/client-types/src/lib/models/LineItemAdjustment.ts index 2e5ba6f16d..38e4f25304 100644 --- a/packages/generated/client-types/src/lib/models/LineItemAdjustment.ts +++ b/packages/generated/client-types/src/lib/models/LineItemAdjustment.ts @@ -7,7 +7,7 @@ import type { Discount } from "./Discount" import type { LineItem } from "./LineItem" /** - * Represents a Line Item Adjustment + * A Line Item Adjustment includes details on discounts applied on a line item. */ export interface LineItemAdjustment { /** @@ -19,7 +19,7 @@ export interface LineItemAdjustment { */ item_id: string /** - * Available if the relation `item` is expanded. + * The details of the line item. */ item?: LineItem | null /** @@ -31,7 +31,7 @@ export interface LineItemAdjustment { */ discount_id: string | null /** - * Available if the relation `discount` is expanded. + * The details of the discount associated with the adjustment. */ discount?: Discount | null /** diff --git a/packages/generated/client-types/src/lib/models/LineItemTaxLine.ts b/packages/generated/client-types/src/lib/models/LineItemTaxLine.ts index c49a66c9d4..3556706ebc 100644 --- a/packages/generated/client-types/src/lib/models/LineItemTaxLine.ts +++ b/packages/generated/client-types/src/lib/models/LineItemTaxLine.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { LineItem } from "./LineItem" /** - * Represents a Line Item Tax Line + * A Line Item Tax Line represents the taxes applied on a line item. */ export interface LineItemTaxLine { /** @@ -30,7 +30,7 @@ export interface LineItemTaxLine { */ item_id: string /** - * Available if the relation `item` is expanded. + * The details of the line item. */ item?: LineItem | null /** diff --git a/packages/generated/client-types/src/lib/models/MoneyAmount.ts b/packages/generated/client-types/src/lib/models/MoneyAmount.ts index dfbf67defa..0ce1a0194c 100644 --- a/packages/generated/client-types/src/lib/models/MoneyAmount.ts +++ b/packages/generated/client-types/src/lib/models/MoneyAmount.ts @@ -9,7 +9,7 @@ import type { ProductVariant } from "./ProductVariant" import type { Region } from "./Region" /** - * 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. + * A Money Amount represent a price amount, for example, a product variant's price or a price in a price list. 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 Region. */ export interface MoneyAmount { /** @@ -17,11 +17,11 @@ export interface MoneyAmount { */ id: string /** - * The 3 character currency code that the Money Amount is given in. + * The 3 character currency code that the money amount may belong to. */ currency_code: string /** - * Available if the relation `currency` is expanded. + * The details of the currency that the money amount may belong to. */ currency?: Currency | null /** @@ -37,19 +37,19 @@ export interface MoneyAmount { */ max_quantity: number | null /** - * The ID of the price list associated with the money amount + * The ID of the price list that the money amount may belong to. */ price_list_id: string | null /** - * Available if the relation `price_list` is expanded. + * The details of the price list that the money amount may belong to. */ price_list?: PriceList | null /** - * The id of the Product Variant contained in the Line Item. + * The ID of the Product Variant contained in the Line Item. */ variant_id: string | null /** - * The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + * The details of the product variant that the money amount may belong to. */ variant?: ProductVariant | null /** @@ -57,7 +57,7 @@ export interface MoneyAmount { */ region_id: string | null /** - * A region object. Available if the relation `region` is expanded. + * The details of the region that the money amount may belong to. */ region?: Region | null /** diff --git a/packages/generated/client-types/src/lib/models/Note.ts b/packages/generated/client-types/src/lib/models/Note.ts index 5e1c45d2ce..c575792ad2 100644 --- a/packages/generated/client-types/src/lib/models/Note.ts +++ b/packages/generated/client-types/src/lib/models/Note.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { User } from "./User" /** - * Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. + * A Note is an element that can be used in association with different resources to allow admin users to describe additional information. For example, they can be used to add additional information about orders. */ export interface Note { /** @@ -26,11 +26,11 @@ export interface Note { */ value: string /** - * The ID of the author (user) + * The ID of the user that created the note. */ author_id: string | null /** - * Available if the relation `author` is expanded. + * The details of the user that created the note. */ author?: User | null /** diff --git a/packages/generated/client-types/src/lib/models/Notification.ts b/packages/generated/client-types/src/lib/models/Notification.ts index b2e9c92977..f4f2581515 100644 --- a/packages/generated/client-types/src/lib/models/Notification.ts +++ b/packages/generated/client-types/src/lib/models/Notification.ts @@ -7,7 +7,7 @@ import type { Customer } from "./Customer" import type { NotificationProvider } from "./NotificationProvider" /** - * 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. + * A notification is an alert sent, typically to customers, using the installed Notification Provider as a reaction to internal events such as `order.placed`. Notifications can be resent. */ export interface Notification { /** @@ -27,15 +27,15 @@ export interface Notification { */ resource_id: string /** - * The ID of the Customer that the Notification was sent to. + * The ID of the customer that this notification was sent to. */ customer_id: string | null /** - * A customer object. Available if the relation `customer` is expanded. + * The details of the customer that this notification was sent to. */ customer?: Customer | null /** - * 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 + * The address that the Notification was sent to. This will usually be an email address, but can represent other addresses such as a chat bot user ID. */ to: string /** @@ -47,19 +47,19 @@ export interface Notification { */ parent_id: string | null /** - * Available if the relation `parent_notification` is expanded. + * The details of the parent notification. */ parent_notification?: Notification | null /** - * The resends that have been completed after the original Notification. Available if the relation `resends` is expanded. + * The details of all resends of the notification. */ resends?: Array /** - * The id of the Notification Provider that handles the Notification. + * The ID of the notification provider used to send the notification. */ provider_id: string | null /** - * Available if the relation `provider` is expanded. + * The notification provider used to send the notification. */ provider?: NotificationProvider | null /** diff --git a/packages/generated/client-types/src/lib/models/NotificationProvider.ts b/packages/generated/client-types/src/lib/models/NotificationProvider.ts index 164262742d..250ef10508 100644 --- a/packages/generated/client-types/src/lib/models/NotificationProvider.ts +++ b/packages/generated/client-types/src/lib/models/NotificationProvider.ts @@ -4,15 +4,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Represents a notification provider plugin and holds its installation status. + * A notification provider represents a notification service installed in the Medusa backend, either through a plugin or backend customizations. It holds the notification service's installation status. */ export interface NotificationProvider { /** - * The id of the notification provider as given by the plugin. + * The ID of the notification provider as given by the notification service. */ id: string /** - * 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`. + * Whether the notification service is installed in the current version. If a notification service is no longer installed, the `is_installed` attribute is set to `false`. */ is_installed: boolean } diff --git a/packages/generated/client-types/src/lib/models/OAuth.ts b/packages/generated/client-types/src/lib/models/OAuth.ts index c4061a33fb..4c7a6fe0d9 100644 --- a/packages/generated/client-types/src/lib/models/OAuth.ts +++ b/packages/generated/client-types/src/lib/models/OAuth.ts @@ -4,7 +4,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Represent an OAuth app + * An Oauth app is typically created by a plugin to handle authentication to third-party services. */ export interface OAuth { /** diff --git a/packages/generated/client-types/src/lib/models/Order.ts b/packages/generated/client-types/src/lib/models/Order.ts index e045e70e0b..999e54291a 100644 --- a/packages/generated/client-types/src/lib/models/Order.ts +++ b/packages/generated/client-types/src/lib/models/Order.ts @@ -24,7 +24,7 @@ import type { ShippingMethod } from "./ShippingMethod" import type { Swap } from "./Swap" /** - * Represents an order + * An order is a purchase made by a customer. It holds details about payment and fulfillment of the order. An order may also be created from a draft order, which is created by an admin user. */ export interface Order { /** @@ -68,7 +68,7 @@ export interface Order { */ cart_id: string | null /** - * A cart object. Available if the relation `cart` is expanded. + * The details of the cart associated with the order. */ cart?: Cart | null /** @@ -76,7 +76,7 @@ export interface Order { */ customer_id: string /** - * A customer object. Available if the relation `customer` is expanded. + * The details of the customer associated with the order. */ customer?: Customer | null /** @@ -88,7 +88,7 @@ export interface Order { */ billing_address_id: string | null /** - * Available if the relation `billing_address` is expanded. + * The details of the billing address associated with the order. */ billing_address?: Address | null /** @@ -96,15 +96,15 @@ export interface Order { */ shipping_address_id: string | null /** - * Available if the relation `shipping_address` is expanded. + * The details of the shipping address associated with the order. */ shipping_address?: Address | null /** - * The region's ID + * The ID of the region this order was created in. */ region_id: string /** - * A region object. Available if the relation `region` is expanded. + * The details of the region this order was created in. */ region?: Region | null /** @@ -112,7 +112,7 @@ export interface Order { */ currency_code: string /** - * Available if the relation `currency` is expanded. + * The details of the currency used in the order. */ currency?: Currency | null /** @@ -120,59 +120,59 @@ export interface Order { */ tax_rate: number | null /** - * The discounts used in the order. Available if the relation `discounts` is expanded. + * The details of the discounts applied on the order. */ discounts?: Array /** - * The gift cards used in the order. Available if the relation `gift_cards` is expanded. + * The details of the gift card used in the order. */ gift_cards?: Array /** - * The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. + * The details of the shipping methods used in the order. */ shipping_methods?: Array /** - * The payments used in the order. Available if the relation `payments` is expanded. + * The details of the payments used in the order. */ payments?: Array /** - * The fulfillments used in the order. Available if the relation `fulfillments` is expanded. + * The details of the fulfillments created for the order. */ fulfillments?: Array /** - * The returns associated with the order. Available if the relation `returns` is expanded. + * The details of the returns created for the order. */ returns?: Array /** - * The claims associated with the order. Available if the relation `claims` is expanded. + * The details of the claims created for the order. */ claims?: Array /** - * The refunds associated with the order. Available if the relation `refunds` is expanded. + * The details of the refunds created for the order. */ refunds?: Array /** - * The swaps associated with the order. Available if the relation `swaps` is expanded. + * The details of the swaps created for the order. */ swaps?: Array /** - * The ID of the draft order this order is associated with. + * The ID of the draft order this order was created from. */ draft_order_id: string | null /** - * A draft order object. Available if the relation `draft_order` is expanded. + * The details of the draft order this order was created from. */ draft_order?: DraftOrder | null /** - * The line items that belong to the order. Available if the relation `items` is expanded. + * The details of the line items that belong to the order. */ items?: Array /** - * Order edits done on the order. Available if the relation `edits` is expanded. + * The details of the order edits done on the order. */ edits?: Array /** - * The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. + * The gift card transactions made in the order. */ gift_card_transactions?: Array /** @@ -192,11 +192,11 @@ export interface Order { */ external_id: string | null /** - * The ID of the sales channel this order is associated with. + * The ID of the sales channel this order belongs to. */ sales_channel_id?: string | null /** - * A sales channel object. Available if the relation `sales_channel` is expanded. + * The details of the sales channel this order belongs to. */ sales_channel?: SalesChannel | null /** @@ -244,7 +244,7 @@ export interface Order { */ gift_card_tax_total?: number /** - * The items that are returnable as part of the order, order swaps or order claims + * The details of the line items that are returnable as part of the order, swaps, or claims */ returnable_items?: Array /** diff --git a/packages/generated/client-types/src/lib/models/OrderEdit.ts b/packages/generated/client-types/src/lib/models/OrderEdit.ts index d42a386305..245b1c8588 100644 --- a/packages/generated/client-types/src/lib/models/OrderEdit.ts +++ b/packages/generated/client-types/src/lib/models/OrderEdit.ts @@ -9,7 +9,7 @@ import type { OrderItemChange } from "./OrderItemChange" import type { PaymentCollection } from "./PaymentCollection" /** - * Order edit keeps track of order items changes. + * Order edit allows modifying items in an order, such as adding, updating, or deleting items from the original order. Once the order edit is confirmed, the changes are reflected on the original order. */ export interface OrderEdit { /** @@ -21,11 +21,11 @@ export interface OrderEdit { */ order_id: string /** - * Available if the relation `order` is expanded. + * The details of the order that this order edit was created for. */ order?: Order | null /** - * Available if the relation `changes` is expanded. + * The details of all the changes on the original order's line items. */ changes?: Array /** @@ -109,7 +109,7 @@ export interface OrderEdit { */ status: "confirmed" | "declined" | "requested" | "created" | "canceled" /** - * Available if the relation `items` is expanded. + * The details of the cloned items from the original order with the new changes. Once the order edit is confirmed, these line items are associated with the original order. */ items?: Array /** @@ -117,7 +117,7 @@ export interface OrderEdit { */ payment_collection_id: string | null /** - * Available if the relation `payment_collection` is expanded. + * The details of the payment collection used to authorize additional payment if necessary. */ payment_collection?: PaymentCollection | null /** diff --git a/packages/generated/client-types/src/lib/models/OrderItemChange.ts b/packages/generated/client-types/src/lib/models/OrderItemChange.ts index 123e57bea0..5062ec00b6 100644 --- a/packages/generated/client-types/src/lib/models/OrderItemChange.ts +++ b/packages/generated/client-types/src/lib/models/OrderItemChange.ts @@ -7,7 +7,7 @@ import type { LineItem } from "./LineItem" import type { OrderEdit } from "./OrderEdit" /** - * Represents an order edit item change + * An order item change is a change made within an order edit to an order's items. These changes are not reflected on the original order until the order edit is confirmed. */ export interface OrderItemChange { /** @@ -23,7 +23,7 @@ export interface OrderItemChange { */ order_edit_id: string /** - * Available if the relation `order_edit` is expanded. + * The details of the order edit the item change is associated with. */ order_edit?: OrderEdit | null /** @@ -31,7 +31,7 @@ export interface OrderItemChange { */ original_line_item_id: string | null /** - * Available if the relation `original_line_item` is expanded. + * The details of the original line item this item change references. This is used if the item change updates or deletes the original item. */ original_line_item?: LineItem | null /** @@ -39,7 +39,7 @@ export interface OrderItemChange { */ line_item_id: string | null /** - * Available if the relation `line_item` is expanded. + * The details of the resulting line item after the item change. This line item is then used in the original order once the order edit is confirmed. */ line_item?: LineItem | null /** diff --git a/packages/generated/client-types/src/lib/models/Payment.ts b/packages/generated/client-types/src/lib/models/Payment.ts index 9776c95e2b..3744dbeac0 100644 --- a/packages/generated/client-types/src/lib/models/Payment.ts +++ b/packages/generated/client-types/src/lib/models/Payment.ts @@ -9,7 +9,7 @@ import type { Order } from "./Order" import type { Swap } from "./Swap" /** - * Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. + * A payment is originally created from a payment session. Once a payment session is authorized, the payment is created to represent the authorized amount with a given payment method. Payments can be captured, canceled or refunded. Payments can be made towards orders, swaps, order edits, or other resources. */ export interface Payment { /** @@ -17,27 +17,27 @@ export interface Payment { */ id: string /** - * The ID of the Swap that the Payment is used for. + * The ID of the swap that this payment was potentially created for. */ swap_id: string | null /** - * A swap object. Available if the relation `swap` is expanded. + * The details of the swap that this payment was potentially created for. */ swap?: Swap | null /** - * The id of the Cart that the Payment Session is created for. + * The ID of the cart that the payment session was potentially created for. */ cart_id: string | null /** - * A cart object. Available if the relation `cart` is expanded. + * The details of the cart that the payment session was potentially created for. */ cart?: Cart | null /** - * The ID of the Order that the Payment is used for. + * The ID of the order that the payment session was potentially created for. */ order_id: string | null /** - * An order object. Available if the relation `order` is expanded. + * The details of the order that the payment session was potentially created for. */ order?: Order | null /** @@ -45,11 +45,11 @@ export interface Payment { */ amount: number /** - * The 3 character ISO currency code that the Payment is completed in. + * The 3 character ISO currency code of the payment. */ currency_code: string /** - * Available if the relation `currency` is expanded. + * The details of the currency of the payment. */ currency?: Currency | null /** diff --git a/packages/generated/client-types/src/lib/models/PaymentCollection.ts b/packages/generated/client-types/src/lib/models/PaymentCollection.ts index a760c5673e..7e0d5546a1 100644 --- a/packages/generated/client-types/src/lib/models/PaymentCollection.ts +++ b/packages/generated/client-types/src/lib/models/PaymentCollection.ts @@ -9,7 +9,7 @@ import type { PaymentSession } from "./PaymentSession" import type { Region } from "./Region" /** - * Payment Collection + * A payment collection allows grouping and managing a list of payments at one. This can be helpful when making additional payment for order edits or integrating installment payments. */ export interface PaymentCollection { /** @@ -42,27 +42,27 @@ export interface PaymentCollection { */ authorized_amount: number | null /** - * The region's ID + * The ID of the region this payment collection is associated with. */ region_id: string /** - * Available if the relation `region` is expanded. + * The details of the region this payment collection is associated with. */ region?: Region | null /** - * The 3 character ISO code for the currency. + * The 3 character ISO code for the currency this payment collection is associated with. */ currency_code: string /** - * Available if the relation `currency` is expanded. + * The details of the currency this payment collection is associated with. */ currency?: Currency | null /** - * Available if the relation `payment_sessions` is expanded. + * The details of the payment sessions created as part of the payment collection. */ payment_sessions?: Array /** - * Available if the relation `payments` is expanded. + * The details of the payments created as part of the payment collection. */ payments?: Array /** diff --git a/packages/generated/client-types/src/lib/models/PaymentProvider.ts b/packages/generated/client-types/src/lib/models/PaymentProvider.ts index fa63c3ab85..561a4fb2b1 100644 --- a/packages/generated/client-types/src/lib/models/PaymentProvider.ts +++ b/packages/generated/client-types/src/lib/models/PaymentProvider.ts @@ -4,15 +4,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Represents a Payment Provider plugin and holds its installation status. + * A payment provider represents a payment service installed in the Medusa backend, either through a plugin or backend customizations. It holds the payment service's installation status. */ export interface PaymentProvider { /** - * The id of the payment provider as given by the plugin. + * The ID of the payment provider as given by the payment service. */ id: string /** - * 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`. + * Whether the payment service is installed in the current version. If a payment service is no longer installed, the `is_installed` attribute is set to `false`. */ is_installed: boolean } diff --git a/packages/generated/client-types/src/lib/models/PaymentSession.ts b/packages/generated/client-types/src/lib/models/PaymentSession.ts index 5b2a20a7fc..239cccd404 100644 --- a/packages/generated/client-types/src/lib/models/PaymentSession.ts +++ b/packages/generated/client-types/src/lib/models/PaymentSession.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Cart } from "./Cart" /** - * 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. + * A Payment Session is 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, which 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 payment processing such as capture or refund. Payment sessions can also be used as part of payment collections. */ export interface PaymentSession { /** @@ -14,15 +14,15 @@ export interface PaymentSession { */ id: string /** - * The id of the Cart that the Payment Session is created for. + * The ID of the cart that the payment session was created for. */ cart_id: string | null /** - * A cart object. Available if the relation `cart` is expanded. + * The details of the cart that the payment session was created for. */ cart?: Cart | null /** - * The id of the Payment Provider that is responsible for the Payment Session + * The ID of the Payment Provider that is responsible for the Payment Session */ provider_id: string /** diff --git a/packages/generated/client-types/src/lib/models/PriceList.ts b/packages/generated/client-types/src/lib/models/PriceList.ts index 59fd51a8dd..f51dd88827 100644 --- a/packages/generated/client-types/src/lib/models/PriceList.ts +++ b/packages/generated/client-types/src/lib/models/PriceList.ts @@ -7,7 +7,7 @@ import type { CustomerGroup } from "./CustomerGroup" import type { MoneyAmount } from "./MoneyAmount" /** - * Price Lists represents a set of prices that overrides the default price for one or more product variants. + * A Price List represents a set of prices that override the default price for one or more product variants. */ export interface PriceList { /** @@ -39,15 +39,15 @@ export interface PriceList { */ ends_at: string | null /** - * The Customer Groups that the Price List applies to. Available if the relation `customer_groups` is expanded. + * The details of the customer groups that the Price List can apply to. */ customer_groups?: Array /** - * The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded. + * The prices that belong to the price list, represented as a Money Amount. */ prices?: Array /** - * [EXPERIMENTAL] Does the price list prices include tax + * Whether the price list prices include tax */ includes_tax?: boolean /** diff --git a/packages/generated/client-types/src/lib/models/Product.ts b/packages/generated/client-types/src/lib/models/Product.ts index 67ce82dc8e..e65335b711 100644 --- a/packages/generated/client-types/src/lib/models/Product.ts +++ b/packages/generated/client-types/src/lib/models/Product.ts @@ -14,7 +14,7 @@ import type { SalesChannel } from "./SalesChannel" import type { ShippingProfile } from "./ShippingProfile" /** - * 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. + * A product is a saleable item that holds general information such as name or description. It must include at least one Product Variant, where each product variant defines different options to purchase the product with (for example, different sizes or colors). The prices and inventory of the product are defined on the variant level. */ export interface Product { /** @@ -46,7 +46,7 @@ export interface Product { */ status: "draft" | "proposed" | "published" | "rejected" /** - * Images of the Product. Available if the relation `images` is expanded. + * The details of the product's images. */ images?: Array /** @@ -54,23 +54,23 @@ export interface Product { */ thumbnail: string | null /** - * 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. + * The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options. */ options?: Array /** - * 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. + * The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options. */ variants?: Array /** - * The product's associated categories. Available if the relation `categories` are expanded. + * The details of the product categories that this product belongs to. */ categories?: Array /** - * 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. + * The ID of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product. */ profile_id: string /** - * Available if the relation `profile` is expanded. + * The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product. */ profile?: ShippingProfile | null /** @@ -110,23 +110,23 @@ export interface Product { */ material: string | null /** - * The Product Collection that the Product belongs to + * The ID of the product collection that the product belongs to. */ collection_id: string | null /** - * A product collection object. Available if the relation `collection` is expanded. + * The details of the product collection that the product belongs to. */ collection?: ProductCollection | null /** - * The Product type that the Product belongs to + * The ID of the product type that the product belongs to. */ type_id: string | null /** - * Available if the relation `type` is expanded. + * The details of the product type that the product belongs to. */ type?: ProductType | null /** - * The Product Tags assigned to the Product. Available if the relation `tags` is expanded. + * The details of the product tags used in this product. */ tags?: Array /** @@ -138,7 +138,7 @@ export interface Product { */ external_id: string | null /** - * The sales channels the product is associated with. Available if the relation `sales_channels` is expanded. + * The details of the sales channels this product is available in. */ sales_channels?: Array /** diff --git a/packages/generated/client-types/src/lib/models/ProductCategory.ts b/packages/generated/client-types/src/lib/models/ProductCategory.ts index 541d6db669..58a9e8fa3e 100644 --- a/packages/generated/client-types/src/lib/models/ProductCategory.ts +++ b/packages/generated/client-types/src/lib/models/ProductCategory.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Product } from "./Product" /** - * Represents a product category + * A product category can be used to categorize products into a hierarchy of categories. */ export interface ProductCategory { /** @@ -38,7 +38,7 @@ export interface ProductCategory { */ rank?: number /** - * Available if the relation `category_children` are expanded. + * The details of the category's children. */ category_children: Array /** @@ -46,11 +46,11 @@ export interface ProductCategory { */ parent_category_id: string | null /** - * A product category object. Available if the relation `parent_category` is expanded. + * The details of the parent of this category. */ parent_category?: ProductCategory | null /** - * Products associated with category. Available if the relation `products` is expanded. + * The details of the products that belong to this category. */ products?: Array /** diff --git a/packages/generated/client-types/src/lib/models/ProductCollection.ts b/packages/generated/client-types/src/lib/models/ProductCollection.ts index db7597bae8..f16de6a271 100644 --- a/packages/generated/client-types/src/lib/models/ProductCollection.ts +++ b/packages/generated/client-types/src/lib/models/ProductCollection.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Product } from "./Product" /** - * Product Collections represents a group of Products that are related. + * A Product Collection allows grouping together products for promotional purposes. For example, an admin can create a Summer collection, add products to it, and showcase it on the storefront. */ export interface ProductCollection { /** @@ -22,7 +22,7 @@ export interface ProductCollection { */ handle: string | null /** - * The Products contained in the Product Collection. Available if the relation `products` is expanded. + * The details of the products that belong to this product collection. */ products?: Array /** diff --git a/packages/generated/client-types/src/lib/models/ProductOption.ts b/packages/generated/client-types/src/lib/models/ProductOption.ts index 37069b9f33..fe91cadbc7 100644 --- a/packages/generated/client-types/src/lib/models/ProductOption.ts +++ b/packages/generated/client-types/src/lib/models/ProductOption.ts @@ -7,7 +7,7 @@ import type { Product } from "./Product" import type { ProductOptionValue } from "./ProductOptionValue" /** - * 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. + * A Product Option defines properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color". Admins are free to create any product options. */ export interface ProductOption { /** @@ -19,15 +19,15 @@ export interface ProductOption { */ title: string /** - * The Product Option Values that are defined for the Product Option. Available if the relation `values` is expanded. + * The details of the values of the product option. */ values?: Array /** - * The ID of the Product that the Product Option is defined for. + * The ID of the product that this product option belongs to. */ product_id: string /** - * A product object. Available if the relation `product` is expanded. + * The details of the product that this product option belongs to. */ product?: Product | null /** diff --git a/packages/generated/client-types/src/lib/models/ProductOptionValue.ts b/packages/generated/client-types/src/lib/models/ProductOptionValue.ts index 6c7e914c7b..60c716cded 100644 --- a/packages/generated/client-types/src/lib/models/ProductOptionValue.ts +++ b/packages/generated/client-types/src/lib/models/ProductOptionValue.ts @@ -7,7 +7,7 @@ import type { ProductOption } from "./ProductOption" import type { ProductVariant } from "./ProductVariant" /** - * 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. + * An option value is one of the possible values of a Product Option. Product Variants specify a unique combination of product option values. */ export interface ProductOptionValue { /** @@ -15,23 +15,23 @@ export interface ProductOptionValue { */ id: string /** - * The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is \"Size\" this value could be `Small`, `Medium` or `Large`). + * The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is "Size" this value could be `Small`, `Medium` or `Large`). */ value: string /** - * The ID of the Product Option that the Product Option Value is defined for. + * The ID of the Product Option that the Product Option Value belongs to. */ option_id: string /** - * Available if the relation `option` is expanded. + * The details of the product option that the Product Option Value belongs to. */ option?: ProductOption | null /** - * The ID of the Product Variant that the Product Option Value is defined for. + * The ID of the product variant that uses this product option value. */ variant_id: string /** - * Available if the relation `variant` is expanded. + * The details of the product variant that uses this product option value. */ variant?: ProductVariant | null /** diff --git a/packages/generated/client-types/src/lib/models/ProductTag.ts b/packages/generated/client-types/src/lib/models/ProductTag.ts index 2b3fb9a54a..6b10bec703 100644 --- a/packages/generated/client-types/src/lib/models/ProductTag.ts +++ b/packages/generated/client-types/src/lib/models/ProductTag.ts @@ -4,7 +4,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Product Tags can be added to Products for easy filtering and grouping. + * A Product Tag can be added to Products for easy filtering and grouping. */ export interface ProductTag { /** diff --git a/packages/generated/client-types/src/lib/models/ProductTaxRate.ts b/packages/generated/client-types/src/lib/models/ProductTaxRate.ts index ebf168857b..44b0e2391f 100644 --- a/packages/generated/client-types/src/lib/models/ProductTaxRate.ts +++ b/packages/generated/client-types/src/lib/models/ProductTaxRate.ts @@ -7,7 +7,7 @@ import type { Product } from "./Product" import type { TaxRate } from "./TaxRate" /** - * Associates a tax rate with a product to indicate that the product is taxed in a certain way + * This represents the association between a tax rate and a product to indicate that the product is taxed in a way different than the default. */ export interface ProductTaxRate { /** @@ -15,7 +15,7 @@ export interface ProductTaxRate { */ product_id: string /** - * Available if the relation `product` is expanded. + * The details of the product. */ product?: Product | null /** @@ -23,7 +23,7 @@ export interface ProductTaxRate { */ rate_id: string /** - * Available if the relation `tax_rate` is expanded. + * The details of the tax rate. */ tax_rate?: TaxRate | null /** diff --git a/packages/generated/client-types/src/lib/models/ProductType.ts b/packages/generated/client-types/src/lib/models/ProductType.ts index 04adaf09a3..6edb3f51d9 100644 --- a/packages/generated/client-types/src/lib/models/ProductType.ts +++ b/packages/generated/client-types/src/lib/models/ProductType.ts @@ -4,7 +4,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Product Type can be added to Products for filtering and reporting purposes. + * A Product Type can be added to Products for filtering and reporting purposes. */ export interface ProductType { /** diff --git a/packages/generated/client-types/src/lib/models/ProductTypeTaxRate.ts b/packages/generated/client-types/src/lib/models/ProductTypeTaxRate.ts index 22bd4e8499..82c174b72f 100644 --- a/packages/generated/client-types/src/lib/models/ProductTypeTaxRate.ts +++ b/packages/generated/client-types/src/lib/models/ProductTypeTaxRate.ts @@ -7,7 +7,7 @@ import type { ProductType } from "./ProductType" import type { TaxRate } from "./TaxRate" /** - * Associates a tax rate with a product type to indicate that the product type is taxed in a certain way + * This represents the association between a tax rate and a product type to indicate that the product type is taxed in a different way than the default. */ export interface ProductTypeTaxRate { /** @@ -15,7 +15,7 @@ export interface ProductTypeTaxRate { */ product_type_id: string /** - * Available if the relation `product_type` is expanded. + * The details of the product type. */ product_type?: ProductType | null /** @@ -23,7 +23,7 @@ export interface ProductTypeTaxRate { */ rate_id: string /** - * Available if the relation `tax_rate` is expanded. + * The details of the tax rate. */ tax_rate?: TaxRate | null /** diff --git a/packages/generated/client-types/src/lib/models/ProductVariant.ts b/packages/generated/client-types/src/lib/models/ProductVariant.ts index ce521be311..839cb1c88d 100644 --- a/packages/generated/client-types/src/lib/models/ProductVariant.ts +++ b/packages/generated/client-types/src/lib/models/ProductVariant.ts @@ -9,7 +9,7 @@ import type { ProductOptionValue } from "./ProductOptionValue" import type { ProductVariantInventoryItem } from "./ProductVariantInventoryItem" /** - * 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. + * A Product Variant represents 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. A product must at least have one product variant. */ export interface ProductVariant { /** @@ -21,15 +21,15 @@ export interface ProductVariant { */ title: string /** - * The ID of the Product that the Product Variant belongs to. + * The ID of the product that the product variant belongs to. */ product_id: string /** - * A product object. Available if the relation `product` is expanded. + * The details of the product that the product variant belongs to. */ product?: Product | null /** - * 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. + * The details of the prices of the Product Variant, each represented as a Money Amount. Each Money Amount represents a price in a given currency or a specific Region. */ prices?: Array /** @@ -97,11 +97,11 @@ export interface ProductVariant { */ width: number | null /** - * The Product Option Values specified for the Product Variant. Available if the relation `options` is expanded. + * The details of the product options that this product variant defines values for. */ options?: Array /** - * The Inventory Items related to the product variant. Available if the relation `inventory_items` is expanded. + * The details inventory items of the product variant. */ inventory_items?: Array /** diff --git a/packages/generated/client-types/src/lib/models/ProductVariantInventoryItem.ts b/packages/generated/client-types/src/lib/models/ProductVariantInventoryItem.ts index a7b5a4f000..d2d0753ac4 100644 --- a/packages/generated/client-types/src/lib/models/ProductVariantInventoryItem.ts +++ b/packages/generated/client-types/src/lib/models/ProductVariantInventoryItem.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductVariant } from "./ProductVariant" /** - * Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant. + * A Product Variant Inventory Item links variants with inventory items and denotes the required quantity of the variant. */ export interface ProductVariantInventoryItem { /** @@ -22,11 +22,11 @@ export interface ProductVariantInventoryItem { */ variant_id: string /** - * A ProductVariant object. Available if the relation `variant` is expanded. + * The details of the product variant. */ variant?: ProductVariant | null /** - * The quantity of an inventory item required for one quantity of the variant. + * The quantity of an inventory item required for the variant. */ required_quantity: number /** diff --git a/packages/generated/client-types/src/lib/models/PublishableApiKey.ts b/packages/generated/client-types/src/lib/models/PublishableApiKey.ts index 8b7a8538bd..20fbac90b7 100644 --- a/packages/generated/client-types/src/lib/models/PublishableApiKey.ts +++ b/packages/generated/client-types/src/lib/models/PublishableApiKey.ts @@ -4,7 +4,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Publishable API key defines scopes (i.e. resources) that are available within a request. + * A Publishable API key defines scopes that resources are available in. Then, it can be used in request to infer the resources without having to directly pass them. For example, a publishable API key can be associated with one or more sales channels. Then, when the publishable API key is passed in the header of a request, it is inferred what sales channel is being used without having to pass the sales channel as a query or body parameter of the request. Publishable API keys can only be used with sales channels, at the moment. */ export interface PublishableApiKey { /** diff --git a/packages/generated/client-types/src/lib/models/PublishableApiKeySalesChannel.ts b/packages/generated/client-types/src/lib/models/PublishableApiKeySalesChannel.ts index b569c400c5..e2edb20e18 100644 --- a/packages/generated/client-types/src/lib/models/PublishableApiKeySalesChannel.ts +++ b/packages/generated/client-types/src/lib/models/PublishableApiKeySalesChannel.ts @@ -4,7 +4,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Holds mapping between Publishable API keys and Sales Channels + * This represents the association between the Publishable API keys and Sales Channels */ export interface PublishableApiKeySalesChannel { /** diff --git a/packages/generated/client-types/src/lib/models/Refund.ts b/packages/generated/client-types/src/lib/models/Refund.ts index abde9ee666..6c47d01092 100644 --- a/packages/generated/client-types/src/lib/models/Refund.ts +++ b/packages/generated/client-types/src/lib/models/Refund.ts @@ -7,7 +7,7 @@ import type { Order } from "./Order" import type { Payment } from "./Payment" /** - * 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. + * A refund represents 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 an admin for an order. */ export interface Refund { /** @@ -15,19 +15,19 @@ export interface Refund { */ id: string /** - * The id of the Order that the Refund is related to. + * The ID of the order this refund was created for. */ order_id: string | null /** - * An order object. Available if the relation `order` is expanded. + * The details of the order this refund was created for. */ order?: Order | null /** - * The payment's ID if available + * The payment's ID, if available. */ payment_id: string | null /** - * Available if the relation `payment` is expanded. + * The details of the payment associated with the refund. */ payment?: Payment | null /** diff --git a/packages/generated/client-types/src/lib/models/Region.ts b/packages/generated/client-types/src/lib/models/Region.ts index 788218a580..554c5529f7 100644 --- a/packages/generated/client-types/src/lib/models/Region.ts +++ b/packages/generated/client-types/src/lib/models/Region.ts @@ -11,7 +11,7 @@ import type { TaxProvider } from "./TaxProvider" import type { TaxRate } from "./TaxRate" /** - * 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. + * A region holds settings specific to a geographical location, including the currency, tax rates, and fulfillment and payment providers. A Region can consist of multiple countries to accomodate common shopping settings across countries. */ export interface Region { /** @@ -23,11 +23,11 @@ export interface Region { */ name: string /** - * The 3 character currency code that the Region uses. + * The 3 character currency code used in the region. */ currency_code: string /** - * Available if the relation `currency` is expanded. + * The details of the currency used in the region. */ currency?: Currency | null /** @@ -35,7 +35,7 @@ export interface Region { */ tax_rate: number /** - * The tax rates that are included in the Region. Available if the relation `tax_rates` is expanded. + * The details of the tax rates used in the region, aside from the default rate. */ tax_rates?: Array /** @@ -51,7 +51,7 @@ export interface Region { */ automatic_taxes: boolean /** - * The countries that are included in the Region. Available if the relation `countries` is expanded. + * The details of the countries included in this region. */ countries?: Array /** @@ -59,19 +59,19 @@ export interface Region { */ tax_provider_id: string | null /** - * Available if the relation `tax_provider` is expanded. + * The details of the tax provider used in the region. */ tax_provider?: TaxProvider | null /** - * The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. + * The details of the payment providers that can be used to process payments in the region. */ payment_providers?: Array /** - * The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `fulfillment_providers` is expanded. + * The details of the fulfillment providers that can be used to fulfill items of orders and similar resources in the region. */ fulfillment_providers?: Array /** - * [EXPERIMENTAL] Does the prices for the region include tax + * Whether the prices for the region include tax */ includes_tax?: boolean /** diff --git a/packages/generated/client-types/src/lib/models/ResponseInventoryItem.ts b/packages/generated/client-types/src/lib/models/ResponseInventoryItem.ts index d34f6276b4..78f7d2096b 100644 --- a/packages/generated/client-types/src/lib/models/ResponseInventoryItem.ts +++ b/packages/generated/client-types/src/lib/models/ResponseInventoryItem.ts @@ -6,5 +6,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { InventoryItemDTO } from "./InventoryItemDTO" export type ResponseInventoryItem = InventoryItemDTO & { - available_quantity: number + /** + * The inventory's location levels. + */ + location_levels?: Array< + InventoryItemDTO & { + /** + * The available quantity in the inventory location. + */ + available_quantity: number + } + > } diff --git a/packages/generated/client-types/src/lib/models/Return.ts b/packages/generated/client-types/src/lib/models/Return.ts index 339dd05e10..cc631f65cf 100644 --- a/packages/generated/client-types/src/lib/models/Return.ts +++ b/packages/generated/client-types/src/lib/models/Return.ts @@ -10,7 +10,7 @@ import type { ShippingMethod } from "./ShippingMethod" import type { Swap } from "./Swap" /** - * 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. + * A Return holds information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can also be used as part of a Swap or a Claim. */ export interface Return { /** @@ -22,35 +22,35 @@ export interface Return { */ status: "requested" | "received" | "requires_action" | "canceled" /** - * The Return Items that will be shipped back to the warehouse. Available if the relation `items` is expanded. + * The details of the items that the customer is returning. */ items?: Array /** - * The ID of the Swap that the Return is a part of. + * The ID of the swap that the return may belong to. */ swap_id: string | null /** - * A swap object. Available if the relation `swap` is expanded. + * The details of the swap that the return may belong to. */ swap?: Swap | null /** - * The ID of the Claim that the Return is a part of. + * The ID of the claim that the return may belong to. */ claim_order_id: string | null /** - * A claim order object. Available if the relation `claim_order` is expanded. + * The details of the claim that the return may belong to. */ claim_order?: ClaimOrder | null /** - * The ID of the Order that the Return is made from. + * The ID of the order that the return was created for. */ order_id: string | null /** - * An order object. Available if the relation `order` is expanded. + * The details of the order that the return was created for. */ order?: Order | null /** - * 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. + * The details of the Shipping Method that will be used to send the Return back. Can be null if the Customer will handle the return shipment themselves. */ shipping_method?: ShippingMethod | null /** @@ -58,7 +58,7 @@ export interface Return { */ shipping_data: Record | null /** - * The id of the stock location the return will be added back. + * The ID of the stock location the return will be added back. */ location_id: string | null /** diff --git a/packages/generated/client-types/src/lib/models/ReturnItem.ts b/packages/generated/client-types/src/lib/models/ReturnItem.ts index e998751653..d80846261b 100644 --- a/packages/generated/client-types/src/lib/models/ReturnItem.ts +++ b/packages/generated/client-types/src/lib/models/ReturnItem.ts @@ -8,27 +8,27 @@ import type { Return } from "./Return" import type { ReturnReason } from "./ReturnReason" /** - * Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. + * A return item represents a line item in an order that is to be returned. It includes details related to the return and the reason behind it. */ export interface ReturnItem { /** - * The id of the Return that the Return Item belongs to. + * The ID of the Return that the Return Item belongs to. */ return_id: string /** - * The id of the Line Item that the Return Item references. + * The ID of the Line Item that the Return Item references. */ item_id: string /** - * Available if the relation `return_order` is expanded. + * Details of the Return that the Return Item belongs to. */ return_order?: Return | null /** - * Available if the relation `item` is expanded. + * The details of the line item in the original order to be returned. */ item?: LineItem | null /** - * The quantity of the Line Item that is included in the Return. + * The quantity of the Line Item to be returned. */ quantity: number /** @@ -48,7 +48,7 @@ export interface ReturnItem { */ reason_id: string | null /** - * Available if the relation `reason` is expanded. + * The details of the reason for returning the item. */ reason?: ReturnReason | null /** diff --git a/packages/generated/client-types/src/lib/models/ReturnReason.ts b/packages/generated/client-types/src/lib/models/ReturnReason.ts index bf4266ec6a..53e2a2f3c7 100644 --- a/packages/generated/client-types/src/lib/models/ReturnReason.ts +++ b/packages/generated/client-types/src/lib/models/ReturnReason.ts @@ -4,7 +4,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * 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. + * A Return Reason is a value defined by an admin. It can be used on Return Items in order to indicate why a Line Item was returned. */ export interface ReturnReason { /** @@ -28,11 +28,11 @@ export interface ReturnReason { */ parent_return_reason_id: string | null /** - * Available if the relation `parent_return_reason` is expanded. + * The details of the parent reason. */ parent_return_reason?: ReturnReason | null /** - * Available if the relation `return_reason_children` is expanded. + * The details of the child reasons. */ return_reason_children?: ReturnReason /** diff --git a/packages/generated/client-types/src/lib/models/SalesChannel.ts b/packages/generated/client-types/src/lib/models/SalesChannel.ts index bedf7a6e1d..a20dd7ecc5 100644 --- a/packages/generated/client-types/src/lib/models/SalesChannel.ts +++ b/packages/generated/client-types/src/lib/models/SalesChannel.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { SalesChannelLocation } from "./SalesChannelLocation" /** - * A Sales Channel + * A Sales Channel is a method a business offers its products for purchase for the customers. For example, a Webshop can be a sales channel, and a mobile app can be another. */ export interface SalesChannel { /** @@ -26,7 +26,7 @@ export interface SalesChannel { */ is_disabled: boolean /** - * The Stock Locations related to the sales channel. Available if the relation `locations` is expanded. + * The details of the stock locations related to the sales channel. */ locations?: Array /** diff --git a/packages/generated/client-types/src/lib/models/SalesChannelLocation.ts b/packages/generated/client-types/src/lib/models/SalesChannelLocation.ts index 88a1fe6546..31fcbc8d2f 100644 --- a/packages/generated/client-types/src/lib/models/SalesChannelLocation.ts +++ b/packages/generated/client-types/src/lib/models/SalesChannelLocation.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { SalesChannel } from "./SalesChannel" /** - * Sales Channel Stock Location link sales channels with stock locations. + * This represents the association between a sales channel and a stock locations. */ export interface SalesChannelLocation { /** @@ -14,15 +14,15 @@ export interface SalesChannelLocation { */ id: string /** - * The id of the Sales Channel + * The ID of the Sales Channel */ sales_channel_id: string /** - * The id of the Location Stock. + * The ID of the Location Stock. */ location_id: string /** - * The sales channel the location is associated with. Available if the relation `sales_channel` is expanded. + * The details of the sales channel the location is associated with. */ sales_channel?: SalesChannel | null /** diff --git a/packages/generated/client-types/src/lib/models/ShippingMethod.ts b/packages/generated/client-types/src/lib/models/ShippingMethod.ts index 4ebe72798a..265e41fa51 100644 --- a/packages/generated/client-types/src/lib/models/ShippingMethod.ts +++ b/packages/generated/client-types/src/lib/models/ShippingMethod.ts @@ -12,7 +12,7 @@ import type { ShippingOption } from "./ShippingOption" import type { Swap } from "./Swap" /** - * 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. + * A Shipping Method represents a way in which an Order or Return can be shipped. Shipping Methods are created from a Shipping Option, but may contain additional details that can be necessary for the Fulfillment Provider to handle the shipment. If the shipping method is created for a return, it may be associated with a claim or a swap that the return is part of. */ export interface ShippingMethod { /** @@ -20,55 +20,55 @@ export interface ShippingMethod { */ id: string /** - * The id of the Shipping Option that the Shipping Method is built from. + * The ID of the Shipping Option that the Shipping Method is built from. */ shipping_option_id: string /** - * The id of the Order that the Shipping Method is used on. + * The ID of the order that the shipping method is used in. */ order_id: string | null /** - * An order object. Available if the relation `order` is expanded. + * The details of the order that the shipping method is used in. */ order?: Order | null /** - * The id of the Claim that the Shipping Method is used on. + * The ID of the claim that the shipping method is used in. */ claim_order_id: string | null /** - * A claim order object. Available if the relation `claim_order` is expanded. + * The details of the claim that the shipping method is used in. */ claim_order?: ClaimOrder | null /** - * The id of the Cart that the Shipping Method is used on. + * The ID of the cart that the shipping method is used in. */ cart_id: string | null /** - * A cart object. Available if the relation `cart` is expanded. + * The details of the cart that the shipping method is used in. */ cart?: Cart | null /** - * The id of the Swap that the Shipping Method is used on. + * The ID of the swap that the shipping method is used in. */ swap_id: string | null /** - * A swap object. Available if the relation `swap` is expanded. + * The details of the swap that the shipping method is used in. */ swap?: Swap | null /** - * The id of the Return that the Shipping Method is used on. + * The ID of the return that the shipping method is used in. */ return_id: string | null /** - * A return object. Available if the relation `return_order` is expanded. + * The details of the return that the shipping method is used in. */ return_order?: Return | null /** - * Available if the relation `shipping_option` is expanded. + * The details of the shipping option the method was created from. */ shipping_option?: ShippingOption | null /** - * Available if the relation `tax_lines` is expanded. + * The details of the tax lines applied on the shipping method. */ tax_lines?: Array /** @@ -80,7 +80,7 @@ export interface ShippingMethod { */ data: Record /** - * [EXPERIMENTAL] Indicates if the shipping method price include tax + * Whether the shipping method price include tax */ includes_tax?: boolean /** diff --git a/packages/generated/client-types/src/lib/models/ShippingMethodTaxLine.ts b/packages/generated/client-types/src/lib/models/ShippingMethodTaxLine.ts index 9dfd76b4eb..ed44ec9f46 100644 --- a/packages/generated/client-types/src/lib/models/ShippingMethodTaxLine.ts +++ b/packages/generated/client-types/src/lib/models/ShippingMethodTaxLine.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ShippingMethod } from "./ShippingMethod" /** - * Shipping Method Tax Line + * A Shipping Method Tax Line represents the taxes applied on a shipping method in a cart. */ export interface ShippingMethodTaxLine { /** @@ -30,7 +30,7 @@ export interface ShippingMethodTaxLine { */ shipping_method_id: string /** - * Available if the relation `shipping_method` is expanded. + * The details of the associated shipping method. */ shipping_method?: ShippingMethod | null /** diff --git a/packages/generated/client-types/src/lib/models/ShippingOption.ts b/packages/generated/client-types/src/lib/models/ShippingOption.ts index 9b2ec83172..74dfa33db4 100644 --- a/packages/generated/client-types/src/lib/models/ShippingOption.ts +++ b/packages/generated/client-types/src/lib/models/ShippingOption.ts @@ -9,7 +9,7 @@ import type { ShippingOptionRequirement } from "./ShippingOptionRequirement" import type { ShippingProfile } from "./ShippingProfile" /** - * 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. + * A Shipping Option represents 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. */ export interface ShippingOption { /** @@ -21,27 +21,27 @@ export interface ShippingOption { */ name: string /** - * The region's ID + * The ID of the region this shipping option can be used in. */ region_id: string /** - * A region object. Available if the relation `region` is expanded. + * The details of the region this shipping option can be used in. */ region?: Region | null /** - * The ID of the Shipping Profile that the shipping option belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. + * The ID of the Shipping Profile that the shipping option belongs to. */ profile_id: string /** - * Available if the relation `profile` is expanded. + * The details of the shipping profile that the shipping option belongs to. */ profile?: ShippingProfile | null /** - * The id of the Fulfillment Provider, that will be used to process Fulfillments from the Shipping Option. + * The ID of the fulfillment provider that will be used to later to process the shipping method created from this shipping option and its fulfillments. */ provider_id: string /** - * Available if the relation `provider` is expanded. + * The details of the fulfillment provider that will be used to later to process the shipping method created from this shipping option and its fulfillments. */ provider?: FulfillmentProvider | null /** @@ -61,7 +61,7 @@ export interface ShippingOption { */ admin_only: boolean /** - * The requirements that must be satisfied for the Shipping Option to be available for a Cart. Available if the relation `requirements` is expanded. + * The details of the requirements that must be satisfied for the Shipping Option to be available for usage in a Cart. */ requirements?: Array /** @@ -69,7 +69,7 @@ export interface ShippingOption { */ data: Record /** - * [EXPERIMENTAL] Does the shipping option price include tax + * Whether the shipping option price include tax */ includes_tax?: boolean /** diff --git a/packages/generated/client-types/src/lib/models/ShippingOptionRequirement.ts b/packages/generated/client-types/src/lib/models/ShippingOptionRequirement.ts index 72f9355a8a..97d3182d4b 100644 --- a/packages/generated/client-types/src/lib/models/ShippingOptionRequirement.ts +++ b/packages/generated/client-types/src/lib/models/ShippingOptionRequirement.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ShippingOption } from "./ShippingOption" /** - * A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. + * A shipping option requirement defines conditions that a Cart must satisfy for the Shipping Option to be available for usage in the Cart. */ export interface ShippingOptionRequirement { /** @@ -14,11 +14,11 @@ export interface ShippingOptionRequirement { */ id: string /** - * The id of the Shipping Option that the hipping option requirement belongs to + * The ID of the shipping option that the requirements belong to. */ shipping_option_id: string /** - * Available if the relation `shipping_option` is expanded. + * The details of the shipping option that the requirements belong to. */ shipping_option?: ShippingOption | null /** diff --git a/packages/generated/client-types/src/lib/models/ShippingProfile.ts b/packages/generated/client-types/src/lib/models/ShippingProfile.ts index 255b7c9998..15bb399b04 100644 --- a/packages/generated/client-types/src/lib/models/ShippingProfile.ts +++ b/packages/generated/client-types/src/lib/models/ShippingProfile.ts @@ -7,7 +7,7 @@ import type { Product } from "./Product" import type { ShippingOption } from "./ShippingOption" /** - * Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. + * A Shipping Profile has a set of defined Shipping Options that can be used to fulfill a given set of Products. For example, gift cards are shipped differently than physical products, so a shipping profile with the type `gift_card` groups together the shipping options that can only be used for gift cards. */ export interface ShippingProfile { /** @@ -23,11 +23,11 @@ export interface ShippingProfile { */ type: "default" | "gift_card" | "custom" /** - * The Products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded. + * The details of the products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded. */ products?: Array /** - * The Shipping Options that can be used to fulfill the Products in the Shipping Profile. Available if the relation `shipping_options` is expanded. + * The details of the shipping options that can be used to create shipping methods for the Products in the Shipping Profile. */ shipping_options?: Array /** diff --git a/packages/generated/client-types/src/lib/models/ShippingTaxRate.ts b/packages/generated/client-types/src/lib/models/ShippingTaxRate.ts index 308678302c..792b0ac335 100644 --- a/packages/generated/client-types/src/lib/models/ShippingTaxRate.ts +++ b/packages/generated/client-types/src/lib/models/ShippingTaxRate.ts @@ -7,23 +7,23 @@ import type { ShippingOption } from "./ShippingOption" import type { TaxRate } from "./TaxRate" /** - * Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way + * This represents the tax rates applied on a shipping option. */ export interface ShippingTaxRate { /** - * The ID of the Shipping Option + * The ID of the shipping option. */ shipping_option_id: string /** - * Available if the relation `shipping_option` is expanded. + * The details of the shipping option. */ shipping_option?: ShippingOption | null /** - * The ID of the Tax Rate + * The ID of the associated tax rate. */ rate_id: string /** - * Available if the relation `tax_rate` is expanded. + * The details of the associated tax rate. */ tax_rate?: TaxRate | null /** diff --git a/packages/generated/client-types/src/lib/models/Store.ts b/packages/generated/client-types/src/lib/models/Store.ts index 9d554c6556..950f3610d9 100644 --- a/packages/generated/client-types/src/lib/models/Store.ts +++ b/packages/generated/client-types/src/lib/models/Store.ts @@ -7,7 +7,7 @@ import type { Currency } from "./Currency" import type { SalesChannel } from "./SalesChannel" /** - * Holds settings for the Store, such as name, currencies, etc. + * A store holds the main settings of the commerce shop. By default, only one store is created and used within the Medusa backend. It holds settings related to the name of the store, available currencies, and more. */ export interface Store { /** @@ -23,11 +23,11 @@ export interface Store { */ default_currency_code: string /** - * Available if the relation `default_currency` is expanded. + * The details of the store's default currency. */ default_currency?: Currency | null /** - * The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. + * The details of the enabled currencies in the store. */ currencies?: Array /** @@ -47,11 +47,11 @@ export interface Store { */ default_location_id: string | null /** - * The sales channel ID the cart is associated with. + * The ID of the store's default sales channel. */ default_sales_channel_id?: string | null /** - * A sales channel object. Available if the relation `default_sales_channel` is expanded. + * The details of the store's default sales channel. */ default_sales_channel?: SalesChannel | null /** diff --git a/packages/generated/client-types/src/lib/models/StoreAuthRes.ts b/packages/generated/client-types/src/lib/models/StoreAuthRes.ts index 108933be43..d659300431 100644 --- a/packages/generated/client-types/src/lib/models/StoreAuthRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreAuthRes.ts @@ -7,6 +7,9 @@ import type { Customer } from "./Customer" import type { Order } from "./Order" export interface StoreAuthRes { + /** + * Customer's details. + */ customer: Merge< SetRelation, { diff --git a/packages/generated/client-types/src/lib/models/StoreCartShippingOptionsListRes.ts b/packages/generated/client-types/src/lib/models/StoreCartShippingOptionsListRes.ts index d587d53eed..48f29a7d00 100644 --- a/packages/generated/client-types/src/lib/models/StoreCartShippingOptionsListRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreCartShippingOptionsListRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PricedShippingOption } from "./PricedShippingOption" export interface StoreCartShippingOptionsListRes { + /** + * An array of shipping options details. + */ shipping_options: Array< SetRelation > diff --git a/packages/generated/client-types/src/lib/models/StoreCartsRes.ts b/packages/generated/client-types/src/lib/models/StoreCartsRes.ts index ed26cb8f96..bceb536bb1 100644 --- a/packages/generated/client-types/src/lib/models/StoreCartsRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreCartsRes.ts @@ -12,6 +12,9 @@ import type { Region } from "./Region" import type { ShippingMethod } from "./ShippingMethod" export interface StoreCartsRes { + /** + * Cart details. + */ cart: Merge< SetRelation< Cart, diff --git a/packages/generated/client-types/src/lib/models/StoreCollectionsListRes.ts b/packages/generated/client-types/src/lib/models/StoreCollectionsListRes.ts index a3a57dd495..680f753e72 100644 --- a/packages/generated/client-types/src/lib/models/StoreCollectionsListRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreCollectionsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductCollection } from "./ProductCollection" export interface StoreCollectionsListRes { + /** + * An array of product collections details + */ collections: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of product collections skipped when retrieving the product collections. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/StoreCollectionsRes.ts b/packages/generated/client-types/src/lib/models/StoreCollectionsRes.ts index b3c4fbcd35..6c9f82fe24 100644 --- a/packages/generated/client-types/src/lib/models/StoreCollectionsRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreCollectionsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductCollection } from "./ProductCollection" export interface StoreCollectionsRes { + /** + * Product collection details. + */ collection: ProductCollection } diff --git a/packages/generated/client-types/src/lib/models/StoreCompleteCartRes.ts b/packages/generated/client-types/src/lib/models/StoreCompleteCartRes.ts index deb3af9138..0ace830e5e 100644 --- a/packages/generated/client-types/src/lib/models/StoreCompleteCartRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreCompleteCartRes.ts @@ -9,7 +9,7 @@ import type { Swap } from "./Swap" export interface StoreCompleteCartRes { /** - * The type of the data property. + * The type of the data property. If the cart completion fails, type will be `cart` and the data object will be the cart's details. If the cart completion is successful and the cart is used for checkout, type will be `order` and the data object will be the order's details. If the cart completion is successful and the cart is used for swap creation, type will be `swap` and the data object will be the swap's details. */ type: "order" | "cart" | "swap" /** diff --git a/packages/generated/client-types/src/lib/models/StoreCustomersListOrdersRes.ts b/packages/generated/client-types/src/lib/models/StoreCustomersListOrdersRes.ts index dce71ad18f..e8982052ad 100644 --- a/packages/generated/client-types/src/lib/models/StoreCustomersListOrdersRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreCustomersListOrdersRes.ts @@ -16,6 +16,9 @@ import type { ShippingMethod } from "./ShippingMethod" import type { Swap } from "./Swap" export interface StoreCustomersListOrdersRes { + /** + * An array of orders details. + */ orders: Array< Merge< SetRelation< @@ -135,7 +138,7 @@ export interface StoreCustomersListOrdersRes { */ count: number /** - * The number of items skipped before these items + * The number of orders skipped when retrieving the orders. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/StoreCustomersListPaymentMethodsRes.ts b/packages/generated/client-types/src/lib/models/StoreCustomersListPaymentMethodsRes.ts index ce67a6e22d..6a88fcb57b 100644 --- a/packages/generated/client-types/src/lib/models/StoreCustomersListPaymentMethodsRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreCustomersListPaymentMethodsRes.ts @@ -4,9 +4,12 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreCustomersListPaymentMethodsRes { + /** + * An array of saved payment method details. + */ payment_methods: Array<{ /** - * The id of the Payment Provider where the payment method is saved. + * The ID of the Payment Provider where the payment method is saved. */ provider_id: string /** diff --git a/packages/generated/client-types/src/lib/models/StoreCustomersRes.ts b/packages/generated/client-types/src/lib/models/StoreCustomersRes.ts index 0540c23b76..95145f40d2 100644 --- a/packages/generated/client-types/src/lib/models/StoreCustomersRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreCustomersRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Customer } from "./Customer" export interface StoreCustomersRes { + /** + * Customer details. + */ customer: SetRelation } diff --git a/packages/generated/client-types/src/lib/models/StoreCustomersResetPasswordRes.ts b/packages/generated/client-types/src/lib/models/StoreCustomersResetPasswordRes.ts index a5cafd713c..37e4207232 100644 --- a/packages/generated/client-types/src/lib/models/StoreCustomersResetPasswordRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreCustomersResetPasswordRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Customer } from "./Customer" export interface StoreCustomersResetPasswordRes { + /** + * Customer details. + */ customer: Customer } diff --git a/packages/generated/client-types/src/lib/models/StoreGetCollectionsParams.ts b/packages/generated/client-types/src/lib/models/StoreGetCollectionsParams.ts index 1ef12142ed..acb024effc 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetCollectionsParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetCollectionsParams.ts @@ -5,19 +5,19 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetCollectionsParams { /** - * The number of collections to skip before starting to collect the collections set + * The number of product collections to skip when retrieving the product collections. */ offset?: number /** - * The number of collections to return + * Limit the number of product collections returned. */ limit?: number /** - * Filter by the collection handle + * Filter by handles */ handle?: Array /** - * Date comparison for when resulting collections were created. + * Filter by a creation date range. */ created_at?: { /** @@ -38,7 +38,7 @@ export interface StoreGetCollectionsParams { gte?: string } /** - * Date comparison for when resulting collections were updated. + * Filter by an update date range. */ updated_at?: { /** diff --git a/packages/generated/client-types/src/lib/models/StoreGetCustomersCustomerOrdersParams.ts b/packages/generated/client-types/src/lib/models/StoreGetCustomersCustomerOrdersParams.ts index da50b8ca1a..ef6efab7ed 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetCustomersCustomerOrdersParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetCustomersCustomerOrdersParams.ts @@ -5,51 +5,71 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetCustomersCustomerOrdersParams { /** - * Query used for searching orders. + * term to search orders' display ID, email, shipping address's first name, customer's first name, customer's last name, and customer's phone number. */ q?: string /** - * Id of the order to search for. + * Filter by ID. */ id?: string /** - * Status to search for. + * Filter by status. */ - status?: Array + status?: Array< + "pending" | "completed" | "archived" | "canceled" | "requires_action" + > /** * Fulfillment status to search for. */ - fulfillment_status?: Array + fulfillment_status?: Array< + | "not_fulfilled" + | "partially_fulfilled" + | "fulfilled" + | "partially_shipped" + | "shipped" + | "partially_returned" + | "returned" + | "canceled" + | "requires_action" + > /** * Payment status to search for. */ - payment_status?: Array + payment_status?: Array< + | "not_paid" + | "awaiting" + | "captured" + | "partially_refunded" + | "refunded" + | "canceled" + | "requires_action" + > /** - * Display id to search for. + * Filter by display ID. */ display_id?: string /** - * to search for. + * Filter by cart ID. */ cart_id?: string /** - * to search for. + * Filter by email. */ email?: string /** - * to search for. + * Filter by region ID. */ region_id?: string /** - * The 3 character ISO currency code to set prices based on. + * Filter by the 3 character ISO currency code of the order. */ currency_code?: string /** - * to search for. + * Filter by tax rate. */ tax_rate?: string /** - * Date comparison for when resulting collections were created. + * Filter by a creation date range. */ created_at?: { /** @@ -70,7 +90,7 @@ export interface StoreGetCustomersCustomerOrdersParams { gte?: string } /** - * Date comparison for when resulting collections were updated. + * Filter by an update date range. */ updated_at?: { /** @@ -91,7 +111,7 @@ export interface StoreGetCustomersCustomerOrdersParams { gte?: string } /** - * Date comparison for when resulting collections were canceled. + * Filter by a cancelation date range. */ canceled_at?: { /** @@ -112,19 +132,19 @@ export interface StoreGetCustomersCustomerOrdersParams { gte?: string } /** - * How many orders to return. + * Limit the number of orders returned. */ limit?: number /** - * The offset in the resulting orders. + * The number of orders to skip when retrieving the orders. */ offset?: number /** - * (Comma separated string) Which fields should be included in the resulting orders. - */ - fields?: string - /** - * (Comma separated string) Which relations should be expanded in the resulting orders. + * Comma-separated relations that should be expanded in the returned orders. */ expand?: string + /** + * Comma-separated fields that should be included in the returned orders. + */ + fields?: string } diff --git a/packages/generated/client-types/src/lib/models/StoreGetOrdersParams.ts b/packages/generated/client-types/src/lib/models/StoreGetOrdersParams.ts index 047571cd83..bca8e1294b 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetOrdersParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetOrdersParams.ts @@ -5,23 +5,23 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetOrdersParams { /** - * The display id given to the Order. + * Filter by ID. */ display_id: number /** - * (Comma separated) Which fields should be included in the result. + * Comma-separated fields that should be expanded in the returned order. */ fields?: string /** - * (Comma separated) Which fields should be expanded in the result. + * Comma-separated relations that should be expanded in the returned order. */ expand?: string /** - * The email associated with this order. + * Filter by email. */ email: string /** - * The shipping address associated with this order. + * Filter by the shipping address's postal code. */ shipping_address?: { /** diff --git a/packages/generated/client-types/src/lib/models/StoreGetPaymentCollectionsParams.ts b/packages/generated/client-types/src/lib/models/StoreGetPaymentCollectionsParams.ts index 51581fe0bf..1007108ffe 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetPaymentCollectionsParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetPaymentCollectionsParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetPaymentCollectionsParams { /** - * Comma separated list of relations to include in the results. - */ - expand?: string - /** - * Comma separated list of fields to include in the results. + * Comma-separated fields that should be expanded in the returned payment collection. */ fields?: string + /** + * Comma-separated relations that should be expanded in the returned payment collection. + */ + expand?: string } diff --git a/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesCategoryParams.ts b/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesCategoryParams.ts index 8a00721b56..48df53c19b 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesCategoryParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesCategoryParams.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetProductCategoriesCategoryParams { /** - * (Comma separated) Which fields should be expanded in each product category. - */ - expand?: string - /** - * (Comma separated) Which fields should be retrieved in each product category. + * Comma-separated fields that should be expanded in the returned product category. */ fields?: string + /** + * Comma-separated relations that should be expanded in the returned product category. + */ + expand?: string } diff --git a/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesCategoryRes.ts b/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesCategoryRes.ts index 0e04eae689..3faa1fc3a6 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesCategoryRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesCategoryRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductCategory } from "./ProductCategory" export interface StoreGetProductCategoriesCategoryRes { + /** + * Product category details. + */ product_category: SetRelation< ProductCategory, "category_children" | "parent_category" diff --git a/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesParams.ts b/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesParams.ts index ebce16ed83..406ee3bd14 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesParams.ts @@ -5,27 +5,35 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetProductCategoriesParams { /** - * Query used for searching product category names or handles. + * term used to search product category's names and handles. */ q?: string /** - * Query used for searching product category by handle. + * Filter by handle. */ handle?: string /** - * Returns categories scoped by parent + * Filter by the ID of a parent category. Only children of the provided parent category are retrieved. */ parent_category_id?: string /** - * Include all nested descendants of category + * Whether all nested categories inside a category should be retrieved. */ include_descendants_tree?: boolean /** - * How many product categories to skip in the result. + * The number of product categories to skip when retrieving the product categories. */ offset?: number /** * Limit the number of product categories returned. */ limit?: number + /** + * Comma-separated relations that should be expanded in the returned product categories. + */ + expand?: string + /** + * Comma-separated fields that should be included in the returned product categories. + */ + fields?: string } diff --git a/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesRes.ts b/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesRes.ts index 9ba92c7faf..ffefed64e3 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetProductCategoriesRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductCategory } from "./ProductCategory" export interface StoreGetProductCategoriesRes { + /** + * An array of product categories details. + */ product_categories: Array< SetRelation > @@ -14,7 +17,7 @@ export interface StoreGetProductCategoriesRes { */ count: number /** - * The number of items skipped before these items + * The number of product categories skipped when retrieving the product categories. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/StoreGetProductTagsParams.ts b/packages/generated/client-types/src/lib/models/StoreGetProductTagsParams.ts index f914b51038..0cc061e242 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetProductTagsParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetProductTagsParams.ts @@ -5,35 +5,35 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetProductTagsParams { /** - * The number of types to return. + * Limit the number of product tags returned. */ limit?: number /** - * The number of items to skip before the results. + * The number of product tags to skip when retrieving the product tags. */ offset?: number /** - * The field to sort items by. + * A product-tag field to sort-order the retrieved product tags by. */ order?: string /** - * The discount condition id on which to filter the product tags. + * Filter by the ID of a discount condition. When provided, only tags that the discount condition applies for will be retrieved. */ discount_condition_id?: string /** - * The tag values to search for + * Filter by tag values. */ value?: Array /** - * The tag IDs to search for + * Filter by IDs. */ id?: Array /** - * A query string to search values for + * term to search product tag's value. */ q?: string /** - * Date comparison for when resulting product tags were created. + * Filter by a creation date range. */ created_at?: { /** @@ -54,7 +54,7 @@ export interface StoreGetProductTagsParams { gte?: string } /** - * Date comparison for when resulting product tags were updated. + * Filter by an update date range. */ updated_at?: { /** diff --git a/packages/generated/client-types/src/lib/models/StoreGetProductTypesParams.ts b/packages/generated/client-types/src/lib/models/StoreGetProductTypesParams.ts index e526710ef6..964a9e026d 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetProductTypesParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetProductTypesParams.ts @@ -5,35 +5,35 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetProductTypesParams { /** - * The number of types to return. + * Limit the number of product types returned. */ limit?: number /** - * The number of items to skip before the results. + * The number of product types to skip when retrieving the product types. */ offset?: number /** - * The field to sort items by. + * A product-type field to sort-order the retrieved product types by. */ order?: string /** - * The discount condition id on which to filter the product types. + * Filter by the ID of a discount condition. When provided, only types that the discount condition applies for will be retrieved. */ discount_condition_id?: string /** - * The type values to search for + * Filter by type values. */ value?: Array /** - * The type IDs to search for + * Filter by IDs. */ id?: Array /** - * A query string to search values for + * term to search product type's value. */ q?: string /** - * Date comparison for when resulting product types were created. + * Filter by a creation date range. */ created_at?: { /** @@ -54,7 +54,7 @@ export interface StoreGetProductTypesParams { gte?: string } /** - * Date comparison for when resulting product types were updated. + * Filter by an update date range. */ updated_at?: { /** diff --git a/packages/generated/client-types/src/lib/models/StoreGetProductsParams.ts b/packages/generated/client-types/src/lib/models/StoreGetProductsParams.ts index f6e5b0c0db..5fd3db84a2 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetProductsParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetProductsParams.ts @@ -5,47 +5,47 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetProductsParams { /** - * Query used for searching products by title, description, variant's title, variant's sku, and collection's title + * term used to search products' title, description, variant's title, variant's sku, and collection's title. */ q?: string /** - * product IDs to search for. + * Filter by IDs. */ id?: string | Array /** - * an array of sales channel IDs to filter the retrieved products by. + * Filter by sales channel IDs. When provided, only products available in the selected sales channels are retrieved. Alternatively, you can pass a publishable API key in the request header and this will have the same effect. */ sales_channel_id?: Array /** - * Collection IDs to search for + * Filter by product collection IDs. When provided, only products that belong to the specified product collections are retrieved. */ collection_id?: Array /** - * Type IDs to search for + * Filter by product type IDs. When provided, only products that belong to the specified product types are retrieved. */ type_id?: Array /** - * Tag IDs to search for + * Filter by product tag IDs. When provided, only products that belong to the specified product tags are retrieved. */ tags?: Array /** - * title to search for. + * Filter by title. */ title?: string /** - * description to search for. + * Filter by description */ description?: string /** - * handle to search for. + * Filter by handle. */ handle?: string /** - * Search for giftcards using is_giftcard=true. + * Whether to retrieve regular products or gift-card products. */ is_giftcard?: boolean /** - * Date comparison for when resulting products were created. + * Filter by a creation date range. */ created_at?: { /** @@ -66,7 +66,7 @@ export interface StoreGetProductsParams { gte?: string } /** - * Date comparison for when resulting products were updated. + * Filter by an update date range. */ updated_at?: { /** @@ -87,15 +87,15 @@ export interface StoreGetProductsParams { gte?: string } /** - * Category ids to filter by. + * Filter by product category IDs. When provided, only products that belong to the specified product categories are retrieved. */ category_id?: Array /** - * Include category children when filtering by category_id. + * Whether to include child product categories when filtering using the `category_id` field. */ include_category_children?: boolean /** - * How many products to skip in the result. + * The number of products to skip when retrieving the products. */ offset?: number /** @@ -103,27 +103,27 @@ export interface StoreGetProductsParams { */ limit?: number /** - * (Comma separated) Which fields should be expanded in each product of the result. + * Comma-separated relations that should be expanded in the returned products. */ expand?: string /** - * (Comma separated) Which fields should be included in each product of the result. + * Comma-separated fields that should be included in the returned products. */ fields?: string /** - * the field used to order the products. + * A product field to sort-order the retrieved products by. */ order?: string /** - * The id of the Cart to set prices based on. + * The ID of the cart. This is useful for accurate pricing based on the cart's context. */ cart_id?: string /** - * The id of the Region to set prices based on. + * The ID of the region. This is useful for accurate pricing based on the selected region. */ region_id?: string /** - * The currency code to use for price selection. + * A 3 character ISO currency code. This is useful for accurate pricing based on the selected currency. */ currency_code?: string } diff --git a/packages/generated/client-types/src/lib/models/StoreGetProductsProductParams.ts b/packages/generated/client-types/src/lib/models/StoreGetProductsProductParams.ts index 5bde519bd4..90bb2f4990 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetProductsProductParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetProductsProductParams.ts @@ -5,27 +5,27 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetProductsProductParams { /** - * The sales channel used when fetching the product. + * The ID of the sales channel the customer is viewing the product from. */ sales_channel_id?: string /** - * The ID of the customer's cart. + * The ID of the cart. This is useful for accurate pricing based on the cart's context. */ cart_id?: string /** - * The ID of the region the customer is using. This is helpful to ensure correct prices are retrieved for a region. + * The ID of the region. This is useful for accurate pricing based on the selected region. */ region_id?: string /** - * (Comma separated) Which fields should be included in the result. - */ - fields?: string - /** - * (Comma separated) Which fields should be expanded in each product of the result. + * Comma-separated relations that should be expanded in the returned product. */ expand?: string /** - * The 3 character ISO currency code to set prices based on. This is helpful to ensure correct prices are retrieved for a currency. + * Comma-separated fields that should be included in the returned product. + */ + fields?: string + /** + * A 3 character ISO currency code. This is useful for accurate pricing based on the selected currency. */ currency_code?: string } diff --git a/packages/generated/client-types/src/lib/models/StoreGetRegionsParams.ts b/packages/generated/client-types/src/lib/models/StoreGetRegionsParams.ts index 578624f4f5..cc5eabf1c3 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetRegionsParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetRegionsParams.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetRegionsParams { /** - * How many regions to skip in the result. + * The number of regions to skip when retrieving the regions. */ offset?: number /** @@ -13,7 +13,7 @@ export interface StoreGetRegionsParams { */ limit?: number /** - * Date comparison for when resulting regions were created. + * Filter by a creation date range. */ created_at?: { /** @@ -34,7 +34,7 @@ export interface StoreGetRegionsParams { gte?: string } /** - * Date comparison for when resulting regions were updated. + * Filter by an update date range. */ updated_at?: { /** diff --git a/packages/generated/client-types/src/lib/models/StoreGetShippingOptionsParams.ts b/packages/generated/client-types/src/lib/models/StoreGetShippingOptionsParams.ts index 44f3d5a84b..a95cd67fd0 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetShippingOptionsParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetShippingOptionsParams.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetShippingOptionsParams { /** - * Whether return Shipping Options should be included. By default all Shipping Options are returned. + * Whether return shipping options should be included. By default, all shipping options are returned. */ is_return?: boolean /** - * A comma separated list of Product ids to filter Shipping Options by. + * "Comma-separated list of Product IDs to filter Shipping Options by. If provided, only shipping options that can be used with the provided products are retrieved." */ product_ids?: string /** - * the Region to retrieve Shipping Options from. + * "The ID of the region that the shipping options belong to. If not provided, all shipping options are retrieved." */ region_id?: string } diff --git a/packages/generated/client-types/src/lib/models/StoreGetVariantsParams.ts b/packages/generated/client-types/src/lib/models/StoreGetVariantsParams.ts index 7dc5c7e6b9..9b9fc7c7f1 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetVariantsParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetVariantsParams.ts @@ -5,39 +5,47 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetVariantsParams { /** - * A comma separated list of Product Variant ids to filter by. + * Filter by a comma-separated list of IDs. If supplied, it overrides the `id` parameter. */ ids?: string /** - * A sales channel id for result configuration. + * Filter by one or more IDs. If `ids` is supplied, it's overrides the value of this parameter. + */ + id?: string | Array + /** + * "Filter by sales channel IDs. When provided, only products available in the selected sales channels are retrieved. Alternatively, you can pass a publishable API key in the request header and this will have the same effect." */ sales_channel_id?: string /** - * A comma separated list of Product Variant relations to load. + * Comma-separated relations that should be expanded in the returned product variants. */ expand?: string /** - * How many product variants to skip in the result. + * Comma-separated fields that should be included in the returned product variants. + */ + fields?: string + /** + * The number of products to skip when retrieving the product variants. */ offset?: number /** - * Maximum number of Product Variants to return. + * Limit the number of product variants returned. */ limit?: number /** - * The id of the Cart to set prices based on. + * The ID of the cart. This is useful for accurate pricing based on the cart's context. */ cart_id?: string /** - * The id of the Region to set prices based on. + * The ID of the region. This is useful for accurate pricing based on the selected region. */ region_id?: string /** - * The currency code to use for price selection. + * A 3 character ISO currency code. This is useful for accurate pricing based on the selected currency. */ currency_code?: string /** - * product variant title to search for. + * Filter by title */ title?: string | Array /** @@ -47,19 +55,19 @@ export interface StoreGetVariantsParams { | number | { /** - * filter by inventory quantity less than this number + * Filter by inventory quantity less than this number */ lt?: number /** - * filter by inventory quantity greater than this number + * Filter by inventory quantity greater than this number */ gt?: number /** - * filter by inventory quantity less than or equal to this number + * Filter by inventory quantity less than or equal to this number */ lte?: number /** - * filter by inventory quantity greater than or equal to this number + * Filter by inventory quantity greater than or equal to this number */ gte?: number } diff --git a/packages/generated/client-types/src/lib/models/StoreGetVariantsVariantParams.ts b/packages/generated/client-types/src/lib/models/StoreGetVariantsVariantParams.ts index 71d724fcf3..15b081b398 100644 --- a/packages/generated/client-types/src/lib/models/StoreGetVariantsVariantParams.ts +++ b/packages/generated/client-types/src/lib/models/StoreGetVariantsVariantParams.ts @@ -5,19 +5,19 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreGetVariantsVariantParams { /** - * The id of the Cart to set prices based on. - */ - cart_id?: string - /** - * A sales channel id for result configuration. + * The ID of the sales channel the customer is viewing the product variant from. */ sales_channel_id?: string /** - * The id of the Region to set prices based on. + * The ID of the cart. This is useful for accurate pricing based on the cart's context. + */ + cart_id?: string + /** + * The ID of the region. This is useful for accurate pricing based on the selected region. */ region_id?: string /** - * The 3 character ISO currency code to set prices based on. + * A 3 character ISO currency code. This is useful for accurate pricing based on the selected currency. */ currency_code?: string } diff --git a/packages/generated/client-types/src/lib/models/StoreGiftCardsRes.ts b/packages/generated/client-types/src/lib/models/StoreGiftCardsRes.ts index 5df3692bb8..c6d239306f 100644 --- a/packages/generated/client-types/src/lib/models/StoreGiftCardsRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreGiftCardsRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { GiftCard } from "./GiftCard" export interface StoreGiftCardsRes { + /** + * Gift card details. + */ gift_card: GiftCard } diff --git a/packages/generated/client-types/src/lib/models/StoreOrderEditsRes.ts b/packages/generated/client-types/src/lib/models/StoreOrderEditsRes.ts index 8bc930f858..eacd54a219 100644 --- a/packages/generated/client-types/src/lib/models/StoreOrderEditsRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreOrderEditsRes.ts @@ -8,6 +8,9 @@ import type { OrderEdit } from "./OrderEdit" import type { OrderItemChange } from "./OrderItemChange" export interface StoreOrderEditsRes { + /** + * Order edit details. + */ order_edit: Merge< SetRelation< OrderEdit, diff --git a/packages/generated/client-types/src/lib/models/StoreOrdersRes.ts b/packages/generated/client-types/src/lib/models/StoreOrdersRes.ts index 546e5cfa98..7fd84e27b2 100644 --- a/packages/generated/client-types/src/lib/models/StoreOrdersRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreOrdersRes.ts @@ -16,6 +16,9 @@ import type { ShippingMethod } from "./ShippingMethod" import type { Swap } from "./Swap" export interface StoreOrdersRes { + /** + * Order details. + */ order: Merge< SetRelation< Order, diff --git a/packages/generated/client-types/src/lib/models/StorePaymentCollectionsRes.ts b/packages/generated/client-types/src/lib/models/StorePaymentCollectionsRes.ts index acc9ac7162..b03f83c15e 100644 --- a/packages/generated/client-types/src/lib/models/StorePaymentCollectionsRes.ts +++ b/packages/generated/client-types/src/lib/models/StorePaymentCollectionsRes.ts @@ -7,6 +7,9 @@ import type { PaymentCollection } from "./PaymentCollection" import type { Region } from "./Region" export interface StorePaymentCollectionsRes { + /** + * Payment collection's details. + */ payment_collection: Merge< SetRelation, { diff --git a/packages/generated/client-types/src/lib/models/StorePaymentCollectionsSessionRes.ts b/packages/generated/client-types/src/lib/models/StorePaymentCollectionsSessionRes.ts index 1e273e2bdf..e5c67195a0 100644 --- a/packages/generated/client-types/src/lib/models/StorePaymentCollectionsSessionRes.ts +++ b/packages/generated/client-types/src/lib/models/StorePaymentCollectionsSessionRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PaymentSession } from "./PaymentSession" export interface StorePaymentCollectionsSessionRes { + /** + * Payment session's details. + */ payment_session: PaymentSession } diff --git a/packages/generated/client-types/src/lib/models/StorePostCartReq.ts b/packages/generated/client-types/src/lib/models/StorePostCartReq.ts index a1333d244d..f5afb0712d 100644 --- a/packages/generated/client-types/src/lib/models/StorePostCartReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostCartReq.ts @@ -5,32 +5,32 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostCartReq { /** - * The ID of the Region to create the Cart in. + * The ID of the Region to create the Cart in. Setting the cart's region can affect the pricing of the items in the cart as well as the used currency. If this parameter is not provided, the first region in the store is used by default. */ region_id?: string /** - * [EXPERIMENTAL] The ID of the Sales channel to create the Cart in. + * The ID of the Sales channel to create the Cart in. The cart's sales channel affects which products can be added to the cart. If a product does not exist in the cart's sales channel, it cannot be added to the cart. If you add a publishable API key in the header of this request and specify a sales channel ID, the specified sales channel must be within the scope of the publishable API key's resources. If you add a publishable API key in the header of this request, you don't specify a sales channel ID, and the publishable API key is associated with one sales channel, that sales channel will be attached to the cart. If no sales channel is passed and no publishable API key header is passed or the publishable API key isn't associated with any sales channel, the cart will not be associated with any sales channel. */ sales_channel_id?: string /** - * The 2 character ISO country code to create the Cart in. + * The 2 character ISO country code to create the Cart in. Setting this parameter will set the country code of the shipping address. */ country_code?: string /** - * An optional array of `variant_id`, `quantity` pairs to generate Line Items from. + * An array of product variants to generate line items from. */ items?: Array<{ /** - * The id of the Product Variant to generate a Line Item from. + * The ID of the Product Variant. */ variant_id: string /** - * The quantity of the Product Variant to add + * The quantity to add into the cart. */ quantity: number }> /** - * An optional object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent` + * An object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent` */ context?: Record } diff --git a/packages/generated/client-types/src/lib/models/StorePostCartsCartLineItemsItemReq.ts b/packages/generated/client-types/src/lib/models/StorePostCartsCartLineItemsItemReq.ts index add0438a6e..1fff6e0304 100644 --- a/packages/generated/client-types/src/lib/models/StorePostCartsCartLineItemsItemReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostCartsCartLineItemsItemReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostCartsCartLineItemsItemReq { /** - * The quantity to set the Line Item to. + * The quantity of the line item in the cart. */ quantity: number /** diff --git a/packages/generated/client-types/src/lib/models/StorePostCartsCartReq.ts b/packages/generated/client-types/src/lib/models/StorePostCartsCartReq.ts index 41c6d1dd42..c318cd0644 100644 --- a/packages/generated/client-types/src/lib/models/StorePostCartsCartReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostCartsCartReq.ts @@ -7,11 +7,11 @@ import type { AddressPayload } from "./AddressPayload" export interface StorePostCartsCartReq { /** - * The id of the Region to create the Cart in. + * The ID of the Region to create the Cart in. Setting the cart's region can affect the pricing of the items in the cart as well as the used currency. */ region_id?: string /** - * The 2 character ISO country code to create the Cart in. + * The 2 character ISO country code to create the Cart in. Setting this parameter will set the country code of the shipping address. */ country_code?: string /** @@ -19,7 +19,7 @@ export interface StorePostCartsCartReq { */ email?: string /** - * The ID of the Sales channel to update the Cart with. + * The ID of the Sales channel to create the Cart in. The cart's sales channel affects which products can be added to the cart. If a product does not exist in the cart's sales channel, it cannot be added to the cart. If you add a publishable API key in the header of this request and specify a sales channel ID, the specified sales channel must be within the scope of the publishable API key's resources. */ sales_channel_id?: string /** @@ -27,7 +27,7 @@ export interface StorePostCartsCartReq { */ billing_address?: AddressPayload | string /** - * The Address to be used for shipping. + * The Address to be used for shipping purposes. */ shipping_address?: AddressPayload | string /** @@ -35,7 +35,7 @@ export interface StorePostCartsCartReq { */ gift_cards?: Array<{ /** - * The code that a Gift Card is identified by. + * The code of a gift card. */ code: string }> @@ -44,7 +44,7 @@ export interface StorePostCartsCartReq { */ discounts?: Array<{ /** - * The code that a Discount is identified by. + * The code of the discount. */ code: string }> @@ -53,7 +53,7 @@ export interface StorePostCartsCartReq { */ customer_id?: string /** - * An optional object to provide context to the Cart. + * An object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent` */ context?: Record } diff --git a/packages/generated/client-types/src/lib/models/StorePostCartsCartShippingMethodReq.ts b/packages/generated/client-types/src/lib/models/StorePostCartsCartShippingMethodReq.ts index f1bc6de702..848c60b343 100644 --- a/packages/generated/client-types/src/lib/models/StorePostCartsCartShippingMethodReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostCartsCartShippingMethodReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostCartsCartShippingMethodReq { /** - * ID of the shipping option to create the method from + * ID of the shipping option to create the method from. */ option_id: string /** - * Used to hold any data that the shipping method may need to process the fulfillment of the order. Look at the documentation for your installed fulfillment providers to find out what to send. + * Used to hold any data that the shipping method may need to process the fulfillment of the order. This depends on the fulfillment provider you're using. */ data?: Record } diff --git a/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerAcceptClaimReq.ts b/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerAcceptClaimReq.ts index ed7898692c..4227cd4295 100644 --- a/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerAcceptClaimReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerAcceptClaimReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostCustomersCustomerAcceptClaimReq { /** - * The invite token provided by the admin. + * The claim token generated by previous request to the Claim Order endpoint. */ token: string } diff --git a/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerAddressesReq.ts b/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerAddressesReq.ts index 9a2ac34fa8..9e92136192 100644 --- a/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerAddressesReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerAddressesReq.ts @@ -7,7 +7,7 @@ import type { AddressCreatePayload } from "./AddressCreatePayload" export interface StorePostCustomersCustomerAddressesReq { /** - * The Address to add to the Customer. + * The Address to add to the Customer's saved addresses. */ address: AddressCreatePayload } diff --git a/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerOrderClaimReq.ts b/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerOrderClaimReq.ts index 6fb1c44f5b..279432e1d7 100644 --- a/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerOrderClaimReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerOrderClaimReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostCustomersCustomerOrderClaimReq { /** - * The ids of the orders to claim + * The ID of the orders to claim */ order_ids: Array } diff --git a/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerPasswordTokenReq.ts b/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerPasswordTokenReq.ts index c643d032b7..be2d931a2b 100644 --- a/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerPasswordTokenReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerPasswordTokenReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostCustomersCustomerPasswordTokenReq { /** - * The email of the customer. + * The customer's email. */ email: string } diff --git a/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerReq.ts b/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerReq.ts index 05e0480915..dbfd4a896e 100644 --- a/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostCustomersCustomerReq.ts @@ -7,31 +7,31 @@ import type { AddressPayload } from "./AddressPayload" export interface StorePostCustomersCustomerReq { /** - * The Customer's first name. + * The customer's first name. */ first_name?: string /** - * The Customer's last name. + * The customer's last name. */ last_name?: string /** - * The Address to be used for billing purposes. + * The address to be used for billing purposes. */ billing_address?: AddressPayload | string /** - * The Customer's password. + * The customer's password. */ password?: string /** - * The Customer's phone number. + * The customer's phone number. */ phone?: string /** - * The email of the customer. + * The customer's email. */ email?: string /** - * Metadata about the customer. + * Additional custom data about the customer. */ metadata?: Record } diff --git a/packages/generated/client-types/src/lib/models/StorePostCustomersReq.ts b/packages/generated/client-types/src/lib/models/StorePostCustomersReq.ts index 30cd789364..e0529a552d 100644 --- a/packages/generated/client-types/src/lib/models/StorePostCustomersReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostCustomersReq.ts @@ -5,23 +5,23 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostCustomersReq { /** - * The Customer's first name. + * The customer's first name. */ first_name: string /** - * The Customer's last name. + * The customer's last name. */ last_name: string /** - * The email of the customer. + * The customer's email. */ email: string /** - * The Customer's password. + * The customer's password. */ password: string /** - * The Customer's phone number. + * The customer's phone number. */ phone?: string } diff --git a/packages/generated/client-types/src/lib/models/StorePostCustomersResetPasswordReq.ts b/packages/generated/client-types/src/lib/models/StorePostCustomersResetPasswordReq.ts index ea6c89bc07..92cf441061 100644 --- a/packages/generated/client-types/src/lib/models/StorePostCustomersResetPasswordReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostCustomersResetPasswordReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostCustomersResetPasswordReq { /** - * The email of the customer. + * The customer's email. */ email: string /** - * The Customer's password. + * The customer's password. */ password: string /** diff --git a/packages/generated/client-types/src/lib/models/StorePostOrderEditsOrderEditDecline.ts b/packages/generated/client-types/src/lib/models/StorePostOrderEditsOrderEditDecline.ts index 70232da35c..5360a2fc78 100644 --- a/packages/generated/client-types/src/lib/models/StorePostOrderEditsOrderEditDecline.ts +++ b/packages/generated/client-types/src/lib/models/StorePostOrderEditsOrderEditDecline.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostOrderEditsOrderEditDecline { /** - * The reason for declining the OrderEdit. + * The reason for declining the Order Edit. */ declined_reason?: string } diff --git a/packages/generated/client-types/src/lib/models/StorePostPaymentCollectionsBatchSessionsReq.ts b/packages/generated/client-types/src/lib/models/StorePostPaymentCollectionsBatchSessionsReq.ts index 556514057b..faed4dabf8 100644 --- a/packages/generated/client-types/src/lib/models/StorePostPaymentCollectionsBatchSessionsReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostPaymentCollectionsBatchSessionsReq.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostPaymentCollectionsBatchSessionsReq { /** - * An array of payment sessions related to the Payment Collection. If the session_id is not provided, existing sessions not present will be deleted and the provided ones will be created. + * An array of payment sessions related to the Payment Collection. Existing sessions that are not added in this array will be deleted. */ sessions: Array<{ /** @@ -13,11 +13,11 @@ export interface StorePostPaymentCollectionsBatchSessionsReq { */ provider_id: string /** - * The amount . + * The payment amount */ amount: number /** - * The ID of the Payment Session to be updated. + * The ID of the Payment Session to be updated. If no ID is provided, a new payment session is created. */ session_id?: string }> diff --git a/packages/generated/client-types/src/lib/models/StorePostReturnsReq.ts b/packages/generated/client-types/src/lib/models/StorePostReturnsReq.ts index 16d898fadb..6f12442bab 100644 --- a/packages/generated/client-types/src/lib/models/StorePostReturnsReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostReturnsReq.ts @@ -5,15 +5,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostReturnsReq { /** - * The ID of the Order to create the Return from. + * The ID of the Order to create the return for. */ order_id: string /** - * The items to include in the Return. + * The items to include in the return. */ items: Array<{ /** - * The ID of the Line Item from the Order. + * The ID of the line item to return. */ item_id: string /** @@ -21,7 +21,7 @@ export interface StorePostReturnsReq { */ quantity: number /** - * The ID of the return reason. + * The ID of the return reason. Return reasons can be retrieved from the List Return Reasons endpoint. */ reason_id?: string /** @@ -30,7 +30,7 @@ export interface StorePostReturnsReq { note?: string }> /** - * If the Return is to be handled by the store operator the Customer can choose a Return Shipping Method. Alternatvely the Customer can handle the Return themselves. + * The return shipping method used to return the items. If provided, a fulfillment is automatically created for the return. */ return_shipping?: { /** diff --git a/packages/generated/client-types/src/lib/models/StorePostSearchReq.ts b/packages/generated/client-types/src/lib/models/StorePostSearchReq.ts index 870f1df33b..43a38a254b 100644 --- a/packages/generated/client-types/src/lib/models/StorePostSearchReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostSearchReq.ts @@ -5,11 +5,11 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StorePostSearchReq { /** - * The query to run the search with. + * The search query. */ q?: string /** - * How many products to skip in the result. + * The number of products to skip when retrieving the products. */ offset?: number /** @@ -17,7 +17,7 @@ export interface StorePostSearchReq { */ limit?: number /** - * Filter based on the search engine. + * Pass filters based on the search service. */ filter?: any } diff --git a/packages/generated/client-types/src/lib/models/StorePostSearchRes.ts b/packages/generated/client-types/src/lib/models/StorePostSearchRes.ts index 216a0fe228..027b70e5b6 100644 --- a/packages/generated/client-types/src/lib/models/StorePostSearchRes.ts +++ b/packages/generated/client-types/src/lib/models/StorePostSearchRes.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export type StorePostSearchRes = { /** - * Array of results. The format of the items depends on the search engine installed on the server. + * Array of search results. The format of the items depends on the search engine installed on the Medusa backend. */ hits: any[] } & Record diff --git a/packages/generated/client-types/src/lib/models/StorePostSwapsReq.ts b/packages/generated/client-types/src/lib/models/StorePostSwapsReq.ts index 3f62ca2d21..081d738b1b 100644 --- a/packages/generated/client-types/src/lib/models/StorePostSwapsReq.ts +++ b/packages/generated/client-types/src/lib/models/StorePostSwapsReq.ts @@ -13,15 +13,15 @@ export interface StorePostSwapsReq { */ return_items: Array<{ /** - * The ID of the Line Item from the Order. + * The ID of the order's line item to return. */ item_id: string /** - * The quantity to swap. + * The quantity to return. */ quantity: number /** - * The ID of the reason of this return. + * The ID of the reason of this return. Return reasons can be retrieved from the List Return Reasons endpoint. */ reason_id?: string /** @@ -34,15 +34,15 @@ export interface StorePostSwapsReq { */ return_shipping_option?: string /** - * The items to exchange the returned items to. + * The items to exchange the returned items with. */ additional_items: Array<{ /** - * The ID of the Product Variant to send. + * The ID of the Product Variant. */ variant_id: string /** - * The quantity to send of the variant. + * The quantity of the variant. */ quantity: number }> diff --git a/packages/generated/client-types/src/lib/models/StoreProductTagsListRes.ts b/packages/generated/client-types/src/lib/models/StoreProductTagsListRes.ts index 1b00f20300..201f32e83d 100644 --- a/packages/generated/client-types/src/lib/models/StoreProductTagsListRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreProductTagsListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductTag } from "./ProductTag" export interface StoreProductTagsListRes { + /** + * An array of product tags details. + */ product_tags: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of product tags skipped when retrieving the product tags. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/StoreProductTypesListRes.ts b/packages/generated/client-types/src/lib/models/StoreProductTypesListRes.ts index b855e8651d..bf31a43235 100644 --- a/packages/generated/client-types/src/lib/models/StoreProductTypesListRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreProductTypesListRes.ts @@ -6,13 +6,16 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ProductType } from "./ProductType" export interface StoreProductTypesListRes { + /** + * An array of product types details. + */ product_types: Array /** * The total number of items available */ count: number /** - * The number of items skipped before these items + * The number of product types skipped when retrieving the product types. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/StoreProductsListRes.ts b/packages/generated/client-types/src/lib/models/StoreProductsListRes.ts index d9c33d58ad..1f523764f6 100644 --- a/packages/generated/client-types/src/lib/models/StoreProductsListRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreProductsListRes.ts @@ -8,6 +8,9 @@ import type { ProductOption } from "./ProductOption" import type { ProductVariant } from "./ProductVariant" export interface StoreProductsListRes { + /** + * An array of products details. + */ products: Array< Merge< SetRelation< @@ -27,7 +30,7 @@ export interface StoreProductsListRes { */ count: number /** - * The number of items skipped before these items + * The number of products skipped when retrieving the products. */ offset: number /** diff --git a/packages/generated/client-types/src/lib/models/StoreProductsRes.ts b/packages/generated/client-types/src/lib/models/StoreProductsRes.ts index 2b3db7ecd0..63e33759d0 100644 --- a/packages/generated/client-types/src/lib/models/StoreProductsRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreProductsRes.ts @@ -8,6 +8,9 @@ import type { ProductOption } from "./ProductOption" import type { ProductVariant } from "./ProductVariant" export interface StoreProductsRes { + /** + * Product details. + */ product: Merge< SetRelation< PricedProduct, diff --git a/packages/generated/client-types/src/lib/models/StoreRegionsListRes.ts b/packages/generated/client-types/src/lib/models/StoreRegionsListRes.ts index 0a98b227b6..6831c5d868 100644 --- a/packages/generated/client-types/src/lib/models/StoreRegionsListRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreRegionsListRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Region } from "./Region" export interface StoreRegionsListRes { + /** + * An array of regions details. + */ regions: Array< SetRelation< Region, @@ -17,7 +20,7 @@ export interface StoreRegionsListRes { */ count?: number /** - * The number of items skipped before these items + * The number of regions skipped when retrieving the regions. */ offset?: number /** diff --git a/packages/generated/client-types/src/lib/models/StoreRegionsRes.ts b/packages/generated/client-types/src/lib/models/StoreRegionsRes.ts index eace2d10db..4024de7fc6 100644 --- a/packages/generated/client-types/src/lib/models/StoreRegionsRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreRegionsRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Region } from "./Region" export interface StoreRegionsRes { + /** + * Region details. + */ region: SetRelation< Region, "countries" | "payment_providers" | "fulfillment_providers" diff --git a/packages/generated/client-types/src/lib/models/StoreReturnReasonsListRes.ts b/packages/generated/client-types/src/lib/models/StoreReturnReasonsListRes.ts index c849f99fe2..5970bb496e 100644 --- a/packages/generated/client-types/src/lib/models/StoreReturnReasonsListRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreReturnReasonsListRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ReturnReason } from "./ReturnReason" export interface StoreReturnReasonsListRes { + /** + * An array of return reasons details. + */ return_reasons: Array< SetRelation > diff --git a/packages/generated/client-types/src/lib/models/StoreReturnReasonsRes.ts b/packages/generated/client-types/src/lib/models/StoreReturnReasonsRes.ts index ac1effde5a..1a1d9d10fc 100644 --- a/packages/generated/client-types/src/lib/models/StoreReturnReasonsRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreReturnReasonsRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { ReturnReason } from "./ReturnReason" export interface StoreReturnReasonsRes { + /** + * Return reason details. + */ return_reason: SetRelation< ReturnReason, "parent_return_reason" | "return_reason_children" diff --git a/packages/generated/client-types/src/lib/models/StoreReturnsRes.ts b/packages/generated/client-types/src/lib/models/StoreReturnsRes.ts index 18a9c02991..4e32e49a5a 100644 --- a/packages/generated/client-types/src/lib/models/StoreReturnsRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreReturnsRes.ts @@ -7,6 +7,9 @@ import type { Return } from "./Return" import type { ReturnItem } from "./ReturnItem" export interface StoreReturnsRes { + /** + * Return details. + */ return: Merge< SetRelation, { diff --git a/packages/generated/client-types/src/lib/models/StoreShippingOptionsListRes.ts b/packages/generated/client-types/src/lib/models/StoreShippingOptionsListRes.ts index 35a22285df..5c5c81205a 100644 --- a/packages/generated/client-types/src/lib/models/StoreShippingOptionsListRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreShippingOptionsListRes.ts @@ -6,5 +6,8 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PricedShippingOption } from "./PricedShippingOption" export interface StoreShippingOptionsListRes { + /** + * An array of shipping options details. + */ shipping_options: Array> } diff --git a/packages/generated/client-types/src/lib/models/StoreSwapsRes.ts b/packages/generated/client-types/src/lib/models/StoreSwapsRes.ts index e6745d4571..532d5b861d 100644 --- a/packages/generated/client-types/src/lib/models/StoreSwapsRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreSwapsRes.ts @@ -9,6 +9,9 @@ import type { Return } from "./Return" import type { Swap } from "./Swap" export interface StoreSwapsRes { + /** + * Swap details. + */ swap: Merge< SetRelation< Swap, diff --git a/packages/generated/client-types/src/lib/models/StoreVariantsListRes.ts b/packages/generated/client-types/src/lib/models/StoreVariantsListRes.ts index 474534369e..ca713c3bd4 100644 --- a/packages/generated/client-types/src/lib/models/StoreVariantsListRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreVariantsListRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PricedVariant } from "./PricedVariant" export interface StoreVariantsListRes { + /** + * An array of product variant descriptions. + */ variants: Array< SetRelation > diff --git a/packages/generated/client-types/src/lib/models/StoreVariantsRes.ts b/packages/generated/client-types/src/lib/models/StoreVariantsRes.ts index 81e96326d6..6d766ea48a 100644 --- a/packages/generated/client-types/src/lib/models/StoreVariantsRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreVariantsRes.ts @@ -6,6 +6,9 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { PricedVariant } from "./PricedVariant" export interface StoreVariantsRes { + /** + * Product variant description. + */ variant: SetRelation< PricedVariant, "prices" | "options" | "product" | "purchasable" diff --git a/packages/generated/client-types/src/lib/models/Swap.ts b/packages/generated/client-types/src/lib/models/Swap.ts index 4a3dae1662..c2eb154c9f 100644 --- a/packages/generated/client-types/src/lib/models/Swap.ts +++ b/packages/generated/client-types/src/lib/models/Swap.ts @@ -13,7 +13,7 @@ import type { Return } from "./Return" import type { ShippingMethod } from "./ShippingMethod" /** - * 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. + * A swap can be created when a Customer wishes to exchange Products that they have purchased with different Products. It consists of a Return of previously purchased Products and a Fulfillment of new Products. It also includes information on any additional payment or refund required based on the difference between the exchanged products. */ export interface Swap { /** @@ -44,31 +44,31 @@ export interface Swap { | "refunded" | "requires_action" /** - * The ID of the Order where the Line Items to be returned where purchased. + * The ID of the order that the swap belongs to. */ order_id: string /** - * An order object. Available if the relation `order` is expanded. + * The details of the order that the swap belongs to. */ order?: Order | null /** - * The new Line Items to ship to the Customer. Available if the relation `additional_items` is expanded. + * The details of the new products to send to the customer, represented as line items. */ additional_items?: Array /** - * A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded. + * The details of the return that belongs to the swap, which holds the details on the items being returned. */ return_order?: Return | null /** - * The Fulfillments used to send the new Line Items. Available if the relation `fulfillments` is expanded. + * The details of the fulfillments that are used to send the new items to the customer. */ fulfillments?: Array /** - * The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. + * The details of the additional payment authorized by the customer when `difference_due` is positive. */ payment?: Payment | null /** - * 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. + * The difference amount between the order’s original total and the new total imposed by the swap. If its value is negative, a refund must be issues to the customer. If it's positive, additional payment must be authorized by the customer. Otherwise, no payment processing is required. */ difference_due: number | null /** @@ -76,19 +76,19 @@ export interface Swap { */ shipping_address_id: string | null /** - * Available if the relation `shipping_address` is expanded. + * The details of the shipping address that the new items should be sent to. */ shipping_address?: Address | null /** - * The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. + * The details of the shipping methods used to fulfill the additional items purchased. */ shipping_methods?: Array /** - * The id of the Cart that the Customer will use to confirm the Swap. + * The ID of the cart that the customer uses to complete the swap. */ cart_id: string | null /** - * A cart object. Available if the relation `cart` is expanded. + * The details of the cart that the customer uses to complete the swap. */ cart?: Cart | null /** diff --git a/packages/generated/client-types/src/lib/models/TaxLine.ts b/packages/generated/client-types/src/lib/models/TaxLine.ts index 5351c62090..8fd51f6c8b 100644 --- a/packages/generated/client-types/src/lib/models/TaxLine.ts +++ b/packages/generated/client-types/src/lib/models/TaxLine.ts @@ -4,7 +4,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Line item that specifies an amount of tax to add to a line item. + * A tax line represents the taxes amount applied to a line item. */ export interface TaxLine { /** diff --git a/packages/generated/client-types/src/lib/models/TaxProvider.ts b/packages/generated/client-types/src/lib/models/TaxProvider.ts index adb883cf07..3c53bbf0ce 100644 --- a/packages/generated/client-types/src/lib/models/TaxProvider.ts +++ b/packages/generated/client-types/src/lib/models/TaxProvider.ts @@ -4,15 +4,15 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * The tax service used to calculate taxes + * A tax provider represents a tax service installed in the Medusa backend, either through a plugin or backend customizations. It holds the tax service's installation status. */ export interface TaxProvider { /** - * The id of the tax provider as given by the plugin. + * The ID of the tax provider as given by the tax service. */ id: string /** - * 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`. + * Whether the tax service is installed in the current version. If a tax service is no longer installed, the `is_installed` attribute is set to `false`. */ is_installed: boolean } diff --git a/packages/generated/client-types/src/lib/models/TaxRate.ts b/packages/generated/client-types/src/lib/models/TaxRate.ts index 0d57398545..b04640f40a 100644 --- a/packages/generated/client-types/src/lib/models/TaxRate.ts +++ b/packages/generated/client-types/src/lib/models/TaxRate.ts @@ -9,7 +9,7 @@ import type { Region } from "./Region" import type { ShippingOption } from "./ShippingOption" /** - * A Tax Rate can be used to associate a certain rate to charge on products within a given Region + * A Tax Rate can be used to define a custom rate to charge on specified products, product types, and shipping options within a given region. */ export interface TaxRate { /** @@ -29,23 +29,23 @@ export interface TaxRate { */ name: string /** - * The id of the Region that the rate belongs to + * The ID of the region that the rate belongs to. */ region_id: string /** - * A region object. Available if the relation `region` is expanded. + * The details of the region that the rate belongs to. */ region?: Region | null /** - * The products that belong to this tax rate. Available if the relation `products` is expanded. + * The details of the products that belong to this tax rate. */ products?: Array /** - * The product types that belong to this tax rate. Available if the relation `product_types` is expanded. + * The details of the product types that belong to this tax rate. */ product_types?: Array /** - * The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded. + * The details of the shipping options that belong to this tax rate. */ shipping_options?: Array /** diff --git a/packages/generated/client-types/src/lib/models/TrackingLink.ts b/packages/generated/client-types/src/lib/models/TrackingLink.ts index 74291eb9d4..ca9b84eaba 100644 --- a/packages/generated/client-types/src/lib/models/TrackingLink.ts +++ b/packages/generated/client-types/src/lib/models/TrackingLink.ts @@ -6,7 +6,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" import type { Fulfillment } from "./Fulfillment" /** - * 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. + * A 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. Typically, the tracking link is provided from the third-party service integrated through the used fulfillment provider. */ export interface TrackingLink { /** @@ -22,11 +22,11 @@ export interface TrackingLink { */ tracking_number: string /** - * The id of the Fulfillment that the Tracking Link references. + * The ID of the fulfillment that the tracking link belongs to. */ fulfillment_id: string /** - * Available if the relation `fulfillment` is expanded. + * The details of the fulfillment that the tracking link belongs to. */ fulfillment?: Fulfillment | null /** diff --git a/packages/generated/client-types/src/lib/models/User.ts b/packages/generated/client-types/src/lib/models/User.ts index afeb06c4b6..d447fb4233 100644 --- a/packages/generated/client-types/src/lib/models/User.ts +++ b/packages/generated/client-types/src/lib/models/User.ts @@ -4,7 +4,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" /** - * Represents a User who can manage store settings. + * A User is an administrator who can manage store settings and data. */ export interface User { /** diff --git a/packages/generated/client-types/src/lib/models/VariantInventory.ts b/packages/generated/client-types/src/lib/models/VariantInventory.ts index db48d9cfcb..1838165b7a 100644 --- a/packages/generated/client-types/src/lib/models/VariantInventory.ts +++ b/packages/generated/client-types/src/lib/models/VariantInventory.ts @@ -7,28 +7,28 @@ import type { ResponseInventoryItem } from "./ResponseInventoryItem" export interface VariantInventory { /** - * the id of the variant + * the ID of the variant */ - id?: string + id: string /** - * the stock location address ID + * The inventory details. */ - inventory?: ResponseInventoryItem + inventory: ResponseInventoryItem /** - * An optional key-value map with additional details + * An array of details about the variant's inventory availability in sales channels. */ - sales_channel_availability?: { + sales_channel_availability: Array<{ /** - * Sales channel name + * Sales channel's name */ - channel_name?: string + channel_name: string /** - * Sales channel id + * Sales channel's ID */ - channel_id?: string + channel_id: string /** - * Available quantity in sales channel + * Available quantity in the sales channel */ - available_quantity?: number - } + available_quantity: number + }> } diff --git a/packages/generated/client-types/src/lib/models/index.ts b/packages/generated/client-types/src/lib/models/index.ts index dd2226255a..f555c6dc0d 100644 --- a/packages/generated/client-types/src/lib/models/index.ts +++ b/packages/generated/client-types/src/lib/models/index.ts @@ -220,6 +220,7 @@ export type { AdminPostShippingProfilesProfileReq } from "./AdminPostShippingPro export type { AdminPostShippingProfilesReq } from "./AdminPostShippingProfilesReq" export type { AdminPostStockLocationsLocationReq } from "./AdminPostStockLocationsLocationReq" export type { AdminPostStockLocationsReq } from "./AdminPostStockLocationsReq" +export type { AdminPostStockLocationsReqAddress } from "./AdminPostStockLocationsReqAddress" export type { AdminPostStoreReq } from "./AdminPostStoreReq" export type { AdminPostTaxRatesParams } from "./AdminPostTaxRatesParams" export type { AdminPostTaxRatesReq } from "./AdminPostTaxRatesReq" diff --git a/packages/medusa/oas/admin.oas.base.yaml b/packages/medusa/oas/admin.oas.base.yaml index 44051021af..be9c625cf2 100644 --- a/packages/medusa/oas/admin.oas.base.yaml +++ b/packages/medusa/oas/admin.oas.base.yaml @@ -244,66 +244,229 @@ info: name: MIT url: https://github.com/medusajs/medusa/blob/master/LICENSE tags: + - name: Apps Oauth + description: | + Some plugins may require to authenticate with third-party services and store authentication details, such as the authentication token. To do that, they can create an Oauth provider within the plugin that handles the authentication. + The Apps Oauth endpoints allows admins to manage and generate token for an app using its oauth provider. - name: Auth - description: Auth endpoints that allow authorization of admin Users and manages - their sessions. - - name: Apps - description: App endpoints that allow handling apps in Medusa. + description: | + Authentication endpoints allow admin users to manage their session, such as login or log out. + When an admin user is logged in, the cookie header is set indicating the admin's login session. + externalDocs: + description: How to implement user profiles + url: https://docs.medusajs.com/modules/users/admin/manage-profile - name: Batch Jobs - description: Batch Job endpoints that allow handling batch jobs in Medusa. - - name: Collections - description: Collection endpoints that allow handling collections in Medusa. + description: | + A batch job is a task that is performed by the Medusa backend asynchronusly. For example, the Import Product feature is implemented using batch jobs. + Batch Job endpoints allows admins to manage the batch jobs and their state. + externalDocs: + description: How to import products + url: https://docs.medusajs.com/modules/products/admin/import-products + - name: Currencies + description: | + A store can use unlimited currencies, and each region must be associated with at least one currency. + Currencies are defined within the Medusa backend. Currency endpoints allow admins to list and update currencies. + externalDocs: + description: How to manage currencies + url: https://docs.medusajs.com/modules/regions-and-currencies/admin/manage-currencies - name: Customers - description: Customer endpoints that allow handling customers in Medusa. + description: | + Customers can either be created when they register through the Store APIs, or created by the admin using the Admin APIs. + externalDocs: + description: How to manage customers + url: https://docs.medusajs.com/modules/customers/admin/manage-customers - name: Customer Groups - description: Customer Group endpoints that allow handling customer groups in Medusa. + description: | + Customer Groups can be used to organize customers that share similar data or attributes into dedicated groups. + This can be useful for different purposes such as setting a different price for a specific customer group. + externalDocs: + description: How to manage customer groups + url: https://docs.medusajs.com/modules/customers/admin/manage-customer-groups - name: Discounts - description: Discount endpoints that allow handling discounts in Medusa. + description: | + Admins can create discounts with conditions and rules, providing them with advanced settings for variety of cases. + The Discount endpoints can be used to manage discounts, their conditions, resources, and more. + externalDocs: + description: How to manage discounts + url: https://docs.medusajs.com/modules/discounts/admin/manage-discounts - name: Draft Orders - description: Draft Order endpoints that allow handling draft orders in Medusa. + description: | + A draft order is an order created manually by the admin. It allows admins to create orders without direct involvement from the customer. + externalDocs: + description: How to manage draft orders + url: https://docs.medusajs.com/modules/orders/admin/manage-draft-orders - name: Gift Cards - description: Gift Card endpoints that allow handling gift cards in Medusa. + description: | + Admins can create gift cards and send them directly to customers, specifying options like their balance, region, and more. + These gift cards are different than the saleable gift cards in a store, which are created and managed through Product endpoints. + externalDocs: + description: How to manage gift cards + url: https://docs.medusajs.com/modules/gift-cards/admin/manage-gift-cards#manage-custom-gift-cards + - name: Inventory Items + description: | + Inventory items, provided by the [Inventory Module](https://docs.medusajs.com/modules/multiwarehouse/inventory-module), can be used to manage the inventory of saleable items in your store. + externalDocs: + description: How to manage inventory items + url: https://docs.medusajs.com/modules/multiwarehouse/admin/manage-inventory-items - name: Invites - description: Invite endpoints that allow handling invites in Medusa. + description: | + An admin can invite new users to manage their team. This would allow new users to authenticate as admins and perform admin functionalities. + externalDocs: + description: How to manage invites + url: https://docs.medusajs.com/modules/users/admin/manage-invites - name: Notes - description: Note endpoints that allow handling notes in Medusa. + description: | + Notes are created by admins and can be associated with any resource. For example, an admin can add a note to an order for additional details or remarks. - name: Notifications - description: Notification endpoints that allow handling notifications in Medusa. + description: | + Notifications are sent to customers to inform them of new updates. For example, a notification can be sent to the customer when their order is place or its state is updated. + The notification's type, such as an email or SMS, is determined by the notification provider installed on the Medusa backend. - name: Orders - description: Order endpoints that allow handling orders in Medusa. + description: | + Orders are purchases made by customers, typically through a storefront using the Store API. Draft orders created by the admin are also transformed to an Order once the payment is captured. + Managing orders include managing fulfillment, payment, claims, reservations, and more. + externalDocs: + description: How to manage orders + url: https://docs.medusajs.com/modules/orders/admin/manage-orders + - name: Order Edits + description: | + An admin can edit an order to remove, add, or update an item's quantity. When an admin edits an order, they're stored as an `OrderEdit`. + externalDocs: + description: How to edit an order + url: https://docs.medusajs.com/modules/orders/admin/edit-order + - name: Payment Collections + description: | + A payment collection is useful for managing additional payments, such as for Order Edits, or installment payments. - name: Price Lists - description: Price List endpoints that allow handling price lists in Medusa. + description: | + A price list are special prices applied to products based on a set of conditions, such as customer group. + externalDocs: + description: How to manage price lists + url: https://docs.medusajs.com/modules/price-lists/admin/manage-price-lists - name: Products - description: Product endpoints that allow handling products in Medusa. + description: | + Products are saleable items in a store. This also includes [saleable gift cards](https://docs.medusajs.com/modules/gift-cards/admin/manage-gift-cards#manage-gift-card-product) in a store. + externalDocs: + description: How to manage products + url: https://docs.medusajs.com/modules/products/admin/manage-products + - name: Product Categories + description: | + Products can be categoriezed into categories. A product can be added into more than one category. + externalDocs: + description: How to manage product categories + url: https://docs.medusajs.com/modules/products/admin/manage-categories + - name: Product Collections + description: | + A product collection is used to organize products for different purposes such as marketing or discount purposes. For example, you can create a Summer Collection. - name: Product Tags - description: Product Tag endpoints that allow handling product tags in Medusa. + description: | + Product tags are string values created when you create or update a product with a new tag. + Products can have more than one tag, and products can share tags. This allows admins to associate products to similar tags that can be used to filter products. - name: Product Types - description: Product Types endpoints that allow handling product types in Medusa. + description: | + Product types are string values created when you create or update a product with a new type. + Products can have one type, and products can share types. This allows admins to associate products with a type that can be used to filter products. + - name: Product Variants + description: | + Product variants are the actual salable item in your store. Each variant is a combination of the different option values available on the product. + Product variants can be managed through the Products endpoints. + externalDocs: + description: How to manage product variants + url: https://docs.medusajs.com/modules/products/admin/manage-products#manage-product-variants + - name: Publishable API Keys + description: | + Publishable API Keys can be used to scope Store API calls with an API key, determining what resources are retrieved when querying the API. + For example, a publishable API key can be associated with one or more sales channels. When it is passed in the header of a request to the List Product store endpoint, + the sales channels are inferred from the key and only products associated with those sales channels are retrieved. + Admins can manage publishable API keys and their associated resources. Currently, only Sales Channels are supported as a resource. + externalDocs: + description: How to manage publishable API keys + url: https://docs.medusajs.com/development/publishable-api-keys/admin/manage-publishable-api-keys + - name: Reservations + description: | + Reservations, provided by the [Inventory Module](https://docs.medusajs.com/modules/multiwarehouse/inventory-module), are quantities of an item that are reserved, typically when an order is placed but not yet fulfilled. + Reservations can be associated with any resources, but commonly with line items of an order. + externalDocs: + description: How to manage item allocations in orders + url: https://docs.medusajs.com/modules/multiwarehouse/admin/manage-item-allocations-in-orders - name: Regions - description: Region endpoints that allow handling regions in Medusa. + description: | + Regions are different countries or geographical regions that the commerce store serves customers in. + Admins can manage these regions, their providers, and more. + externalDocs: + description: How to manage regions + url: https://docs.medusajs.com/modules/regions-and-currencies/admin/manage-regions - name: Return Reasons - description: Return Reason endpoints that allow handling return reasons in Medusa. + description: | + Return reasons are key-value pairs that are used to specify why an order return is being created. + Admins can manage available return reasons, and they can be used by both admins and customers when creating a return. + externalDocs: + description: How to manage return reasons + url: https://docs.medusajs.com/modules/orders/admin/manage-returns#manage-return-reasons - name: Returns - description: Return endpoints that allow handling returns in Medusa. + description: | + A return can be created by a customer or an admin to return items in an order. + Admins can manage these returns and change their state. + externalDocs: + description: How to manage returns + url: https://docs.medusajs.com/modules/orders/admin/manage-returns - name: Sales Channels - description: Sales Channel endpoints that allow handling sales channels in Medusa. + description: | + A sales channel indicates a channel where products can be sold in. For example, a webshop or a mobile app. + Admins can manage sales channels and the products available in them. + externalDocs: + description: How to manage sales channels + url: https://docs.medusajs.com/modules/sales-channels/admin/manage - name: Shipping Options - description: Shipping Option endpoints that allow handling shipping options in Medusa. + description: | + A shipping option is used to define the available shipping methods during checkout or when creating a return. + Admins can create an unlimited number of shipping options, each associated with a shipping profile and fulfillment provider, among other resources. + externalDocs: + description: Shipping Option architecture + url: https://docs.medusajs.com/modules/carts-and-checkout/shipping#shipping-option - name: Shipping Profiles - description: Shipping Profile endpoints that allow handling shipping profiles in - Medusa. + description: | + A shipping profile is used to group products that can be shipped in the same manner. + They are created by the admin and they're not associated with a fulfillment provider. + externalDocs: + description: Shipping Option architecture + url: https://docs.medusajs.com/modules/carts-and-checkout/shipping#shipping-profile + - name: Stock Locations + description: | + A stock location, provided by the [Stock Location module](https://docs.medusajs.com/modules/multiwarehouse/stock-location-module), indicates a physical address that stock-kept items, such as physical products, can be stored in. + An admin can create and manage available stock locations. + externalDocs: + description: How to manage stock locations. + url: https://docs.medusajs.com/modules/multiwarehouse/admin/manage-stock-locations - name: Store - description: Store endpoints that allow handling stores in Medusa. + description: | + A store indicates the general configurations and details about the commerce store. By default, there's only one store in the Medusa backend. + Admins can manage the store and its details or configurations. - name: Swaps - description: Swap endpoints that allow handling swaps in Medusa. + description: | + A swap is created by a customer or an admin to exchange an item with a new one. + Creating a swap implicitely includes creating a return for the item being exchanged. + externalDocs: + description: How to manage swaps + url: https://docs.medusajs.com/modules/orders/admin/manage-swaps - name: Tax Rates - description: Tax Rate endpoints that allow handling tax rates in Medusa. + description: | + Each region has at least a default tax rate. Admins can create and manage additional tax rates that can be applied for certain conditions, such as for specific product types. + externalDocs: + description: How to manage tax rates + url: https://docs.medusajs.com/modules/taxes/admin/manage-tax-rates - name: Uploads - description: Upload endpoints that allow handling uploads in Medusa. + description: | + The upload endpoints are used to upload any type of resources. For example, they can be used to upload CSV files that are used to import products into the store. + externalDocs: + description: How to upload CSV file when importing a product. + url: https://docs.medusajs.com/modules/products/admin/import-products#1-upload-csv-file - name: Users - description: User endpoints that allow handling users in Medusa. - - name: Variants - description: Product Variant endpoints that allow handling product variants in Medusa. + description: | + A store can have more than one user, each having the same privileges. Admins can manage users, their passwords, and more. + externalDocs: + description: How to manage users + url: https://docs.medusajs.com/modules/users/admin/manage-users servers: - url: https://api.medusa-commerce.com paths: { } diff --git a/packages/medusa/oas/store.oas.base.yaml b/packages/medusa/oas/store.oas.base.yaml index 021c383782..14ecc5807b 100644 --- a/packages/medusa/oas/store.oas.base.yaml +++ b/packages/medusa/oas/store.oas.base.yaml @@ -225,32 +225,107 @@ info: url: https://github.com/medusajs/medusa/blob/master/LICENSE tags: - name: Auth - description: Auth endpoints that allow authorization of customers and manages their - sessions. + description: | + Authentication endpoints allow customers to manage their session, such as login or log out. + When a customer is logged in, the cookie header is set indicating the customer's login session. + externalDocs: + description: How to implement customer profiles in your storefront + url: https://docs.medusajs.com/modules/customers/storefront/implement-customer-profiles - name: Carts - description: Cart endpoints that allow handling carts in Medusa. - - name: Collections - description: Collection endpoints that allow handling collections in Medusa. + description: | + A cart is a virtual shopping bag that customers can use to add items they want to purchase. + A cart is then used to checkout and place an order. + externalDocs: + description: How to implement cart functionality in your storefront + url: https://docs.medusajs.com/modules/carts-and-checkout/storefront/implement-cart - name: Customers - description: Customer endpoints that allow handling customers in Medusa. + description: | + A customer can register and manage their information such as addresses, orders, payment methods, and more. + externalDocs: + description: How to implement customer profiles in your storefront + url: https://docs.medusajs.com/modules/customers/storefront/implement-customer-profiles - name: Gift Cards - description: Gift Card endpoints that allow handling gift cards in Medusa. + description: | + Customers can use gift cards during checkout to deduct the gift card's balance from the checkout total. + The Gift Card endpoints allow retrieving a gift card's details by its code. A gift card can be applied to a cart using the Carts endpoints. + externalDocs: + description: How to use gift cards in a storefront + url: https://docs.medusajs.com/modules/gift-cards/storefront/use-gift-cards - name: Orders - description: Order endpoints that allow handling orders in Medusa. + description: | + Orders are purchases made by customers, typically through a storefront. + Orders are placed and created using the Carts endpoints. The Orders endpoints allow retrieving and claiming orders. + externalDocs: + description: How to retrieve order details in a storefront + url: https://docs.medusajs.com/modules/orders/storefront/retrieve-order-details + - name: Order Edits + description: | + Order edits are changes made to items in an order such as adding, updating their quantity, or deleting them. Order edits are created by the admin. + A customer can review order edit requests created by an admin and confirm or decline them. + externalDocs: + description: How to handle order edits in a storefront + url: https://docs.medusajs.com/modules/orders/storefront/handle-order-edits + - name: Payment Collections + description: | + A payment collection is useful for managing additional payments, such as for Order Edits, or installment payments. - name: Products - description: Product endpoints that allow handling products in Medusa. + description: | + Products are saleable items in a store. This also includes [saleable gift cards](https://docs.medusajs.com/modules/gift-cards/storefront/use-gift-cards) in a store. + Using these endpoints, you can filter products by categories, collections, sales channels, and more. + externalDocs: + description: How to show products in a storefront + url: https://docs.medusajs.com/modules/products/storefront/show-products - name: Product Variants - description: Product Variant endpoints that allow handling product variants in Medusa. + description: | + Product variants are the actual salable item in your store. Each variant is a combination of the different option values available on the product. + - name: Product Categories + description: | + Products can be categoriezed into categories. A product can be associated more than one category. + Using these endpoints, you can list or retrieve a category's details and products. + externalDocs: + description: How to use product categories in a storefront + url: https://docs.medusajs.com/modules/products/storefront/use-categories + - name: Product Collections + description: | + A product collection is used to organize products for different purposes such as marketing or discount purposes. For example, you can create a Summer Collection. + Using these endpoints, you can list or retrieve a collection's details and products. + - name: Product Tags + description: | + Product tags are string values that can be used to filter products by. + Products can have more than one tag, and products can share tags. + - name: Product Types + description: | + Product types are string values that can be used to filter products by. + Products can have more than one tag, and products can share types. - name: Regions - description: Region endpoints that allow handling regions in Medusa. - - name: Return Reasons - description: Return Reason endpoints that allow handling return reasons in Medusa. + description: | + Regions are different countries or geographical regions that the commerce store serves customers in. + Customers can choose what region they're in, which can be used to change the prices shown based on the region and its currency. + externalDocs: + description: How to use regions in a storefront + url: https://docs.medusajs.com/modules/regions-and-currencies/storefront/use-regions - name: Returns - description: Return endpoints that allow handling returns in Medusa. + description: | + A return can be created by a customer to return items in an order. + externalDocs: + description: How to create a return in a storefront + url: https://docs.medusajs.com/modules/orders/storefront/create-return + - name: Return Reasons + description: | + Return reasons are key-value pairs that are used to specify why an order return is being created. - name: Shipping Options - description: Shipping Option endpoints that allow handling shipping options in Medusa. + description: | + A shipping option is used to define the available shipping methods during checkout or when creating a return. + externalDocs: + description: Shipping Option architecture + url: https://docs.medusajs.com/modules/carts-and-checkout/shipping#shipping-option - name: Swaps - description: Swap endpoints that allow handling swaps in Medusa. + description: | + A swap is created by a customer or an admin to exchange an item with a new one. + Creating a swap implicitely includes creating a return for the item being exchanged. + externalDocs: + description: How to create a swap in a storefront + url: https://docs.medusajs.com/modules/orders/storefront/create-swap servers: - url: https://api.medusa-commerce.com paths: { } diff --git a/packages/medusa/src/api/routes/admin/apps/authorize-app.ts b/packages/medusa/src/api/routes/admin/apps/authorize-app.ts index 4d1830fca6..442484433b 100644 --- a/packages/medusa/src/api/routes/admin/apps/authorize-app.ts +++ b/packages/medusa/src/api/routes/admin/apps/authorize-app.ts @@ -7,7 +7,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/apps/authorizations * operationId: "PostApps" * summary: "Generate Token for App" - * description: "Generates a token for an application." + * description: "Use an app's Oauth provider to generate and store a new token for authentication." * x-authenticated: true * requestBody: * content: @@ -20,9 +20,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/apps/authorizations' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/apps/authorizations' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "application_name": "example", * "state": "ready", @@ -74,7 +74,7 @@ export default async (req, res) => { * properties: * application_name: * type: string - * description: Name of the application for the token to be generated for. + * description: Name of the application for to generate the token for. * state: * type: string * description: State of the application. diff --git a/packages/medusa/src/api/routes/admin/apps/index.ts b/packages/medusa/src/api/routes/admin/apps/index.ts index 8b45a04f8e..de6d82abcb 100644 --- a/packages/medusa/src/api/routes/admin/apps/index.ts +++ b/packages/medusa/src/api/routes/admin/apps/index.ts @@ -23,6 +23,7 @@ export default (app) => { * - apps * properties: * apps: + * description: App details. * $ref: "#/components/schemas/OAuth" */ export type AdminAppsRes = { @@ -37,6 +38,7 @@ export type AdminAppsRes = { * properties: * apps: * type: array + * description: An array of app details. * items: * $ref: "#/components/schemas/OAuth" */ diff --git a/packages/medusa/src/api/routes/admin/apps/list.ts b/packages/medusa/src/api/routes/admin/apps/list.ts index 2903cb0be2..3e3bfa83be 100644 --- a/packages/medusa/src/api/routes/admin/apps/list.ts +++ b/packages/medusa/src/api/routes/admin/apps/list.ts @@ -4,7 +4,7 @@ import { OauthService } from "../../../../services" * @oas [get] /admin/apps * operationId: "GetApps" * summary: "List Applications" - * description: "Retrieve a list of applications." + * description: "Retrieve a list of applications registered in the Medusa backend." * x-authenticated: true * x-codegen: * method: list @@ -12,8 +12,8 @@ import { OauthService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/apps' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/apps' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/auth/create-session.ts b/packages/medusa/src/api/routes/admin/auth/create-session.ts index c71023322f..ce2e0e8dd4 100644 --- a/packages/medusa/src/api/routes/admin/auth/create-session.ts +++ b/packages/medusa/src/api/routes/admin/auth/create-session.ts @@ -12,10 +12,8 @@ import { validator } from "../../../../utils/validator" * operationId: "PostAuth" * summary: "User Login" * x-authenticated: false - * description: "Logs a User in and authorizes them to manage Store settings." - * parameters: - * - (body) email=* {string} The User's email. - * - (body) password=* {string} The User's password. + * description: "Log a User in and includes the Cookie session in the response header. The cookie session can be used in subsequent requests to authorize the user to perform admin functionalities. + * When using Medusa's JS or Medusa React clients, the cookie is automatically attached to subsequent requests." * requestBody: * content: * application/json: @@ -30,8 +28,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * medusa.admin.auth.createSession({ - * email: 'user@example.com', - * password: 'supersecret' + * email: "user@example.com", + * password: "supersecret" * }) * .then(({ user }) => { * console.log(user.id); @@ -39,8 +37,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/auth' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/auth' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com", * "password": "supersecret" @@ -110,11 +108,11 @@ export default async (req, res) => { * properties: * email: * type: string - * description: The User's email. + * description: The user's email. * format: email * password: * type: string - * description: The User's password. + * description: The user's password. * format: password */ export class AdminPostAuthReq { diff --git a/packages/medusa/src/api/routes/admin/auth/delete-session.ts b/packages/medusa/src/api/routes/admin/auth/delete-session.ts index fae3c8c9d8..9a82e09acf 100644 --- a/packages/medusa/src/api/routes/admin/auth/delete-session.ts +++ b/packages/medusa/src/api/routes/admin/auth/delete-session.ts @@ -3,7 +3,8 @@ * operationId: "DeleteAuth" * summary: "User Logout" * x-authenticated: true - * description: "Deletes the current session for the logged in user." + * description: "Delete the current session for the logged in user. This will only work if you're using Cookie session for authentication. If the API token is still passed in the header, + * the user is still authorized to perform admin functionalities in other endpoints." * x-codegen: * method: deleteSession * x-codeSamples: @@ -12,13 +13,13 @@ * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * // must be previously logged in or use api token + * // must be previously logged in * medusa.admin.auth.deleteSession() * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/auth' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/auth' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/auth/get-session.ts b/packages/medusa/src/api/routes/admin/auth/get-session.ts index e66d89dcb5..91ee522c20 100644 --- a/packages/medusa/src/api/routes/admin/auth/get-session.ts +++ b/packages/medusa/src/api/routes/admin/auth/get-session.ts @@ -6,7 +6,7 @@ import _ from "lodash" * operationId: "GetAuth" * summary: "Get Current User" * x-authenticated: true - * description: "Gets the currently logged in User." + * description: "Get the currently logged in user's details." * x-codegen: * method: getSession * x-codeSamples: @@ -23,8 +23,8 @@ import _ from "lodash" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/auth' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/auth' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/auth/index.ts b/packages/medusa/src/api/routes/admin/auth/index.ts index 5c8cc0bc3f..839743e15e 100644 --- a/packages/medusa/src/api/routes/admin/auth/index.ts +++ b/packages/medusa/src/api/routes/admin/auth/index.ts @@ -30,6 +30,7 @@ export default (app) => { * - user * properties: * user: + * description: User details. * $ref: "#/components/schemas/User" */ export type AdminAuthRes = { diff --git a/packages/medusa/src/api/routes/admin/batch/cancel-batch-job.ts b/packages/medusa/src/api/routes/admin/batch/cancel-batch-job.ts index b97099b945..9432cf7a8d 100644 --- a/packages/medusa/src/api/routes/admin/batch/cancel-batch-job.ts +++ b/packages/medusa/src/api/routes/admin/batch/cancel-batch-job.ts @@ -5,7 +5,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/batch-jobs/{id}/cancel * operationId: "PostBatchJobsBatchJobCancel" * summary: "Cancel a Batch Job" - * description: "Marks a batch job as canceled" + * description: "Mark a batch job as canceled. When a batch job is canceled, the processing of the batch job doesn’t automatically stop." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the batch job. @@ -18,15 +18,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.batchJobs.cancel(batch_job_id) + * medusa.admin.batchJobs.cancel(batchJobId) * .then(({ batch_job }) => { * console.log(batch_job.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/batch/confirm-batch-job.ts b/packages/medusa/src/api/routes/admin/batch/confirm-batch-job.ts index bff093461f..523f425ce4 100644 --- a/packages/medusa/src/api/routes/admin/batch/confirm-batch-job.ts +++ b/packages/medusa/src/api/routes/admin/batch/confirm-batch-job.ts @@ -5,7 +5,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/batch-jobs/{id}/confirm * operationId: "PostBatchJobsBatchJobConfirmProcessing" * summary: "Confirm a Batch Job" - * description: "Confirms that a previously requested batch job should be executed." + * description: "When a batch job is created, it is not executed automatically if `dry_run` is set to `true`. This endpoint confirms that the batch job should be executed." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the batch job. @@ -18,15 +18,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.batchJobs.confirm(batch_job_id) + * medusa.admin.batchJobs.confirm(batchJobId) * .then(({ batch_job }) => { * console.log(batch_job.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/batch/create-batch-job.ts b/packages/medusa/src/api/routes/admin/batch/create-batch-job.ts index 890ea7a95a..9e0f789f4c 100644 --- a/packages/medusa/src/api/routes/admin/batch/create-batch-job.ts +++ b/packages/medusa/src/api/routes/admin/batch/create-batch-job.ts @@ -9,7 +9,11 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/batch-jobs * operationId: "PostBatchJobs" * summary: "Create a Batch Job" - * description: "Creates a Batch Job." + * description: "Create a Batch Job to be executed asynchronously in the Medusa backend. If `dry_run` is set to `true`, the batch job will not be executed until the it is confirmed, + * which can be done using the Confirm Batch Job endpoint." + * externalDocs: + * description: "How to create a batch job" + * url: "https://docs.medusajs.com/development/batch-jobs/create#create-batch-job" * x-authenticated: true * requestBody: * content: @@ -35,9 +39,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/batch-jobs' \ - * --header 'Content-Type: application/json' \ - * --header 'Authorization: Bearer {api_token}' \ + * curl -X POST 'https://medusa-url.com/admin/batch-jobs' \ + * -H 'Content-Type: application/json' \ + * -H 'Authorization: Bearer {api_token}' \ * --data-raw '{ * "type": "product-export", * "context": { } @@ -97,7 +101,7 @@ export default async (req, res) => { * properties: * type: * type: string - * description: The type of batch job to start. + * description: The type of batch job to start, which is defined by the `batchType` property of the associated batch job strategy. * example: product-export * context: * type: object @@ -120,7 +124,7 @@ export default async (req, res) => { * - images * dry_run: * type: boolean - * description: Set a batch job in dry_run mode to get some information on what will be done without applying any modifications. + * description: Set a batch job in dry_run mode, which would delay executing the batch job until it's confirmed. * default: false */ export class AdminPostBatchesReq { diff --git a/packages/medusa/src/api/routes/admin/batch/get-batch-job.ts b/packages/medusa/src/api/routes/admin/batch/get-batch-job.ts index 18cdca57b2..c9c137d5fd 100644 --- a/packages/medusa/src/api/routes/admin/batch/get-batch-job.ts +++ b/packages/medusa/src/api/routes/admin/batch/get-batch-job.ts @@ -2,7 +2,7 @@ * @oas [get] /admin/batch-jobs/{id} * operationId: "GetBatchJobsBatchJob" * summary: "Get a Batch Job" - * description: "Retrieves a Batch Job." + * description: "Retrieve the details of a batch job." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Batch Job @@ -15,15 +15,15 @@ * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.batchJobs.retrieve(batch_job_id) + * medusa.admin.batchJobs.retrieve(batchJobId) * .then(({ batch_job }) => { * console.log(batch_job.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/batch-jobs/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/batch-jobs/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/batch/index.ts b/packages/medusa/src/api/routes/admin/batch/index.ts index 00ac1d10ba..5e4b53b362 100644 --- a/packages/medusa/src/api/routes/admin/batch/index.ts +++ b/packages/medusa/src/api/routes/admin/batch/index.ts @@ -49,6 +49,7 @@ export default (app) => { * - batch_job * properties: * batch_job: + * description: Batch job details. * $ref: "#/components/schemas/BatchJob" */ export type AdminBatchJobRes = { @@ -66,6 +67,7 @@ export type AdminBatchJobRes = { * properties: * batch_jobs: * type: array + * description: An array of batch job details. * items: * $ref: "#/components/schemas/BatchJob" * count: @@ -73,7 +75,7 @@ export type AdminBatchJobRes = { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of batch jobs skipped when retrieving the batch jobs. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/batch/list-batch-jobs.ts b/packages/medusa/src/api/routes/admin/batch/list-batch-jobs.ts index 080ee6cffe..32ef14d93d 100644 --- a/packages/medusa/src/api/routes/admin/batch/list-batch-jobs.ts +++ b/packages/medusa/src/api/routes/admin/batch/list-batch-jobs.ts @@ -12,11 +12,11 @@ import { isDefined } from "medusa-core-utils" * @oas [get] /admin/batch-jobs * operationId: "GetBatchJobs" * summary: "List Batch Jobs" - * description: "Retrieve a list of Batch Jobs." + * description: "Retrieve a list of Batch Jobs. The batch jobs can be filtered by fields such as `type` or `confirmed_at`. The batch jobs can also be sorted or paginated." * x-authenticated: true * parameters: - * - (query) limit=10 {integer} The number of batch jobs to return. - * - (query) offset=0 {integer} The number of batch jobs to skip before results. + * - (query) limit=10 {integer} Limit the number of batch jobs returned. + * - (query) offset=0 {integer} The number of batch jobs to skip when retrieving the batch jobs. * - in: query * name: id * style: form @@ -43,7 +43,7 @@ import { isDefined } from "medusa-core-utils" * name: confirmed_at * style: form * explode: false - * description: Date comparison for when resulting collections was confirmed, i.e. less than, greater than etc. + * description: Filter by a confirmation date range. * schema: * type: object * properties: @@ -67,7 +67,7 @@ import { isDefined } from "medusa-core-utils" * name: pre_processed_at * style: form * explode: false - * description: Date comparison for when resulting collections was pre processed, i.e. less than, greater than etc. + * description: Filter by a pre-processing date range. * schema: * type: object * properties: @@ -91,7 +91,7 @@ import { isDefined } from "medusa-core-utils" * name: completed_at * style: form * explode: false - * description: Date comparison for when resulting collections was completed, i.e. less than, greater than etc. + * description: Filter by a completion date range. * schema: * type: object * properties: @@ -115,7 +115,7 @@ import { isDefined } from "medusa-core-utils" * name: failed_at * style: form * explode: false - * description: Date comparison for when resulting collections was failed, i.e. less than, greater than etc. + * description: Filter by a failure date range. * schema: * type: object * properties: @@ -139,7 +139,7 @@ import { isDefined } from "medusa-core-utils" * name: canceled_at * style: form * explode: false - * description: Date comparison for when resulting collections was canceled, i.e. less than, greater than etc. + * description: Filter by a cancelation date range. * schema: * type: object * properties: @@ -159,14 +159,14 @@ import { isDefined } from "medusa-core-utils" * type: string * description: filter by dates greater than or equal to this date * format: date - * - (query) order {string} Field used to order retrieved batch jobs - * - (query) expand {string} (Comma separated) Which fields should be expanded in each order of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each order of the result. + * - (query) order {string} A batch-job field to sort-order the retrieved batch jobs by. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned batch jobs. + * - (query) fields {string} Comma-separated fields that should be included in the returned batch jobs. * - in: query * name: created_at * style: form * explode: false - * description: Date comparison for when resulting collections was created, i.e. less than, greater than etc. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -190,7 +190,7 @@ import { isDefined } from "medusa-core-utils" * name: updated_at * style: form * explode: false - * description: Date comparison for when resulting collections was updated, i.e. less than, greater than etc. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -222,13 +222,13 @@ import { isDefined } from "medusa-core-utils" * // must be previously logged in or use api token * medusa.admin.batchJobs.list() * .then(({ batch_jobs, limit, offset, count }) => { - * console.log(batch_jobs.length); - * }); + * console.log(batch_jobs.length) + * }) * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/batch-jobs' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/batch-jobs' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/collections/add-products.ts b/packages/medusa/src/api/routes/admin/collections/add-products.ts index 87095295c2..075a7125b2 100644 --- a/packages/medusa/src/api/routes/admin/collections/add-products.ts +++ b/packages/medusa/src/api/routes/admin/collections/add-products.ts @@ -8,11 +8,11 @@ import { defaultAdminCollectionsRelations } from "./index" /** * @oas [post] /admin/collections/{id}/products/batch * operationId: "PostProductsToCollection" - * summary: "Update Products" - * description: "Updates products associated with a Product Collection" + * summary: "Add Products to Collection" + * description: "Add products to a product collection." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Collection. + * - (path) id=* {string} The ID of the product collection. * requestBody: * content: * application/json: @@ -21,12 +21,27 @@ import { defaultAdminCollectionsRelations } from "./index" * x-codegen: * method: addProducts * x-codeSamples: + * - lang: JavaScript + * label: JS Client + * source: | + * import Medusa from "@medusajs/medusa-js" + * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + * // must be previously logged in or use api token + * medusa.admin.collections.addProducts(collectionId, { + * product_ids: [ + * productId1, + * productId2 + * ] + * }) + * .then(({ collection }) => { + * console.log(collection.products) + * }) * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "product_ids": [ * "prod_01G1G5V2MBA328390B5AXJ610F" @@ -36,7 +51,7 @@ import { defaultAdminCollectionsRelations } from "./index" * - api_token: [] * - cookie_auth: [] * tags: - * - Collections + * - Product Collections * responses: * "200": * description: OK diff --git a/packages/medusa/src/api/routes/admin/collections/create-collection.ts b/packages/medusa/src/api/routes/admin/collections/create-collection.ts index 95ac6ba156..2e5155f369 100644 --- a/packages/medusa/src/api/routes/admin/collections/create-collection.ts +++ b/packages/medusa/src/api/routes/admin/collections/create-collection.ts @@ -8,7 +8,7 @@ import { defaultAdminCollectionsRelations } from "." * @oas [post] /admin/collections * operationId: "PostCollections" * summary: "Create a Collection" - * description: "Creates a Product Collection." + * description: "Create a Product Collection." * x-authenticated: true * requestBody: * content: @@ -25,7 +25,7 @@ import { defaultAdminCollectionsRelations } from "." * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.collections.create({ - * title: 'New Collection' + * title: "New Collection" * }) * .then(({ collection }) => { * console.log(collection.id); @@ -33,9 +33,9 @@ import { defaultAdminCollectionsRelations } from "." * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/collections' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/collections' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "title": "New Collection" * }' @@ -43,7 +43,7 @@ import { defaultAdminCollectionsRelations } from "." * - api_token: [] * - cookie_auth: [] * tags: - * - Collections + * - Product Collections * responses: * "200": * description: OK @@ -93,10 +93,10 @@ export default async (req: Request, res: Response) => { * properties: * title: * type: string - * description: The title to identify the Collection by. + * description: The title of the collection. * handle: * type: string - * description: An optional handle to be used in slugs, if none is provided we will kebab-case the title. + * description: An optional handle to be used in slugs. If none is provided, the kebab-case version of the title will be used. * metadata: * description: An optional set of key-value pairs to hold additional information. * type: object diff --git a/packages/medusa/src/api/routes/admin/collections/delete-collection.ts b/packages/medusa/src/api/routes/admin/collections/delete-collection.ts index 82ba68e391..c58921177b 100644 --- a/packages/medusa/src/api/routes/admin/collections/delete-collection.ts +++ b/packages/medusa/src/api/routes/admin/collections/delete-collection.ts @@ -7,7 +7,7 @@ import ProductCollectionService from "../../../../services/product-collection" * @oas [delete] /admin/collections/{id} * operationId: "DeleteCollectionsCollection" * summary: "Delete a Collection" - * description: "Deletes a Product Collection." + * description: "Delete a Product Collection. This does not delete associated products." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Collection. @@ -20,20 +20,20 @@ import ProductCollectionService from "../../../../services/product-collection" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.collections.delete(collection_id) + * medusa.admin.collections.delete(collectionId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/collections/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/collections/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] * tags: - * - Collections + * - Product Collections * responses: * "200": * description: OK diff --git a/packages/medusa/src/api/routes/admin/collections/get-collection.ts b/packages/medusa/src/api/routes/admin/collections/get-collection.ts index a1d15eb6a8..ffabc0028d 100644 --- a/packages/medusa/src/api/routes/admin/collections/get-collection.ts +++ b/packages/medusa/src/api/routes/admin/collections/get-collection.ts @@ -7,7 +7,7 @@ import { defaultAdminCollectionsRelations } from "." * @oas [get] /admin/collections/{id} * operationId: "GetCollectionsCollection" * summary: "Get a Collection" - * description: "Retrieves a Product Collection." + * description: "Retrieve a Product Collection by its ID. The products associated with it are expanded and returned as well." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Product Collection @@ -20,20 +20,20 @@ import { defaultAdminCollectionsRelations } from "." * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.collections.retrieve(collection_id) + * medusa.admin.collections.retrieve(collectionId) * .then(({ collection }) => { * console.log(collection.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/collections/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/collections/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] * tags: - * - Collections + * - Product Collections * responses: * "200": * description: OK diff --git a/packages/medusa/src/api/routes/admin/collections/index.ts b/packages/medusa/src/api/routes/admin/collections/index.ts index e2729ba78e..a621c03e00 100644 --- a/packages/medusa/src/api/routes/admin/collections/index.ts +++ b/packages/medusa/src/api/routes/admin/collections/index.ts @@ -80,6 +80,7 @@ export const defaultAdminCollectionsRelations = ["products.profiles"] * properties: * collections: * type: array + * description: an array of collection details * items: * $ref: "#/components/schemas/ProductCollection" * count: @@ -87,7 +88,7 @@ export const defaultAdminCollectionsRelations = ["products.profiles"] * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of product collections skipped when retrieving the product collections. * limit: * type: integer * description: The number of items per page @@ -137,7 +138,7 @@ export type AdminCollectionsDeleteRes = DeleteResponse * description: "The IDs of the products removed from the collection" * type: array * items: - * description: "The ID of a Product to add to the Product Collection." + * description: "The ID of the Product removed from the Product Collection." * type: string */ export type AdminDeleteProductsFromCollectionRes = { @@ -157,6 +158,7 @@ export type AdminDeleteProductsFromCollectionRes = { * - collection * properties: * collection: + * type: "Product Collection details." * $ref: "#/components/schemas/ProductCollection" */ export type AdminCollectionsRes = { diff --git a/packages/medusa/src/api/routes/admin/collections/list-collections.ts b/packages/medusa/src/api/routes/admin/collections/list-collections.ts index 711079ea2b..bd7c2a1908 100644 --- a/packages/medusa/src/api/routes/admin/collections/list-collections.ts +++ b/packages/medusa/src/api/routes/admin/collections/list-collections.ts @@ -9,18 +9,18 @@ import { Type } from "class-transformer" * @oas [get] /admin/collections * operationId: "GetCollections" * summary: "List Collections" - * description: "Retrieve a list of Product Collection." + * description: "Retrieve a list of Product Collection. The product collections can be filtered by fields such as `handle` or `title`. The collections can also be sorted or paginated." * x-authenticated: true * parameters: * - (query) limit=10 {integer} The number of collections to return. - * - (query) offset=0 {integer} The number of collections to skip before the results. - * - (query) title {string} The title of collections to return. - * - (query) handle {string} The handle of collections to return. - * - (query) q {string} a search term to search titles and handles. - * - (query) discount_condition_id {string} The discount condition id on which to filter the product collections. + * - (query) offset=0 {integer} The number of collections to skip when retrieving the collections. + * - (query) title {string} Filter collections by their title. + * - (query) handle {string} Filter collections by their handle. + * - (query) q {string} a term to search collections by their title or handle. + * - (query) discount_condition_id {string} Filter collections by a discount condition ID associated with them. * - in: query * name: created_at - * description: Date comparison for when resulting collections were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -42,7 +42,7 @@ import { Type } from "class-transformer" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting collections were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -64,7 +64,7 @@ import { Type } from "class-transformer" * format: date * - in: query * name: deleted_at - * description: Date comparison for when resulting collections were deleted. + * description: Filter by a deletion date range. * schema: * type: object * properties: @@ -101,13 +101,13 @@ import { Type } from "class-transformer" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/collections' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/collections' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] * tags: - * - Collections + * - Product Collections * responses: * "200": * description: OK diff --git a/packages/medusa/src/api/routes/admin/collections/remove-products.ts b/packages/medusa/src/api/routes/admin/collections/remove-products.ts index 9f9f5ba4b6..d2263af43f 100644 --- a/packages/medusa/src/api/routes/admin/collections/remove-products.ts +++ b/packages/medusa/src/api/routes/admin/collections/remove-products.ts @@ -7,11 +7,11 @@ import ProductCollectionService from "../../../../services/product-collection" /** * @oas [delete] /admin/collections/{id}/products/batch * operationId: "DeleteProductsFromCollection" - * summary: "Remove Product" - * description: "Removes products associated with a Product Collection" + * summary: "Remove Products from Collection" + * description: "Remove a list of products from a collection. This would not delete the product, only the association between the product and the collection." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Collection. + * - (path) id=* {string} The ID of the Product Collection. * requestBody: * content: * application/json: @@ -20,12 +20,27 @@ import ProductCollectionService from "../../../../services/product-collection" * x-codegen: * method: removeProducts * x-codeSamples: + * - lang: JavaScript + * label: JS Client + * source: | + * import Medusa from "@medusajs/medusa-js" + * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + * // must be previously logged in or use api token + * medusa.admin.collections.removeProducts(collectionId, { + * product_ids: [ + * productId1, + * productId2 + * ] + * }) + * .then(({ id, object, removed_products }) => { + * console.log(removed_products) + * }) * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "product_ids": [ * "prod_01G1G5V2MBA328390B5AXJ610F" @@ -35,7 +50,7 @@ import ProductCollectionService from "../../../../services/product-collection" * - api_token: [] * - cookie_auth: [] * tags: - * - Collections + * - Product Collections * responses: * "200": * description: OK diff --git a/packages/medusa/src/api/routes/admin/collections/update-collection.ts b/packages/medusa/src/api/routes/admin/collections/update-collection.ts index d466bf4362..69b5e44f2c 100644 --- a/packages/medusa/src/api/routes/admin/collections/update-collection.ts +++ b/packages/medusa/src/api/routes/admin/collections/update-collection.ts @@ -8,7 +8,7 @@ import { defaultAdminCollectionsRelations } from "." * @oas [post] /admin/collections/{id} * operationId: "PostCollectionsCollection" * summary: "Update a Collection" - * description: "Updates a Product Collection." + * description: "Update a Product Collection's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Collection. @@ -26,8 +26,8 @@ import { defaultAdminCollectionsRelations } from "." * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.collections.update(collection_id, { - * title: 'New Collection' + * medusa.admin.collections.update(collectionId, { + * title: "New Collection" * }) * .then(({ collection }) => { * console.log(collection.id); @@ -35,9 +35,9 @@ import { defaultAdminCollectionsRelations } from "." * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/collections/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/collections/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "title": "New Collection" * }' @@ -45,7 +45,7 @@ import { defaultAdminCollectionsRelations } from "." * - api_token: [] * - cookie_auth: [] * tags: - * - Collections + * - Product Collections * responses: * "200": * description: OK @@ -96,10 +96,10 @@ export default async (req: Request, res: Response) => { * properties: * title: * type: string - * description: The title to identify the Collection by. + * description: The title of the collection. * handle: * type: string - * description: An optional handle to be used in slugs, if none is provided we will kebab-case the title. + * description: An optional handle to be used in slugs. If none is provided, the kebab-case version of the title will be used. * metadata: * description: An optional set of key-value pairs to hold additional information. * type: object diff --git a/packages/medusa/src/api/routes/admin/currencies/index.ts b/packages/medusa/src/api/routes/admin/currencies/index.ts index c5c0b1657e..6586bfeb18 100644 --- a/packages/medusa/src/api/routes/admin/currencies/index.ts +++ b/packages/medusa/src/api/routes/admin/currencies/index.ts @@ -43,6 +43,7 @@ export default (app) => { * properties: * currencies: * type: array + * description: An array of currency details. * items: * $ref: "#/components/schemas/Currency" * count: @@ -50,7 +51,7 @@ export default (app) => { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of currencies skipped when retrieving the currencies. * limit: * type: integer * description: The number of items per page @@ -66,7 +67,8 @@ export type AdminCurrenciesListRes = PaginatedResponse & { * - currency * properties: * currency: - * $ref: "#/components/schemas/Currency" + * description: Currency details. + * $ref: "#/components/schemas/Currency" */ export type AdminCurrenciesRes = { currency: Currency diff --git a/packages/medusa/src/api/routes/admin/currencies/list-currencies.ts b/packages/medusa/src/api/routes/admin/currencies/list-currencies.ts index 1ee1339220..ce02b141a8 100644 --- a/packages/medusa/src/api/routes/admin/currencies/list-currencies.ts +++ b/packages/medusa/src/api/routes/admin/currencies/list-currencies.ts @@ -10,14 +10,19 @@ import { FeatureFlagDecorators } from "../../../../utils/feature-flag-decorators * @oas [get] /admin/currencies * operationId: "GetCurrencies" * summary: "List Currency" - * description: "Retrieves a list of Currency" + * description: "Retrieve a list of currencies. The currencies can be filtered by fields such as `code`. The currencies can also be sorted or paginated." * x-authenticated: true * parameters: - * - (query) code {string} Code of the currency to search for. - * - (query) includes_tax {boolean} Search for tax inclusive currencies. - * - (query) order {string} order to retrieve products in. - * - (query) offset=0 {number} How many products to skip in the result. - * - (query) limit=20 {number} Limit the number of products returned. + * - (query) code {string} filter by currency code. + * - in: query + * name: includes_tax + * description: filter currencies by whether they include taxes or not. + * schema: + * type: boolean + * x-featureFlag: "tax_inclusive_pricing" + * - (query) order {string} A field to sort order the retrieved currencies by. + * - (query) offset=0 {number} The number of currencies to skip when retrieving the currencies. + * - (query) limit=20 {number} The number of currencies to return. * x-codegen: * method: list * queryParams: AdminGetCurrenciesParams @@ -35,8 +40,8 @@ import { FeatureFlagDecorators } from "../../../../utils/feature-flag-decorators * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/currencies' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/currencies' \ + * -H 'Authorization: Bearer {api_token}' * tags: * - Currencies * responses: diff --git a/packages/medusa/src/api/routes/admin/currencies/update-currency.ts b/packages/medusa/src/api/routes/admin/currencies/update-currency.ts index 552d953609..a7e73afc2b 100644 --- a/packages/medusa/src/api/routes/admin/currencies/update-currency.ts +++ b/packages/medusa/src/api/routes/admin/currencies/update-currency.ts @@ -10,7 +10,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/currencies/{code} * operationId: "PostCurrenciesCurrency" * summary: "Update a Currency" - * description: "Update a Currency" + * description: "Update a Currency's details." * x-authenticated: true * parameters: * - (path) code=* {string} The code of the Currency. @@ -37,9 +37,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/currencies/{code}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/currencies/{code}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "includes_tax": true * }' @@ -74,7 +74,8 @@ export default async (req: ExtendedRequest, res) => { * properties: * includes_tax: * type: boolean - * description: "[EXPERIMENTAL] Tax included in prices of currency." + * x-featureFlag: "tax_inclusive_pricing" + * description: "Tax included in prices of currency." */ export class AdminPostCurrenciesCurrencyReq { @FeatureFlagDecorators(TaxInclusivePricingFeatureFlag.key, [ diff --git a/packages/medusa/src/api/routes/admin/customer-groups/add-customers-batch.ts b/packages/medusa/src/api/routes/admin/customer-groups/add-customers-batch.ts index 54632a69b0..457a98f2b1 100644 --- a/packages/medusa/src/api/routes/admin/customer-groups/add-customers-batch.ts +++ b/packages/medusa/src/api/routes/admin/customer-groups/add-customers-batch.ts @@ -10,8 +10,8 @@ import { validator } from "../../../../utils/validator" /** * @oas [post] /admin/customer-groups/{id}/customers/batch * operationId: "PostCustomerGroupsGroupCustomersBatch" - * summary: "Add Customers" - * description: "Adds a list of customers, represented by id's, to a customer group." + * summary: "Add Customers to Group" + * description: "Add a list of customers to a customer group." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the customer group. @@ -29,10 +29,10 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.customerGroups.addCustomers(customer_group_id, { + * medusa.admin.customerGroups.addCustomers(customerGroupId, { * customer_ids: [ * { - * id: customer_id + * id: customerId * } * ] * }) @@ -42,9 +42,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "customer_ids": [ * { diff --git a/packages/medusa/src/api/routes/admin/customer-groups/create-customer-group.ts b/packages/medusa/src/api/routes/admin/customer-groups/create-customer-group.ts index fde60bd7cc..dbb818637c 100644 --- a/packages/medusa/src/api/routes/admin/customer-groups/create-customer-group.ts +++ b/packages/medusa/src/api/routes/admin/customer-groups/create-customer-group.ts @@ -9,7 +9,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/customer-groups * operationId: "PostCustomerGroups" * summary: "Create a Customer Group" - * description: "Creates a CustomerGroup." + * description: "Creates a Customer Group." * x-authenticated: true * requestBody: * content: @@ -26,7 +26,7 @@ import { validator } from "../../../../utils/validator" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.customerGroups.create({ - * name: 'VIP' + * name: "VIP" * }) * .then(({ customer_group }) => { * console.log(customer_group.id); @@ -34,9 +34,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/customer-groups' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/customer-groups' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "VIP" * }' @@ -96,7 +96,7 @@ export default async (req: Request, res: Response) => { * description: Name of the customer group * metadata: * type: object - * description: Metadata for the customer. + * description: Metadata of the customer group. */ export class AdminPostCustomerGroupsReq { @IsString() diff --git a/packages/medusa/src/api/routes/admin/customer-groups/delete-customer-group.ts b/packages/medusa/src/api/routes/admin/customer-groups/delete-customer-group.ts index 38b8fa227f..1ee55bd494 100644 --- a/packages/medusa/src/api/routes/admin/customer-groups/delete-customer-group.ts +++ b/packages/medusa/src/api/routes/admin/customer-groups/delete-customer-group.ts @@ -7,7 +7,7 @@ import { EntityManager } from "typeorm" * @oas [delete] /admin/customer-groups/{id} * operationId: "DeleteCustomerGroupsCustomerGroup" * summary: "Delete a Customer Group" - * description: "Deletes a CustomerGroup." + * description: "Delete a customer group. This doesn't delete the customers associated with the customer group." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Customer Group @@ -20,15 +20,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.customerGroups.delete(customer_group_id) + * medusa.admin.customerGroups.delete(customerGroupId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/customer-groups/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/customer-groups/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/customer-groups/delete-customers-batch.ts b/packages/medusa/src/api/routes/admin/customer-groups/delete-customers-batch.ts index 7ee1a37519..73e3eef884 100644 --- a/packages/medusa/src/api/routes/admin/customer-groups/delete-customers-batch.ts +++ b/packages/medusa/src/api/routes/admin/customer-groups/delete-customers-batch.ts @@ -10,8 +10,8 @@ import { validator } from "../../../../utils/validator" /** * @oas [delete] /admin/customer-groups/{id}/customers/batch * operationId: "DeleteCustomerGroupsGroupCustomerBatch" - * summary: "Remove Customers" - * description: "Removes a list of customers, represented by id's, from a customer group." + * summary: "Remove Customers from Group" + * description: "Remove a list of customers from a customer group. This doesn't delete the customer, only the association between the customer and the customer group." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the customer group. @@ -29,10 +29,10 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.customerGroups.removeCustomers(customer_group_id, { + * medusa.admin.customerGroups.removeCustomers(customerGroupId, { * customer_ids: [ * { - * id: customer_id + * id: customerId * } * ] * }) @@ -42,9 +42,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "customer_ids": [ * { diff --git a/packages/medusa/src/api/routes/admin/customer-groups/get-customer-group-customers.ts b/packages/medusa/src/api/routes/admin/customer-groups/get-customer-group-customers.ts index 0de23ea0c5..de194ceb53 100644 --- a/packages/medusa/src/api/routes/admin/customer-groups/get-customer-group-customers.ts +++ b/packages/medusa/src/api/routes/admin/customer-groups/get-customer-group-customers.ts @@ -8,14 +8,14 @@ import { Type } from "class-transformer" * @oas [get] /admin/customer-groups/{id}/customers * operationId: "GetCustomerGroupsGroupCustomers" * summary: "List Customers" - * description: "Retrieves a list of customers in a customer group" + * description: "Retrieve a list of customers in a customer group. The customers can be filtered by the `q` field. The customers can also be paginated." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the customer group. - * - (query) limit=50 {integer} The number of items to return. - * - (query) offset=0 {integer} The items to skip before result. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each customer. - * - (query) q {string} a search term to search email, first_name, and last_name. + * - (query) limit=50 {integer} The number of customers to return. + * - (query) offset=0 {integer} The number of customers to skip when retrieving the customers. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned customers. + * - (query) q {string} a term to search customers by email, first_name, and last_name. * x-codegen: * method: listCustomers * queryParams: AdminGetGroupsGroupCustomersParams @@ -26,15 +26,15 @@ import { Type } from "class-transformer" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.customerGroups.listCustomers(customer_group_id) + * medusa.admin.customerGroups.listCustomers(customerGroupId) * .then(({ customers }) => { * console.log(customers.length); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/customer-groups/get-customer-group.ts b/packages/medusa/src/api/routes/admin/customer-groups/get-customer-group.ts index 2e02e4b1f1..b5aab6d93d 100644 --- a/packages/medusa/src/api/routes/admin/customer-groups/get-customer-group.ts +++ b/packages/medusa/src/api/routes/admin/customer-groups/get-customer-group.ts @@ -7,12 +7,12 @@ import { FindParams } from "../../../../types/common" * @oas [get] /admin/customer-groups/{id} * operationId: "GetCustomerGroupsGroup" * summary: "Get a Customer Group" - * description: "Retrieves a Customer Group." + * description: "Retrieve a Customer Group by its ID. You can expand the customer group's relations or select the fields that should be returned." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Customer Group. - * - (query) expand {string} (Comma separated) Which fields should be expanded in the customer group. - * - (query) fields {string} (Comma separated) Which fields should be included in the customer group. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned customer group. + * - (query) fields {string} Comma-separated fields that should be included in the returned customer group. * x-codegen: * method: retrieve * queryParams: AdminGetCustomerGroupsGroupParams @@ -23,15 +23,15 @@ import { FindParams } from "../../../../types/common" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.customerGroups.retrieve(customer_group_id) + * medusa.admin.customerGroups.retrieve(customerGroupId) * .then(({ customer_group }) => { * console.log(customer_group.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/customer-groups/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/customer-groups/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/customer-groups/index.ts b/packages/medusa/src/api/routes/admin/customer-groups/index.ts index ad03e4f4c5..c807230f65 100644 --- a/packages/medusa/src/api/routes/admin/customer-groups/index.ts +++ b/packages/medusa/src/api/routes/admin/customer-groups/index.ts @@ -63,6 +63,7 @@ export default (app) => { * - customer_group * properties: * customer_group: + * description: Customer group details. * $ref: "#/components/schemas/CustomerGroup" */ export type AdminCustomerGroupsRes = { @@ -102,6 +103,7 @@ export type AdminCustomerGroupsDeleteRes = DeleteResponse * properties: * customer_groups: * type: array + * description: An array of customer group details. * items: * $ref: "#/components/schemas/CustomerGroup" * count: @@ -109,7 +111,7 @@ export type AdminCustomerGroupsDeleteRes = DeleteResponse * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of customer groups skipped when retrieving the customer groups. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/customer-groups/list-customer-groups.ts b/packages/medusa/src/api/routes/admin/customer-groups/list-customer-groups.ts index c8e01760a0..3aee43826b 100644 --- a/packages/medusa/src/api/routes/admin/customer-groups/list-customer-groups.ts +++ b/packages/medusa/src/api/routes/admin/customer-groups/list-customer-groups.ts @@ -9,13 +9,13 @@ import { Type } from "class-transformer" * @oas [get] /admin/customer-groups * operationId: "GetCustomerGroups" * summary: "List Customer Groups" - * description: "Retrieve a list of customer groups." + * description: "Retrieve a list of customer groups. The customer groups can be filtered by fields such as `name` or `id. The customer groups can also be sorted or paginated." * x-authenticated: true * parameters: - * - (query) q {string} Query used for searching customer group names. - * - (query) offset=0 {integer} How many groups to skip in the result. - * - (query) order {string} the field used to order the customer groups. - * - (query) discount_condition_id {string} The discount condition id on which to filter the customer groups. + * - (query) q {string} term to search customer groups by name. + * - (query) offset=0 {integer} The number of customer groups to skip when retrieving the customer groups. + * - (query) order {string} A field to sort order the retrieved customer groups by. + * - (query) discount_condition_id {string} Filter by discount condition ID. * - in: query * name: id * style: form @@ -26,7 +26,7 @@ import { Type } from "class-transformer" * - type: string * description: customer group ID * - type: array - * description: multiple customer group IDs + * description: an array of customer group IDs * items: * type: string * - type: object @@ -50,13 +50,13 @@ import { Type } from "class-transformer" * description: Filter by the customer group name * schema: * type: array - * description: multiple customer group names + * description: an array of customer group names * items: * type: string * description: customer group name * - in: query * name: created_at - * description: Date comparison for when resulting customer groups were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -78,7 +78,7 @@ import { Type } from "class-transformer" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting customer groups were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -98,8 +98,8 @@ import { Type } from "class-transformer" * type: string * description: filter by dates greater than or equal to this date * format: date - * - (query) limit=10 {integer} Limit the number of customer groups returned. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each customer groups of the result. + * - (query) limit=10 {integer} The number of customer groups to return. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned customer groups. * x-codegen: * method: list * queryParams: AdminGetCustomerGroupsParams @@ -117,8 +117,8 @@ import { Type } from "class-transformer" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/customer-groups' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/customer-groups' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/customer-groups/update-customer-group.ts b/packages/medusa/src/api/routes/admin/customer-groups/update-customer-group.ts index cba2727b1e..02ffb28b67 100644 --- a/packages/medusa/src/api/routes/admin/customer-groups/update-customer-group.ts +++ b/packages/medusa/src/api/routes/admin/customer-groups/update-customer-group.ts @@ -11,7 +11,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/customer-groups/{id} * operationId: "PostCustomerGroupsGroup" * summary: "Update a Customer Group" - * description: "Update a CustomerGroup." + * description: "Update a Customer Group's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the customer group. @@ -29,8 +29,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.customerGroups.update(customer_group_id, { - * name: 'VIP' + * medusa.admin.customerGroups.update(customerGroupId, { + * name: "VIP" * }) * .then(({ customer_group }) => { * console.log(customer_group.id); @@ -38,9 +38,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/customer-groups/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/customer-groups/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "VIP" * }' @@ -114,7 +114,7 @@ export default async (req: Request, res: Response) => { * description: "Name of the customer group" * type: string * metadata: - * description: "Metadata for the customer." + * description: "Metadata of the customer group." * type: object */ export class AdminPostCustomerGroupsGroupReq { diff --git a/packages/medusa/src/api/routes/admin/customers/create-customer.ts b/packages/medusa/src/api/routes/admin/customers/create-customer.ts index 2d5ef935a4..7e0e9619f4 100644 --- a/packages/medusa/src/api/routes/admin/customers/create-customer.ts +++ b/packages/medusa/src/api/routes/admin/customers/create-customer.ts @@ -8,7 +8,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/customers * operationId: "PostCustomers" * summary: "Create a Customer" - * description: "Creates a Customer." + * description: "Allow admins to create a customer." * x-authenticated: true * requestBody: * content: @@ -25,10 +25,10 @@ import { EntityManager } from "typeorm" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.customers.create({ - * email: 'user@example.com', - * first_name: 'Caterina', - * last_name: 'Yost', - * password: 'supersecret' + * email: "user@example.com", + * first_name: "Caterina", + * last_name: "Yost", + * password: "supersecret" * }) * .then(({ customer }) => { * console.log(customer.id); @@ -36,9 +36,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/customers' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/customers' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com", * "first_name": "Caterina", diff --git a/packages/medusa/src/api/routes/admin/customers/get-customer.ts b/packages/medusa/src/api/routes/admin/customers/get-customer.ts index 76cfd3f35a..e07443cec8 100644 --- a/packages/medusa/src/api/routes/admin/customers/get-customer.ts +++ b/packages/medusa/src/api/routes/admin/customers/get-customer.ts @@ -7,12 +7,12 @@ import { validator } from "../../../../utils/validator" * @oas [get] /admin/customers/{id} * operationId: "GetCustomersCustomer" * summary: "Get a Customer" - * description: "Retrieves a Customer." + * description: "Retrieve the details of a customer." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Customer. - * - (query) expand {string} (Comma separated) Which fields should be expanded in the customer. - * - (query) fields {string} (Comma separated) Which fields should be included in the customer. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned customer. + * - (query) fields {string} Comma-separated fields that should be included in the returned customer. * x-codegen: * method: retrieve * x-codeSamples: @@ -22,15 +22,15 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.customers.retrieve(customer_id) + * medusa.admin.customers.retrieve(customerId) * .then(({ customer }) => { * console.log(customer.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/customers/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/customers/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/customers/index.ts b/packages/medusa/src/api/routes/admin/customers/index.ts index a5f3df6aa6..e60193440d 100644 --- a/packages/medusa/src/api/routes/admin/customers/index.ts +++ b/packages/medusa/src/api/routes/admin/customers/index.ts @@ -32,6 +32,7 @@ export default (app) => { * - customer * properties: * customer: + * description: "Customer details." * $ref: "#/components/schemas/Customer" */ export type AdminCustomersRes = { @@ -49,6 +50,7 @@ export type AdminCustomersRes = { * properties: * customers: * type: array + * description: "An array of customer details." * items: * $ref: "#/components/schemas/Customer" * count: @@ -56,7 +58,7 @@ export type AdminCustomersRes = { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of customers skipped when retrieving the customers. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/customers/list-customers.ts b/packages/medusa/src/api/routes/admin/customers/list-customers.ts index 6083338899..3ed65116c3 100644 --- a/packages/medusa/src/api/routes/admin/customers/list-customers.ts +++ b/packages/medusa/src/api/routes/admin/customers/list-customers.ts @@ -8,14 +8,22 @@ import customerController from "../../../../controllers/customers" * @oas [get] /admin/customers * operationId: "GetCustomers" * summary: "List Customers" - * description: "Retrieves a list of Customers." + * description: "Retrieve a list of Customers. The customers can be filtered by fields such as `q` or `groups`. The customers can also be paginated." * x-authenticated: true * parameters: - * - (query) limit=50 {integer} The number of items to return. - * - (query) offset=0 {integer} The items to skip before result. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each customer. - * - (query) q {string} a search term to search email, first_name, and last_name. - * - (query) groups[] {string} group IDs to search customers by. + * - (query) limit=50 {integer} The number of customers to return. + * - (query) offset=0 {integer} The number of customers to skip when retrieving the customers. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned customer. + * - (query) q {string} term to search customers' email, first_name, and last_name fields. + * - in: query + * name: groups + * style: form + * explode: false + * description: Filter by customer group IDs. + * schema: + * type: array + * items: + * type: string * x-codegen: * method: list * queryParams: AdminGetCustomersParams @@ -33,8 +41,8 @@ import customerController from "../../../../controllers/customers" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/customers' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/customers' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/customers/update-customer.ts b/packages/medusa/src/api/routes/admin/customers/update-customer.ts index fbfe61d303..3011981b10 100644 --- a/packages/medusa/src/api/routes/admin/customers/update-customer.ts +++ b/packages/medusa/src/api/routes/admin/customers/update-customer.ts @@ -19,12 +19,12 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/customers/{id} * operationId: "PostCustomersCustomer" * summary: "Update a Customer" - * description: "Updates a Customer." + * description: "Update a Customer's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Customer. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each customer. - * - (query) fields {string} (Comma separated) Which fields should be retrieved in each customer. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned customer. + * - (query) fields {string} Comma-separated fields that should be retrieved in the returned customer. * requestBody: * content: * application/json: @@ -39,8 +39,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.customers.update(customer_id, { - * first_name: 'Dolly' + * medusa.admin.customers.update(customerId, { + * first_name: "Dolly" * }) * .then(({ customer }) => { * console.log(customer.id); @@ -48,9 +48,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/customers/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/customers/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "first_name": "Dolly" * }' @@ -147,6 +147,7 @@ class Group { * format: password * groups: * type: array + * description: A list of customer groups to which the customer belongs. * items: * type: object * required: @@ -155,7 +156,6 @@ class Group { * id: * description: The ID of a customer group * type: string - * description: A list of customer groups to which the customer belongs. * metadata: * description: An optional set of key-value pairs to hold additional information. * type: object diff --git a/packages/medusa/src/api/routes/admin/discounts/add-region.ts b/packages/medusa/src/api/routes/admin/discounts/add-region.ts index 92bff62bed..b78bb7af14 100644 --- a/packages/medusa/src/api/routes/admin/discounts/add-region.ts +++ b/packages/medusa/src/api/routes/admin/discounts/add-region.ts @@ -7,8 +7,8 @@ import { EntityManager } from "typeorm" /** * @oas [post] /admin/discounts/{id}/regions/{region_id} * operationId: "PostDiscountsDiscountRegionsRegion" - * summary: "Add Region" - * description: "Adds a Region to the list of Regions that a Discount can be used in." + * summary: "Add Region to Discount" + * description: "Add a Region to the list of Regions a Discount can be used in." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Discount. @@ -22,15 +22,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.addRegion(discount_id, region_id) + * medusa.admin.discounts.addRegion(discountId, regionId) * .then(({ discount }) => { * console.log(discount.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/discounts/add-resources-to-condition-batch.ts b/packages/medusa/src/api/routes/admin/discounts/add-resources-to-condition-batch.ts index 8535754254..2e7072b292 100644 --- a/packages/medusa/src/api/routes/admin/discounts/add-resources-to-condition-batch.ts +++ b/packages/medusa/src/api/routes/admin/discounts/add-resources-to-condition-batch.ts @@ -13,13 +13,14 @@ import { FindParams } from "../../../../types/common" * @oas [post] /admin/discounts/{discount_id}/conditions/{condition_id}/batch * operationId: "PostDiscountsDiscountConditionsConditionBatch" * summary: "Add Batch Resources" - * description: "Add a batch of resources to a discount condition." + * description: "Add a batch of resources to a discount condition. The type of resource depends on the type of discount condition. For example, if the discount condition's type is `products`, + * the resources being added should be products." * x-authenticated: true * parameters: - * - (path) discount_id=* {string} The ID of the Product. - * - (path) condition_id=* {string} The ID of the condition on which to add the item. - * - (query) expand {string} (Comma separated) Which relations should be expanded in each discount of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each discount of the result. + * - (path) discount_id=* {string} The ID of the discount the condition belongs to. + * - (path) condition_id=* {string} The ID of the discount condition on which to add the item. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned discount. + * - (query) fields {string} Comma-separated fields that should be included in the returned discount. * requestBody: * content: * application/json: @@ -35,8 +36,8 @@ import { FindParams } from "../../../../types/common" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.addConditionResourceBatch(discount_id, condition_id, { - * resources: [{ id: item_id }] + * medusa.admin.discounts.addConditionResourceBatch(discountId, conditionId, { + * resources: [{ id: itemId }] * }) * .then(({ discount }) => { * console.log(discount.id); @@ -44,9 +45,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "resources": [{ "id": "item_id" }] * }' diff --git a/packages/medusa/src/api/routes/admin/discounts/create-condition.ts b/packages/medusa/src/api/routes/admin/discounts/create-condition.ts index aa22eae583..d785ac8470 100644 --- a/packages/medusa/src/api/routes/admin/discounts/create-condition.ts +++ b/packages/medusa/src/api/routes/admin/discounts/create-condition.ts @@ -12,12 +12,13 @@ import { FindParams } from "../../../../types/common" * @oas [post] /admin/discounts/{discount_id}/conditions * operationId: "PostDiscountsDiscountConditions" * summary: "Create a Condition" - * description: "Creates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided." + * description: "Create a Discount Condition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided, based on the type of discount condition. + * For example, if the discount condition's type is `products`, the `products` field should be provided in the request body." * x-authenticated: true * parameters: - * - (path) discount_id=* {string} The ID of the Product. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each product of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each product of the result. + * - (path) discount_id=* {string} The ID of the discount. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned discount. + * - (query) fields {string} Comma-separated fields that should be included in the returned discount. * requestBody: * content: * application/json: @@ -34,7 +35,7 @@ import { FindParams } from "../../../../types/common" * import { DiscountConditionOperator } from "@medusajs/medusa" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.createCondition(discount_id, { + * medusa.admin.discounts.createCondition(discountId, { * operator: DiscountConditionOperator.IN * }) * .then(({ discount }) => { @@ -43,9 +44,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/discounts/{id}/conditions' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "operator": "in" * }' @@ -105,32 +106,33 @@ export default async (req: Request, res: Response) => { * - operator * properties: * operator: - * description: Operator of the condition + * description: "Operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that + * discountable resources are everything but the specified resources." * type: string * enum: [in, not_in] * products: * type: array - * description: list of product IDs if the condition is applied on products. + * description: list of product IDs if the condition's type is `products`. * items: * type: string * product_types: * type: array - * description: list of product type IDs if the condition is applied on product types. + * description: list of product type IDs if the condition's type is `product_types`. * items: * type: string * product_collections: * type: array - * description: list of product collection IDs if the condition is applied on product collections. + * description: list of product collection IDs if the condition's type is `product_collections`. * items: * type: string * product_tags: * type: array - * description: list of product tag IDs if the condition is applied on product tags. + * description: list of product tag IDs if the condition's type is `product_tags`. * items: * type: string * customer_groups: * type: array - * description: list of customer group IDs if the condition is applied on customer groups. + * description: list of customer group IDs if the condition's type is `customer_groups`. * items: * type: string */ diff --git a/packages/medusa/src/api/routes/admin/discounts/create-discount.ts b/packages/medusa/src/api/routes/admin/discounts/create-discount.ts index ceb6075619..5732e89434 100644 --- a/packages/medusa/src/api/routes/admin/discounts/create-discount.ts +++ b/packages/medusa/src/api/routes/admin/discounts/create-discount.ts @@ -28,12 +28,12 @@ import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/discounts * operationId: "PostDiscounts" - * summary: "Creates a Discount" + * summary: "Create a Discount" * x-authenticated: true - * description: "Creates a Discount with a given set of rules that define how the Discount behaves." + * description: "Create a Discount with a given set of rules that defines how the Discount is applied." * parameters: - * - (query) expand {string} (Comma separated) Which fields should be expanded in the results. - * - (query) fields {string} (Comma separated) Which fields should be retrieved in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned discount. + * - (query) fields {string} Comma-separated fields that should be retrieved in the returned discount. * requestBody: * content: * application/json: @@ -51,7 +51,7 @@ import { FindParams } from "../../../../types/common" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.discounts.create({ - * code: 'TEST', + * code: "TEST", * rule: { * type: DiscountRuleType.FIXED, * value: 10, @@ -67,9 +67,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/discounts' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/discounts' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "code": "TEST", * "rule": { @@ -133,13 +133,13 @@ export default async (req: Request, res: Response) => { * properties: * code: * type: string - * description: A unique code that will be used to redeem the Discount + * description: A unique code that will be used to redeem the discount * is_dynamic: * type: boolean - * description: Whether the Discount should have multiple instances of itself, each with a different code. This can be useful for automatically generated codes that all have to follow a common set of rules. + * description: Whether the discount should have multiple instances of itself, each with a different code. This can be useful for automatically generated discount codes that all have to follow a common set of rules. * default: false * rule: - * description: The Discount Rule that defines how Discounts are calculated + * description: The discount rule that defines how discounts are calculated * type: object * required: * - type @@ -151,18 +151,18 @@ export default async (req: Request, res: Response) => { * description: "A short description of the discount" * type: * type: string - * description: "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers." + * description: "The type of the discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers." * enum: [fixed, percentage, free_shipping] * value: * type: number - * description: "The value that the discount represents; this will depend on the type of the discount" + * description: "The value that the discount represents. This will depend on the type of the discount." * allocation: * type: string - * description: "The scope that the discount should apply to." + * description: "The scope that the discount should apply to. `total` indicates that the discount should be applied on the cart total, and `item` indicates that the discount should be applied to each discountable item in the cart." * enum: [total, item] * conditions: * type: array - * description: "A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided." + * description: "A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided based on the discount condition's type." * items: * type: object * required: @@ -170,57 +170,58 @@ export default async (req: Request, res: Response) => { * properties: * operator: * type: string - * description: Operator of the condition + * description: "Operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that + * discountable resources are everything but the specified resources." * enum: [in, not_in] * products: * type: array - * description: list of product IDs if the condition is applied on products. + * description: list of product IDs if the condition's type is `products`. * items: * type: string * product_types: * type: array - * description: list of product type IDs if the condition is applied on product types. + * description: list of product type IDs if the condition's type is `product_types`. * items: * type: string * product_collections: * type: array - * description: list of product collection IDs if the condition is applied on product collections. + * description: list of product collection IDs if the condition's type is `product_collections`. * items: * type: string * product_tags: * type: array - * description: list of product tag IDs if the condition is applied on product tags. + * description: list of product tag IDs if the condition's type is `product_tags`. * items: * type: string * customer_groups: * type: array - * description: list of customer group IDs if the condition is applied on customer groups. + * description: list of customer group IDs if the condition's type is `customer_groups`. * items: * type: string * is_disabled: * type: boolean - * description: Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers. + * description: Whether the discount code is disabled on creation. If set to `true`, it will not be available for customers. * default: false * starts_at: * type: string * format: date-time - * description: The time at which the Discount should be available. + * description: The date and time at which the discount should be available. * ends_at: * type: string * format: date-time - * description: The time at which the Discount should no longer be available. + * description: The date and time at which the discount should no longer be available. * valid_duration: * type: string - * description: Duration the discount runs between + * description: The duration the discount runs between * example: P3Y6M4DT12H30M5S * regions: - * description: A list of Region ids representing the Regions in which the Discount can be used. + * description: A list of region IDs representing the Regions in which the Discount can be used. * type: array * items: * type: string * usage_limit: * type: number - * description: Maximum times the discount can be used + * description: Maximum number of times the discount can be used * metadata: * description: An optional set of key-value pairs to hold additional information. * type: object diff --git a/packages/medusa/src/api/routes/admin/discounts/create-dynamic-code.ts b/packages/medusa/src/api/routes/admin/discounts/create-dynamic-code.ts index 68f7d1eeaf..80b70c9557 100644 --- a/packages/medusa/src/api/routes/admin/discounts/create-dynamic-code.ts +++ b/packages/medusa/src/api/routes/admin/discounts/create-dynamic-code.ts @@ -15,10 +15,10 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/discounts/{id}/dynamic-codes * operationId: "PostDiscountsDiscountDynamicCodes" * summary: "Create a Dynamic Code" - * description: "Creates a dynamic unique code that can map to a parent Discount. This is useful if you want to automatically generate codes with the same behaviour." + * description: "Create a dynamic unique code that can map to a parent Discount. This is useful if you want to automatically generate codes with the same rules and conditions." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Discount to create the dynamic code from." + * - (path) id=* {string} The ID of the Discount to create the dynamic code for." * requestBody: * content: * application/json: @@ -33,8 +33,8 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.createDynamicCode(discount_id, { - * code: 'TEST', + * medusa.admin.discounts.createDynamicCode(discountId, { + * code: "TEST", * usage_limit: 1 * }) * .then(({ discount }) => { @@ -43,9 +43,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "code": "TEST" * }' @@ -107,7 +107,7 @@ export default async (req: Request, res: Response) => { * description: A unique code that will be used to redeem the Discount * usage_limit: * type: number - * description: Maximum times the discount can be used + * description: Maximum number of times the discount code can be used * default: 1 * metadata: * type: object diff --git a/packages/medusa/src/api/routes/admin/discounts/delete-condition.ts b/packages/medusa/src/api/routes/admin/discounts/delete-condition.ts index c0e699c265..cdcab5deb0 100644 --- a/packages/medusa/src/api/routes/admin/discounts/delete-condition.ts +++ b/packages/medusa/src/api/routes/admin/discounts/delete-condition.ts @@ -8,13 +8,13 @@ import { FindParams } from "../../../../types/common" * @oas [delete] /admin/discounts/{discount_id}/conditions/{condition_id} * operationId: "DeleteDiscountsDiscountConditionsCondition" * summary: "Delete a Condition" - * description: "Deletes a DiscountCondition" + * description: "Deletes a Discount Condition. This does not delete resources associated to the discount condition." * x-authenticated: true * parameters: * - (path) discount_id=* {string} The ID of the Discount - * - (path) condition_id=* {string} The ID of the DiscountCondition - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (path) condition_id=* {string} The ID of the Discount Condition + * - (query) expand {string} Comma-separated relations that should be expanded in the returned discount. + * - (query) fields {string} Comma-separated fields that should be included in the returned discount. * x-codegen: * method: deleteCondition * queryParams: AdminDeleteDiscountsDiscountConditionsConditionParams @@ -25,15 +25,15 @@ import { FindParams } from "../../../../types/common" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.deleteCondition(discount_id, condition_id) + * medusa.admin.discounts.deleteCondition(discountId, conditionId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/discounts/delete-discount.ts b/packages/medusa/src/api/routes/admin/discounts/delete-discount.ts index 38f118fcaa..5cfcac78f4 100644 --- a/packages/medusa/src/api/routes/admin/discounts/delete-discount.ts +++ b/packages/medusa/src/api/routes/admin/discounts/delete-discount.ts @@ -5,7 +5,7 @@ import { EntityManager } from "typeorm" * @oas [delete] /admin/discounts/{id} * operationId: "DeleteDiscountsDiscount" * summary: "Delete a Discount" - * description: "Deletes a Discount." + * description: "Delete a Discount. Deleting the discount will make it unavailable for customers to use." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Discount @@ -18,15 +18,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.delete(discount_id) + * medusa.admin.discounts.delete(discountId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/discounts/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/discounts/delete-dynamic-code.ts b/packages/medusa/src/api/routes/admin/discounts/delete-dynamic-code.ts index 04352ecfc8..03cc07a518 100644 --- a/packages/medusa/src/api/routes/admin/discounts/delete-dynamic-code.ts +++ b/packages/medusa/src/api/routes/admin/discounts/delete-dynamic-code.ts @@ -7,11 +7,11 @@ import { EntityManager } from "typeorm" * @oas [delete] /admin/discounts/{id}/dynamic-codes/{code} * operationId: "DeleteDiscountsDiscountDynamicCodesCode" * summary: "Delete a Dynamic Code" - * description: "Deletes a dynamic code from a Discount." + * description: "Delete a dynamic code from a Discount." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Discount - * - (path) code=* {string} The ID of the Discount + * - (path) code=* {string} The dynamic code to delete * x-codegen: * method: deleteDynamicCode * x-codeSamples: @@ -21,15 +21,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.deleteDynamicCode(discount_id, code) + * medusa.admin.discounts.deleteDynamicCode(discountId, code) * .then(({ discount }) => { * console.log(discount.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/discounts/delete-resources-from-condition-batch.ts b/packages/medusa/src/api/routes/admin/discounts/delete-resources-from-condition-batch.ts index 4813233c12..bbde18e5be 100644 --- a/packages/medusa/src/api/routes/admin/discounts/delete-resources-from-condition-batch.ts +++ b/packages/medusa/src/api/routes/admin/discounts/delete-resources-from-condition-batch.ts @@ -11,14 +11,14 @@ import { FindParams } from "../../../../types/common" /** * @oas [delete] /admin/discounts/{discount_id}/conditions/{condition_id}/batch * operationId: "DeleteDiscountsDiscountConditionsConditionBatch" - * summary: "Delete Batch Resources" - * description: "Delete a batch of resources from a discount condition." + * summary: "Remove Batch Resources" + * description: "Remove a batch of resources from a discount condition. This will only remove the association between the resource and the discount condition, but not the resource itself." * x-authenticated: true * parameters: - * - (path) discount_id=* {string} The ID of the Product. - * - (path) condition_id=* {string} The ID of the condition on which to add the item. - * - (query) expand {string} (Comma separated) Which relations should be expanded in each discount of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each discount of the result. + * - (path) discount_id=* {string} The ID of the discount. + * - (path) condition_id=* {string} The ID of the condition to remove the resources from. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned discount. + * - (query) fields {string} Comma-separated fields that should be included in the returned discount. * requestBody: * content: * application/json: @@ -33,8 +33,8 @@ import { FindParams } from "../../../../types/common" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.deleteConditionResourceBatch(discount_id, condition_id, { - * resources: [{ id: item_id }] + * medusa.admin.discounts.deleteConditionResourceBatch(discountId, conditionId, { + * resources: [{ id: itemId }] * }) * .then(({ discount }) => { * console.log(discount.id); @@ -42,9 +42,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "resources": [{ "id": "item_id" }] * }' @@ -119,7 +119,7 @@ export class AdminDeleteDiscountsDiscountConditionsConditionBatchParams extends * - resources * properties: * resources: - * description: The resources to be deleted from the discount condition + * description: The resources to be removed from the discount condition * type: array * items: * type: object diff --git a/packages/medusa/src/api/routes/admin/discounts/get-condition.ts b/packages/medusa/src/api/routes/admin/discounts/get-condition.ts index c788669099..6e71c81f6f 100644 --- a/packages/medusa/src/api/routes/admin/discounts/get-condition.ts +++ b/packages/medusa/src/api/routes/admin/discounts/get-condition.ts @@ -6,13 +6,13 @@ import { FindParams } from "../../../../types/common" * @oas [get] /admin/discounts/{discount_id}/conditions/{condition_id} * operationId: "GetDiscountsDiscountConditionsCondition" * summary: "Get a Condition" - * description: "Gets a DiscountCondition" + * description: "Retrieve a Discount Condition's details." * x-authenticated: true * parameters: * - (path) discount_id=* {string} The ID of the Discount. - * - (path) condition_id=* {string} The ID of the DiscountCondition. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (path) condition_id=* {string} The ID of the Discount Condition. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned discount condition. + * - (query) fields {string} Comma-separated fields that should be included in the returned discount condition. * x-codegen: * method: getCondition * queryParams: AdminGetDiscountsDiscountConditionsConditionParams @@ -23,15 +23,15 @@ import { FindParams } from "../../../../types/common" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.getCondition(discount_id, condition_id) + * medusa.admin.discounts.getCondition(discountId, conditionId) * .then(({ discount_condition }) => { * console.log(discount_condition.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/discounts/get-discount-by-code.ts b/packages/medusa/src/api/routes/admin/discounts/get-discount-by-code.ts index 3df16e8ba9..256206df6f 100644 --- a/packages/medusa/src/api/routes/admin/discounts/get-discount-by-code.ts +++ b/packages/medusa/src/api/routes/admin/discounts/get-discount-by-code.ts @@ -6,12 +6,12 @@ import { FindParams } from "../../../../types/common" * @oas [get] /admin/discounts/code/{code} * operationId: "GetDiscountsDiscountCode" * summary: "Get Discount by Code" - * description: "Retrieves a Discount by its discount code" + * description: "Retrieve a Discount's details by its discount code" * x-authenticated: true * parameters: * - (path) code=* {string} The code of the Discount - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned discount. + * - (query) fields {string} Comma-separated fields that should be included in the returned discount. * x-codegen: * method: retrieveByCode * queryParams: AdminGetDiscountsDiscountCodeParams @@ -29,8 +29,8 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/discounts/code/{code}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/discounts/code/{code}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/discounts/get-discount.ts b/packages/medusa/src/api/routes/admin/discounts/get-discount.ts index 1bca5b53fa..c6313a4b74 100644 --- a/packages/medusa/src/api/routes/admin/discounts/get-discount.ts +++ b/packages/medusa/src/api/routes/admin/discounts/get-discount.ts @@ -10,8 +10,8 @@ import { FindParams } from "../../../../types/common" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Discount - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned discount. + * - (query) fields {string} Comma-separated fields that should be included in the returned discount. * x-codegen: * method: retrieve * queryParams: AdminGetDiscountParams @@ -22,15 +22,15 @@ import { FindParams } from "../../../../types/common" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.retrieve(discount_id) + * medusa.admin.discounts.retrieve(discountId) * .then(({ discount }) => { * console.log(discount.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/discounts/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/discounts/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/discounts/index.ts b/packages/medusa/src/api/routes/admin/discounts/index.ts index 5582a3ba52..8db5893ce4 100644 --- a/packages/medusa/src/api/routes/admin/discounts/index.ts +++ b/packages/medusa/src/api/routes/admin/discounts/index.ts @@ -236,6 +236,7 @@ export const defaultAdminDiscountConditionRelations = ["discount_rule"] * - discount * properties: * discount: + * description: "Discount details." * $ref: "#/components/schemas/Discount" */ export type AdminDiscountsRes = { @@ -253,6 +254,7 @@ export type AdminDiscountsRes = { * - discount_condition * properties: * discount_condition: + * description: "Discount condition details." * $ref: "#/components/schemas/DiscountCondition" */ export type AdminDiscountConditionsRes = { @@ -276,7 +278,7 @@ export type AdminDiscountConditionsRes = { * default: discount * deleted: * type: boolean - * description: Whether the discount was deleted successfully or not. + * description: Whether the discount was deleted successfully. * default: true */ export type AdminDiscountsDeleteRes = DeleteResponse @@ -292,17 +294,17 @@ export type AdminDiscountsDeleteRes = DeleteResponse * properties: * id: * type: string - * description: The ID of the deleted DiscountCondition + * description: The ID of the deleted Discount Condition * object: * type: string * description: The type of the object that was deleted. * default: discount-condition * deleted: * type: boolean - * description: Whether the discount condition was deleted successfully or not. + * description: Whether the discount condition was deleted successfully. * default: true * discount: - * description: The Discount to which the condition used to belong + * description: The Discount to which the condition used to belong to. * $ref: "#/components/schemas/Discount" */ export type AdminDiscountConditionsDeleteRes = DeleteResponse & { @@ -334,7 +336,7 @@ export type AdminDiscountConditionsDeleteRes = DeleteResponse & { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of discounts skipped when retrieving the discounts. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/discounts/list-discounts.ts b/packages/medusa/src/api/routes/admin/discounts/list-discounts.ts index a21aee3e44..5d77440157 100644 --- a/packages/medusa/src/api/routes/admin/discounts/list-discounts.ts +++ b/packages/medusa/src/api/routes/admin/discounts/list-discounts.ts @@ -17,28 +17,28 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * operationId: "GetDiscounts" * summary: "List Discounts" * x-authenticated: true - * description: "Retrieves a list of Discounts" + * description: "Retrieve a list of Discounts. The discounts can be filtered by fields such as `rule` or `is_dynamic`. The discounts can also be paginated." * parameters: - * - (query) q {string} Search query applied on the code field. + * - (query) q {string} term to search discounts' code field. * - in: query * name: rule - * description: Discount Rules filters to apply on the search + * description: Filter discounts by rule fields. * schema: * type: object * properties: * type: * type: string * enum: [fixed, percentage, free_shipping] - * description: "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers." + * description: "Filter discounts by type." * allocation: * type: string * enum: [total, item] - * description: "The value that the discount represents; this will depend on the type of the discount" - * - (query) is_dynamic {boolean} Return only dynamic discounts. - * - (query) is_disabled {boolean} Return only disabled discounts. - * - (query) limit=20 {number} The number of items in the response - * - (query) offset=0 {number} The offset of items in response - * - (query) expand {string} Comma separated list of relations to include in the results. + * description: "Filter discounts by allocation type." + * - (query) is_dynamic {boolean} Filter discounts by whether they're dynamic or not. + * - (query) is_disabled {boolean} Filter discounts by whether they're disabled or not. + * - (query) limit=20 {number} The number of discounts to return + * - (query) offset=0 {number} The number of discounts to skip when retrieving the discounts. + * - (query) expand {string} Comma-separated relations that should be expanded in each returned discount. * x-codegen: * method: list * queryParams: AdminGetDiscountsParams @@ -56,8 +56,8 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/discounts' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/discounts' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/discounts/remove-region.ts b/packages/medusa/src/api/routes/admin/discounts/remove-region.ts index 129fa47503..3d04d1b8b4 100644 --- a/packages/medusa/src/api/routes/admin/discounts/remove-region.ts +++ b/packages/medusa/src/api/routes/admin/discounts/remove-region.ts @@ -8,7 +8,7 @@ import { EntityManager } from "typeorm" * operationId: "DeleteDiscountsDiscountRegionsRegion" * summary: "Remove Region" * x-authenticated: true - * description: "Removes a Region from the list of Regions that a Discount can be used in." + * description: "Remove a Region from the list of Regions that a Discount can be used in. This does not delete a region, only the association between it and the discount." * parameters: * - (path) id=* {string} The ID of the Discount. * - (path) region_id=* {string} The ID of the Region. @@ -21,15 +21,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.removeRegion(discount_id, region_id) + * medusa.admin.discounts.removeRegion(discountId, regionId) * .then(({ discount }) => { * console.log(discount.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/discounts/update-condition.ts b/packages/medusa/src/api/routes/admin/discounts/update-condition.ts index 1a1db93b81..1f65dbd540 100644 --- a/packages/medusa/src/api/routes/admin/discounts/update-condition.ts +++ b/packages/medusa/src/api/routes/admin/discounts/update-condition.ts @@ -9,13 +9,14 @@ import { FindParams } from "../../../../types/common" * @oas [post] /admin/discounts/{discount_id}/conditions/{condition_id} * operationId: "PostDiscountsDiscountConditionsCondition" * summary: "Update a Condition" - * description: "Updates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided." + * description: "Update a Discount Condition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided, based on the type of discount condition. + * For example, if the discount condition's type is `products`, the `products` field should be provided in the request body." * x-authenticated: true * parameters: - * - (path) discount_id=* {string} The ID of the Product. - * - (path) condition_id=* {string} The ID of the DiscountCondition. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each item of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each item of the result. + * - (path) discount_id=* {string} The ID of the Discount. + * - (path) condition_id=* {string} The ID of the Discount Condition. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned discount. + * - (query) fields {string} Comma-separated fields that should be included in the returned discount. * requestBody: * content: * application/json: @@ -31,9 +32,9 @@ import { FindParams } from "../../../../types/common" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.updateCondition(discount_id, condition_id, { + * medusa.admin.discounts.updateCondition(discountId, conditionId, { * products: [ - * product_id + * productId * ] * }) * .then(({ discount }) => { @@ -42,9 +43,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "products": [ * "prod_01G1G5V2MBA328390B5AXJ610F" @@ -113,27 +114,27 @@ export default async (req: Request, res: Response) => { * properties: * products: * type: array - * description: list of product IDs if the condition is applied on products. + * description: list of product IDs if the condition's type is `products`. * items: * type: string * product_types: * type: array - * description: list of product type IDs if the condition is applied on product types. + * description: list of product type IDs if the condition's type is `product_types`. * items: * type: string * product_collections: * type: array - * description: list of product collection IDs if the condition is applied on product collections. + * description: list of product collection IDs if the condition's type is `product_collections`. * items: * type: string * product_tags: * type: array - * description: list of product tag IDs if the condition is applied on product tags. + * description: list of product tag IDs if the condition's type is `product_tags` * items: * type: string * customer_groups: * type: array - * description: list of customer group IDs if the condition is applied on customer groups. + * description: list of customer group IDs if the condition's type is `customer_groups`. * items: * type: string */ diff --git a/packages/medusa/src/api/routes/admin/discounts/update-discount.ts b/packages/medusa/src/api/routes/admin/discounts/update-discount.ts index d78c64c821..a7ace2ee1e 100644 --- a/packages/medusa/src/api/routes/admin/discounts/update-discount.ts +++ b/packages/medusa/src/api/routes/admin/discounts/update-discount.ts @@ -26,12 +26,12 @@ import { FindParams } from "../../../../types/common" * @oas [post] /admin/discounts/{id} * operationId: "PostDiscountsDiscount" * summary: "Update a Discount" - * description: "Updates a Discount with a given set of rules that define how the Discount behaves." + * description: "Update a Discount with a given set of rules that define how the Discount is applied." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Discount. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each item of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each item of the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned discount. + * - (query) fields {string} Comma-separated fields that should be retrieved in the returned discount. * requestBody: * content: * application/json: @@ -47,8 +47,8 @@ import { FindParams } from "../../../../types/common" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.discounts.update(discount_id, { - * code: 'TEST' + * medusa.admin.discounts.update(discountId, { + * code: "TEST" * }) * .then(({ discount }) => { * console.log(discount.id); @@ -56,9 +56,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/discounts/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "code": "TEST" * }' @@ -113,9 +113,9 @@ export default async (req: Request, res: Response) => { * properties: * code: * type: string - * description: A unique code that will be used to redeem the Discount + * description: A unique code that will be used to redeem the discount * rule: - * description: The Discount Rule that defines how Discounts are calculated + * description: The discount rule that defines how discounts are calculated * type: object * required: * - id @@ -128,14 +128,14 @@ export default async (req: Request, res: Response) => { * description: "A short description of the discount" * value: * type: number - * description: "The value that the discount represents; this will depend on the type of the discount" + * description: "The value that the discount represents. This will depend on the type of the discount." * allocation: * type: string - * description: "The scope that the discount should apply to." + * description: "The scope that the discount should apply to. `total` indicates that the discount should be applied on the cart total, and `item` indicates that the discount should be applied to each discountable item in the cart." * enum: [total, item] * conditions: * type: array - * description: "A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided." + * description: "A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided based on the discount condition's type." * items: * type: object * required: @@ -143,56 +143,57 @@ export default async (req: Request, res: Response) => { * properties: * id: * type: string - * description: "The ID of the Rule" + * description: "The ID of the condition" * operator: * type: string - * description: Operator of the condition + * description: "Operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that + * discountable resources are everything but the specified resources." * enum: [in, not_in] * products: * type: array - * description: list of product IDs if the condition is applied on products. + * description: list of product IDs if the condition's type is `products`. * items: * type: string * product_types: * type: array - * description: list of product type IDs if the condition is applied on product types. + * description: list of product type IDs if the condition's type is `product_types`. * items: * type: string * product_collections: * type: array - * description: list of product collection IDs if the condition is applied on product collections. + * description: list of product collection IDs if the condition's type is `product_collections`. * items: * type: string * product_tags: * type: array - * description: list of product tag IDs if the condition is applied on product tags. + * description: list of product tag IDs if the condition's type is `product_tags`. * items: * type: string * customer_groups: * type: array - * description: list of customer group IDs if the condition is applied on customer groups. + * description: list of customer group IDs if the condition's type is `customer_groups`. * items: * type: string * is_disabled: * type: boolean - * description: Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers. + * description: Whether the discount code is disabled on creation. If set to `true`, it will not be available for customers. * starts_at: * type: string * format: date-time - * description: The time at which the Discount should be available. + * description: The date and time at which the discount should be available. * ends_at: * type: string * format: date-time - * description: The time at which the Discount should no longer be available. + * description: The date and time at which the discount should no longer be available. * valid_duration: * type: string - * description: Duration the discount runs between + * description: The duration the discount runs between * example: P3Y6M4DT12H30M5S * usage_limit: * type: number - * description: Maximum times the discount can be used + * description: Maximum number of times the discount can be used * regions: - * description: A list of Region ids representing the Regions in which the Discount can be used. + * description: A list of region IDs representing the Regions in which the Discount can be used. * type: array * items: * type: string diff --git a/packages/medusa/src/api/routes/admin/draft-orders/create-draft-order.ts b/packages/medusa/src/api/routes/admin/draft-orders/create-draft-order.ts index 05415259c0..f49d34bcfc 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/create-draft-order.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/create-draft-order.ts @@ -31,7 +31,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/draft-orders * operationId: "PostDraftOrders" * summary: "Create a Draft Order" - * description: "Creates a Draft Order" + * description: "Create a Draft Order. A draft order is not transformed into an order until payment is captured." * x-authenticated: true * requestBody: * content: @@ -48,7 +48,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.draftOrders.create({ - * email: 'user@example.com', + * email: "user@example.com", * region_id, * items: [ * { @@ -67,9 +67,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/draft-orders' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/draft-orders' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com", * "region_id": "{region_id}" @@ -172,7 +172,7 @@ enum Status { * - shipping_methods * properties: * status: - * description: "The status of the draft order" + * description: "The status of the draft order. The draft order's default status is `open`. It's changed to `completed` when its payment is marked as paid." * type: string * enum: [open, completed] * email: @@ -185,12 +185,12 @@ enum Status { * - $ref: "#/components/schemas/AddressPayload" * - type: string * shipping_address: - * description: "The Address to be used for shipping." + * description: "The Address to be used for shipping purposes." * anyOf: * - $ref: "#/components/schemas/AddressPayload" * - type: string * items: - * description: The Line Items that have been received. + * description: The draft order's line items. * type: array * items: * type: object @@ -198,25 +198,25 @@ enum Status { * - quantity * properties: * variant_id: - * description: The ID of the Product Variant to generate the Line Item from. + * description: The ID of the Product Variant associated with the line item. If the line item is custom, the `variant_id` should be omitted. * type: string * unit_price: - * description: The potential custom price of the item. + * description: The custom price of the line item. If a `variant_id` is supplied, the price provided here will override the variant's price. * type: integer * title: - * description: The potential custom title of the item. + * description: The title of the line item if `variant_id` is not provided. * type: string * quantity: - * description: The quantity of the Line Item. + * description: The quantity of the line item. * type: integer * metadata: - * description: The optional key-value map with additional details about the Line Item. + * description: The optional key-value map with additional details about the line item. * type: object * region_id: * description: The ID of the region for the draft order * type: string * discounts: - * description: The discounts to add on the draft order + * description: The discounts to add to the draft order * type: array * items: * type: object @@ -227,10 +227,10 @@ enum Status { * description: The code of the discount to apply * type: string * customer_id: - * description: The ID of the customer to add on the draft order + * description: The ID of the customer this draft order is associated with. * type: string * no_notification_order: - * description: An optional flag passed to the resulting order to determine use of notifications. + * description: An optional flag passed to the resulting order that indicates whether the customer should receive notifications about order updates. * type: boolean * shipping_methods: * description: The shipping methods for the draft order @@ -247,7 +247,7 @@ enum Status { * description: The optional additional data needed for the shipping method * type: object * price: - * description: The potential custom price of the shipping + * description: The price of the shipping method. * type: integer * metadata: * description: The optional key-value map with additional details about the Draft Order. diff --git a/packages/medusa/src/api/routes/admin/draft-orders/create-line-item.ts b/packages/medusa/src/api/routes/admin/draft-orders/create-line-item.ts index e625890779..cf8a78ba17 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/create-line-item.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/create-line-item.ts @@ -19,7 +19,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/draft-orders/{id}/line-items * operationId: "PostDraftOrdersDraftOrderLineItems" * summary: "Create a Line Item" - * description: "Creates a Line Item for the Draft Order" + * description: "Create a Line Item in the Draft Order." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Draft Order. @@ -37,7 +37,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.draftOrders.addLineItem(draft_order_id, { + * medusa.admin.draftOrders.addLineItem(draftOrderId, { * quantity: 1 * }) * .then(({ draft_order }) => { @@ -46,9 +46,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "quantity": 1 * }' @@ -152,17 +152,17 @@ export default async (req, res) => { * - quantity * properties: * variant_id: - * description: The ID of the Product Variant to generate the Line Item from. + * description: The ID of the Product Variant associated with the line item. If the line item is custom, the `variant_id` should be omitted. * type: string * unit_price: - * description: The potential custom price of the item. + * description: The custom price of the line item. If a `variant_id` is supplied, the price provided here will override the variant's price. * type: integer * title: - * description: The potential custom title of the item. + * description: The title of the line item if `variant_id` is not provided. * type: string * default: "Custom item" * quantity: - * description: The quantity of the Line Item. + * description: The quantity of the line item. * type: integer * metadata: * description: The optional key-value map with additional details about the Line Item. diff --git a/packages/medusa/src/api/routes/admin/draft-orders/delete-draft-order.ts b/packages/medusa/src/api/routes/admin/draft-orders/delete-draft-order.ts index f5d43977b5..8517be2c57 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/delete-draft-order.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/delete-draft-order.ts @@ -5,7 +5,7 @@ import { EntityManager } from "typeorm" * @oas [delete] /admin/draft-orders/{id} * operationId: DeleteDraftOrdersDraftOrder * summary: Delete a Draft Order - * description: "Deletes a Draft Order" + * description: "Delete a Draft Order" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Draft Order. @@ -18,15 +18,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.draftOrders.delete(draft_order_id) + * medusa.admin.draftOrders.delete(draftOrderId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/draft-orders/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/draft-orders/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/draft-orders/delete-line-item.ts b/packages/medusa/src/api/routes/admin/draft-orders/delete-line-item.ts index 624c414489..15471350fd 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/delete-line-item.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/delete-line-item.ts @@ -14,11 +14,11 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [delete] /admin/draft-orders/{id}/line-items/{line_id} * operationId: DeleteDraftOrdersDraftOrderLineItemsItem * summary: Delete a Line Item - * description: "Removes a Line Item from a Draft Order." + * description: "Deletes a Line Item from a Draft Order." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Draft Order. - * - (path) line_id=* {string} The ID of the Draft Order. + * - (path) line_id=* {string} The ID of the line item. * x-codegen: * method: removeLineItem * x-codeSamples: @@ -28,15 +28,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.draftOrders.removeLineItem(draft_order_id, item_id) + * medusa.admin.draftOrders.removeLineItem(draftOrderId, itemId) * .then(({ draft_order }) => { * console.log(draft_order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/draft-orders/get-draft-order.ts b/packages/medusa/src/api/routes/admin/draft-orders/get-draft-order.ts index da466dae02..09f4c32680 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/get-draft-order.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/get-draft-order.ts @@ -13,7 +13,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [get] /admin/draft-orders/{id} * operationId: "GetDraftOrdersDraftOrder" * summary: "Get a Draft Order" - * description: "Retrieves a Draft Order." + * description: "Retrieve a Draft Order's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Draft Order. @@ -26,15 +26,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.draftOrders.retrieve(draft_order_id) + * medusa.admin.draftOrders.retrieve(draftOrderId) * .then(({ draft_order }) => { * console.log(draft_order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/draft-orders/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/draft-orders/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/draft-orders/index.ts b/packages/medusa/src/api/routes/admin/draft-orders/index.ts index 171dbf47d5..8b8fba4158 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/index.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/index.ts @@ -98,6 +98,7 @@ export const defaultAdminDraftOrdersFields: (keyof DraftOrder)[] = [ * - order * properties: * order: + * description: Order's details. * $ref: "#/components/schemas/Order" */ export type AdminPostDraftOrdersDraftOrderRegisterPaymentRes = { @@ -169,6 +170,7 @@ export type AdminPostDraftOrdersDraftOrderRegisterPaymentRes = { * - draft_order * properties: * draft_order: + * description: Draft order's details. * $ref: "#/components/schemas/DraftOrder" */ export type AdminDraftOrdersRes = { @@ -192,7 +194,7 @@ export type AdminDraftOrdersRes = { * default: draft-order * deleted: * type: boolean - * description: Whether the draft order was deleted successfully or not. + * description: Whether the draft order was deleted successfully. * default: true */ export type AdminDraftOrdersDeleteRes = DeleteResponse @@ -215,6 +217,7 @@ export type AdminDraftOrdersDeleteRes = DeleteResponse * properties: * draft_orders: * type: array + * description: An array of draft order's details. * items: * $ref: "#/components/schemas/DraftOrder" * count: @@ -222,7 +225,7 @@ export type AdminDraftOrdersDeleteRes = DeleteResponse * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of draft orders skipped when retrieving the draft orders. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/draft-orders/list-draft-orders.ts b/packages/medusa/src/api/routes/admin/draft-orders/list-draft-orders.ts index 6c22674d99..41fa0bfc73 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/list-draft-orders.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/list-draft-orders.ts @@ -15,12 +15,12 @@ import { validator } from "../../../../utils/validator" * @oas [get] /admin/draft-orders * operationId: "GetDraftOrders" * summary: "List Draft Orders" - * description: "Retrieves an list of Draft Orders" + * description: "Retrieve an list of Draft Orders. The draft orders can be filtered by fields such as `q`. The draft orders can also paginated." * x-authenticated: true * parameters: - * - (query) offset=0 {number} The number of items to skip before the results. - * - (query) limit=50 {number} Limit the number of items returned. - * - (query) q {string} a search term to search emails in carts associated with draft orders and display IDs of draft orders + * - (query) offset=0 {number} The number of draft orders to skip when retrieving the draft orders. + * - (query) limit=50 {number} Limit the number of draft orders returned. + * - (query) q {string} a term to search draft orders' display IDs and emails in the draft order's cart * x-codegen: * method: list * queryParams: AdminGetDraftOrdersParams @@ -38,8 +38,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/draft-orders' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/draft-orders' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/draft-orders/register-payment.ts b/packages/medusa/src/api/routes/admin/draft-orders/register-payment.ts index 7d69dab67f..0bc28eab3f 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/register-payment.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/register-payment.ts @@ -17,12 +17,13 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [post] /admin/draft-orders/{id}/pay - * summary: "Registers a Payment" + * summary: "Mark Paid" * operationId: "PostDraftOrdersDraftOrderRegisterPayment" - * description: "Registers a payment for a Draft Order." + * description: "Capture the draft order's payment. This will also set the draft order's status to `completed` and create an Order from the draft order. The payment is captured through Medusa's system payment, + * which is manual payment that isn't integrated with any third-party payment provider. It is assumed that the payment capturing is handled manually by the admin." * x-authenticated: true * parameters: - * - (path) id=* {String} The Draft Order id. + * - (path) id=* {String} The Draft Order ID. * x-codegen: * method: markPaid * x-codeSamples: @@ -32,15 +33,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.draftOrders.markPaid(draft_order_id) + * medusa.admin.draftOrders.markPaid(draftOrderId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/draft-orders/update-draft-order.ts b/packages/medusa/src/api/routes/admin/draft-orders/update-draft-order.ts index 2102c96c60..f3addacf16 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/update-draft-order.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/update-draft-order.ts @@ -25,7 +25,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/draft-orders/{id} * operationId: PostDraftOrdersDraftOrder * summary: Update a Draft Order - * description: "Updates a Draft Order." + * description: "Update a Draft Order's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Draft Order. @@ -43,7 +43,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.draftOrders.update(draft_order_id, { + * medusa.admin.draftOrders.update(draftOrderId, { * email: "user@example.com" * }) * .then(({ draft_order }) => { @@ -52,9 +52,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/draft-orders/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com" * }' @@ -156,7 +156,7 @@ export default async (req, res) => { * description: See a list of codes. * email: * type: string - * description: "An email to be used on the Draft Order." + * description: "An email to be used in the Draft Order." * format: email * billing_address: * description: "The Address to be used for billing purposes." @@ -164,7 +164,7 @@ export default async (req, res) => { * - $ref: "#/components/schemas/AddressPayload" * - type: string * shipping_address: - * description: "The Address to be used for shipping." + * description: "The Address to be used for shipping purposes." * anyOf: * - $ref: "#/components/schemas/AddressPayload" * - type: string @@ -180,10 +180,10 @@ export default async (req, res) => { * description: "The code that a Discount is identifed by." * type: string * no_notification_order: - * description: "An optional flag passed to the resulting order to determine use of notifications." + * description: "An optional flag passed to the resulting order that indicates whether the customer should receive notifications about order updates." * type: boolean * customer_id: - * description: "The ID of the Customer to associate the Draft Order with." + * description: "The ID of the customer this draft order is associated with." * type: string */ export class AdminPostDraftOrdersDraftOrderReq { diff --git a/packages/medusa/src/api/routes/admin/draft-orders/update-line-item.ts b/packages/medusa/src/api/routes/admin/draft-orders/update-line-item.ts index 5fdce359f9..cc9bf222f8 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/update-line-item.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/update-line-item.ts @@ -17,7 +17,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/draft-orders/{id}/line-items/{line_id} * operationId: "PostDraftOrdersDraftOrderLineItemsItem" * summary: "Update a Line Item" - * description: "Updates a Line Item for a Draft Order" + * description: "Update a Line Item in a Draft Order" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Draft Order. @@ -36,7 +36,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, { + * medusa.admin.draftOrders.updateLineItem(draftOrderId, lineId, { * quantity: 1 * }) * .then(({ draft_order }) => { @@ -45,9 +45,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "quantity": 1 * }' @@ -151,13 +151,13 @@ export default async (req, res) => { * type: object * properties: * unit_price: - * description: The potential custom price of the item. + * description: The custom price of the line item. If a `variant_id` is supplied, the price provided here will override the variant's price. * type: integer * title: - * description: The potential custom title of the item. + * description: The title of the line item if `variant_id` is not provided. * type: string * quantity: - * description: The quantity of the Line Item. + * description: The quantity of the line item. * type: integer * metadata: * description: The optional key-value map with additional details about the Line Item. diff --git a/packages/medusa/src/api/routes/admin/gift-cards/create-gift-card.ts b/packages/medusa/src/api/routes/admin/gift-cards/create-gift-card.ts index 22dda06114..1649948a2c 100644 --- a/packages/medusa/src/api/routes/admin/gift-cards/create-gift-card.ts +++ b/packages/medusa/src/api/routes/admin/gift-cards/create-gift-card.ts @@ -9,7 +9,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/gift-cards * operationId: "PostGiftCards" * summary: "Create a Gift Card" - * description: "Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region." + * description: "Create a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region." * x-authenticated: true * requestBody: * content: @@ -34,9 +34,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/gift-cards' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/gift-cards' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "region_id": "{region_id}" * }' @@ -97,11 +97,11 @@ export default async (req, res) => { * description: The value (excluding VAT) that the Gift Card should represent. * is_disabled: * type: boolean - * description: Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers. + * description: Whether the Gift Card is disabled on creation. If set to `true`, the gift card will not be available for customers. * ends_at: * type: string * format: date-time - * description: The time at which the Gift Card should no longer be available. + * description: The date and time at which the Gift Card should no longer be available. * region_id: * description: The ID of the Region in which the Gift Card can be used. * type: string diff --git a/packages/medusa/src/api/routes/admin/gift-cards/delete-gift-card.ts b/packages/medusa/src/api/routes/admin/gift-cards/delete-gift-card.ts index c2a65075b0..493f89a4af 100644 --- a/packages/medusa/src/api/routes/admin/gift-cards/delete-gift-card.ts +++ b/packages/medusa/src/api/routes/admin/gift-cards/delete-gift-card.ts @@ -4,7 +4,7 @@ import { EntityManager } from "typeorm" * @oas [delete] /admin/gift-cards/{id} * operationId: "DeleteGiftCardsGiftCard" * summary: "Delete a Gift Card" - * description: "Deletes a Gift Card" + * description: "Delete a Gift Card. Once deleted, it can't be used by customers." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Gift Card to delete. @@ -17,15 +17,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.giftCards.delete(gift_card_id) + * medusa.admin.giftCards.delete(giftCardId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/gift-cards/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/gift-cards/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/gift-cards/get-gift-card.ts b/packages/medusa/src/api/routes/admin/gift-cards/get-gift-card.ts index 79870e9f41..3fbd151e43 100644 --- a/packages/medusa/src/api/routes/admin/gift-cards/get-gift-card.ts +++ b/packages/medusa/src/api/routes/admin/gift-cards/get-gift-card.ts @@ -4,7 +4,7 @@ import { defaultAdminGiftCardFields, defaultAdminGiftCardRelations } from "./" * @oas [get] /admin/gift-cards/{id} * operationId: "GetGiftCardsGiftCard" * summary: "Get a Gift Card" - * description: "Retrieves a Gift Card." + * description: "Retrieve a Gift Card's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Gift Card. @@ -17,15 +17,15 @@ import { defaultAdminGiftCardFields, defaultAdminGiftCardRelations } from "./" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.giftCards.retrieve(gift_card_id) + * medusa.admin.giftCards.retrieve(giftCardId) * .then(({ gift_card }) => { * console.log(gift_card.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/gift-cards/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/gift-cards/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/gift-cards/index.ts b/packages/medusa/src/api/routes/admin/gift-cards/index.ts index 319433bb93..ad8b203128 100644 --- a/packages/medusa/src/api/routes/admin/gift-cards/index.ts +++ b/packages/medusa/src/api/routes/admin/gift-cards/index.ts @@ -71,6 +71,7 @@ export const defaultAdminGiftCardRelations = ["region", "order"] * - gift_card * properties: * gift_card: + * description: "A gift card's details." * $ref: "#/components/schemas/GiftCard" */ export type AdminGiftCardsRes = { @@ -94,7 +95,7 @@ export type AdminGiftCardsRes = { * default: gift-card * deleted: * type: boolean - * description: Whether the gift card was deleted successfully or not. + * description: Whether the gift card was deleted successfully. * default: true */ export type AdminGiftCardsDeleteRes = DeleteResponse @@ -125,7 +126,7 @@ export type AdminGiftCardsDeleteRes = DeleteResponse * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of gift cards skipped when retrieving the gift cards. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/gift-cards/list-gift-cards.ts b/packages/medusa/src/api/routes/admin/gift-cards/list-gift-cards.ts index 344b2f03b1..752c901dcd 100644 --- a/packages/medusa/src/api/routes/admin/gift-cards/list-gift-cards.ts +++ b/packages/medusa/src/api/routes/admin/gift-cards/list-gift-cards.ts @@ -10,12 +10,12 @@ import { isDefined } from "medusa-core-utils" * @oas [get] /admin/gift-cards * operationId: "GetGiftCards" * summary: "List Gift Cards" - * description: "Retrieves a list of Gift Cards." + * description: "Retrieve a list of Gift Cards. The gift cards can be filtered by fields such as `q`. The gift cards can also paginated." * x-authenticated: true * parameters: - * - (query) offset=0 {number} The number of items to skip before the results. - * - (query) limit=50 {number} Limit the number of items returned. - * - (query) q {string} a search term to search by code or display ID + * - (query) offset=0 {number} The number of gift cards to skip when retrieving the gift cards. + * - (query) limit=50 {number} Limit the number of gift cards returned. + * - (query) q {string} a term to search gift cards' code or display ID * x-codegen: * method: list * queryParams: AdminGetGiftCardsParams @@ -33,8 +33,8 @@ import { isDefined } from "medusa-core-utils" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/gift-cards' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/gift-cards' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/gift-cards/update-gift-card.ts b/packages/medusa/src/api/routes/admin/gift-cards/update-gift-card.ts index 6744bbbba3..e937323ebb 100644 --- a/packages/medusa/src/api/routes/admin/gift-cards/update-gift-card.ts +++ b/packages/medusa/src/api/routes/admin/gift-cards/update-gift-card.ts @@ -10,7 +10,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/gift-cards/{id} * operationId: "PostGiftCardsGiftCard" * summary: "Update a Gift Card" - * description: "Update a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region." + * description: "Update a Gift Card's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Gift Card. @@ -28,7 +28,7 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.giftCards.update(gift_card_id, { + * medusa.admin.giftCards.update(giftCardId, { * region_id * }) * .then(({ gift_card }) => { @@ -37,9 +37,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/gift-cards/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/gift-cards/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "region_id": "{region_id}" * }' @@ -99,11 +99,11 @@ export default async (req, res) => { * description: The value (excluding VAT) that the Gift Card should represent. * is_disabled: * type: boolean - * description: Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers. + * description: Whether the Gift Card is disabled on creation. If set to `true`, the gift card will not be available for customers. * ends_at: * type: string * format: date-time - * description: The time at which the Gift Card should no longer be available. + * description: The date and time at which the Gift Card should no longer be available. * region_id: * description: The ID of the Region in which the Gift Card can be used. * type: string diff --git a/packages/medusa/src/api/routes/admin/inventory-items/create-inventory-item.ts b/packages/medusa/src/api/routes/admin/inventory-items/create-inventory-item.ts index 9ff125ccf0..5d8f8ea129 100644 --- a/packages/medusa/src/api/routes/admin/inventory-items/create-inventory-item.ts +++ b/packages/medusa/src/api/routes/admin/inventory-items/create-inventory-item.ts @@ -15,11 +15,11 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/inventory-items * operationId: "PostInventoryItems" * summary: "Create an Inventory Item" - * description: "Creates an Inventory Item." + * description: "Create an Inventory Item." * x-authenticated: true * parameters: - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned inventory item. + * - (query) fields {string} Comma-separated fields that should be included in the returned inventory item. * requestBody: * content: * application/json: @@ -36,7 +36,7 @@ import { validator } from "../../../../utils/validator" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.inventoryItems.create({ - * variant_id: 'variant_123', + * variant_id: "variant_123", * }) * .then(({ inventory_item }) => { * console.log(inventory_item.id); @@ -44,9 +44,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/inventory-items' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/inventory-items' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "variant_id": "variant_123", * }' @@ -132,7 +132,7 @@ export default async (req, res) => { * type: object * properties: * sku: - * description: The unique SKU for the Product Variant. + * description: The unique SKU of the associated Product Variant. * type: string * ean: * description: The EAN number of the item. @@ -144,39 +144,39 @@ export default async (req, res) => { * description: A generic GTIN field for the Product Variant. * type: string * hs_code: - * description: The Harmonized System code for the Product Variant. + * description: The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. * type: string * inventory_quantity: - * description: The amount of stock kept for the Product Variant. + * description: The amount of stock kept of the associated Product Variant. * type: integer * default: 0 * allow_backorder: - * description: Whether the Product Variant can be purchased when out of stock. + * description: Whether the associated Product Variant can be purchased when out of stock. * type: boolean * manage_inventory: - * description: Whether Medusa should keep track of the inventory for this Product Variant. + * description: Whether Medusa should keep track of the inventory for the associated Product Variant. * type: boolean * default: true * weight: - * description: The wieght of the Product Variant. + * description: The weight of the Inventory Item. May be used in shipping rate calculations. * type: number * length: - * description: The length of the Product Variant. + * description: The length of the Inventory Item. May be used in shipping rate calculations. * type: number * height: - * description: The height of the Product Variant. + * description: The height of the Inventory Item. May be used in shipping rate calculations. * type: number * width: - * description: The width of the Product Variant. + * description: The width of the Inventory Item. May be used in shipping rate calculations. * type: number * origin_country: - * description: The country of origin of the Product Variant. + * description: The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. * type: string * mid_code: - * description: The Manufacturer Identification code for the Product Variant. + * description: The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. * type: string * material: - * description: The material composition of the Product Variant. + * description: The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. * type: string * metadata: * description: An optional set of key-value pairs with additional information. diff --git a/packages/medusa/src/api/routes/admin/inventory-items/create-location-level.ts b/packages/medusa/src/api/routes/admin/inventory-items/create-location-level.ts index 2748da4344..09a9bb3f4b 100644 --- a/packages/medusa/src/api/routes/admin/inventory-items/create-location-level.ts +++ b/packages/medusa/src/api/routes/admin/inventory-items/create-location-level.ts @@ -7,12 +7,12 @@ import { FindParams } from "../../../../types/common" * @oas [post] /admin/inventory-items/{id}/location-levels * operationId: "PostInventoryItemsInventoryItemLocationLevels" * summary: "Create an Inventory Level" - * description: "Creates an Inventory Level for a given Inventory Item." + * description: "Create an Inventory Level for a given Inventory Item." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Inventory Item. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned inventory item. + * - (query) fields {string} Comma-separated fields that should be included in the returned inventory item. * requestBody: * content: * application/json: @@ -29,7 +29,7 @@ import { FindParams } from "../../../../types/common" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.inventoryItems.createLocationLevel(inventoryItemId, { - * location_id: 'sloc_123', + * location_id: "sloc_123", * stocked_quantity: 10, * }) * .then(({ inventory_item }) => { @@ -38,9 +38,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "location_id": "sloc_123", * "stocked_quantity": 10 @@ -111,13 +111,13 @@ export default async (req: Request, res: Response) => { * - stocked_quantity * properties: * location_id: - * description: the item location ID + * description: the ID of the stock location * type: string * stocked_quantity: - * description: the stock quantity of an inventory item at the given location ID + * description: the stock quantity of the inventory item at this location * type: number * incoming_quantity: - * description: the incoming stock quantity of an inventory item at the given location ID + * description: the incoming stock quantity of the inventory item at this location * type: number */ export class AdminPostInventoryItemsItemLocationLevelsReq { diff --git a/packages/medusa/src/api/routes/admin/inventory-items/delete-inventory-item.ts b/packages/medusa/src/api/routes/admin/inventory-items/delete-inventory-item.ts index b181616952..063edef5b5 100644 --- a/packages/medusa/src/api/routes/admin/inventory-items/delete-inventory-item.ts +++ b/packages/medusa/src/api/routes/admin/inventory-items/delete-inventory-item.ts @@ -7,7 +7,7 @@ import { ProductVariantInventoryService } from "../../../../services" * @oas [delete] /admin/inventory-items/{id} * operationId: "DeleteInventoryItemsInventoryItem" * summary: "Delete an Inventory Item" - * description: "Delete an Inventory Item" + * description: "Delete an Inventory Item. This does not delete the associated product variant." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Inventory Item to delete. @@ -27,8 +27,8 @@ import { ProductVariantInventoryService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/inventory-items/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/inventory-items/delete-location-level.ts b/packages/medusa/src/api/routes/admin/inventory-items/delete-location-level.ts index 59951aa23c..294cc30c4c 100644 --- a/packages/medusa/src/api/routes/admin/inventory-items/delete-location-level.ts +++ b/packages/medusa/src/api/routes/admin/inventory-items/delete-location-level.ts @@ -28,8 +28,8 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/inventory-items/get-inventory-item.ts b/packages/medusa/src/api/routes/admin/inventory-items/get-inventory-item.ts index 8371677560..bf9ea1e0f8 100644 --- a/packages/medusa/src/api/routes/admin/inventory-items/get-inventory-item.ts +++ b/packages/medusa/src/api/routes/admin/inventory-items/get-inventory-item.ts @@ -7,12 +7,12 @@ import { joinLevels } from "./utils/join-levels" * @oas [get] /admin/inventory-items/{id} * operationId: "GetInventoryItemsInventoryItem" * summary: "Get an Inventory Item" - * description: "Retrieves an Inventory Item." + * description: "Retrieve an Inventory Item's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Inventory Item. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned inventory item. + * - (query) fields {string} Comma-separated fields that should be included in the returned inventory item. * x-codegen: * method: retrieve * queryParams: AdminGetInventoryItemsItemParams @@ -30,8 +30,8 @@ import { joinLevels } from "./utils/join-levels" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/inventory-items/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/inventory-items/index.ts b/packages/medusa/src/api/routes/admin/inventory-items/index.ts index 66f97e308b..af07827739 100644 --- a/packages/medusa/src/api/routes/admin/inventory-items/index.ts +++ b/packages/medusa/src/api/routes/admin/inventory-items/index.ts @@ -170,6 +170,7 @@ export const defaultAdminInventoryItemRelations = [] * - inventory_item * properties: * inventory_item: + * description: Inventory Item details * $ref: "#/components/schemas/InventoryItemDTO" */ export type AdminInventoryItemsRes = { @@ -209,6 +210,7 @@ export type AdminInventoryItemsDeleteRes = DeleteResponse * properties: * inventory_items: * type: array + * description: an array of Inventory Item details * items: * $ref: "#/components/schemas/InventoryItemDTO" * count: @@ -216,7 +218,7 @@ export type AdminInventoryItemsDeleteRes = DeleteResponse * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of inventory items skipped when retrieving the inventory items. * limit: * type: integer * description: The number of items per page @@ -237,10 +239,12 @@ export type AdminInventoryItemsListRes = PaginatedResponse & { * properties: * location_levels: * type: array + * description: An array of location level details * items: * $ref: "#/components/schemas/InventoryLevelDTO" * variants: * type: array + * description: An array of product variant details * items: * $ref: "#/components/schemas/ProductVariant" * stocked_quantity: @@ -268,6 +272,7 @@ export type DecoratedInventoryItemDTO = InventoryItemDTO & { * properties: * inventory_items: * type: array + * description: an array of Inventory Item details * items: * $ref: "#/components/schemas/DecoratedInventoryItemDTO" * count: @@ -275,7 +280,7 @@ export type DecoratedInventoryItemDTO = InventoryItemDTO & { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of inventory items skipped when retrieving the inventory items. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/inventory-items/list-inventory-items.ts b/packages/medusa/src/api/routes/admin/inventory-items/list-inventory-items.ts index 4efc68cb4c..8698c099c0 100644 --- a/packages/medusa/src/api/routes/admin/inventory-items/list-inventory-items.ts +++ b/packages/medusa/src/api/routes/admin/inventory-items/list-inventory-items.ts @@ -23,34 +23,46 @@ import { Transform } from "class-transformer" * @oas [get] /admin/inventory-items * operationId: "GetInventoryItems" * summary: "List Inventory Items" - * description: "Lists inventory items with the ability to apply filters or search queries on them." + * description: "Retrieve a list of inventory items. The inventory items can be filtered by fields such as `q` or `location_id`. The inventory items can also be paginated." * x-authenticated: true * parameters: - * - (query) offset=0 {integer} How many inventory items to skip in the result. + * - (query) offset=0 {integer} The number of inventory items to skip when retrieving the inventory items. * - (query) limit=20 {integer} Limit the number of inventory items returned. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. - * - (query) q {string} Query used for searching product inventory items and their properties. + * - (query) expand {string} Comma-separated relations that should be expanded in each returned inventory item. + * - (query) fields {string} Comma-separated fields that should be included in the returned inventory item. + * - (query) q {string} term to search inventory item's sku, title, and description. * - in: query * name: location_id * style: form * explode: false - * description: Locations ids to search for. + * description: Filter by location IDs. * schema: * type: array * items: * type: string - * - (query) id {string} id to search for. - * - (query) sku {string} sku to search for. - * - (query) origin_country {string} origin_country to search for. - * - (query) mid_code {string} mid_code to search for. - * - (query) material {string} material to search for. - * - (query) hs_code {string} hs_code to search for. - * - (query) weight {string} weight to search for. - * - (query) length {string} length to search for. - * - (query) height {string} height to search for. - * - (query) width {string} width to search for. - * - (query) requires_shipping {string} requires_shipping to search for. + * - in: query + * name: id + * style: form + * explode: false + * description: Filter by the inventory ID + * schema: + * oneOf: + * - type: string + * description: inventory ID + * - type: array + * description: an array of inventory IDs + * items: + * type: string + * - (query) sku {string} Filter by SKU + * - (query) origin_country {string} Filter by origin country + * - (query) mid_code {string} Filter by MID code + * - (query) material {string} Filter by material + * - (query) hs_code {string} Filter by HS Code + * - (query) weight {string} Filter by weight + * - (query) length {string} Filter by length + * - (query) height {string} Filter by height + * - (query) width {string} Filter by width + * - (query) requires_shipping {string} Filter by whether the item requires shipping * x-codegen: * method: list * queryParams: AdminGetInventoryItemsParams @@ -68,8 +80,8 @@ import { Transform } from "class-transformer" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/inventory-items' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/inventory-items' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/inventory-items/list-location-levels.ts b/packages/medusa/src/api/routes/admin/inventory-items/list-location-levels.ts index 2478b7d524..638909cc0b 100644 --- a/packages/medusa/src/api/routes/admin/inventory-items/list-location-levels.ts +++ b/packages/medusa/src/api/routes/admin/inventory-items/list-location-levels.ts @@ -8,22 +8,22 @@ import { IsType } from "../../../../utils/validators/is-type" /** * @oas [get] /admin/inventory-items/{id}/location-levels * operationId: "GetInventoryItemsInventoryItemLocationLevels" - * summary: "List Inventory Levels" - * description: "Lists inventory levels of an inventory item." + * summary: "List Inventory Level" + * description: "Retrieve a list of inventory levels of an inventory item. The inventory levels can be filtered by fields such as `location_id`. The inventory levels can also be paginated." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Inventory Item. + * - (path) id=* {string} The ID of the Inventory Item the locations are associated with. * - in: query * name: location_id * style: form * explode: false - * description: Locations ids to search for. + * description: Filter by location IDs. * schema: * type: array * items: * type: string - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned inventory levels. + * - (query) fields {string} Comma-separated fields that should be included in the returned inventory levels. * x-codegen: * method: listLocationLevels * queryParams: AdminGetInventoryItemsItemLocationLevelsParams @@ -41,8 +41,8 @@ import { IsType } from "../../../../utils/validators/is-type" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/inventory-items/update-inventory-item.ts b/packages/medusa/src/api/routes/admin/inventory-items/update-inventory-item.ts index b8b4c365f0..444220cec2 100644 --- a/packages/medusa/src/api/routes/admin/inventory-items/update-inventory-item.ts +++ b/packages/medusa/src/api/routes/admin/inventory-items/update-inventory-item.ts @@ -9,12 +9,12 @@ import { IInventoryService } from "@medusajs/types" * @oas [post] /admin/inventory-items/{id} * operationId: "PostInventoryItemsInventoryItem" * summary: "Update an Inventory Item" - * description: "Updates an Inventory Item." + * description: "Update an Inventory Item's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Inventory Item. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned inventory level. + * - (query) fields {string} Comma-separated fields that should be included in the returned inventory level. * requestBody: * content: * application/json: @@ -39,9 +39,9 @@ import { IInventoryService } from "@medusajs/types" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/inventory-items/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "origin_country": "US" * }' diff --git a/packages/medusa/src/api/routes/admin/inventory-items/update-location-level.ts b/packages/medusa/src/api/routes/admin/inventory-items/update-location-level.ts index b61264b2a5..2a6e7140bc 100644 --- a/packages/medusa/src/api/routes/admin/inventory-items/update-location-level.ts +++ b/packages/medusa/src/api/routes/admin/inventory-items/update-location-level.ts @@ -8,13 +8,13 @@ import { FindParams } from "../../../../types/common" * @oas [post] /admin/inventory-items/{id}/location-levels/{location_id} * operationId: "PostInventoryItemsInventoryItemLocationLevelsLocationLevel" * summary: "Update an Inventory Level" - * description: "Updates an Inventory Level for a given Inventory Item." + * description: "Update an Inventory Level's details for a given Inventory Item." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Inventory Item. - * - (path) location_id=* {string} The ID of the Location. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (path) id=* {string} The ID of the Inventory Item that the location is associated with. + * - (path) location_id=* {string} The ID of the Location to update. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned inventory level. + * - (query) fields {string} Comma-separated fields that should be included in the returned inventory level. * requestBody: * content: * application/json: @@ -39,9 +39,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "stocked_quantity": 15 * }' diff --git a/packages/medusa/src/api/routes/admin/invites/accept-invite.ts b/packages/medusa/src/api/routes/admin/invites/accept-invite.ts index 2129389ed1..b326cc5b4d 100644 --- a/packages/medusa/src/api/routes/admin/invites/accept-invite.ts +++ b/packages/medusa/src/api/routes/admin/invites/accept-invite.ts @@ -9,7 +9,8 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/invites/accept * operationId: "PostInvitesInviteAccept" * summary: "Accept an Invite" - * description: "Accepts an Invite and creates a corresponding user" + * description: "Accept an Invite. This will also delete the invite and create a new user that can log in and perform admin functionalities. The user will have the email associated with the invite, and the password + * provided in the request body." * requestBody: * content: * application/json: @@ -27,9 +28,9 @@ import { EntityManager } from "typeorm" * medusa.admin.invites.accept({ * token, * user: { - * first_name: 'Brigitte', - * last_name: 'Collier', - * password: 'supersecret' + * first_name: "Brigitte", + * last_name: "Collier", + * password: "supersecret" * } * }) * .then(() => { @@ -41,9 +42,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/invites/accept' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/invites/accept' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "token": "{token}", * "user": { @@ -107,10 +108,10 @@ export class AdminPostInvitesInviteAcceptUserReq { * - user * properties: * token: - * description: "The invite token provided by the admin." + * description: "The token of the invite to accept. This is a unique token generated when the invite was created or resent." * type: string * user: - * description: "The User to create." + * description: "The details of the user to create." * type: object * required: * - first_name @@ -124,7 +125,7 @@ export class AdminPostInvitesInviteAcceptUserReq { * type: string * description: the last name of the User * password: - * description: The desired password for the User + * description: The password for the User * type: string * format: password */ diff --git a/packages/medusa/src/api/routes/admin/invites/create-invite.ts b/packages/medusa/src/api/routes/admin/invites/create-invite.ts index 4c117447e2..8e102a113a 100644 --- a/packages/medusa/src/api/routes/admin/invites/create-invite.ts +++ b/packages/medusa/src/api/routes/admin/invites/create-invite.ts @@ -9,7 +9,8 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/invites * operationId: "PostInvites" * summary: "Create an Invite" - * description: "Creates an Invite and triggers an 'invite' created event" + * description: "Create an Invite. This will generate a token associated with the invite and trigger an `invite.created` event. If you have a Notification Provider installed that handles this + * event, a notification should be sent to the email associated with the invite to allow them to accept the invite." * x-authenticated: true * requestBody: * content: @@ -38,9 +39,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/invites' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/invites' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "user": "user@example.com", * "role": "admin" @@ -89,11 +90,11 @@ export default async (req, res) => { * - role * properties: * user: - * description: "The email for the user to be created." + * description: "The email associated with the invite. Once the invite is accepted, the email will be associated with the created user." * type: string * format: email * role: - * description: "The role of the user to be created." + * description: "The role of the user to be created. This does not actually change the privileges of the user that is eventually created." * type: string * enum: [admin, member, developer] */ diff --git a/packages/medusa/src/api/routes/admin/invites/delete-invite.ts b/packages/medusa/src/api/routes/admin/invites/delete-invite.ts index 0bec201bd5..7819bdf017 100644 --- a/packages/medusa/src/api/routes/admin/invites/delete-invite.ts +++ b/packages/medusa/src/api/routes/admin/invites/delete-invite.ts @@ -5,7 +5,7 @@ import InviteService from "../../../../services/invite" * @oas [delete] /admin/invites/{invite_id} * operationId: "DeleteInvitesInvite" * summary: "Delete an Invite" - * description: "Deletes an Invite" + * description: "Delete an Invite. Only invites that weren't accepted can be deleted." * x-authenticated: true * parameters: * - (path) invite_id=* {string} The ID of the Invite @@ -18,15 +18,15 @@ import InviteService from "../../../../services/invite" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.invites.delete(invite_id) + * medusa.admin.invites.delete(inviteId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/invites/{invite_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/invites/{invite_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/invites/index.ts b/packages/medusa/src/api/routes/admin/invites/index.ts index 286e0bdd81..1e641d131d 100644 --- a/packages/medusa/src/api/routes/admin/invites/index.ts +++ b/packages/medusa/src/api/routes/admin/invites/index.ts @@ -49,7 +49,7 @@ export default (app) => { * default: invite * deleted: * type: boolean - * description: Whether or not the Invite was deleted. + * description: Whether or not the invite was deleted. * default: true */ export type AdminInviteDeleteRes = DeleteResponse @@ -62,6 +62,7 @@ export type AdminInviteDeleteRes = DeleteResponse * properties: * invites: * type: array + * description: An array of invites * items: * $ref: "#/components/schemas/Invite" */ diff --git a/packages/medusa/src/api/routes/admin/invites/list-invites.ts b/packages/medusa/src/api/routes/admin/invites/list-invites.ts index 28e2ea973e..82e4348ec3 100644 --- a/packages/medusa/src/api/routes/admin/invites/list-invites.ts +++ b/packages/medusa/src/api/routes/admin/invites/list-invites.ts @@ -4,7 +4,7 @@ import InviteService from "../../../../services/invite" * @oas [get] /admin/invites * operationId: "GetInvites" * summary: "Lists Invites" - * description: "Lists all Invites" + * description: "Retrieve a list of invites." * x-authenticated: true * x-codegen: * method: list @@ -22,8 +22,8 @@ import InviteService from "../../../../services/invite" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/invites' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/invites' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/invites/resend-invite.ts b/packages/medusa/src/api/routes/admin/invites/resend-invite.ts index dc8868777c..27e61df662 100644 --- a/packages/medusa/src/api/routes/admin/invites/resend-invite.ts +++ b/packages/medusa/src/api/routes/admin/invites/resend-invite.ts @@ -5,7 +5,8 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/invites/{invite_id}/resend * operationId: "PostInvitesInviteResend" * summary: "Resend an Invite" - * description: "Resends an Invite by triggering the 'invite' created event again" + * description: "Resend an Invite. This renews the expiry date by 7 days and generates a new token for the invite. It also triggers the `invite.created` event, so if you have a Notification Provider installed that handles this + * event, a notification should be sent to the email associated with the invite to allow them to accept the invite." * x-authenticated: true * parameters: * - (path) invite_id=* {string} The ID of the Invite @@ -18,7 +19,7 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.invites.resend(invite_id) + * medusa.admin.invites.resend(inviteId) * .then(() => { * // successful * }) @@ -28,8 +29,8 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/invites/{invite_id}/resend' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/invites/{invite_id}/resend' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/notes/create-note.ts b/packages/medusa/src/api/routes/admin/notes/create-note.ts index 3b778bf1db..e3fd1a281d 100644 --- a/packages/medusa/src/api/routes/admin/notes/create-note.ts +++ b/packages/medusa/src/api/routes/admin/notes/create-note.ts @@ -7,8 +7,8 @@ import { EntityManager } from "typeorm" /** * @oas [post] /admin/notes * operationId: "PostNotes" - * summary: "Creates a Note" - * description: "Creates a Note which can be associated with any resource as required." + * summary: "Create a Note" + * description: "Create a Note which can be associated with any resource." * x-authenticated: true * requestBody: * content: @@ -26,8 +26,8 @@ import { EntityManager } from "typeorm" * // must be previously logged in or use api token * medusa.admin.notes.create({ * resource_id, - * resource_type: 'order', - * value: 'We delivered this order' + * resource_type: "order", + * value: "We delivered this order" * }) * .then(({ note }) => { * console.log(note.id); @@ -35,9 +35,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/notes' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/notes' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "resource_id": "{resource_id}", * "resource_type": "order", @@ -99,10 +99,10 @@ export default async (req, res) => { * properties: * resource_id: * type: string - * description: The ID of the resource which the Note relates to. + * description: The ID of the resource which the Note relates to. For example, an order ID. * resource_type: * type: string - * description: The type of resource which the Note relates to. + * description: The type of resource which the Note relates to. For example, `order`. * value: * type: string * description: The content of the Note to create. diff --git a/packages/medusa/src/api/routes/admin/notes/delete-note.ts b/packages/medusa/src/api/routes/admin/notes/delete-note.ts index 19529e9c8d..777f47fa93 100644 --- a/packages/medusa/src/api/routes/admin/notes/delete-note.ts +++ b/packages/medusa/src/api/routes/admin/notes/delete-note.ts @@ -5,7 +5,7 @@ import NoteService from "../../../../services/note" * @oas [delete] /admin/notes/{id} * operationId: "DeleteNotesNote" * summary: "Delete a Note" - * description: "Deletes a Note." + * description: "Delete a Note." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Note to delete. @@ -18,15 +18,15 @@ import NoteService from "../../../../services/note" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.notes.delete(note_id) + * medusa.admin.notes.delete(noteId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/notes/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/notes/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/notes/get-note.ts b/packages/medusa/src/api/routes/admin/notes/get-note.ts index 6f7486a2c6..c438a98f13 100644 --- a/packages/medusa/src/api/routes/admin/notes/get-note.ts +++ b/packages/medusa/src/api/routes/admin/notes/get-note.ts @@ -4,10 +4,10 @@ import NoteService from "../../../../services/note" * @oas [get] /admin/notes/{id} * operationId: "GetNotesNote" * summary: "Get a Note" - * description: "Retrieves a single note using its id" + * description: "Retrieve a note's details." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the note to retrieve. + * - (path) id=* {string} The ID of the note. * x-codegen: * method: retrieve * x-codeSamples: @@ -17,15 +17,15 @@ import NoteService from "../../../../services/note" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.notes.retrieve(note_id) + * medusa.admin.notes.retrieve(noteId) * .then(({ note }) => { * console.log(note.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/notes/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/notes/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/notes/index.ts b/packages/medusa/src/api/routes/admin/notes/index.ts index 0e77df3d66..8fce6ac2ae 100644 --- a/packages/medusa/src/api/routes/admin/notes/index.ts +++ b/packages/medusa/src/api/routes/admin/notes/index.ts @@ -29,6 +29,7 @@ export default (app) => { * - note * properties: * note: + * description: Note details. * $ref: "#/components/schemas/Note" */ export type AdminNotesRes = { @@ -68,6 +69,7 @@ export type AdminNotesDeleteRes = DeleteResponse * properties: * notes: * type: array + * description: An array of notes * items: * $ref: "#/components/schemas/Note" * count: @@ -75,7 +77,7 @@ export type AdminNotesDeleteRes = DeleteResponse * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of notes skipped when retrieving the notes. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/notes/list-notes.ts b/packages/medusa/src/api/routes/admin/notes/list-notes.ts index 0d6bb05b4f..821a865400 100644 --- a/packages/medusa/src/api/routes/admin/notes/list-notes.ts +++ b/packages/medusa/src/api/routes/admin/notes/list-notes.ts @@ -10,11 +10,11 @@ import { validator } from "../../../../utils/validator" * operationId: "GetNotes" * summary: "List Notes" * x-authenticated: true - * description: "Retrieves a list of notes" + * description: "Retrieve a list of notes. The notes can be filtered by fields such as `resource_id`. The notes can also be paginated." * parameters: - * - (query) limit=50 {number} The number of notes to get - * - (query) offset=0 {number} The offset at which to get notes - * - (query) resource_id {string} The ID which the notes belongs to + * - (query) limit=50 {number} Limit the number of notes returned. + * - (query) offset=0 {number} The number of notes to skip when retrieving the notes. + * - (query) resource_id {string} Filter by resource ID * x-codegen: * method: list * queryParams: AdminGetNotesParams @@ -32,8 +32,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/notes' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/notes' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/notes/update-note.ts b/packages/medusa/src/api/routes/admin/notes/update-note.ts index f2b5720ef3..174230bd45 100644 --- a/packages/medusa/src/api/routes/admin/notes/update-note.ts +++ b/packages/medusa/src/api/routes/admin/notes/update-note.ts @@ -8,9 +8,9 @@ import { EntityManager } from "typeorm" * operationId: "PostNotesNote" * summary: "Update a Note" * x-authenticated: true - * description: "Updates a Note associated with some resource" + * description: "Update a Note's details.'" * parameters: - * - (path) id=* {string} The ID of the Note to update + * - (path) id=* {string} The ID of the Note * requestBody: * content: * application/json: @@ -25,8 +25,8 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.notes.update(note_id, { - * value: 'We delivered this order' + * medusa.admin.notes.update(noteId, { + * value: "We delivered this order" * }) * .then(({ note }) => { * console.log(note.id); @@ -34,9 +34,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/notes/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/notes/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "value": "We delivered this order" * }' @@ -89,7 +89,7 @@ export default async (req, res) => { * properties: * value: * type: string - * description: The updated description of the Note. + * description: The description of the Note. */ export class AdminPostNotesNoteReq { @IsString() diff --git a/packages/medusa/src/api/routes/admin/notifications/index.ts b/packages/medusa/src/api/routes/admin/notifications/index.ts index cb81534cd4..4b17e3bea2 100644 --- a/packages/medusa/src/api/routes/admin/notifications/index.ts +++ b/packages/medusa/src/api/routes/admin/notifications/index.ts @@ -49,6 +49,7 @@ export const defaultAdminNotificationsFields = [ * properties: * notifications: * type: array + * description: an array of notifications * items: * $ref: "#/components/schemas/Notification" * count: @@ -56,7 +57,7 @@ export const defaultAdminNotificationsFields = [ * description: The total number of notifications * offset: * type: integer - * description: The number of notifications skipped before these notifications + * description: The number of notifications skipped when retrieving the notifications. * limit: * type: integer * description: The number of notifications per page @@ -76,6 +77,7 @@ export type AdminNotificationsListRes = PaginatedResponse & { * - notification * properties: * notification: + * description: Notification details * $ref: "#/components/schemas/Notification" */ export type AdminNotificationsRes = { diff --git a/packages/medusa/src/api/routes/admin/notifications/list-notifications.ts b/packages/medusa/src/api/routes/admin/notifications/list-notifications.ts index 5bad762e0a..2e52216ddf 100644 --- a/packages/medusa/src/api/routes/admin/notifications/list-notifications.ts +++ b/packages/medusa/src/api/routes/admin/notifications/list-notifications.ts @@ -15,17 +15,17 @@ import { validator } from "../../../../utils/validator" * @oas [get] /admin/notifications * operationId: "GetNotifications" * summary: "List Notifications" - * description: "Retrieves a list of Notifications." + * description: "Retrieve a list of notifications. The notifications can be filtered by fields such as `event_name` or `resource_type`. The notifications can also be paginated." * x-authenticated: true * parameters: - * - (query) offset=0 {integer} The number of notifications to skip before starting to collect the notifications set - * - (query) limit=50 {integer} The number of notifications to return - * - (query) fields {string} Comma separated fields to include in the result set - * - (query) expand {string} Comma separated fields to populate - * - (query) event_name {string} The name of the event that the notification was sent for. - * - (query) resource_type {string} The type of resource that the Notification refers to. - * - (query) resource_id {string} The ID of the resource that the Notification refers to. - * - (query) to {string} 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 + * - (query) offset=0 {integer} The number of inventory items to skip when retrieving the inventory items. + * - (query) limit=50 {integer} Limit the number of notifications returned. + * - (query) fields {string} Comma-separated fields that should be included in each returned notification. + * - (query) expand {string} Comma-separated relations that should be expanded in each returned notification. + * - (query) event_name {string} Filter by the name of the event that triggered sending this notification. + * - (query) resource_type {string} Filter by the resource type. + * - (query) resource_id {string} Filter by the resource ID. + * - (query) to {string} Filter by the address that the Notification was sent to. This will usually be an email address, but it can also represent other addresses such as a chat bot user id. * - (query) include_resends {string} A boolean indicating whether the result set should include resent notifications or not * x-codegen: * method: list @@ -44,8 +44,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/notifications' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/notifications' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/notifications/resend-notification.ts b/packages/medusa/src/api/routes/admin/notifications/resend-notification.ts index 83b1af3106..cb780564ff 100644 --- a/packages/medusa/src/api/routes/admin/notifications/resend-notification.ts +++ b/packages/medusa/src/api/routes/admin/notifications/resend-notification.ts @@ -13,7 +13,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/notifications/{id}/resend * operationId: "PostNotificationsNotificationResend" * summary: "Resend Notification" - * description: "Resends a previously sent notifications, with the same data but optionally to a different address" + * description: "Resend a previously sent notifications, with the same data but optionally to a different address." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Notification @@ -31,15 +31,15 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.notifications.resend(notification_id) + * medusa.admin.notifications.resend(notificationId) * .then(({ notification }) => { * console.log(notification.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/notifications/{id}/resend' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/notifications/{id}/resend' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] @@ -103,7 +103,7 @@ export default async (req, res) => { * type: object * properties: * to: - * description: "A new address or user identifier that the Notification should be sent to" + * description: "A new address or user identifier that the Notification should be sent to. If not provided, the previous `to` field of the notification will be used." * type: string */ export class AdminPostNotificationsNotificationResendReq { diff --git a/packages/medusa/src/api/routes/admin/order-edits/add-line-item.ts b/packages/medusa/src/api/routes/admin/order-edits/add-line-item.ts index f0bf9e4569..dfe167f5b5 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/add-line-item.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/add-line-item.ts @@ -12,7 +12,8 @@ import { * @oas [post] /admin/order-edits/{id}/items * operationId: "PostOrderEditsEditLineItems" * summary: "Add a Line Item" - * description: "Create an OrderEdit LineItem." + * description: "Create a line item change in the order edit that indicates adding an item in the original order. The item will not be added to the original order until the order edit is + * confirmed." * parameters: * - (path) id=* {string} The ID of the Order Edit. * requestBody: @@ -30,7 +31,7 @@ import { * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orderEdits.addLineItem(order_edit_id, { + * medusa.admin.orderEdits.addLineItem(orderEditId, { * variant_id, * quantity * }) @@ -40,9 +41,9 @@ import { * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/order-edits/{id}/items' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", "quantity": 3 }' * security: * - api_token: [] @@ -106,10 +107,10 @@ export default async (req: Request, res: Response) => { * - quantity * properties: * variant_id: - * description: The ID of the variant ID to add + * description: The ID of the product variant associated with the item. * type: string * quantity: - * description: The quantity to add + * description: The quantity of the item. * type: number * metadata: * description: An optional set of key-value pairs to hold additional information. diff --git a/packages/medusa/src/api/routes/admin/order-edits/cancel-order-edit.ts b/packages/medusa/src/api/routes/admin/order-edits/cancel-order-edit.ts index 016d579c77..d7921a0a93 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/cancel-order-edit.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/cancel-order-edit.ts @@ -9,8 +9,8 @@ import { /** * @oas [post] /admin/order-edits/{id}/cancel * operationId: "PostOrderEditsOrderEditCancel" - * summary: "Cancel an OrderEdit" - * description: "Cancels an OrderEdit." + * summary: "Cancel an Order Edit" + * description: "Cancel an OrderEdit." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the OrderEdit. @@ -23,15 +23,15 @@ import { * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orderEdits.cancel(order_edit_id) + * medusa.admin.orderEdits.cancel(orderEditId) * .then(({ order_edit }) => { * console.log(order_edit.id) * }) * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/order-edits/confirm-order-edit.ts b/packages/medusa/src/api/routes/admin/order-edits/confirm-order-edit.ts index 36f94ca688..0626bffaba 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/confirm-order-edit.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/confirm-order-edit.ts @@ -9,8 +9,8 @@ import { /** * @oas [post] /admin/order-edits/{id}/confirm * operationId: "PostOrderEditsOrderEditConfirm" - * summary: "Confirms an OrderEdit" - * description: "Confirms an OrderEdit." + * summary: "Confirm an OrderEdit" + * description: "Confirm an Order Edit. This will reflect the changes in the order edit on the associated order." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the order edit. @@ -23,15 +23,15 @@ import { * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orderEdits.confirm(order_edit_id) + * medusa.admin.orderEdits.confirm(orderEditId) * .then(({ order_edit }) => { * console.log(order_edit.id) * }) * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/order-edits/create-order-edit.ts b/packages/medusa/src/api/routes/admin/order-edits/create-order-edit.ts index bef85ef4fe..eb5539dc66 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/create-order-edit.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/create-order-edit.ts @@ -11,7 +11,7 @@ import { * @oas [post] /admin/order-edits * operationId: "PostOrderEdits" * summary: "Create an OrderEdit" - * description: "Creates an OrderEdit." + * description: "Create an Order Edit." * requestBody: * content: * application/json: @@ -27,16 +27,16 @@ import { * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orderEdits.create({ order_id }) + * medusa.admin.orderEdits.create({ orderId }) * .then(({ order_edit }) => { * console.log(order_edit.id) * }) * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/order-edits' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/order-edits' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ "order_id": "my_order_id", "internal_note": "my_optional_note" }' * security: * - api_token: [] @@ -99,7 +99,7 @@ export default async (req: Request, res: Response) => { * description: The ID of the order to create the edit for. * type: string * internal_note: - * description: An optional note to create for the order edit. + * description: An optional note to associate with the order edit. * type: string */ export class AdminPostOrderEditsReq { diff --git a/packages/medusa/src/api/routes/admin/order-edits/delete-line-item.ts b/packages/medusa/src/api/routes/admin/order-edits/delete-line-item.ts index af229eb67c..1bb864096f 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/delete-line-item.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/delete-line-item.ts @@ -9,12 +9,13 @@ import { /** * @oas [delete] /admin/order-edits/{id}/items/{item_id} * operationId: "DeleteOrderEditsOrderEditLineItemsLineItem" - * summary: "Delete a Line Item" - * description: "Delete line items from an order edit and create change item" + * summary: "Delete Line Item" + * description: "Create a line item change in the order edit that indicates deleting an item in the original order. The item in the original order will not be deleted until the order edit is + * confirmed." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Order Edit to delete from. - * - (path) item_id=* {string} The ID of the order edit item to delete from order. + * - (path) id=* {string} The ID of the Order Edit. + * - (path) item_id=* {string} The ID of line item in the original order. * x-codegen: * method: removeLineItem * x-codeSamples: @@ -24,15 +25,15 @@ import { * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id) + * medusa.admin.orderEdits.removeLineItem(orderEditId, lineItemId) * .then(({ order_edit }) => { * console.log(order_edit.id) * }) * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit-item-change.ts b/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit-item-change.ts index a359c75f9c..9fd8578e79 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit-item-change.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit-item-change.ts @@ -5,11 +5,11 @@ import { OrderEditService } from "../../../../services" * @oas [delete] /admin/order-edits/{id}/changes/{change_id} * operationId: "DeleteOrderEditsOrderEditItemChange" * summary: "Delete a Line Item Change" - * description: "Deletes an Order Edit Item Change" + * description: "Delete a line item change that indicates the addition, deletion, or update of a line item in the original order." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Order Edit to delete. - * - (path) change_id=* {string} The ID of the Order Edit Item Change to delete. + * - (path) id=* {string} The ID of the Order Edit. + * - (path) change_id=* {string} The ID of the Line Item Change to delete. * x-codegen: * method: deleteItemChange * x-codeSamples: @@ -19,15 +19,15 @@ import { OrderEditService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orderEdits.deleteItemChange(order_edit_id, item_change_id) + * medusa.admin.orderEdits.deleteItemChange(orderEdit_id, itemChangeId) * .then(({ id, object, deleted }) => { * console.log(id) * }) * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit.ts b/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit.ts index ee5aadfbc8..fe9b353deb 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit.ts @@ -5,7 +5,7 @@ import { OrderEditService } from "../../../../services" * @oas [delete] /admin/order-edits/{id} * operationId: "DeleteOrderEditsOrderEdit" * summary: "Delete an Order Edit" - * description: "Delete an Order Edit" + * description: "Delete an Order Edit. Only order edits that have the status `created` can be deleted." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order Edit to delete. @@ -18,15 +18,15 @@ import { OrderEditService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orderEdits.delete(order_edit_id) + * medusa.admin.orderEdits.delete(orderEditId) * .then(({ id, object, deleted }) => { * console.log(id) * }) * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/order-edits/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/order-edits/get-order-edit.ts b/packages/medusa/src/api/routes/admin/order-edits/get-order-edit.ts index 3dff2730e9..96931ae18d 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/get-order-edit.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/get-order-edit.ts @@ -5,13 +5,13 @@ import { FindParams } from "../../../../types/common" /** * @oas [get] /admin/order-edits/{id} * operationId: "GetOrderEditsOrderEdit" - * summary: "Get an OrderEdit" - * description: "Retrieves a OrderEdit." + * summary: "Get an Order Edit" + * description: "Retrieve an Order Edit's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the OrderEdit. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in each returned order edit. + * - (query) fields {string} Comma-separated fields that should be included in the returned order edit. * x-codegen: * method: retrieve * queryParams: GetOrderEditsOrderEditParams @@ -29,8 +29,8 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/order-edits/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/order-edits/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/order-edits/index.ts b/packages/medusa/src/api/routes/admin/order-edits/index.ts index 01152b2ca6..a834b6c509 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/index.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/index.ts @@ -140,6 +140,7 @@ export default (app) => { * - order_edit * properties: * order_edit: + * description: "Order edit details" * $ref: "#/components/schemas/OrderEdit" */ export type AdminOrderEditsRes = { @@ -192,6 +193,7 @@ export type AdminOrderEditsRes = { * properties: * order_edits: * type: array + * description: "An array of order edit details" * items: * $ref: "#/components/schemas/OrderEdit" * count: @@ -199,7 +201,7 @@ export type AdminOrderEditsRes = { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of order edits skipped when retrieving the order edits. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/order-edits/list-order-edit.ts b/packages/medusa/src/api/routes/admin/order-edits/list-order-edit.ts index 43041a29de..7dda4037b4 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/list-order-edit.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/list-order-edit.ts @@ -6,16 +6,16 @@ import { IsOptional, IsString } from "class-validator" /** * @oas [get] /admin/order-edits * operationId: "GetOrderEdits" - * summary: "List OrderEdits" - * description: "List OrderEdits." + * summary: "List Order Edits" + * description: "Retrieve a list of order edits. The order edits can be filtered by fields such as `q` or `order_id`. The order edits can also be paginated." * x-authenticated: true * parameters: - * - (query) q {string} Query used for searching order edit internal note. - * - (query) order_id {string} List order edits by order id. - * - (query) limit=20 {number} The number of items in the response - * - (query) offset=0 {number} The offset of items in response - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) q {string} term to search order edits' internal note. + * - (query) order_id {string} Filter by order ID + * - (query) limit=20 {number} Limit the number of order edits returned. + * - (query) offset=0 {number} The number of order edits to skip when retrieving the order edits. + * - (query) expand {string} Comma-separated relations that should be expanded in each returned order edit. + * - (query) fields {string} Comma-separated fields that should be included in each returned order edit. * x-codegen: * method: list * queryParams: GetOrderEditsParams @@ -33,8 +33,8 @@ import { IsOptional, IsString } from "class-validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/order-edits' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/order-edits' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/order-edits/request-confirmation.ts b/packages/medusa/src/api/routes/admin/order-edits/request-confirmation.ts index 0157281ada..a0ac0ebb74 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/request-confirmation.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/request-confirmation.ts @@ -15,10 +15,11 @@ import { * @oas [post] /admin/order-edits/{id}/request * operationId: "PostOrderEditsOrderEditRequest" * summary: "Request Confirmation" - * description: "Request customer confirmation of an Order Edit" + * description: "Request customer confirmation of an Order Edit. This would emit the event `order-edit.requested` which Notification Providers listen to and send + * a notification to the customer about the order edit." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Order Edit to request confirmation from. + * - (path) id=* {string} The ID of the Order Edit. * x-codegen: * method: requestConfirmation * x-codeSamples: @@ -28,15 +29,15 @@ import { * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orderEdits.requestConfirmation(order_edit_id) + * medusa.admin.orderEdits.requestConfirmation(orderEditId) * .then({ order_edit }) => { * console.log(order_edit.id) * }) * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/request' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/order-edits/{id}/request' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/order-edits/update-order-edit-line-item.ts b/packages/medusa/src/api/routes/admin/order-edits/update-order-edit-line-item.ts index 16b41127e5..e00b624ca7 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/update-order-edit-line-item.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/update-order-edit-line-item.ts @@ -11,11 +11,12 @@ import { * @oas [post] /admin/order-edits/{id}/items/{item_id} * operationId: "PostOrderEditsEditLineItemsLineItem" * summary: "Upsert Line Item Change" - * description: "Create or update the order edit change holding the line item changes" + * description: "Create or update a line item change in the order edit that indicates addition, deletion, or update of a line item into an original order. Line item changes + * are only reflected on the original order after the order edit is confirmed." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Order Edit to update. - * - (path) item_id=* {string} The ID of the order edit item to update. + * - (path) id=* {string} The ID of the Order Edit. + * - (path) item_id=* {string} The ID of the line item in the original order. * requestBody: * content: * application/json: @@ -30,7 +31,7 @@ import { * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, { + * medusa.admin.orderEdits.updateLineItem(orderEditId, lineItemId, { * quantity: 5 * }) * .then(({ order_edit }) => { @@ -39,9 +40,9 @@ import { * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ "quantity": 5 }' * security: * - api_token: [] diff --git a/packages/medusa/src/api/routes/admin/order-edits/update-order-edit.ts b/packages/medusa/src/api/routes/admin/order-edits/update-order-edit.ts index cbba0d7669..74a4b1d91c 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/update-order-edit.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/update-order-edit.ts @@ -11,8 +11,8 @@ import { /** * @oas [post] /admin/order-edits/{id} * operationId: "PostOrderEditsOrderEdit" - * summary: "Update an OrderEdit" - * description: "Updates a OrderEdit." + * summary: "Update an Order Edit" + * description: "Updates an Order Edit's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the OrderEdit. @@ -30,7 +30,7 @@ import { * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orderEdits.update(order_edit_id, { + * medusa.admin.orderEdits.update(orderEditId, { * internal_note: "internal reason XY" * }) * .then(({ order_edit }) => { @@ -39,9 +39,9 @@ import { * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/order-edits/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "internal_note": "internal reason XY" * }' @@ -103,7 +103,7 @@ export default async (req: Request, res: Response) => { * type: object * properties: * internal_note: - * description: An optional note to create or update for the order edit. + * description: An optional note to create or update in the order edit. * type: string */ export class AdminPostOrderEditsOrderEditReq { diff --git a/packages/medusa/src/api/routes/admin/orders/add-shipping-method.ts b/packages/medusa/src/api/routes/admin/orders/add-shipping-method.ts index 5a3067ddf2..84aa519191 100644 --- a/packages/medusa/src/api/routes/admin/orders/add-shipping-method.ts +++ b/packages/medusa/src/api/routes/admin/orders/add-shipping-method.ts @@ -18,8 +18,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * description: "Adds a Shipping Method to an Order. If another Shipping Method exists with the same Shipping Profile, the previous Shipping Method will be replaced." * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -36,7 +36,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.addShippingMethod(order_id, { + * medusa.admin.orders.addShippingMethod(orderId, { * price: 1000, * option_id * }) @@ -46,9 +46,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "price": 1000, * "option_id": "{option_id}" @@ -116,7 +116,7 @@ export default async (req, res) => { * description: The ID of the Shipping Option to create the Shipping Method from. * date: * type: object - * description: The data required for the Shipping Option to create a Shipping Method. This will depend on the Fulfillment Provider. + * description: The data required for the Shipping Option to create a Shipping Method. This depends on the Fulfillment Provider. */ export class AdminPostOrdersOrderShippingMethodsReq { @IsInt() diff --git a/packages/medusa/src/api/routes/admin/orders/archive-order.ts b/packages/medusa/src/api/routes/admin/orders/archive-order.ts index 0822d60e39..7f64f39bc7 100644 --- a/packages/medusa/src/api/routes/admin/orders/archive-order.ts +++ b/packages/medusa/src/api/routes/admin/orders/archive-order.ts @@ -7,12 +7,12 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id}/archive * operationId: "PostOrdersOrderArchive" * summary: "Archive Order" - * description: "Archives the order with the given id." + * description: "Archive an order and change its status." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: archive * params: AdminPostOrdersOrderArchiveParams @@ -23,15 +23,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.archive(order_id) + * medusa.admin.orders.archive(orderId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/archive' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/archive' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-claim.ts b/packages/medusa/src/api/routes/admin/orders/cancel-claim.ts index 2c7117a593..bb10e153cf 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-claim.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-claim.ts @@ -9,13 +9,16 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id}/claims/{claim_id}/cancel * operationId: "PostOrdersClaimCancel" * summary: "Cancel a Claim" - * description: "Cancels a Claim" + * description: "Cancel a Claim and change its status. A claim can't be canceled if it has a refund, if its fulfillments haven't been canceled, of if its associated return hasn't been canceled." * x-authenticated: true + * externalDocs: + * description: Canceling a claim + * url: https://docs.medusajs.com/modules/orders/claims#cancel-a-claim * parameters: - * - (path) id=* {string} The ID of the Order. + * - (path) id=* {string} The ID of the order the claim is associated with. * - (path) claim_id=* {string} The ID of the Claim. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: cancelClaim * params: AdminPostOrdersClaimCancel @@ -26,15 +29,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.cancelClaim(order_id, claim_id) + * medusa.admin.orders.cancelClaim(orderId, claimId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.ts b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.ts index 5767d59b9f..e8272420a2 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.ts @@ -12,15 +12,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [post] /admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel * operationId: "PostOrdersClaimFulfillmentsCancel" - * summary: "Cancel Claim Fulfillment" - * description: "Registers a claim's fulfillment as canceled." + * summary: "Cancel Claim's Fulfillment" + * description: "Cancel a claim's fulfillment and change its status." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Order which the Claim relates to. - * - (path) claim_id=* {string} The ID of the Claim which the Fulfillment relates to. - * - (path) fulfillment_id=* {string} The ID of the Fulfillment. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (path) id=* {string} The ID of the order the claim is associated with. + * - (path) claim_id=* {string} The ID of the claim. + * - (path) fulfillment_id=* {string} The ID of the fulfillment. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: cancelClaimFulfillment * params: AdminPostOrdersClaimFulfillmentsCancelParams @@ -31,15 +31,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.cancelClaimFulfillment(order_id, claim_id, fulfillment_id) + * medusa.admin.orders.cancelClaimFulfillment(orderId, claimId, fulfillmentId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-swap.ts b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-swap.ts index 6dac90c092..e7f7c32ce8 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-swap.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-swap.ts @@ -13,14 +13,14 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel * operationId: "PostOrdersSwapFulfillmentsCancel" * summary: "Cancel Swap's Fulfilmment" - * description: "Registers a Swap's Fulfillment as canceled." + * description: "Cancel a swap's fulfillment and change its status." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Order which the Swap relates to. - * - (path) swap_id=* {string} The ID of the Swap which the Fulfillment relates to. - * - (path) fulfillment_id=* {string} The ID of the Fulfillment. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (path) id=* {string} The ID of the order the swap is associated with. + * - (path) swap_id=* {string} The ID of the swap. + * - (path) fulfillment_id=* {string} The ID of the fulfillment. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: cancelSwapFulfillment * params: AdminPostOrdersSwapFulfillementsCancelParams @@ -31,15 +31,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.cancelSwapFulfillment(order_id, swap_id, fulfillment_id) + * medusa.admin.orders.cancelSwapFulfillment(orderId, swapId, fulfillmentId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment.ts b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment.ts index 0bbc5de26b..606d7d1f9e 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment.ts @@ -14,14 +14,14 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [post] /admin/orders/{id}/fulfillments/{fulfillment_id}/cancel * operationId: "PostOrdersOrderFulfillmentsCancel" - * summary: "Cancels a Fulfilmment" - * description: "Registers a Fulfillment as canceled." + * summary: "Cancel a Fulfilmment" + * description: "Cancel an order's fulfillment and change its status." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Order which the Fulfillment relates to. - * - (path) fulfillment_id=* {string} The ID of the Fulfillment - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (path) id=* {string} The ID of the Order. + * - (path) fulfillment_id=* {string} The ID of the Fulfillment. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: cancelFulfillment * params: AdminPostOrdersOrderFulfillementsCancelParams @@ -32,15 +32,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.cancelFulfillment(order_id, fulfillment_id) + * medusa.admin.orders.cancelFulfillment(orderId, fulfillmentId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-order.ts b/packages/medusa/src/api/routes/admin/orders/cancel-order.ts index 8672f2269e..17b1cad245 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-order.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-order.ts @@ -7,12 +7,12 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id}/cancel * operationId: "PostOrdersOrderCancel" * summary: "Cancel an Order" - * description: "Registers an Order as canceled. This triggers a flow that will cancel any created Fulfillments and Payments, may fail if the Payment or Fulfillment Provider is unable to cancel the Payment/Fulfillment." + * description: "Cancel an order and change its status. This will also cancel any associated Fulfillments and Payments, and it may fail if the Payment or Fulfillment Provider is unable to cancel the Payment/Fulfillment." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: cancel * params: AdminPostOrdersOrderCancel @@ -23,15 +23,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.cancel(order_id) + * medusa.admin.orders.cancel(orderId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/cancel' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/cancel' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-swap.ts b/packages/medusa/src/api/routes/admin/orders/cancel-swap.ts index 25d90920a0..0f82765771 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-swap.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-swap.ts @@ -8,14 +8,17 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [post] /admin/orders/{id}/swaps/{swap_id}/cancel * operationId: "PostOrdersSwapCancel" - * summary: "Cancels a Swap" - * description: "Cancels a Swap" + * summary: "Cancel a Swap" + * description: "Cancel a Swap and change its status." * x-authenticated: true + * externalDocs: + * description: Canceling a swap + * url: https://docs.medusajs.com/modules/orders/swaps#canceling-a-swap * parameters: - * - (path) id=* {string} The ID of the Order. + * - (path) id=* {string} The ID of the Order the swap is associated with. * - (path) swap_id=* {string} The ID of the Swap. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: cancelSwap * params: AdminPostOrdersSwapCancelParams @@ -26,15 +29,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.cancelSwap(order_id, swap_id) + * medusa.admin.orders.cancelSwap(orderId, swapId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/capture-payment.ts b/packages/medusa/src/api/routes/admin/orders/capture-payment.ts index 77af27bea4..980ec22a1f 100644 --- a/packages/medusa/src/api/routes/admin/orders/capture-payment.ts +++ b/packages/medusa/src/api/routes/admin/orders/capture-payment.ts @@ -6,13 +6,13 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [post] /admin/orders/{id}/capture * operationId: "PostOrdersOrderCapture" - * summary: "Capture Order's Payment" - * description: "Captures all the Payments associated with an Order." + * summary: "Capture an Order's Payments" + * description: "Capture all the Payments associated with an Order. The payment of canceled orders can't be captured." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: capturePayment * params: AdminPostOrdersOrderCaptureParams @@ -23,15 +23,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.capturePayment(order_id) + * medusa.admin.orders.capturePayment(orderId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/capture' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/capture' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/complete-order.ts b/packages/medusa/src/api/routes/admin/orders/complete-order.ts index 842a3e0e30..d56a0b9ddd 100644 --- a/packages/medusa/src/api/routes/admin/orders/complete-order.ts +++ b/packages/medusa/src/api/routes/admin/orders/complete-order.ts @@ -7,12 +7,12 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id}/complete * operationId: "PostOrdersOrderComplete" * summary: "Complete an Order" - * description: "Completes an Order" + * description: "Complete an Order and change its status. A canceled order can't be completed." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: complete * params: AdminPostOrdersOrderCompleteParams @@ -23,15 +23,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.complete(order_id) + * medusa.admin.orders.complete(orderId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/complete' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/complete' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/create-claim-shipment.ts b/packages/medusa/src/api/routes/admin/orders/create-claim-shipment.ts index 212d314f1f..3db433b208 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-claim-shipment.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-claim-shipment.ts @@ -7,14 +7,18 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [post] /admin/orders/{id}/claims/{claim_id}/shipments * operationId: "PostOrdersOrderClaimsClaimShipments" - * summary: "Create Claim Shipment" - * description: "Registers a Claim Fulfillment as shipped." + * summary: "Ship a Claim's Fulfillment" + * description: "Mark a claim's fulfillment as shipped. This changes the claim's fulfillment status to either `shipped` or `partially_shipped`, depending on + * whether all the items were shipped." * x-authenticated: true + * externalDocs: + * description: Fulfill a claim + * url: https://docs.medusajs.com/modules/orders/claims#fulfill-a-claim * parameters: - * - (path) id=* {string} The ID of the Order. + * - (path) id=* {string} The ID of the Order the claim is associated with. * - (path) claim_id=* {string} The ID of the Claim. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -30,7 +34,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.createClaimShipment(order_id, claim_id, { + * medusa.admin.orders.createClaimShipment(orderId, claimId, { * fulfillment_id * }) * .then(({ order }) => { @@ -39,9 +43,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "fulfillment_id": "{fulfillment_id}" * }' @@ -106,7 +110,7 @@ export default async (req, res) => { * description: The ID of the Fulfillment. * type: string * tracking_numbers: - * description: The tracking numbers for the shipment. + * description: An array of tracking numbers for the shipment. * type: array * items: * type: string diff --git a/packages/medusa/src/api/routes/admin/orders/create-claim.ts b/packages/medusa/src/api/routes/admin/orders/create-claim.ts index ce108e0503..a74b7a0b5b 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-claim.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-claim.ts @@ -22,12 +22,16 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id}/claims * operationId: "PostOrdersOrderClaims" * summary: "Create a Claim" - * description: "Creates a Claim." + * description: "Create a Claim for an order. If a return shipping method is specified, a return will also be created and associated with the claim. If the claim's type is `refund`, + * the refund is processed as well." + * externalDocs: + * description: How are claims created + * url: https://docs.medusajs.com/modules/orders/claims#how-are-claims-created * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -43,7 +47,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.createClaim(order_id, { + * medusa.admin.orders.createClaim(orderId, { * type: 'refund', * claim_items: [ * { @@ -58,9 +62,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/claims' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "type": "refund", * "claim_items": [ @@ -341,7 +345,7 @@ export default async (req, res) => { * - production_failure * - other * tags: - * description: A list o tags to add to the Claim Item + * description: A list of tags to add to the Claim Item * type: array * items: * type: string @@ -350,7 +354,7 @@ export default async (req, res) => { * items: * type: string * return_shipping: - * description: Optional details for the Return Shipping Method, if the items are to be sent back. + * description: Optional details for the Return Shipping Method, if the items are to be sent back. Providing this field will result in a return being created and associated with the claim. * type: object * properties: * option_id: @@ -360,7 +364,7 @@ export default async (req, res) => { * type: integer * description: The price to charge for the Shipping Method. * additional_items: - * description: The new items to send to the Customer when the Claim type is Replace. + * description: The new items to send to the Customer. This is only used if the claim's type is `replace`. * type: array * items: * type: object @@ -369,13 +373,13 @@ export default async (req, res) => { * - quantity * properties: * variant_id: - * description: The ID of the Product Variant to ship. + * description: The ID of the Product Variant. * type: string * quantity: - * description: The quantity of the Product Variant to ship. + * description: The quantity of the Product Variant. * type: integer * shipping_methods: - * description: The Shipping Methods to send the additional Line Items with. + * description: The Shipping Methods to send the additional Line Items with. This is only used if the claim's type is `replace`. * type: array * items: * type: object @@ -393,10 +397,10 @@ export default async (req, res) => { * description: An optional set of key-value pairs to hold additional information. * type: object * shipping_address: - * description: "An optional shipping address to send the claim to. Defaults to the parent order's shipping address" + * description: "An optional shipping address to send the claimed items to. If not provided, the parent order's shipping address will be used." * $ref: "#/components/schemas/AddressPayload" * refund_amount: - * description: The amount to refund the Customer when the Claim type is `refund`. + * description: The amount to refund the customer. This is used when the claim's type is `refund`. * type: integer * no_notification: * description: If set to true no notification will be send related to this Claim. diff --git a/packages/medusa/src/api/routes/admin/orders/create-fulfillment.ts b/packages/medusa/src/api/routes/admin/orders/create-fulfillment.ts index 7605a2bf53..4e318a66e6 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-fulfillment.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-fulfillment.ts @@ -24,12 +24,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id}/fulfillment * operationId: "PostOrdersOrderFulfillments" * summary: "Create a Fulfillment" - * description: "Creates a Fulfillment of an Order - will notify Fulfillment Providers to prepare a shipment." + * description: "Create a Fulfillment of an Order using the fulfillment provider." * x-authenticated: true + * externalDocs: + * description: Fulfillments of orders + * url: https://docs.medusajs.com/modules/orders/#fulfillments-in-orders * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -45,7 +48,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.createFulfillment(order_id, { + * medusa.admin.orders.createFulfillment(orderId, { * items: [ * { * item_id, @@ -59,9 +62,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "items": [ * { @@ -214,13 +217,13 @@ export const updateInventoryAndReservations = async ( * - quantity * properties: * item_id: - * description: The ID of Line Item to fulfill. + * description: The ID of the Line Item to fulfill. * type: string * quantity: * description: The quantity of the Line Item to fulfill. * type: integer * no_notification: - * description: If set to true no notification will be send related to this Swap. + * description: If set to `true`, no notification will be sent to the customer related to this fulfillment. * type: boolean * metadata: * description: An optional set of key-value pairs to hold additional information. diff --git a/packages/medusa/src/api/routes/admin/orders/create-reservation-for-line-item.ts b/packages/medusa/src/api/routes/admin/orders/create-reservation-for-line-item.ts index 1e8b51ec99..4f6da35360 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-reservation-for-line-item.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-reservation-for-line-item.ts @@ -8,8 +8,8 @@ import { /** * @oas [post] /admin/orders/{id}/line-items/{line_item_id}/reserve * operationId: "PostOrdersOrderLineItemReservations" - * summary: "Create a Reservation for a line item" - * description: "Creates a Reservation for a line item at a specified location, optionally for a partial quantity." + * summary: "Create a Reservation" + * description: "Create a Reservation for a line item at a specified location, optionally for a partial quantity." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. @@ -23,9 +23,9 @@ import { * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reserve' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reserve' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "location_id": "loc_1" * }' @@ -103,7 +103,7 @@ export default async (req, res) => { * - location_id * properties: * location_id: - * description: "The id of the location of the reservation" + * description: "The ID of the location of the reservation" * type: string * quantity: * description: "The quantity to reserve" diff --git a/packages/medusa/src/api/routes/admin/orders/create-shipment.ts b/packages/medusa/src/api/routes/admin/orders/create-shipment.ts index dc6e50ab51..060645b39d 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-shipment.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-shipment.ts @@ -15,13 +15,17 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [post] /admin/orders/{id}/shipment * operationId: "PostOrdersOrderShipment" - * summary: "Create a Shipment" - * description: "Registers a Fulfillment as shipped." + * summary: "Ship a Fulfillment" + * description: "Mark a fulfillment as shipped. This changes the order's fulfillment status to either `shipped` or `partially_shipped`, depending on + * whether all the items were shipped." * x-authenticated: true + * externalDocs: + * description: Fulfillments of orders + * url: https://docs.medusajs.com/modules/orders/#fulfillments-in-orders * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -46,9 +50,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/shipment' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/shipment' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "fulfillment_id": "{fulfillment_id}" * }' diff --git a/packages/medusa/src/api/routes/admin/orders/create-swap-shipment.ts b/packages/medusa/src/api/routes/admin/orders/create-swap-shipment.ts index d3967d9ac8..20ef389b50 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-swap-shipment.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-swap-shipment.ts @@ -15,14 +15,18 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [post] /admin/orders/{id}/swaps/{swap_id}/shipments * operationId: "PostOrdersOrderSwapsSwapShipments" - * summary: "Create Swap Shipment" - * description: "Registers a Swap Fulfillment as shipped." + * summary: "Ship a Swap's Fulfillment" + * description: "RMark a swap's fulfillment as shipped. This changes the swap's fulfillment status to either `shipped` or `partially_shipped`, depending on + * whether all the items were shipped." * x-authenticated: true + * externalDocs: + * description: Handling swap fulfillments + * url: https://docs.medusajs.com/modules/orders/swaps#handling-swap-fulfillment * parameters: * - (path) id=* {string} The ID of the Order. * - (path) swap_id=* {string} The ID of the Swap. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -47,9 +51,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "fulfillment_id": "{fulfillment_id}" * }' diff --git a/packages/medusa/src/api/routes/admin/orders/create-swap.ts b/packages/medusa/src/api/routes/admin/orders/create-swap.ts index 79c3b556c0..acde9e5099 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-swap.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-swap.ts @@ -27,12 +27,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id}/swaps * operationId: "PostOrdersOrderSwaps" * summary: "Create a Swap" - * description: "Creates a Swap. Swaps are used to handle Return of previously purchased goods and Fulfillment of replacements simultaneously." + * description: "Create a Swap. This includes creating a return that is associated with the swap." * x-authenticated: true + * externalDocs: + * description: How are swaps created + * url: https://docs.medusajs.com/modules/orders/swaps#how-are-swaps-created * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} (Comma separated) Which fields should be expanded the order of the result. - * - (query) fields {string} (Comma separated) Which fields should be included the order of the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -48,7 +51,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.createSwap(order_id, { + * medusa.admin.orders.createSwap(orderId, { * return_items: [ * { * item_id, @@ -62,9 +65,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/swaps' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "return_items": [ * { @@ -268,7 +271,7 @@ export default async (req, res) => { * - return_items * properties: * return_items: - * description: The Line Items to return as part of the Swap. + * description: The Line Items to associate with the swap's return. * type: array * items: * type: object @@ -277,7 +280,7 @@ export default async (req, res) => { * - quantity * properties: * item_id: - * description: The ID of the Line Item that will be claimed. + * description: The ID of the Line Item that will be returned. * type: string * quantity: * description: The number of items that will be returned @@ -289,7 +292,7 @@ export default async (req, res) => { * description: An optional note with information about the Return. * type: string * return_shipping: - * description: How the Swap will be returned. + * description: The shipping method associated with the swap's return. * type: object * required: * - option_id @@ -310,13 +313,13 @@ export default async (req, res) => { * - quantity * properties: * variant_id: - * description: The ID of the Product Variant to ship. + * description: The ID of the Product Variant. * type: string * quantity: - * description: The quantity of the Product Variant to ship. + * description: The quantity of the Product Variant. * type: integer * custom_shipping_options: - * description: The custom shipping options to potentially create a Shipping Method from. + * description: An array of custom shipping options to potentially create a Shipping Method from to send the additional items. * type: array * items: * type: object @@ -325,16 +328,16 @@ export default async (req, res) => { * - price * properties: * option_id: - * description: The ID of the Shipping Option to override with a custom price. + * description: The ID of the Shipping Option. * type: string * price: * description: The custom price of the Shipping Option. * type: integer * no_notification: - * description: If set to true no notification will be send related to this Swap. + * description: If set to `true`, no notification will be sent to the customer related to this Swap. * type: boolean * allow_backorder: - * description: If true, swaps can be completed with items out of stock + * description: If set to `true`, swaps can be completed with items out of stock * type: boolean * default: true */ diff --git a/packages/medusa/src/api/routes/admin/orders/fulfill-claim.ts b/packages/medusa/src/api/routes/admin/orders/fulfill-claim.ts index 1ff1e540bf..ff4fe7bb5e 100644 --- a/packages/medusa/src/api/routes/admin/orders/fulfill-claim.ts +++ b/packages/medusa/src/api/routes/admin/orders/fulfill-claim.ts @@ -13,14 +13,17 @@ import { updateInventoryAndReservations } from "./create-fulfillment" /** * @oas [post] /admin/orders/{id}/claims/{claim_id}/fulfillments * operationId: "PostOrdersOrderClaimsClaimFulfillments" - * summary: "Create Claim Fulfillment" - * description: "Creates a Fulfillment for a Claim." + * summary: "Create a Claim Fulfillment" + * description: "Create a Fulfillment for a Claim." * x-authenticated: true + * externalDocs: + * description: Fulfill a claim + * url: https://docs.medusajs.com/modules/orders/claims#fulfill-a-claim * parameters: - * - (path) id=* {string} The ID of the Order. + * - (path) id=* {string} The ID of the Order the claim is associated with. * - (path) claim_id=* {string} The ID of the Claim. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -36,7 +39,7 @@ import { updateInventoryAndReservations } from "./create-fulfillment" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.fulfillClaim(order_id, claim_id, { + * medusa.admin.orders.fulfillClaim(orderId, claimId, { * }) * .then(({ order }) => { * console.log(order.id); @@ -44,8 +47,8 @@ import { updateInventoryAndReservations } from "./create-fulfillment" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] @@ -141,7 +144,7 @@ export default async (req, res) => { * description: An optional set of key-value pairs to hold additional information. * type: object * no_notification: - * description: If set to true no notification will be send related to this Claim. + * description: If set to `true`, no notification will be sent to the customer related to this Claim. * type: boolean */ export class AdminPostOrdersOrderClaimsClaimFulfillmentsReq { diff --git a/packages/medusa/src/api/routes/admin/orders/fulfill-swap.ts b/packages/medusa/src/api/routes/admin/orders/fulfill-swap.ts index be7e50087a..6c7c13a3a4 100644 --- a/packages/medusa/src/api/routes/admin/orders/fulfill-swap.ts +++ b/packages/medusa/src/api/routes/admin/orders/fulfill-swap.ts @@ -14,14 +14,17 @@ import { updateInventoryAndReservations } from "./create-fulfillment" /** * @oas [post] /admin/orders/{id}/swaps/{swap_id}/fulfillments * operationId: "PostOrdersOrderSwapsSwapFulfillments" - * summary: "Create Swap Fulfillment" - * description: "Creates a Fulfillment for a Swap." + * summary: "Create a Swap Fulfillment" + * description: "Create a Fulfillment for a Swap." * x-authenticated: true + * externalDocs: + * description: Handling a swap's fulfillment + * url: https://docs.medusajs.com/modules/orders/swaps#handling-swap-fulfillment * parameters: - * - (path) id=* {string} The ID of the Order. + * - (path) id=* {string} The ID of the Order the swap is associated with. * - (path) swap_id=* {string} The ID of the Swap. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -37,8 +40,8 @@ import { updateInventoryAndReservations } from "./create-fulfillment" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.fulfillSwap(order_id, swap_id, { - * + * medusa.admin.orders.fulfillSwap(orderId, swapId, { + * * }) * .then(({ order }) => { * console.log(order.id); @@ -46,8 +49,8 @@ import { updateInventoryAndReservations } from "./create-fulfillment" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] @@ -148,7 +151,7 @@ export default async (req, res) => { * description: An optional set of key-value pairs to hold additional information. * type: object * no_notification: - * description: If set to true no notification will be send related to this Claim. + * description: If set to `true`, no notification will be sent to the customer related to this swap. * type: boolean */ export class AdminPostOrdersOrderSwapsSwapFulfillmentsReq { diff --git a/packages/medusa/src/api/routes/admin/orders/get-order.ts b/packages/medusa/src/api/routes/admin/orders/get-order.ts index 8b9854a896..49ad35d783 100644 --- a/packages/medusa/src/api/routes/admin/orders/get-order.ts +++ b/packages/medusa/src/api/routes/admin/orders/get-order.ts @@ -7,12 +7,12 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [get] /admin/orders/{id} * operationId: "GetOrdersOrder" * summary: "Get an Order" - * description: "Retrieves an Order" + * description: "Retrieve an Order's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: retrieve * queryParams: AdminGetOrdersOrderParams @@ -23,15 +23,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.retrieve(order_id) + * medusa.admin.orders.retrieve(orderId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/orders/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/orders/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/get-reservations.ts b/packages/medusa/src/api/routes/admin/orders/get-reservations.ts index 3ab0d165a2..e3da0fa29a 100644 --- a/packages/medusa/src/api/routes/admin/orders/get-reservations.ts +++ b/packages/medusa/src/api/routes/admin/orders/get-reservations.ts @@ -6,19 +6,19 @@ import { extendedFindParamsMixin } from "../../../../types/common" /** * @oas [get] /admin/orders/{id}/reservations * operationId: "GetOrdersOrderReservations" - * summary: "Get reservations of an Order" - * description: "Retrieves reservations of an Order" + * summary: "Get Order Reservations" + * description: "Retrieve the list of reservations of an Order" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) offset=0 {integer} How many reservations to skip before the results. + * - (query) offset=0 {integer} The number of reservations to skip when retrieving the reservations. * - (query) limit=20 {integer} Limit the number of reservations returned. * x-codeSamples: * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/orders/{id}/reservations' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/orders/{id}/reservations' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/index.ts b/packages/medusa/src/api/routes/admin/orders/index.ts index 6045b8d0c7..2cbbf6ed0f 100644 --- a/packages/medusa/src/api/routes/admin/orders/index.ts +++ b/packages/medusa/src/api/routes/admin/orders/index.ts @@ -592,6 +592,7 @@ export default (app, featureFlagRouter: FlagRouter) => { * - order * properties: * order: + * description: "Order details." * $ref: "#/components/schemas/Order" */ export type AdminOrdersRes = { @@ -713,6 +714,7 @@ export type AdminOrdersRes = { * properties: * orders: * type: array + * description: "An array of order details." * items: * $ref: "#/components/schemas/Order" * count: @@ -720,7 +722,7 @@ export type AdminOrdersRes = { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of orders skipped when retrieving the orders. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/orders/list-orders.ts b/packages/medusa/src/api/routes/admin/orders/list-orders.ts index a1ea9b358f..5469e5cdfa 100644 --- a/packages/medusa/src/api/routes/admin/orders/list-orders.ts +++ b/packages/medusa/src/api/routes/admin/orders/list-orders.ts @@ -9,16 +9,16 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [get] /admin/orders * operationId: "GetOrders" * summary: "List Orders" - * description: "Retrieves a list of Orders" + * description: "Retrieve a list of Orders. The orders can be filtered by fields such as `status` or `display_id`. The order can also be paginated." * x-authenticated: true * parameters: - * - (query) q {string} Query used for searching orders by shipping address first name, orders' email, and orders' display ID - * - (query) id {string} ID of the order to search for. + * - (query) q {string} term to search orders' shipping address, first name, email, and display ID + * - (query) id {string} Filter by ID. * - in: query * name: status * style: form * explode: false - * description: Status to search for + * description: Filter by status * schema: * type: array * items: @@ -28,7 +28,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * name: fulfillment_status * style: form * explode: false - * description: Fulfillment status to search for. + * description: Filter by fulfillment status * schema: * type: array * items: @@ -38,21 +38,21 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * name: payment_status * style: form * explode: false - * description: Payment status to search for. + * description: Filter by payment status * schema: * type: array * items: * type: string * enum: [captured, awaiting, not_paid, refunded, partially_refunded, canceled, requires_action] - * - (query) display_id {string} Display ID to search for. - * - (query) cart_id {string} to search for. - * - (query) customer_id {string} to search for. - * - (query) email {string} to search for. + * - (query) display_id {string} Filter by display ID + * - (query) cart_id {string} Filter by cart ID + * - (query) customer_id {string} Filter by customer ID + * - (query) email {string} Filter by email * - in: query * name: region_id * style: form * explode: false - * description: Regions to search orders by + * description: Filter by region IDs. * schema: * oneOf: * - type: string @@ -65,16 +65,16 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * name: currency_code * style: form * explode: false - * description: Currency code to search for + * description: Filter by currency codes. * schema: * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. - * - (query) tax_rate {string} to search for. + * - (query) tax_rate {string} Filter by tax rate. * - in: query * name: created_at - * description: Date comparison for when resulting orders were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -96,7 +96,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting orders were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -118,7 +118,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * format: date * - in: query * name: canceled_at - * description: Date comparison for when resulting orders were canceled. + * description: Filter by a cancelation date range. * schema: * type: object * properties: @@ -142,16 +142,16 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * name: sales_channel_id * style: form * explode: false - * description: Filter by Sales Channels + * description: Filter by Sales Channel IDs * schema: * type: array * items: * type: string * description: The ID of a Sales Channel - * - (query) offset=0 {integer} How many orders to skip before the results. + * - (query) offset=0 {integer} The number of orders to skip when retrieving the orders. * - (query) limit=50 {integer} Limit the number of orders returned. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each order of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each order of the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: list * queryParams: AdminGetOrdersParams @@ -169,8 +169,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/orders' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/orders' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/process-swap-payment.ts b/packages/medusa/src/api/routes/admin/orders/process-swap-payment.ts index b3dba47355..81ffabdd88 100644 --- a/packages/medusa/src/api/routes/admin/orders/process-swap-payment.ts +++ b/packages/medusa/src/api/routes/admin/orders/process-swap-payment.ts @@ -7,14 +7,18 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [post] /admin/orders/{id}/swaps/{swap_id}/process-payment * operationId: "PostOrdersOrderSwapsSwapProcessPayment" - * summary: "Process Swap Payment" - * description: "When there are differences between the returned and shipped Products in a Swap, the difference must be processed. Either a Refund will be issued or a Payment will be captured." + * summary: "Process a Swap Payment" + * description: "Process a swap's payment either by refunding or issuing a payment. This depends on the `difference_due` of the swap. If `difference_due` is negative, the amount is refunded. + * If `difference_due` is positive, the amount is captured." * x-authenticated: true + * externalDocs: + * description: Handling a swap's payment + * url: https://docs.medusajs.com/modules/orders/swaps#handling-swap-payment * parameters: - * - (path) id=* {string} The ID of the Order. - * - (path) swap_id=* {string} The ID of the Swap. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (path) id=* {string} The ID of the order the swap is associated with. + * - (path) swap_id=* {string} The ID of the swap. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * x-codegen: * method: processSwapPayment * params: AdminPostOrdersOrderSwapsSwapProcessPaymentParams @@ -25,15 +29,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.processSwapPayment(order_id, swap_id) + * medusa.admin.orders.processSwapPayment(orderId, swapId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/orders/refund-payment.ts b/packages/medusa/src/api/routes/admin/orders/refund-payment.ts index 98a4315f34..42eca65fda 100644 --- a/packages/medusa/src/api/routes/admin/orders/refund-payment.ts +++ b/packages/medusa/src/api/routes/admin/orders/refund-payment.ts @@ -15,12 +15,12 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id}/refund * operationId: "PostOrdersOrderRefunds" * summary: "Create a Refund" - * description: "Issues a Refund." + * description: "Refund an amount for an order. The amount must be less than or equal the `refundable_amount` of the order." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -36,9 +36,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.refundPayment(order_id, { + * medusa.admin.orders.refundPayment(orderId, { * amount: 1000, - * reason: 'Do not like it' + * reason: "Do not like it" * }) * .then(({ order }) => { * console.log(order.id); @@ -46,9 +46,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/adasda/refund' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/adasda/refund' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "amount": 1000, * "reason": "Do not like it" @@ -109,7 +109,7 @@ export default async (req, res) => { * - reason * properties: * amount: - * description: The amount to refund. + * description: The amount to refund. It should be less than or equal the `refundable_amount` of the order. * type: integer * reason: * description: The reason for the Refund. @@ -118,7 +118,7 @@ export default async (req, res) => { * description: A note with additional details about the Refund. * type: string * no_notification: - * description: If set to true no notification will be send related to this Refund. + * description: If set to `true`, no notification will be sent to the customer related to this Refund. * type: boolean */ export class AdminPostOrdersOrderRefundsReq { diff --git a/packages/medusa/src/api/routes/admin/orders/request-return.ts b/packages/medusa/src/api/routes/admin/orders/request-return.ts index 5c221ebe40..ac978c3844 100644 --- a/packages/medusa/src/api/routes/admin/orders/request-return.ts +++ b/packages/medusa/src/api/routes/admin/orders/request-return.ts @@ -23,12 +23,15 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id}/return * operationId: "PostOrdersOrderReturns" * summary: "Request a Return" - * description: "Requests a Return. If applicable a return label will be created and other plugins notified." + * description: "Request and create a Return for items in an order. If the return shipping method is specified, it will be automatically fulfilled." * x-authenticated: true + * externalDocs: + * description: Return creation process + * url: https://docs.medusajs.com/modules/orders/returns#returns-process * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -44,7 +47,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.requestReturn(order_id, { + * medusa.admin.orders.requestReturn(orderId, { * items: [ * { * item_id, @@ -58,9 +61,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/return' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/return' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "items": [ * { @@ -302,7 +305,7 @@ type ReturnObj = { * - items * properties: * items: - * description: The Line Items that will be returned. + * description: The line items that will be returned. * type: array * items: * type: object @@ -340,7 +343,7 @@ type ReturnObj = { * type: boolean * default: false * no_notification: - * description: A flag to indicate if no notifications should be emitted related to the requested Return. + * description: If set to `true`, no notification will be sent to the customer related to this Return. * type: boolean * refund: * description: The amount to refund. diff --git a/packages/medusa/src/api/routes/admin/orders/update-claim.ts b/packages/medusa/src/api/routes/admin/orders/update-claim.ts index e07b01bf2d..8d7deec955 100644 --- a/packages/medusa/src/api/routes/admin/orders/update-claim.ts +++ b/packages/medusa/src/api/routes/admin/orders/update-claim.ts @@ -20,13 +20,13 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id}/claims/{claim_id} * operationId: "PostOrdersOrderClaimsClaim" * summary: "Update a Claim" - * description: "Updates a Claim." + * description: "Update a Claim's details." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Order. + * - (path) id=* {string} The ID of the Order associated with the claim. * - (path) claim_id=* {string} The ID of the Claim. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -42,7 +42,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.updateClaim(order_id, claim_id, { + * medusa.admin.orders.updateClaim(orderId, claimId, { * no_notification: true * }) * .then(({ order }) => { @@ -51,9 +51,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "no_notification": true * }' diff --git a/packages/medusa/src/api/routes/admin/orders/update-order.ts b/packages/medusa/src/api/routes/admin/orders/update-order.ts index 83db12cac3..fa263e01bc 100644 --- a/packages/medusa/src/api/routes/admin/orders/update-order.ts +++ b/packages/medusa/src/api/routes/admin/orders/update-order.ts @@ -19,12 +19,12 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /admin/orders/{id} * operationId: "PostOrdersOrder" * summary: "Update an Order" - * description: "Updates and order" + * description: "Update and order's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. - * - (query) expand {string} Comma separated list of relations to include in the result. - * - (query) fields {string} Comma separated list of fields to include in the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. + * - (query) fields {string} Comma-separated fields that should be included in the returned order. * requestBody: * content: * application/json: @@ -40,8 +40,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.orders.update(order_id, { - * email: 'user@example.com' + * medusa.admin.orders.update(orderId, { + * email: "user@example.com" * }) * .then(({ order }) => { * console.log(order.id); @@ -49,9 +49,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/orders/adasda' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/orders/adasda' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com" * }' @@ -105,39 +105,39 @@ export default async (req, res) => { * type: object * properties: * email: - * description: the email for the order + * description: the email associated with the order * type: string * billing_address: - * description: Billing address + * description: The order's billing address * $ref: "#/components/schemas/AddressPayload" * shipping_address: - * description: Shipping address + * description: The order's shipping address * $ref: "#/components/schemas/AddressPayload" * items: - * description: The Line Items for the order + * description: The line items of the order * type: array * items: * $ref: "#/components/schemas/LineItem" * region: - * description: ID of the region where the order belongs + * description: ID of the region that the order is associated with. * type: string * discounts: - * description: Discounts applied to the order + * description: The discounts applied to the order * type: array * items: * $ref: "#/components/schemas/Discount" * customer_id: - * description: ID of the customer + * description: The ID of the customer associated with the order. * type: string * payment_method: - * description: payment method chosen for the order + * description: The payment method chosen for the order. * type: object * properties: * provider_id: * type: string - * description: ID of the payment provider + * description: The ID of the payment provider. * data: - * description: Data relevant for the given payment method + * description: Any data relevant for the given payment method. * type: object * shipping_method: * description: The Shipping Method used for shipping the order. @@ -154,14 +154,14 @@ export default async (req, res) => { * description: The price of the shipping. * data: * type: object - * description: Data relevant to the specific shipping method. + * description: Any data relevant to the specific shipping method. * items: * type: array * items: * $ref: "#/components/schemas/LineItem" * description: Items to ship * no_notification: - * description: A flag to indicate if no notifications should be emitted related to the updated order. + * description: If set to `true`, no notification will be sent to the customer related to this order. * type: boolean */ export class AdminPostOrdersOrderReq { diff --git a/packages/medusa/src/api/routes/admin/payment-collections/delete-payment-collection.ts b/packages/medusa/src/api/routes/admin/payment-collections/delete-payment-collection.ts index 031c1bef0b..f55f3ad7e7 100644 --- a/packages/medusa/src/api/routes/admin/payment-collections/delete-payment-collection.ts +++ b/packages/medusa/src/api/routes/admin/payment-collections/delete-payment-collection.ts @@ -3,11 +3,11 @@ import { PaymentCollectionService } from "../../../../services" /** * @oas [delete] /admin/payment-collections/{id} * operationId: "DeletePaymentCollectionsPaymentCollection" - * summary: "Del a PaymentCollection" - * description: "Deletes a Payment Collection" + * summary: "Delete a Payment Collection" + * description: "Delete a Payment Collection. Only payment collections with the statuses `canceled` or `not_paid` can be deleted." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Payment Collection to delete. + * - (path) id=* {string} The ID of the Payment Collection. * x-codegen: * method: delete * x-codeSamples: @@ -17,15 +17,15 @@ import { PaymentCollectionService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.paymentCollections.delete(payment_collection_id) + * medusa.admin.paymentCollections.delete(paymentCollectionId) * .then(({ id, object, deleted }) => { * console.log(id) * }) * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/payment-collections/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/payment-collections/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts b/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts index 7d33acc5ef..27c5db7650 100644 --- a/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts +++ b/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts @@ -4,13 +4,13 @@ import { FindParams } from "../../../../types/common" /** * @oas [get] /admin/payment-collections/{id} * operationId: "GetPaymentCollectionsPaymentCollection" - * summary: "Get a PaymentCollection" - * description: "Retrieves a PaymentCollection." + * summary: "Get a Payment Collection" + * description: "Retrieve a Payment Collection's details." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the PaymentCollection. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (path) id=* {string} The ID of the Payment Collection. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned payment collection. + * - (query) fields {string} Comma-separated fields that should be included in the returned payment collection. * x-codegen: * method: retrieve * queryParams: AdminGetPaymentCollectionsParams @@ -28,8 +28,8 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/payment-collections/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/payment-collections/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/payment-collections/index.ts b/packages/medusa/src/api/routes/admin/payment-collections/index.ts index 6e9a4642e6..7d1adbedd7 100644 --- a/packages/medusa/src/api/routes/admin/payment-collections/index.ts +++ b/packages/medusa/src/api/routes/admin/payment-collections/index.ts @@ -78,6 +78,7 @@ export const defaulPaymentCollectionRelations = [ * - payment_collection * properties: * payment_collection: + * description: Payment Collection details. * $ref: "#/components/schemas/PaymentCollection" */ export type AdminPaymentCollectionsRes = { diff --git a/packages/medusa/src/api/routes/admin/payment-collections/mark-authorized-payment-collection.ts b/packages/medusa/src/api/routes/admin/payment-collections/mark-authorized-payment-collection.ts index ada8d17b5c..52db7b0c23 100644 --- a/packages/medusa/src/api/routes/admin/payment-collections/mark-authorized-payment-collection.ts +++ b/packages/medusa/src/api/routes/admin/payment-collections/mark-authorized-payment-collection.ts @@ -5,10 +5,10 @@ import { PaymentCollectionService } from "../../../../services" * @oas [post] /admin/payment-collections/{id}/authorize * operationId: "PostPaymentCollectionsPaymentCollectionAuthorize" * summary: "Mark Authorized" - * description: "Sets the status of PaymentCollection as Authorized." + * description: "Set the status of a Payment Collection as `authorized`. This will also change the `authorized_amount` of the payment collection." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the PaymentCollection. + * - (path) id=* {string} The ID of the Payment Collection. * x-codegen: * method: markAsAuthorized * x-codeSamples: @@ -18,15 +18,15 @@ import { PaymentCollectionService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.paymentCollections.markAsAuthorized(payment_collection_id) + * medusa.admin.paymentCollections.markAsAuthorized(paymentCollectionId) * .then(({ payment_collection }) => { * console.log(payment_collection.id) * }) * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/payment-collections/update-payment-collection.ts b/packages/medusa/src/api/routes/admin/payment-collections/update-payment-collection.ts index 9564830279..460b2f465b 100644 --- a/packages/medusa/src/api/routes/admin/payment-collections/update-payment-collection.ts +++ b/packages/medusa/src/api/routes/admin/payment-collections/update-payment-collection.ts @@ -6,11 +6,11 @@ import { PaymentCollectionService } from "../../../../services" /** * @oas [post] /admin/payment-collections/{id} * operationId: "PostPaymentCollectionsPaymentCollection" - * summary: "Update PaymentCollection" - * description: "Updates a PaymentCollection." + * summary: "Update Payment Collection" + * description: "Update a Payment Collection's details." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the PaymentCollection. + * - (path) id=* {string} The ID of the Payment Collection. * requestBody: * content: * application/json: @@ -25,8 +25,8 @@ import { PaymentCollectionService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.paymentCollections.update(payment_collection_id, { - * description: "Description of payCol" + * medusa.admin.paymentCollections.update(paymentCollectionId, { + * description * }) * .then(({ payment_collection }) => { * console.log(payment_collection.id) @@ -34,11 +34,11 @@ import { PaymentCollectionService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/payment-collections/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ - * "description": "Description of payCol" + * "description": "Description of payment collection" * }' * security: * - api_token: [] @@ -90,10 +90,10 @@ export default async (req, res) => { * type: object * properties: * description: - * description: An optional description to create or update the payment collection. + * description: A description to create or update the payment collection. * type: string * metadata: - * description: An optional set of key-value pairs to hold additional information. + * description: A set of key-value pairs to hold additional information. * type: object */ export class AdminUpdatePaymentCollectionsReq { diff --git a/packages/medusa/src/api/routes/admin/payments/capture-payment.ts b/packages/medusa/src/api/routes/admin/payments/capture-payment.ts index 9a66893498..f8362a112b 100644 --- a/packages/medusa/src/api/routes/admin/payments/capture-payment.ts +++ b/packages/medusa/src/api/routes/admin/payments/capture-payment.ts @@ -4,7 +4,7 @@ import { PaymentService } from "../../../../services" * @oas [post] /admin/payments/{id}/capture * operationId: "PostPaymentsPaymentCapture" * summary: "Capture a Payment" - * description: "Captures a Payment." + * description: "Capture a Payment." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Payment. @@ -17,15 +17,15 @@ import { PaymentService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.payments.capturePayment(payment_id) + * medusa.admin.payments.capturePayment(paymentId) * .then(({ payment }) => { * console.log(payment.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/payments/{id}/capture' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/payments/{id}/capture' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/payments/get-payment.ts b/packages/medusa/src/api/routes/admin/payments/get-payment.ts index b1484951f2..decf8fb404 100644 --- a/packages/medusa/src/api/routes/admin/payments/get-payment.ts +++ b/packages/medusa/src/api/routes/admin/payments/get-payment.ts @@ -5,7 +5,7 @@ import { FindParams } from "../../../../types/common" * @oas [get] /admin/payments/{id} * operationId: "GetPaymentsPayment" * summary: "Get Payment details" - * description: "Retrieves the Payment details" + * description: "Retrieve a Payment's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Payment. @@ -19,15 +19,15 @@ import { FindParams } from "../../../../types/common" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.payments.retrieve(payment_id) + * medusa.admin.payments.retrieve(paymentId) * .then(({ payment }) => { * console.log(payment.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/payments/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/payments/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/payments/index.ts b/packages/medusa/src/api/routes/admin/payments/index.ts index 8beb979582..8ac9ee112a 100644 --- a/packages/medusa/src/api/routes/admin/payments/index.ts +++ b/packages/medusa/src/api/routes/admin/payments/index.ts @@ -59,6 +59,7 @@ export const defaultPaymentFields = [ * - payment * properties: * payment: + * description: "Payment details" * $ref: "#/components/schemas/Payment" */ export type AdminPaymentRes = { @@ -72,6 +73,7 @@ export type AdminPaymentRes = { * - refund * properties: * refund: + * description: "Refund details" * $ref: "#/components/schemas/Refund" */ export type AdminRefundRes = { diff --git a/packages/medusa/src/api/routes/admin/payments/refund-payment.ts b/packages/medusa/src/api/routes/admin/payments/refund-payment.ts index e0d4953a1c..eb3bedec25 100644 --- a/packages/medusa/src/api/routes/admin/payments/refund-payment.ts +++ b/packages/medusa/src/api/routes/admin/payments/refund-payment.ts @@ -12,8 +12,8 @@ import { PaymentService } from "../../../../services" /** * @oas [post] /admin/payments/{id}/refund * operationId: "PostPaymentsPaymentRefunds" - * summary: "Create a Refund" - * description: "Issues a Refund." + * summary: "Refund Payment" + * description: "Refund a payment. The payment must be captured first." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Payment. @@ -31,10 +31,10 @@ import { PaymentService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.payments.refundPayment(payment_id, { + * medusa.admin.payments.refundPayment(paymentId, { * amount: 1000, - * reason: 'return', - * note: 'Do not like it', + * reason: "return", + * note: "Do not like it", * }) * .then(({ payment }) => { * console.log(payment.id); @@ -42,9 +42,9 @@ import { PaymentService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/payments/pay_123/refund' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/payments/pay_123/refund' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "amount": 1000, * "reason": "return", diff --git a/packages/medusa/src/api/routes/admin/price-lists/add-prices-batch.ts b/packages/medusa/src/api/routes/admin/price-lists/add-prices-batch.ts index 09aa1943c2..70e6d35995 100644 --- a/packages/medusa/src/api/routes/admin/price-lists/add-prices-batch.ts +++ b/packages/medusa/src/api/routes/admin/price-lists/add-prices-batch.ts @@ -11,11 +11,11 @@ import { EntityManager } from "typeorm" /** * @oas [post] /admin/price-lists/{id}/prices/batch * operationId: "PostPriceListsPriceListPricesBatch" - * summary: "Update Prices" - * description: "Batch update prices for a Price List" + * summary: "Add or Update Prices" + * description: "Add or update a list of prices in a Price List" * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Price List to update prices for. + * - (path) id=* {string} The ID of the Price List. * requestBody: * content: * application/json: @@ -30,12 +30,12 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.priceLists.addPrices(price_list_id, { + * medusa.admin.priceLists.addPrices(priceListId, { * prices: [ * { * amount: 1000, * variant_id, - * currency_code: 'eur' + * currency_code: "eur" * } * ] * }) @@ -45,9 +45,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "prices": [ * { @@ -122,10 +122,10 @@ export default async (req, res) => { * description: The ID of the price. * type: string * region_id: - * description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. + * description: The ID of the Region for which the price is used. This is only required if `currecny_code` is not provided. * type: string * currency_code: - * description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * description: The 3 character ISO currency code for which the price will be used. This is only required if `region_id` is not provided. * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes @@ -143,7 +143,7 @@ export default async (req, res) => { * description: The maximum quantity for which the price will be used. * type: integer * override: - * description: "If true the prices will replace all existing prices associated with the Price List." + * description: "If set to `true`, the prices will replace all existing prices associated with the Price List." * type: boolean */ export class AdminPostPriceListPricesPricesReq { diff --git a/packages/medusa/src/api/routes/admin/price-lists/create-price-list.ts b/packages/medusa/src/api/routes/admin/price-lists/create-price-list.ts index f3b6620bbc..c3d8639361 100644 --- a/packages/medusa/src/api/routes/admin/price-lists/create-price-list.ts +++ b/packages/medusa/src/api/routes/admin/price-lists/create-price-list.ts @@ -29,7 +29,7 @@ import { PriceList } from "../../../../models" * @oas [post] /admin/price-lists * operationId: "PostPriceListsPriceList" * summary: "Create a Price List" - * description: "Creates a Price List" + * description: "Create a Price List." * x-authenticated: true * requestBody: * content: @@ -47,14 +47,14 @@ import { PriceList } from "../../../../models" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.priceLists.create({ - * name: 'New Price List', - * description: 'A new price list', + * name: "New Price List", + * description: "A new price list", * type: PriceListType.SALE, * prices: [ * { * amount: 1000, * variant_id, - * currency_code: 'eur' + * currency_code: "eur" * } * ] * }) @@ -64,9 +64,9 @@ import { PriceList } from "../../../../models" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/price-lists' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/price-lists' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "New Price List", * "description": "A new price list", @@ -138,10 +138,10 @@ class CustomerGroup { * - prices * properties: * name: - * description: "The name of the Price List" + * description: "The name of the Price List." * type: string * description: - * description: "A description of the Price List." + * description: "The description of the Price List." * type: string * starts_at: * description: "The date with timezone that the Price List starts being valid." @@ -158,7 +158,7 @@ class CustomerGroup { * - sale * - override * status: - * description: The status of the Price List. + * description: "The status of the Price List. If the status is set to `draft`, the prices created in the price list will not be available of the customer." * type: string * enum: * - active @@ -173,10 +173,10 @@ class CustomerGroup { * - variant_id * properties: * region_id: - * description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. + * description: The ID of the Region for which the price is used. This is only required if `currecny_code` is not provided. * type: string * currency_code: - * description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * description: The 3 character ISO currency code for which the price will be used. This is only required if `region_id` is not provided. * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes @@ -195,7 +195,7 @@ class CustomerGroup { * type: integer * customer_groups: * type: array - * description: A list of customer groups that the Price List applies to. + * description: An array of customer groups that the Price List applies to. * items: * type: object * required: @@ -205,7 +205,8 @@ class CustomerGroup { * description: The ID of a customer group * type: string * includes_tax: - * description: "[EXPERIMENTAL] Tax included in prices of price list" + * description: "Tax included in prices of price list" + * x-featureFlag: "tax_inclusive_pricing" * type: boolean */ export class AdminPostPriceListsPriceListReq { diff --git a/packages/medusa/src/api/routes/admin/price-lists/delete-price-list.ts b/packages/medusa/src/api/routes/admin/price-lists/delete-price-list.ts index 8ff41e3462..d8d397f234 100644 --- a/packages/medusa/src/api/routes/admin/price-lists/delete-price-list.ts +++ b/packages/medusa/src/api/routes/admin/price-lists/delete-price-list.ts @@ -5,10 +5,10 @@ import PriceListService from "../../../../services/price-list" * @oas [delete] /admin/price-lists/{id} * operationId: "DeletePriceListsPriceList" * summary: "Delete a Price List" - * description: "Deletes a Price List" + * description: "Delete a Price List and its associated prices." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Price List to delete. + * - (path) id=* {string} The ID of the Price List. * x-codegen: * method: delete * x-codeSamples: @@ -18,15 +18,15 @@ import PriceListService from "../../../../services/price-list" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.priceLists.delete(price_list_id) + * medusa.admin.priceLists.delete(priceListId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/price-lists/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/price-lists/delete-prices-batch.ts b/packages/medusa/src/api/routes/admin/price-lists/delete-prices-batch.ts index 09fd751d95..fa29db08a4 100644 --- a/packages/medusa/src/api/routes/admin/price-lists/delete-prices-batch.ts +++ b/packages/medusa/src/api/routes/admin/price-lists/delete-prices-batch.ts @@ -8,10 +8,10 @@ import { validator } from "../../../../utils/validator" * @oas [delete] /admin/price-lists/{id}/prices/batch * operationId: "DeletePriceListsPriceListPricesBatch" * summary: "Delete Prices" - * description: "Batch delete prices that belong to a Price List" + * description: "Delete a list of prices in a Price List" * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Price List that the Money Amounts (Prices) that will be deleted belongs to. + * - (path) id=* {string} The ID of the Price List * requestBody: * content: * application/json: @@ -26,7 +26,7 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.priceLists.deletePrices(price_list_id, { + * medusa.admin.priceLists.deletePrices(priceListId, { * price_ids: [ * price_id * ] @@ -37,9 +37,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "price_ids": [ * "adasfa" @@ -96,7 +96,7 @@ export default async (req, res) => { * type: object * properties: * price_ids: - * description: The price id's of the Money Amounts to delete. + * description: The price IDs of the Money Amounts to delete. * type: array * items: * type: string diff --git a/packages/medusa/src/api/routes/admin/price-lists/delete-product-prices.ts b/packages/medusa/src/api/routes/admin/price-lists/delete-product-prices.ts index 34809093f2..31e5ee6d29 100644 --- a/packages/medusa/src/api/routes/admin/price-lists/delete-product-prices.ts +++ b/packages/medusa/src/api/routes/admin/price-lists/delete-product-prices.ts @@ -4,12 +4,12 @@ import PriceListService from "../../../../services/price-list" /** * @oas [delete] /admin/price-lists/{id}/products/{product_id}/prices * operationId: "DeletePriceListsPriceListProductsProductPrices" - * summary: "Delete Product's Prices" - * description: "Delete all the prices related to a specific product in a price list" + * summary: "Delete a Product's Prices" + * description: "Delete all the prices related to a specific product in a price list." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Price List that the Money Amounts that will be deleted belongs to. - * - (path) product_id=* {string} The ID of the product from which the money amount will be deleted. + * - (path) id=* {string} The ID of the Price List. + * - (path) product_id=* {string} The ID of the product from which the prices will be deleted. * x-codegen: * method: deleteProductPrices * x-codeSamples: @@ -19,15 +19,15 @@ import PriceListService from "../../../../services/price-list" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.priceLists.deleteProductPrices(price_list_id, product_id) + * medusa.admin.priceLists.deleteProductPrices(priceListId, productId) * .then(({ ids, object, deleted }) => { * console.log(ids.length); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/price-lists/delete-variant-prices.ts b/packages/medusa/src/api/routes/admin/price-lists/delete-variant-prices.ts index f61763b654..f343657c2a 100644 --- a/packages/medusa/src/api/routes/admin/price-lists/delete-variant-prices.ts +++ b/packages/medusa/src/api/routes/admin/price-lists/delete-variant-prices.ts @@ -4,12 +4,12 @@ import PriceListService from "../../../../services/price-list" /** * @oas [delete] /admin/price-lists/{id}/variants/{variant_id}/prices * operationId: "DeletePriceListsPriceListVariantsVariantPrices" - * summary: "Delete Variant's Prices" + * summary: "Delete a Variant's Prices" * description: "Delete all the prices related to a specific variant in a price list" * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Price List that the Money Amounts that will be deleted belongs to. - * - (path) variant_id=* {string} The ID of the variant from which the money amount will be deleted. + * - (path) id=* {string} The ID of the Price List. + * - (path) variant_id=* {string} The ID of the variant. * x-codegen: * method: deleteVariantPrices * x-codeSamples: @@ -19,15 +19,15 @@ import PriceListService from "../../../../services/price-list" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.priceLists.deleteVariantPrices(price_list_id, variant_id) + * medusa.admin.priceLists.deleteVariantPrices(priceListId, variantId) * .then(({ ids, object, deleted }) => { * console.log(ids); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/price-lists/get-price-list.ts b/packages/medusa/src/api/routes/admin/price-lists/get-price-list.ts index 50d1c03515..a059eea4aa 100644 --- a/packages/medusa/src/api/routes/admin/price-lists/get-price-list.ts +++ b/packages/medusa/src/api/routes/admin/price-lists/get-price-list.ts @@ -7,7 +7,7 @@ import PriceListService from "../../../../services/price-list" * @oas [get] /admin/price-lists/{id} * operationId: "GetPriceListsPriceList" * summary: "Get a Price List" - * description: "Retrieves a Price List." + * description: "Retrieve a Price List's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Price List. @@ -20,15 +20,15 @@ import PriceListService from "../../../../services/price-list" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.priceLists.retrieve(price_list_id) + * medusa.admin.priceLists.retrieve(priceListId) * .then(({ price_list }) => { * console.log(price_list.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/price-lists/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/price-lists/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/price-lists/index.ts b/packages/medusa/src/api/routes/admin/price-lists/index.ts index 6805fa3edf..8f107cc408 100644 --- a/packages/medusa/src/api/routes/admin/price-lists/index.ts +++ b/packages/medusa/src/api/routes/admin/price-lists/index.ts @@ -105,6 +105,7 @@ export const defaultAdminPriceListRelations = ["prices", "customer_groups"] * - price_list * properties: * price_list: + * description: "Price List details." * $ref: "#/components/schemas/PriceList" */ export type AdminPriceListRes = { @@ -123,10 +124,10 @@ export type AdminPriceListRes = { * type: array * items: * type: string - * description: The IDs of the deleted Money Amounts (Prices). + * description: The IDs of the deleted prices. * object: * type: string - * description: The type of the object that was deleted. + * description: The type of the object that was deleted. A price is also named `money-amount`. * default: money-amount * deleted: * type: boolean @@ -149,12 +150,12 @@ export type AdminPriceListDeleteBatchRes = { * properties: * ids: * type: array - * description: The price ids that have been deleted. + * description: The IDs of the deleted prices. * items: * type: string * object: * type: string - * description: The type of the object that was deleted. + * description: The type of the object that was deleted. A price is also named `money-amount`. * default: money-amount * deleted: * type: boolean @@ -173,12 +174,12 @@ export type AdminPriceListDeleteProductPricesRes = AdminPriceListDeleteBatchRes * properties: * ids: * type: array - * description: The price ids that have been deleted. + * description: The IDs of the deleted prices. * items: * type: string * object: * type: string - * description: The type of the object that was deleted. + * description: The type of the object that was deleted. A price is also named `money-amount`. * default: money-amount * deleted: * type: boolean @@ -220,6 +221,7 @@ export type AdminPriceListDeleteRes = DeleteResponse * properties: * price_lists: * type: array + * description: "An array of price lists details." * items: * $ref: "#/components/schemas/PriceList" * count: @@ -227,7 +229,7 @@ export type AdminPriceListDeleteRes = DeleteResponse * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of price lists skipped when retrieving the price lists. * limit: * type: integer * description: The number of items per page @@ -258,6 +260,7 @@ export type AdminPriceListsListRes = PaginatedResponse & { * properties: * products: * type: array + * description: "An array of products details." * items: * $ref: "#/components/schemas/Product" * count: @@ -265,7 +268,7 @@ export type AdminPriceListsListRes = PaginatedResponse & { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of price lists skipped when retrieving the price lists. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/price-lists/list-price-list-products.ts b/packages/medusa/src/api/routes/admin/price-lists/list-price-list-products.ts index 1349629fba..5e5b7e70ac 100644 --- a/packages/medusa/src/api/routes/admin/price-lists/list-price-list-products.ts +++ b/packages/medusa/src/api/routes/admin/price-lists/list-price-list-products.ts @@ -23,15 +23,15 @@ import { isDefined } from "medusa-core-utils" * @oas [get] /admin/price-lists/{id}/products * operationId: "GetPriceListsPriceListProducts" * summary: "List Products" - * description: "Retrieves a list of Product that are part of a Price List" + * description: "Retrieve a price list's products. The products can be filtered by fields such as `q` or `status`. The products can also be sorted or paginated." * x-authenticated: true * parameters: * - (path) id=* {string} ID of the price list. - * - (query) q {string} Query used for searching product title and description, variant title and sku, and collection title. - * - (query) id {string} ID of the product to search for. + * - (query) q {string} term used to search products' title, description, product variant's title and sku, and product collection's title. + * - (query) id {string} Filter by product ID * - in: query * name: status - * description: Product status to search for + * description: Filter by product status * style: form * explode: false * schema: @@ -41,7 +41,7 @@ import { isDefined } from "medusa-core-utils" * enum: [draft, proposed, published, rejected] * - in: query * name: collection_id - * description: Collection IDs to search for + * description: Filter by product collection ID. Only products in the specified collections are retrieved. * style: form * explode: false * schema: @@ -50,22 +50,22 @@ import { isDefined } from "medusa-core-utils" * type: string * - in: query * name: tags - * description: Tag IDs to search for + * description: Filter by tag IDs. Only products having the specified tags are retrieved. * style: form * explode: false * schema: * type: array * items: * type: string - * - (query) title {string} product title to search for. - * - (query) description {string} product description to search for. - * - (query) handle {string} product handle to search for. - * - (query) is_giftcard {string} Search for giftcards using is_giftcard=true. - * - (query) type {string} to search for. - * - (query) order {string} field to sort results by. + * - (query) title {string} Filter by title + * - (query) description {string} Filter by description + * - (query) handle {string} Filter by handle + * - (query) is_giftcard {string} A boolean value to filter by whether the product is a gift card or not. + * - (query) type {string} Filter product type. + * - (query) order {string} A product field to sort-order the retrieved products by. * - in: query * name: created_at - * description: Date comparison for when resulting products were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -87,7 +87,7 @@ import { isDefined } from "medusa-core-utils" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting products were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -109,7 +109,7 @@ import { isDefined } from "medusa-core-utils" * format: date * - in: query * name: deleted_at - * description: Date comparison for when resulting products were deleted. + * description: Filter by a deletion date range. * schema: * type: object * properties: @@ -129,10 +129,10 @@ import { isDefined } from "medusa-core-utils" * type: string * description: filter by dates greater than or equal to this date * format: date - * - (query) offset=0 {integer} How many products to skip in the result. + * - (query) offset=0 {integer} The number of products to skip when retrieving the products. * - (query) limit=50 {integer} Limit the number of products returned. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each product of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each product of the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned products. + * - (query) fields {string} Comma-separated fields that should be included in the returned products. * x-codegen: * method: listProducts * queryParams: AdminGetPriceListsPriceListProductsParams @@ -143,15 +143,15 @@ import { isDefined } from "medusa-core-utils" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.priceLists.listProducts(price_list_id) + * medusa.admin.priceLists.listProducts(priceListId) * .then(({ products, limit, offset, count }) => { * console.log(products.length); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/price-lists/{id}/products' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/price-lists/{id}/products' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/price-lists/list-price-lists.ts b/packages/medusa/src/api/routes/admin/price-lists/list-price-lists.ts index f901ab692a..9c20150604 100644 --- a/packages/medusa/src/api/routes/admin/price-lists/list-price-lists.ts +++ b/packages/medusa/src/api/routes/admin/price-lists/list-price-lists.ts @@ -9,31 +9,32 @@ import { Type } from "class-transformer" * @oas [get] /admin/price-lists * operationId: "GetPriceLists" * summary: "List Price Lists" - * description: "Retrieves a list of Price Lists." + * description: "Retrieve a list of price lists. The price lists can be filtered by fields such as `q` or `status`. The price lists can also be sorted or paginated." * x-authenticated: true * parameters: - * - (query) limit=10 {number} The number of items to get - * - (query) offset=0 {number} The offset at which to get items - * - (query) expand {string} (Comma separated) Which fields should be expanded in each item of the result. - * - (query) order {string} field to order results by. - * - (query) id {string} ID to search for. - * - (query) q {string} query to search in price list description, price list name, and customer group name fields. + * - (query) limit=10 {number} Limit the number of price lists returned. + * - (query) offset=0 {number} The number of price lists to skip when retrieving the price lists. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned price lists. + * - (query) fields {string} Comma-separated fields that should be included in the returned price lists. + * - (query) order {string} A price-list field to sort-order the retrieved price lists by. + * - (query) id {string} Filter by ID + * - (query) q {string} term to search price lists' description, name, and customer group's name. * - in: query * name: status * style: form * explode: false - * description: Status to search for. + * description: Filter by status. * schema: * type: array * items: * type: string * enum: [active, draft] - * - (query) name {string} price list name to search for. + * - (query) name {string} Filter by name * - in: query * name: customer_groups * style: form * explode: false - * description: Customer Group IDs to search for. + * description: Filter by customer-group IDs. * schema: * type: array * items: @@ -42,7 +43,7 @@ import { Type } from "class-transformer" * name: type * style: form * explode: false - * description: Type to search for. + * description: Filter by type. * schema: * type: array * items: @@ -50,7 +51,7 @@ import { Type } from "class-transformer" * enum: [sale, override] * - in: query * name: created_at - * description: Date comparison for when resulting price lists were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -72,7 +73,7 @@ import { Type } from "class-transformer" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting price lists were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -94,7 +95,7 @@ import { Type } from "class-transformer" * format: date * - in: query * name: deleted_at - * description: Date comparison for when resulting price lists were deleted. + * description: Filter by a deletion date range. * schema: * type: object * properties: @@ -131,8 +132,8 @@ import { Type } from "class-transformer" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/price-lists' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/price-lists' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/price-lists/update-price-list.ts b/packages/medusa/src/api/routes/admin/price-lists/update-price-list.ts index 2bc8ff78cf..cb143f0820 100644 --- a/packages/medusa/src/api/routes/admin/price-lists/update-price-list.ts +++ b/packages/medusa/src/api/routes/admin/price-lists/update-price-list.ts @@ -25,7 +25,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/price-lists/{id} * operationId: "PostPriceListsPriceListPriceList" * summary: "Update a Price List" - * description: "Updates a Price List" + * description: "Update a Price List's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Price List. @@ -43,8 +43,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.priceLists.update(price_list_id, { - * name: 'New Price List' + * medusa.admin.priceLists.update(priceListId, { + * name: "New Price List" * }) * .then(({ price_list }) => { * console.log(price_list.id); @@ -52,9 +52,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/price-lists/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/price-lists/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "New Price List" * }' @@ -122,7 +122,7 @@ class CustomerGroup { * description: "The name of the Price List" * type: string * description: - * description: "A description of the Price List." + * description: "The description of the Price List." * type: string * starts_at: * description: "The date with timezone that the Price List starts being valid." @@ -139,7 +139,7 @@ class CustomerGroup { * - sale * - override * status: - * description: The status of the Price List. + * description: "The status of the Price List. If the status is set to `draft`, the prices created in the price list will not be available of the customer." * type: string * enum: * - active @@ -157,10 +157,10 @@ class CustomerGroup { * description: The ID of the price. * type: string * region_id: - * description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. + * description: The ID of the Region for which the price is used. This is only required if `currecny_code` is not provided. * type: string * currency_code: - * description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * description: The 3 character ISO currency code for which the price will be used. This is only required if `region_id` is not provided. * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes @@ -179,7 +179,7 @@ class CustomerGroup { * type: integer * customer_groups: * type: array - * description: A list of customer groups that the Price List applies to. + * description: An array of customer groups that the Price List applies to. * items: * type: object * required: @@ -189,7 +189,8 @@ class CustomerGroup { * description: The ID of a customer group * type: string * includes_tax: - * description: "[EXPERIMENTAL] Tax included in prices of price list" + * description: "Tax included in prices of price list" + * x-featureFlag: "tax_inclusive_pricing" * type: boolean */ export class AdminPostPriceListsPriceListPriceListReq { diff --git a/packages/medusa/src/api/routes/admin/product-categories/add-products-batch.ts b/packages/medusa/src/api/routes/admin/product-categories/add-products-batch.ts index cfd21e4ced..819879b09e 100644 --- a/packages/medusa/src/api/routes/admin/product-categories/add-products-batch.ts +++ b/packages/medusa/src/api/routes/admin/product-categories/add-products-batch.ts @@ -11,12 +11,13 @@ import { FindParams } from "../../../../types/common" * @oas [post] /admin/product-categories/{id}/products/batch * operationId: "PostProductCategoriesCategoryProductsBatch" * summary: "Add Products to a Category" - * description: "Assign a batch of products to a product category." + * description: "Add a list of products to a product category." * x-authenticated: true + * x-featureFlag: "product_categories" * parameters: * - (path) id=* {string} The ID of the Product Category. - * - (query) expand {string} (Comma separated) Category fields to be expanded in the response. - * - (query) fields {string} (Comma separated) Category fields to be retrieved in the response. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned product category. + * - (query) fields {string} Comma-separated fields that should be included in the returned product category. * requestBody: * content: * application/json: @@ -45,10 +46,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location \ - * --request POST 'https://medusa-url.com/admin/product-categories/{id}/products/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/product-categories/{id}/products/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "product_ids": [ * { diff --git a/packages/medusa/src/api/routes/admin/product-categories/create-product-category.ts b/packages/medusa/src/api/routes/admin/product-categories/create-product-category.ts index 0b7d848cad..29ef4e67dc 100644 --- a/packages/medusa/src/api/routes/admin/product-categories/create-product-category.ts +++ b/packages/medusa/src/api/routes/admin/product-categories/create-product-category.ts @@ -10,11 +10,12 @@ import { FindParams } from "../../../../types/common" * @oas [post] /admin/product-categories * operationId: "PostProductCategories" * summary: "Create a Product Category" - * description: "Creates a Product Category." + * description: "Create a Product Category." * x-authenticated: true + * x-featureFlag: "product_categories" * parameters: - * - (query) expand {string} (Comma separated) Which fields should be expanded in the results. - * - (query) fields {string} (Comma separated) Which fields should be retrieved in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned product category. + * - (query) fields {string} Comma-separated fields that should be included in the returned product category. * requestBody: * content: * application/json: @@ -39,9 +40,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/product-categories' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/product-categories' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "Skinny Jeans" * }' @@ -102,19 +103,19 @@ export default async (req: Request, res: Response) => { * properties: * name: * type: string - * description: The name to identify the Product Category by. + * description: The name of the product category * description: * type: string - * description: An optional text field to describe the Product Category by. + * description: The description of the product category. * handle: * type: string - * description: An optional handle to be used in slugs, if none is provided we will kebab-case the title. + * description: The handle of the product category. If none is provided, the kebab-case version of the name will be used. This field can be used as a slug in URLs. * is_internal: * type: boolean - * description: A flag to make product category an internal category for admins + * description: If set to `true`, the product category will only be available to admins. * is_active: * type: boolean - * description: A flag to make product category visible/hidden in the store front + * description: If set to `false`, the product category will not be available in the storefront. * parent_category_id: * type: string * description: The ID of the parent product category diff --git a/packages/medusa/src/api/routes/admin/product-categories/delete-product-category.ts b/packages/medusa/src/api/routes/admin/product-categories/delete-product-category.ts index b3d2191266..55c7b046c7 100644 --- a/packages/medusa/src/api/routes/admin/product-categories/delete-product-category.ts +++ b/packages/medusa/src/api/routes/admin/product-categories/delete-product-category.ts @@ -7,8 +7,9 @@ import { ProductCategoryService } from "../../../../services" * @oas [delete] /admin/product-categories/{id} * operationId: "DeleteProductCategoriesCategory" * summary: "Delete a Product Category" - * description: "Deletes a Product Category." + * description: "Delete a Product Category. This does not delete associated products." * x-authenticated: true + * x-featureFlag: "product_categories" * parameters: * - (path) id=* {string} The ID of the Product Category * x-codegen: @@ -27,8 +28,8 @@ import { ProductCategoryService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/product-categories/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/product-categories/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/product-categories/delete-products-batch.ts b/packages/medusa/src/api/routes/admin/product-categories/delete-products-batch.ts index 45cb3765b3..996cd0d6b2 100644 --- a/packages/medusa/src/api/routes/admin/product-categories/delete-products-batch.ts +++ b/packages/medusa/src/api/routes/admin/product-categories/delete-products-batch.ts @@ -13,10 +13,11 @@ import { FindParams } from "../../../../types/common" * summary: "Remove Products from Category" * description: "Remove a list of products from a product category." * x-authenticated: true + * x-featureFlag: "product_categories" * parameters: * - (path) id=* {string} The ID of the Product Category. - * - (query) expand {string} (Comma separated) Category fields to be expanded in the response. - * - (query) fields {string} (Comma separated) Category fields to be retrieved in the response. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned product category. + * - (query) fields {string} Comma-separated fields that should be included in the returned product category. * requestBody: * content: * application/json: @@ -45,9 +46,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/product-categories/{id}/products/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/product-categories/{id}/products/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "product_ids": [ * { diff --git a/packages/medusa/src/api/routes/admin/product-categories/get-product-category.ts b/packages/medusa/src/api/routes/admin/product-categories/get-product-category.ts index 28ea56824c..5285685815 100644 --- a/packages/medusa/src/api/routes/admin/product-categories/get-product-category.ts +++ b/packages/medusa/src/api/routes/admin/product-categories/get-product-category.ts @@ -8,12 +8,13 @@ import { defaultAdminProductCategoryRelations } from "." * @oas [get] /admin/product-categories/{id} * operationId: "GetProductCategoriesCategory" * summary: "Get a Product Category" - * description: "Retrieves a Product Category." + * description: "Retrieve a Product Category's details." * x-authenticated: true + * x-featureFlag: "product_categories" * parameters: * - (path) id=* {string} The ID of the Product Category - * - (query) expand {string} (Comma separated) Which fields should be expanded in the results. - * - (query) fields {string} (Comma separated) Which fields should be included in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned product category. + * - (query) fields {string} Comma-separated fields that should be included in the returned product category. * x-codegen: * method: retrieve * queryParams: AdminGetProductCategoryParams @@ -31,8 +32,8 @@ import { defaultAdminProductCategoryRelations } from "." * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/product-categories/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/product-categories/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/product-categories/index.ts b/packages/medusa/src/api/routes/admin/product-categories/index.ts index a2d210d8dd..2f4a362f57 100644 --- a/packages/medusa/src/api/routes/admin/product-categories/index.ts +++ b/packages/medusa/src/api/routes/admin/product-categories/index.ts @@ -163,6 +163,7 @@ export const defaultProductCategoryFields = [ * - product_category * properties: * product_category: + * description: "Product category details." * $ref: "#/components/schemas/ProductCategory" */ export type AdminProductCategoriesCategoryRes = { @@ -207,6 +208,7 @@ export type AdminProductCategoriesCategoryDeleteRes = DeleteResponse * properties: * product_categories: * type: array + * description: "An array of product category details." * items: * $ref: "#/components/schemas/ProductCategory" * count: @@ -214,7 +216,7 @@ export type AdminProductCategoriesCategoryDeleteRes = DeleteResponse * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of product categories skipped when retrieving the product categories. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/product-categories/list-product-categories.ts b/packages/medusa/src/api/routes/admin/product-categories/list-product-categories.ts index 7bfbcf5356..d695b09ca6 100644 --- a/packages/medusa/src/api/routes/admin/product-categories/list-product-categories.ts +++ b/packages/medusa/src/api/routes/admin/product-categories/list-product-categories.ts @@ -10,19 +10,20 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * @oas [get] /admin/product-categories * operationId: "GetProductCategories" * summary: "List Product Categories" - * description: "Retrieve a list of product categories." + * description: "Retrieve a list of product categories. The product categories can be filtered by fields such as `q` or `handle`. The product categories can also be paginated." * x-authenticated: true + * x-featureFlag: "product_categories" * parameters: - * - (query) q {string} Query used for searching product category names or handles. - * - (query) handle {string} Query used for searching product category by handle. - * - (query) is_internal {boolean} Search for only internal categories. - * - (query) is_active {boolean} Search for only active categories - * - (query) include_descendants_tree {boolean} Include all nested descendants of category - * - (query) parent_category_id {string} Returns categories scoped by parent - * - (query) offset=0 {integer} How many product categories to skip in the result. + * - (query) q {string} term to search product categories' names and handles. + * - (query) handle {string} Filter by handle. + * - (query) is_internal {boolean} Filter by whether the category is internal or not. + * - (query) is_active {boolean} Filter by whether the category is active or not. + * - (query) include_descendants_tree {boolean} If set to `true`, all nested descendants of a category are included in the response. + * - (query) parent_category_id {string} Filter by the ID of a parent category. + * - (query) offset=0 {integer} The number of product categories to skip when retrieving the product categories. * - (query) limit=100 {integer} Limit the number of product categories returned. - * - (query) expand {string} (Comma separated) Which fields should be expanded in the product category. - * - (query) fields {string} (Comma separated) Which fields should be included in the product category. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned product categories. + * - (query) fields {string} Comma-separated fields that should be included in the returned product categories. * x-codegen: * method: list * queryParams: AdminGetProductCategoriesParams @@ -40,8 +41,8 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/product-categories' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/product-categories' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/product-categories/update-product-category.ts b/packages/medusa/src/api/routes/admin/product-categories/update-product-category.ts index 8ac549cc46..acf96d6328 100644 --- a/packages/medusa/src/api/routes/admin/product-categories/update-product-category.ts +++ b/packages/medusa/src/api/routes/admin/product-categories/update-product-category.ts @@ -12,6 +12,7 @@ import { FindParams } from "../../../../types/common" * summary: "Update a Product Category" * description: "Updates a Product Category." * x-authenticated: true + * x-featureFlag: "product_categories" * parameters: * - (path) id=* {string} The ID of the Product Category. * - (query) expand {string} (Comma separated) Which fields should be expanded in each product category. @@ -40,9 +41,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/product-categories/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/product-categories/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "Skinny Jeans" * }' diff --git a/packages/medusa/src/api/routes/admin/product-tags/index.ts b/packages/medusa/src/api/routes/admin/product-tags/index.ts index 795fb93642..45538d5a50 100644 --- a/packages/medusa/src/api/routes/admin/product-tags/index.ts +++ b/packages/medusa/src/api/routes/admin/product-tags/index.ts @@ -42,6 +42,7 @@ export const defaultAdminProductTagsRelations = [] * properties: * product_tags: * type: array + * description: "An array of product tag details." * items: * $ref: "#/components/schemas/ProductTag" * count: @@ -49,7 +50,7 @@ export const defaultAdminProductTagsRelations = [] * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of product tags skipped when retrieving the product tags. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/product-tags/list-product-tags.ts b/packages/medusa/src/api/routes/admin/product-tags/list-product-tags.ts index 8532f51501..0b22486ff8 100644 --- a/packages/medusa/src/api/routes/admin/product-tags/list-product-tags.ts +++ b/packages/medusa/src/api/routes/admin/product-tags/list-product-tags.ts @@ -13,35 +13,35 @@ import { Request, Response } from "express" * @oas [get] /admin/product-tags * operationId: "GetProductTags" * summary: "List Product Tags" - * description: "Retrieve a list of Product Tags." + * description: "Retrieve a list of product tags. The product tags can be filtered by fields such as `q` or `value`. The product tags can also be sorted or paginated." * x-authenticated: true * parameters: - * - (query) limit=10 {integer} The number of tags to return. - * - (query) offset=0 {integer} The number of items to skip before the results. - * - (query) order {string} The field to sort items by. - * - (query) discount_condition_id {string} The discount condition id on which to filter the tags. + * - (query) limit=10 {integer} Limit the number of product tags returned. + * - (query) offset=0 {integer} The number of product tags to skip when retrieving the product tags. + * - (query) order {string} A product tag field to sort-order the retrieved product tags by. + * - (query) discount_condition_id {string} Filter by the ID of a discount condition. Only product tags that this discount condition is applied to will be retrieved. * - in: query * name: value * style: form * explode: false - * description: The tag values to search for + * description: Filter by tag value. * schema: * type: array * items: * type: string - * - (query) q {string} A query string to search values for + * - (query) q {string} term to search product tags' values. * - in: query * name: id * style: form * explode: false - * description: The tag IDs to search for + * description: Filter by tag IDs. * schema: * type: array * items: * type: string * - in: query * name: created_at - * description: Date comparison for when resulting product tags were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -63,7 +63,7 @@ import { Request, Response } from "express" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting product tags were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -100,8 +100,8 @@ import { Request, Response } from "express" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/product-tags' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/product-tags' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/product-types/index.ts b/packages/medusa/src/api/routes/admin/product-types/index.ts index 57efbf1936..988297e16a 100644 --- a/packages/medusa/src/api/routes/admin/product-types/index.ts +++ b/packages/medusa/src/api/routes/admin/product-types/index.ts @@ -42,6 +42,7 @@ export const defaultAdminProductTypeRelations = [] * properties: * product_types: * type: array + * description: An array of product types details. * items: * $ref: "#/components/schemas/ProductType" * count: @@ -49,7 +50,7 @@ export const defaultAdminProductTypeRelations = [] * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of product types skipped when retrieving the product types. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/product-types/list-product-types.ts b/packages/medusa/src/api/routes/admin/product-types/list-product-types.ts index 68998786e4..feff87b564 100644 --- a/packages/medusa/src/api/routes/admin/product-types/list-product-types.ts +++ b/packages/medusa/src/api/routes/admin/product-types/list-product-types.ts @@ -12,18 +12,18 @@ import ProductTypeService from "../../../../services/product-type" * @oas [get] /admin/product-types * operationId: "GetProductTypes" * summary: "List Product Types" - * description: "Retrieve a list of Product Types." + * description: "Retrieve a list of product types. The product types can be filtered by fields such as `q` or `value`. The product types can also be sorted or paginated." * x-authenticated: true * parameters: - * - (query) limit=20 {integer} The number of types to return. - * - (query) offset=0 {integer} The number of items to skip before the results. - * - (query) order {string} The field to sort items by. - * - (query) discount_condition_id {string} The discount condition id on which to filter the product types. + * - (query) limit=20 {integer} Limit the number of product types returned. + * - (query) offset=0 {integer} The number of product types to skip when retrieving the product types. + * - (query) order {string} A product type field to sort-order the retrieved product types by. + * - (query) discount_condition_id {string} Filter by the ID of a discount condition. Only product types that this discount condition is applied to will be retrieved. * - in: query * name: value * style: form * explode: false - * description: The type values to search for + * description: Filter by value. * schema: * type: array * items: @@ -32,15 +32,15 @@ import ProductTypeService from "../../../../services/product-type" * name: id * style: form * explode: false - * description: The type IDs to search for + * description: Filter by product type IDs. * schema: * type: array * items: * type: string - * - (query) q {string} A query string to search values for + * - (query) q {string} term to search product types' values. * - in: query * name: created_at - * description: Date comparison for when resulting product types were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -62,7 +62,7 @@ import ProductTypeService from "../../../../services/product-type" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting product types were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -99,8 +99,8 @@ import ProductTypeService from "../../../../services/product-type" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/product-types' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/product-types' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/products/add-option.ts b/packages/medusa/src/api/routes/admin/products/add-option.ts index 1fe1ed2b30..1b816f3d3c 100644 --- a/packages/medusa/src/api/routes/admin/products/add-option.ts +++ b/packages/medusa/src/api/routes/admin/products/add-option.ts @@ -9,8 +9,8 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/products/{id}/options * operationId: "PostProductsProductOptions" * summary: "Add a Product Option" + * description: "Add a Product Option to a Product." * x-authenticated: true - * description: "Adds a Product Option to a Product" * parameters: * - (path) id=* {string} The ID of the Product. * requestBody: @@ -27,8 +27,8 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.products.addOption(product_id, { - * title: 'Size' + * medusa.admin.products.addOption(productId, { + * title: "Size" * }) * .then(({ product }) => { * console.log(product.id); @@ -36,9 +36,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/products/{id}/options' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/products/{id}/options' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "title": "Size" * }' @@ -102,8 +102,9 @@ export default async (req, res) => { * - title * properties: * title: - * description: "The title the Product Option will be identified by i.e. \"Size\"" + * description: "The title the Product Option." * type: string + * example: "Size" */ export class AdminPostProductsProductOptionsReq { @IsString() diff --git a/packages/medusa/src/api/routes/admin/products/create-product.ts b/packages/medusa/src/api/routes/admin/products/create-product.ts index 73c8209db3..a7f2fddc18 100644 --- a/packages/medusa/src/api/routes/admin/products/create-product.ts +++ b/packages/medusa/src/api/routes/admin/products/create-product.ts @@ -49,7 +49,7 @@ import { validator } from "../../../../utils/validator" * operationId: "PostProducts" * summary: "Create a Product" * x-authenticated: true - * description: "Creates a Product" + * description: "Create a new Product. This endpoint can also be used to create a gift card if the `is_giftcard` field is set to `true`." * requestBody: * content: * application/json: @@ -65,7 +65,7 @@ import { validator } from "../../../../utils/validator" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.products.create({ - * title: 'Shirt', + * title: "Shirt", * is_giftcard: false, * discountable: true * }) @@ -75,9 +75,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/products' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/products' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "title": "Shirt" * }' @@ -352,29 +352,29 @@ class ProductVariantReq { * description: "The subtitle of the Product" * type: string * description: - * description: "A description of the Product." + * description: "The description of the Product." * type: string * is_giftcard: * description: A flag to indicate if the Product represents a Gift Card. Purchasing Products with this flag set to `true` will result in a Gift Card being created. * type: boolean * default: false * discountable: - * description: A flag to indicate if discounts can be applied to the LineItems generated from this Product + * description: A flag to indicate if discounts can be applied to the Line Items generated from this Product * type: boolean * default: true * images: - * description: Images of the Product. + * description: An array of images of the Product. Each value in the array is a URL to the image. You can use the upload endpoints to upload the image and obtain a URL. * type: array * items: * type: string * thumbnail: - * description: The thumbnail to use for the Product. + * description: The thumbnail to use for the Product. The value is a URL to the thumbnail. You can use the upload endpoints to upload the thumbnail and obtain a URL. * type: string * handle: - * description: A unique handle to identify the Product by. + * description: A unique handle to identify the Product by. If not provided, the kebab-case version of the product title will be used. This can be used as a slug in URLs. * type: string * status: - * description: The status of the product. + * description: The status of the product. The product is shown to the customer only if its status is `published`. * type: string * enum: [draft, proposed, published, rejected] * default: draft @@ -385,16 +385,16 @@ class ProductVariantReq { * - value * properties: * id: - * description: The ID of the Product Type. + * description: The ID of an existing Product Type. If not provided, a new product type will be created. * type: string * value: * description: The value of the Product Type. * type: string * collection_id: - * description: The ID of the Collection the Product should belong to. + * description: The ID of the Product Collection the Product belongs to. * type: string * tags: - * description: Tags to associate the Product with. + * description: Product Tags to associate the Product with. * type: array * items: * type: object @@ -402,13 +402,13 @@ class ProductVariantReq { * - value * properties: * id: - * description: The ID of an existing Tag. + * description: The ID of an existing Product Tag. If not provided, a new product tag will be created. * type: string * value: - * description: The value of the Tag, these will be upserted. + * description: The value of the Tag. If the `id` is provided, the value of the existing tag will be updated. * type: string * sales_channels: - * description: "[EXPERIMENTAL] Sales channels to associate the Product with." + * description: "Sales channels to associate the Product with." * type: array * items: * type: object @@ -419,7 +419,8 @@ class ProductVariantReq { * description: The ID of an existing Sales channel. * type: string * categories: - * description: "Categories to add the Product to." + * description: "Product categories to add the Product to." + * x-featureFlag: "product_categories" * type: array * items: * required: @@ -429,7 +430,7 @@ class ProductVariantReq { * description: The ID of a Product Category. * type: string * options: - * description: The Options that the Product should have. These define on which properties the Product's Product Variants will differ. + * description: The Options that the Product should have. A new product option will be created for every item in the array. * type: array * items: * type: object @@ -437,10 +438,10 @@ class ProductVariantReq { * - title * properties: * title: - * description: The title to identify the Product Option by. + * description: The title of the Product Option. * type: string * variants: - * description: A list of Product Variants to create with the Product. + * description: An array of Product Variants to create with the Product. Each product variant must have a unique combination of Product Option values. * type: array * items: * type: object @@ -448,10 +449,10 @@ class ProductVariantReq { * - title * properties: * title: - * description: The title to identify the Product Variant by. + * description: The title of the Product Variant. * type: string * sku: - * description: The unique SKU for the Product Variant. + * description: The unique SKU of the Product Variant. * type: string * ean: * description: The EAN number of the item. @@ -460,20 +461,20 @@ class ProductVariantReq { * description: The UPC number of the item. * type: string * barcode: - * description: A generic GTIN field for the Product Variant. + * description: A generic GTIN field of the Product Variant. * type: string * hs_code: - * description: The Harmonized System code for the Product Variant. + * description: The Harmonized System code of the Product Variant. * type: string * inventory_quantity: - * description: The amount of stock kept for the Product Variant. + * description: The amount of stock kept of the Product Variant. * type: integer * default: 0 * allow_backorder: * description: Whether the Product Variant can be purchased when out of stock. * type: boolean * manage_inventory: - * description: Whether Medusa should keep track of the inventory for this Product Variant. + * description: Whether Medusa should keep track of the inventory of this Product Variant. * type: boolean * weight: * description: The wieght of the Product Variant. @@ -491,7 +492,7 @@ class ProductVariantReq { * description: The country of origin of the Product Variant. * type: string * mid_code: - * description: The Manufacturer Identification code for the Product Variant. + * description: The Manufacturer Identification code of the Product Variant. * type: string * material: * description: The material composition of the Product Variant. @@ -501,31 +502,39 @@ class ProductVariantReq { * type: object * prices: * type: array + * description: An array of product variant prices. A product variant can have different prices for each region or currency code. + * externalDocs: + * url: https://docs.medusajs.com/modules/products/admin/manage-products#product-variant-prices + * description: Product variant pricing. * items: * type: object * required: * - amount * properties: * region_id: - * description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + * description: The ID of the Region the price will be used in. This is only required if `currency_code` is not provided. * type: string * currency_code: - * description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * description: The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided. * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * amount: - * description: The amount to charge for the Product Variant. + * description: The price amount. * type: integer * min_quantity: - * description: The minimum quantity for which the price will be used. + * description: The minimum quantity required to be added to the cart for the price to be used. * type: integer * max_quantity: - * description: The maximum quantity for which the price will be used. + * description: The maximum quantity required to be added to the cart for the price to be used. * type: integer * options: * type: array + * description: An array of Product Option values that the variant corresponds to. The option values should be added into the array in the same index as in the `options` field of the product. + * externalDocs: + * url: https://docs.medusajs.com/modules/products/admin/manage-products#create-a-product + * description: Example of how to create a product with options and variants * items: * type: object * required: @@ -547,13 +556,13 @@ class ProductVariantReq { * description: The width of the Product. * type: number * hs_code: - * description: The Harmonized System code for the Product Variant. + * description: The Harmonized System code of the Product. * type: string * origin_country: * description: The country of origin of the Product. * type: string * mid_code: - * description: The Manufacturer Identification code for the Product. + * description: The Manufacturer Identification code of the Product. * type: string * material: * description: The material composition of the Product. diff --git a/packages/medusa/src/api/routes/admin/products/create-variant.ts b/packages/medusa/src/api/routes/admin/products/create-variant.ts index b99cdfeb40..a087b56c20 100644 --- a/packages/medusa/src/api/routes/admin/products/create-variant.ts +++ b/packages/medusa/src/api/routes/admin/products/create-variant.ts @@ -28,7 +28,7 @@ import { createVariantsTransaction } from "./transaction/create-product-variant" * @oas [post] /admin/products/{id}/variants * operationId: "PostProductsProductVariants" * summary: "Create a Product Variant" - * description: "Creates a Product Variant. Each Product Variant must have a unique combination of Product Option Values." + * description: "Create a Product Variant associated with a Product. Each product variant must have a unique combination of Product Option values." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Product. @@ -46,8 +46,8 @@ import { createVariantsTransaction } from "./transaction/create-product-variant" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.products.createVariant(product_id, { - * title: 'Color', + * medusa.admin.products.createVariant(productId, { + * title: "Color", * prices: [ * { * amount: 1000, @@ -57,20 +57,20 @@ import { createVariantsTransaction } from "./transaction/create-product-variant" * options: [ * { * option_id, - * value: 'S' + * value: "S" * } * ], * inventory_quantity: 100 * }) * .then(({ product }) => { * console.log(product.id); - * }); + * }) * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/products/{id}/variants' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/products/{id}/variants' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "title": "Color", * "prices": [ @@ -173,88 +173,90 @@ class ProductVariantOptionReq { * - options * properties: * title: - * description: The title to identify the Product Variant by. + * description: The title of the product variant. * type: string * sku: - * description: The unique SKU for the Product Variant. + * description: The unique SKU of the product variant. * type: string * ean: - * description: The EAN number of the item. + * description: The EAN number of the product variant. * type: string * upc: - * description: The UPC number of the item. + * description: The UPC number of the product variant. * type: string * barcode: - * description: A generic GTIN field for the Product Variant. + * description: A generic GTIN field of the product variant. * type: string * hs_code: - * description: The Harmonized System code for the Product Variant. + * description: The Harmonized System code of the product variant. * type: string * inventory_quantity: - * description: The amount of stock kept for the Product Variant. + * description: The amount of stock kept of the product variant. * type: integer * default: 0 * allow_backorder: - * description: Whether the Product Variant can be purchased when out of stock. + * description: Whether the product variant can be purchased when out of stock. * type: boolean * manage_inventory: - * description: Whether Medusa should keep track of the inventory for this Product Variant. + * description: Whether Medusa should keep track of the inventory of this product variant. * type: boolean * default: true * weight: - * description: The wieght of the Product Variant. + * description: The wieght of the product variant. * type: number * length: - * description: The length of the Product Variant. + * description: The length of the product variant. * type: number * height: - * description: The height of the Product Variant. + * description: The height of the product variant. * type: number * width: - * description: The width of the Product Variant. + * description: The width of the product variant. * type: number * origin_country: - * description: The country of origin of the Product Variant. + * description: The country of origin of the product variant. * type: string * mid_code: - * description: The Manufacturer Identification code for the Product Variant. + * description: The Manufacturer Identification code of the product variant. * type: string * material: - * description: The material composition of the Product Variant. + * description: The material composition of the product variant. * type: string * metadata: * description: An optional set of key-value pairs with additional information. * type: object * prices: * type: array + * description: An array of product variant prices. A product variant can have different prices for each region or currency code. + * externalDocs: + * url: https://docs.medusajs.com/modules/products/admin/manage-products#product-variant-prices + * description: Product variant pricing. * items: * type: object * required: * - amount * properties: - * id: - * description: The ID of the price. - * type: string * region_id: - * description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + * description: The ID of the Region the price will be used in. This is only required if `currency_code` is not provided. * type: string * currency_code: - * description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * description: The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided. * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * amount: - * description: The amount to charge for the Product Variant. + * description: The price amount. * type: integer * min_quantity: - * description: The minimum quantity for which the price will be used. + * description: The minimum quantity required to be added to the cart for the price to be used. * type: integer * max_quantity: - * description: The maximum quantity for which the price will be used. + * description: The maximum quantity required to be added to the cart for the price to be used. * type: integer * options: * type: array + * description: An array of Product Option values that the variant corresponds to. * items: * type: object * required: @@ -262,10 +264,10 @@ class ProductVariantOptionReq { * - value * properties: * option_id: - * description: The ID of the Product Option to set the value for. + * description: The ID of the Product Option. * type: string * value: - * description: The value to give for the Product Option. + * description: A value to give to the Product Option. * type: string */ export class AdminPostProductsProductVariantsReq { diff --git a/packages/medusa/src/api/routes/admin/products/delete-option.ts b/packages/medusa/src/api/routes/admin/products/delete-option.ts index 89e452cee8..764e900fa7 100644 --- a/packages/medusa/src/api/routes/admin/products/delete-option.ts +++ b/packages/medusa/src/api/routes/admin/products/delete-option.ts @@ -7,7 +7,7 @@ import { ProductService } from "../../../../services" * @oas [delete] /admin/products/{id}/options/{option_id} * operationId: "DeleteProductsProductOptionsOption" * summary: "Delete a Product Option" - * description: "Deletes a Product Option. Before a Product Option can be deleted all Option Values for the Product Option must be the same. You may, for example, have to delete some of your variants prior to deleting the Product Option" + * description: "Delete a Product Option. If there are product variants that use this product option, they must be deleted before deleting the product option." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Product. @@ -21,15 +21,15 @@ import { ProductService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.products.deleteOption(product_id, option_id) + * medusa.admin.products.deleteOption(productId, optionId) * .then(({ option_id, object, deleted, product }) => { * console.log(product.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/products/delete-product.ts b/packages/medusa/src/api/routes/admin/products/delete-product.ts index 08e1e384d4..4c064aaeb2 100644 --- a/packages/medusa/src/api/routes/admin/products/delete-product.ts +++ b/packages/medusa/src/api/routes/admin/products/delete-product.ts @@ -5,7 +5,7 @@ import { ProductService } from "../../../../services" * @oas [delete] /admin/products/{id} * operationId: "DeleteProductsProduct" * summary: "Delete a Product" - * description: "Deletes a Product and it's associated Product Variants." + * description: "Delete a Product and its associated product variants and options." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Product. @@ -18,15 +18,15 @@ import { ProductService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.products.delete(product_id) + * medusa.admin.products.delete(productId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/products/asfsaf' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/products/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/products/delete-variant.ts b/packages/medusa/src/api/routes/admin/products/delete-variant.ts index 1883ae5641..a671d12152 100644 --- a/packages/medusa/src/api/routes/admin/products/delete-variant.ts +++ b/packages/medusa/src/api/routes/admin/products/delete-variant.ts @@ -11,7 +11,7 @@ import { EntityManager } from "typeorm" * @oas [delete] /admin/products/{id}/variants/{variant_id} * operationId: "DeleteProductsProductVariantsVariant" * summary: "Delete a Product Variant" - * description: "Deletes a Product Variant." + * description: "Delete a Product Variant." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Product. @@ -25,15 +25,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.products.deleteVariant(product_id, variant_id) + * medusa.admin.products.deleteVariant(productId, variantId) * .then(({ variant_id, object, deleted, product }) => { * console.log(product.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/products/get-product.ts b/packages/medusa/src/api/routes/admin/products/get-product.ts index f3f7fcbde2..27470175fb 100644 --- a/packages/medusa/src/api/routes/admin/products/get-product.ts +++ b/packages/medusa/src/api/routes/admin/products/get-product.ts @@ -4,7 +4,7 @@ import { PricingService, ProductService } from "../../../../services" * @oas [get] /admin/products/{id} * operationId: "GetProductsProduct" * summary: "Get a Product" - * description: "Retrieves a Product." + * description: "Retrieve a Product's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Product. @@ -17,15 +17,15 @@ import { PricingService, ProductService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.products.retrieve(product_id) + * medusa.admin.products.retrieve(productId) * .then(({ product }) => { * console.log(product.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/products/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/products/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/products/index.ts b/packages/medusa/src/api/routes/admin/products/index.ts index e7ad218476..d6fcf94b24 100644 --- a/packages/medusa/src/api/routes/admin/products/index.ts +++ b/packages/medusa/src/api/routes/admin/products/index.ts @@ -170,6 +170,7 @@ export const defaultAdminGetProductsVariantsFields = ["id", "product_id"] * description: Whether or not the items were deleted. * default: true * product: + * description: Product details. * $ref: "#/components/schemas/PricedProduct" */ export type AdminProductsDeleteOptionRes = { @@ -211,6 +212,7 @@ export type AdminProductsDeleteOptionRes = { * description: Whether or not the items were deleted. * default: true * product: + * description: Product details. * $ref: "#/components/schemas/PricedProduct" */ export type AdminProductsDeleteVariantRes = { @@ -270,6 +272,7 @@ export type AdminProductsDeleteRes = { * properties: * products: * type: array + * description: An array of products details. * items: * $ref: "#/components/schemas/PricedProduct" * count: @@ -277,7 +280,7 @@ export type AdminProductsDeleteRes = { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of products skipped when retrieving the products. * limit: * type: integer * description: The number of items per page @@ -297,6 +300,7 @@ export type AdminProductsListRes = PaginatedResponse & { * properties: * variants: * type: array + * description: An array of product variants details. * items: * $ref: "#/components/schemas/ProductVariant" * count: @@ -304,7 +308,7 @@ export type AdminProductsListRes = PaginatedResponse & { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of product variants skipped when retrieving the product variants. * limit: * type: integer * description: The number of items per page @@ -321,6 +325,7 @@ export type AdminProductsListVariantsRes = PaginatedResponse & { * properties: * types: * type: array + * description: An array of product types details. * items: * $ref: "#/components/schemas/ProductType" */ @@ -335,6 +340,7 @@ export type AdminProductsListTypesRes = { * - tags * properties: * tags: + * description: An array of product tags details. * type: array * items: * type: object @@ -379,6 +385,7 @@ export type AdminProductsListTagsRes = { * - product * properties: * product: + * description: Product details. * $ref: "#/components/schemas/PricedProduct" */ export type AdminProductsRes = { diff --git a/packages/medusa/src/api/routes/admin/products/list-products.ts b/packages/medusa/src/api/routes/admin/products/list-products.ts index 4b1c42f348..a86479b33e 100644 --- a/packages/medusa/src/api/routes/admin/products/list-products.ts +++ b/packages/medusa/src/api/routes/admin/products/list-products.ts @@ -16,11 +16,11 @@ import { FilterableProductProps } from "../../../../types/product" * @oas [get] /admin/products * operationId: "GetProducts" * summary: "List Products" - * description: "Retrieves a list of Product" + * description: "Retrieve a list of products. The products can be filtered by fields such as `q` or `status`. The products can also be sorted or paginated." * x-authenticated: true * parameters: - * - (query) q {string} Query used for searching product title and description, variant title and sku, and collection title. - * - (query) discount_condition_id {string} The discount condition id on which to filter the product. + * - (query) q {string} term to search products' title, description, variants' title and sku, and collections' title. + * - (query) discount_condition_id {string} Filter by the ID of a discount condition. Only products that this discount condition is applied to will be retrieved. * - in: query * name: id * style: form @@ -29,7 +29,7 @@ import { FilterableProductProps } from "../../../../types/product" * schema: * oneOf: * - type: string - * description: ID of the product to search for. + * description: ID of the product. * - type: array * items: * type: string @@ -38,7 +38,7 @@ import { FilterableProductProps } from "../../../../types/product" * name: status * style: form * explode: false - * description: Status to search for + * description: Filter by status. * schema: * type: array * items: @@ -48,7 +48,7 @@ import { FilterableProductProps } from "../../../../types/product" * name: collection_id * style: form * explode: false - * description: Collection ids to search for. + * description: Filter by product collection IDs. Only products that are associated with the specified collections will be retrieved. * schema: * type: array * items: @@ -57,7 +57,7 @@ import { FilterableProductProps } from "../../../../types/product" * name: tags * style: form * explode: false - * description: Tag IDs to search for + * description: Filter by product tag IDs. Only products that are associated with the specified tags will be retrieved. * schema: * type: array * items: @@ -66,7 +66,7 @@ import { FilterableProductProps } from "../../../../types/product" * name: price_list_id * style: form * explode: false - * description: Price List IDs to search for + * description: Filter by IDs of price lists. Only products that these price lists are applied to will be retrieved. * schema: * type: array * items: @@ -75,7 +75,7 @@ import { FilterableProductProps } from "../../../../types/product" * name: sales_channel_id * style: form * explode: false - * description: Sales Channel IDs to filter products by + * description: Filter by sales channel IDs. Only products that are available in the specified sales channels will be retrieved. * schema: * type: array * items: @@ -84,7 +84,7 @@ import { FilterableProductProps } from "../../../../types/product" * name: type_id * style: form * explode: false - * description: Type IDs to filter products by + * description: Filter by product type IDs. Only products that are associated with the specified types will be retrieved. * schema: * type: array * items: @@ -93,19 +93,27 @@ import { FilterableProductProps } from "../../../../types/product" * name: category_id * style: form * explode: false - * description: Category IDs to filter products by + * description: Filter by product category IDs. Only products that are associated with the specified categories will be retrieved. * schema: * type: array + * x-featureFlag: "product_categories" * items: * type: string - * - (query) include_category_children {boolean} Include category children when filtering by category_id - * - (query) title {string} title to search for. - * - (query) description {string} description to search for. - * - (query) handle {string} handle to search for. - * - (query) is_giftcard {boolean} Search for giftcards using is_giftcard=true. + * - in: query + * name: include_category_children + * style: form + * explode: false + * description: whether to include product category children when filtering by `category_id` + * schema: + * type: boolean + * x-featureFlag: "product_categories" + * - (query) title {string} Filter by title. + * - (query) description {string} Filter by description. + * - (query) handle {string} Filter by handle. + * - (query) is_giftcard {boolean} Whether to retrieve gift cards or regular products. * - in: query * name: created_at - * description: Date comparison for when resulting products were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -127,7 +135,7 @@ import { FilterableProductProps } from "../../../../types/product" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting products were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -149,7 +157,7 @@ import { FilterableProductProps } from "../../../../types/product" * format: date * - in: query * name: deleted_at - * description: Date comparison for when resulting products were deleted. + * description: Filter by a deletion date range. * schema: * type: object * properties: @@ -169,11 +177,11 @@ import { FilterableProductProps } from "../../../../types/product" * type: string * description: filter by dates greater than or equal to this date * format: date - * - (query) offset=0 {integer} How many products to skip in the result. + * - (query) offset=0 {integer} The number of products to skip when retrieving the products. * - (query) limit=50 {integer} Limit the number of products returned. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each product of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each product of the result. - * - (query) order {string} the field used to order the products. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned products. + * - (query) fields {string} Comma-separated fields that should be included in the returned products. + * - (query) order {string} A product field to sort-order the retrieved products by. * x-codegen: * method: list * queryParams: AdminGetProductsParams @@ -191,8 +199,8 @@ import { FilterableProductProps } from "../../../../types/product" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/products' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/products' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/products/list-tag-usage-count.ts b/packages/medusa/src/api/routes/admin/products/list-tag-usage-count.ts index ff0cfd13f7..307c496f04 100644 --- a/packages/medusa/src/api/routes/admin/products/list-tag-usage-count.ts +++ b/packages/medusa/src/api/routes/admin/products/list-tag-usage-count.ts @@ -4,7 +4,7 @@ import { ProductService } from "../../../../services" * @oas [get] /admin/products/tag-usage * operationId: "GetProductsTagUsage" * summary: "List Tags Usage Number" - * description: "Retrieves a list of Product Tags with how many times each is used." + * description: "Retrieve a list of Product Tags with how many times each is used in products." * x-authenticated: true * x-codegen: * method: listTags @@ -22,8 +22,8 @@ import { ProductService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/products/tag-usage' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/products/tag-usage' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/products/list-types.ts b/packages/medusa/src/api/routes/admin/products/list-types.ts index bc309e37f6..b849811405 100644 --- a/packages/medusa/src/api/routes/admin/products/list-types.ts +++ b/packages/medusa/src/api/routes/admin/products/list-types.ts @@ -5,7 +5,7 @@ import { ProductService } from "../../../../services" * deprecated: true * operationId: "GetProductsTypes" * summary: "List Product Types" - * description: "Retrieves a list of Product Types." + * description: "Retrieve a list of Product Types." * x-authenticated: true * x-codegen: * method: listTypes @@ -23,8 +23,8 @@ import { ProductService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/products/types' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/products/types' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/products/list-variants.ts b/packages/medusa/src/api/routes/admin/products/list-variants.ts index 09c85efca7..e5a51157f9 100644 --- a/packages/medusa/src/api/routes/admin/products/list-variants.ts +++ b/packages/medusa/src/api/routes/admin/products/list-variants.ts @@ -12,14 +12,14 @@ import { validator } from "../../../../utils/validator" * @oas [get] /admin/products/{id}/variants * operationId: "GetProductsProductVariants" * summary: "List a Product's Variants" - * description: "Retrieves a list of the Product Variants associated with a Product." + * description: "Retrieve a list of Product Variants associated with a Product. The variants can be paginated." * x-authenticated: true * parameters: - * - (path) id=* {string} ID of the product to search for the variants. - * - (query) fields {string} Comma separated string of the column to select. - * - (query) expand {string} Comma separated string of the relations to include. - * - (query) offset=0 {integer} How many items to skip before the results. - * - (query) limit=100 {integer} Limit the number of items returned. + * - (path) id=* {string} ID of the product. + * - (query) fields {string} Comma-separated fields that should be included in the returned product variants. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned product variants. + * - (query) offset=0 {integer} The number of product variants to skip when retrieving the product variants. + * - (query) limit=100 {integer} Limit the number of product variants returned. * x-codegen: * method: listVariants * queryParams: AdminGetProductsVariantsParams @@ -27,8 +27,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/products/{id}/variants' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/products/{id}/variants' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/products/set-metadata.ts b/packages/medusa/src/api/routes/admin/products/set-metadata.ts index 56fc47bad6..ec7b2ec7b8 100644 --- a/packages/medusa/src/api/routes/admin/products/set-metadata.ts +++ b/packages/medusa/src/api/routes/admin/products/set-metadata.ts @@ -8,8 +8,8 @@ import { PricingService } from "../../../../services" /** * @oas [post] /admin/products/{id}/metadata * operationId: "PostProductsProductMetadata" - * summary: "Set Product Metadata" - * description: "Set metadata key/value pair for Product" + * summary: "Set Metadata" + * description: "Set the metadata of a Product. It can be any key-value pair, which allows adding custom data to a product." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Product. @@ -27,9 +27,9 @@ import { PricingService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.products.setMetadata(product_id, { - * key: 'test', - * value: 'true' + * medusa.admin.products.setMetadata(productId, { + * key: "test", + * value: "true" * }) * .then(({ product }) => { * console.log(product.id); @@ -37,9 +37,9 @@ import { PricingService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/products/{id}/metadata' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/products/{id}/metadata' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "key": "test", * "value": "true" diff --git a/packages/medusa/src/api/routes/admin/products/update-option.ts b/packages/medusa/src/api/routes/admin/products/update-option.ts index 345ceff5e1..07d68d6cdf 100644 --- a/packages/medusa/src/api/routes/admin/products/update-option.ts +++ b/packages/medusa/src/api/routes/admin/products/update-option.ts @@ -9,7 +9,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/products/{id}/options/{option_id} * operationId: "PostProductsProductOptionsOption" * summary: "Update a Product Option" - * description: "Updates a Product Option" + * description: "Update a Product Option's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Product. @@ -28,8 +28,8 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.products.updateOption(product_id, option_id, { - * title: 'Size' + * medusa.admin.products.updateOption(productId, optionId, { + * title: "Size" * }) * .then(({ product }) => { * console.log(product.id); @@ -37,9 +37,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "title": "Size" * }' diff --git a/packages/medusa/src/api/routes/admin/products/update-product.ts b/packages/medusa/src/api/routes/admin/products/update-product.ts index 0f53a62fea..889c34a4f3 100644 --- a/packages/medusa/src/api/routes/admin/products/update-product.ts +++ b/packages/medusa/src/api/routes/admin/products/update-product.ts @@ -50,7 +50,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/products/{id} * operationId: "PostProductsProduct" * summary: "Update a Product" - * description: "Updates a Product" + * description: "Update a Product's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Product. @@ -68,9 +68,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.products.update(product_id, { - * title: 'Shirt', - * images: [] + * medusa.admin.products.update(productId, { + * title: "Shirt", * }) * .then(({ product }) => { * console.log(product.id); @@ -78,9 +77,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/products/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/products/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "title": "Size" * }' @@ -362,24 +361,24 @@ class ProductVariantReq { * description: "The subtitle of the Product" * type: string * description: - * description: "A description of the Product." + * description: "The description of the Product." * type: string * discountable: - * description: A flag to indicate if discounts can be applied to the LineItems generated from this Product + * description: A flag to indicate if discounts can be applied to the Line Items generated from this Product * type: boolean * images: - * description: Images of the Product. + * description: An array of images of the Product. Each value in the array is a URL to the image. You can use the upload endpoints to upload the image and obtain a URL. * type: array * items: * type: string * thumbnail: - * description: The thumbnail to use for the Product. + * description: The thumbnail to use for the Product. The value is a URL to the thumbnail. You can use the upload endpoints to upload the thumbnail and obtain a URL. * type: string * handle: - * description: A unique handle to identify the Product by. + * description: A unique handle to identify the Product by. If not provided, the kebab-case version of the product title will be used. This can be used as a slug in URLs. * type: string * status: - * description: The status of the product. + * description: The status of the product. The product is shown to the customer only if its status is `published`. * type: string * enum: [draft, proposed, published, rejected] * type: @@ -389,16 +388,16 @@ class ProductVariantReq { * - value * properties: * id: - * description: The ID of the Product Type. + * description: The ID of an existing Product Type. If not provided, a new product type will be created. * type: string * value: * description: The value of the Product Type. * type: string * collection_id: - * description: The ID of the Collection the Product should belong to. + * description: The ID of the Product Collection the Product belongs to. * type: string * tags: - * description: Tags to associate the Product with. + * description: Product Tags to associate the Product with. * type: array * items: * type: object @@ -406,13 +405,13 @@ class ProductVariantReq { * - value * properties: * id: - * description: The ID of an existing Tag. + * description: The ID of an existing Product Tag. If not provided, a new product tag will be created. * type: string * value: - * description: The value of the Tag, these will be upserted. + * description: The value of the Tag. If the `id` is provided, the value of the existing tag will be updated. * type: string * sales_channels: - * description: "[EXPERIMENTAL] Sales channels to associate the Product with." + * description: "Sales channels to associate the Product with." * type: array * items: * type: object @@ -423,7 +422,8 @@ class ProductVariantReq { * description: The ID of an existing Sales channel. * type: string * categories: - * description: "Categories to add the Product to." + * description: "Product categories to add the Product to." + * x-featureFlag: "product_categories" * type: array * items: * required: @@ -433,95 +433,100 @@ class ProductVariantReq { * description: The ID of a Product Category. * type: string * variants: - * description: A list of Product Variants to create with the Product. + * description: An array of Product Variants to create with the Product. Each product variant must have a unique combination of Product Option values. * type: array * items: * type: object * properties: * id: - * description: The ID of the Product Variant. + * description: The id of an existing product variant. If provided, the details of the product variant will be updated. If not, a new product variant will be created. * type: string * title: - * description: The title to identify the Product Variant by. + * description: The title of the product variant. * type: string * sku: - * description: The unique SKU for the Product Variant. + * description: The unique SKU of the product variant. * type: string * ean: - * description: The EAN number of the item. + * description: The EAN number of the product variant. * type: string * upc: - * description: The UPC number of the item. + * description: The UPC number of the product variant. * type: string * barcode: - * description: A generic GTIN field for the Product Variant. + * description: A generic GTIN field of the product variant. * type: string * hs_code: - * description: The Harmonized System code for the Product Variant. + * description: The Harmonized System code of the product variant. * type: string * inventory_quantity: - * description: The amount of stock kept for the Product Variant. + * description: The amount of stock kept of the product variant. * type: integer * allow_backorder: - * description: Whether the Product Variant can be purchased when out of stock. + * description: Whether the product variant can be purchased when out of stock. * type: boolean * manage_inventory: - * description: Whether Medusa should keep track of the inventory for this Product Variant. + * description: Whether Medusa should keep track of the inventory of this product variant. * type: boolean * weight: - * description: The wieght of the Product Variant. + * description: The weight of the product variant. * type: number * length: - * description: The length of the Product Variant. + * description: The length of the product variant. * type: number * height: - * description: The height of the Product Variant. + * description: The height of the product variant. * type: number * width: - * description: The width of the Product Variant. + * description: The width of the product variant. * type: number * origin_country: - * description: The country of origin of the Product Variant. + * description: The country of origin of the product variant. * type: string * mid_code: - * description: The Manufacturer Identification code for the Product Variant. + * description: The Manufacturer Identification code of the product variant. * type: string * material: - * description: The material composition of the Product Variant. + * description: The material composition of the product variant. * type: string * metadata: * description: An optional set of key-value pairs with additional information. * type: object * prices: * type: array + * description: An array of product variant prices. A product variant can have different prices for each region or currency code. + * externalDocs: + * url: https://docs.medusajs.com/modules/products/admin/manage-products#product-variant-prices + * description: Product variant pricing. * items: * type: object * required: * - amount * properties: * id: - * description: The ID of the Price. + * description: The ID of the Price. If provided, the existing price will be updated. Otherwise, a new price will be created. * type: string * region_id: - * description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + * description: The ID of the Region the price will be used in. This is only required if `currency_code` is not provided. * type: string * currency_code: - * description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * description: The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided. * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * amount: - * description: The amount to charge for the Product Variant. + * description: The price amount. * type: integer * min_quantity: - * description: The minimum quantity for which the price will be used. + * description: The minimum quantity required to be added to the cart for the price to be used. * type: integer * max_quantity: - * description: The maximum quantity for which the price will be used. + * description: The maximum quantity required to be added to the cart for the price to be used. * type: integer * options: * type: array + * description: An array of Product Option values that the variant corresponds to. * items: * type: object * required: @@ -532,10 +537,10 @@ class ProductVariantReq { * description: The ID of the Option. * type: string * value: - * description: The value to give for the Product Option at the same index in the Product's `options` field. + * description: The value of the Product Option. * type: string * weight: - * description: The wieght of the Product. + * description: The weight of the Product. * type: number * length: * description: The length of the Product. @@ -550,7 +555,7 @@ class ProductVariantReq { * description: The country of origin of the Product. * type: string * mid_code: - * description: The Manufacturer Identification code for the Product. + * description: The Manufacturer Identification code of the Product. * type: string * material: * description: The material composition of the Product. diff --git a/packages/medusa/src/api/routes/admin/products/update-variant.ts b/packages/medusa/src/api/routes/admin/products/update-variant.ts index c4df7e171e..59a430544a 100644 --- a/packages/medusa/src/api/routes/admin/products/update-variant.ts +++ b/packages/medusa/src/api/routes/admin/products/update-variant.ts @@ -24,7 +24,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/products/{id}/variants/{variant_id} * operationId: "PostProductsProductVariantsVariant" * summary: "Update a Product Variant" - * description: "Update a Product Variant." + * description: "Update a Product Variant's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Product. @@ -43,8 +43,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.products.updateVariant(product_id, variant_id, { - * title: 'Color', + * medusa.admin.products.updateVariant(productId, variantId, { + * title: "Color", * prices: [ * { * amount: 1000, @@ -54,7 +54,7 @@ import { validator } from "../../../../utils/validator" * options: [ * { * option_id, - * value: 'S' + * value: "S" * } * ], * inventory_quantity: 100 @@ -65,9 +65,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/products/asfsaf/variants/saaga' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "title": "Color", * "prices": [ @@ -152,10 +152,10 @@ class ProductVariantOptionReq { * type: object * properties: * title: - * description: The title to identify the Product Variant by. + * description: The title of the product variant. * type: string * sku: - * description: The unique SKU for the Product Variant. + * description: The unique SKU of the product variant. * type: string * ean: * description: The EAN number of the item. @@ -164,74 +164,79 @@ class ProductVariantOptionReq { * description: The UPC number of the item. * type: string * barcode: - * description: A generic GTIN field for the Product Variant. + * description: A generic GTIN field of the product variant. * type: string * hs_code: - * description: The Harmonized System code for the Product Variant. + * description: The Harmonized System code of the product variant. * type: string * inventory_quantity: - * description: The amount of stock kept for the Product Variant. + * description: The amount of stock kept of the product variant. * type: integer * allow_backorder: - * description: Whether the Product Variant can be purchased when out of stock. + * description: Whether the product variant can be purchased when out of stock. * type: boolean * manage_inventory: - * description: Whether Medusa should keep track of the inventory for this Product Variant. + * description: Whether Medusa should keep track of the inventory of this product variant. * type: boolean * weight: - * description: The weight of the Product Variant. + * description: The weight of the product variant. * type: number * length: - * description: The length of the Product Variant. + * description: The length of the product variant. * type: number * height: - * description: The height of the Product Variant. + * description: The height of the product variant. * type: number * width: - * description: The width of the Product Variant. + * description: The width of the product variant. * type: number * origin_country: - * description: The country of origin of the Product Variant. + * description: The country of origin of the product variant. * type: string * mid_code: - * description: The Manufacturer Identification code for the Product Variant. + * description: The Manufacturer Identification code of the product variant. * type: string * material: - * description: The material composition of the Product Variant. + * description: The material composition of the product variant. * type: string * metadata: * description: An optional set of key-value pairs with additional information. * type: object * prices: * type: array + * description: An array of product variant prices. A product variant can have different prices for each region or currency code. + * externalDocs: + * url: https://docs.medusajs.com/modules/products/admin/manage-products#product-variant-prices + * description: Product variant pricing. * items: * type: object * required: * - amount * properties: * id: - * description: The ID of the price. + * description: The ID of the price. If provided, the existing price will be updated. Otherwise, a new price will be created. * type: string * region_id: - * description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + * description: The ID of the Region the price will be used in. This is only required if `currency_code` is not provided. * type: string * currency_code: - * description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + * description: The 3 character ISO currency code the price will be used in. This is only required if `region_id` is not provided. * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * amount: - * description: The amount to charge for the Product Variant. + * description: The price amount. * type: integer * min_quantity: - * description: The minimum quantity for which the price will be used. + * description: The minimum quantity required to be added to the cart for the price to be used. * type: integer * max_quantity: - * description: The maximum quantity for which the price will be used. + * description: The maximum quantity required to be added to the cart for the price to be used. * type: integer * options: * type: array + * description: An array of Product Option values that the variant corresponds to. * items: * type: object * required: @@ -239,10 +244,10 @@ class ProductVariantOptionReq { * - value * properties: * option_id: - * description: The ID of the Product Option to set the value for. + * description: The ID of the Product Option. * type: string * value: - * description: The value to give for the Product Option. + * description: The value of the Product Option. * type: string */ export class AdminPostProductsProductVariantsVariantReq { diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/add-channels-batch.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/add-channels-batch.ts index 6a34f46096..3a396ca087 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/add-channels-batch.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/add-channels-batch.ts @@ -9,8 +9,8 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [post] /admin/publishable-api-keys/{id}/sales-channels/batch * operationId: "PostPublishableApiKeySalesChannelsChannelsBatch" - * summary: "Add SalesChannels" - * description: "Assign a batch of sales channels to a publishable api key." + * summary: "Add Sales Channels" + * description: "Assign a list of sales channels to a publishable API key." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Publishable Api Key. @@ -31,7 +31,7 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" * medusa.admin.publishableApiKeys.addSalesChannelsBatch(publishableApiKeyId, { * sales_channel_ids: [ * { - * id: channel_id + * id: channelId * } * ] * }) @@ -41,9 +41,9 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pak_id}/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/publishable-api-keys/{pak_id}/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "sales_channel_ids": [ * { @@ -110,7 +110,7 @@ export default async (req: Request, res: Response): Promise => { * - sales_channel_ids * properties: * sales_channel_ids: - * description: The IDs of the sales channels to add to the publishable api key + * description: The IDs of the sales channels to add to the publishable API key * type: array * items: * type: object diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/create-publishable-api-key.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/create-publishable-api-key.ts index ed0a4cdfa1..778b1d5bc3 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/create-publishable-api-key.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/create-publishable-api-key.ts @@ -7,8 +7,8 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [post] /admin/publishable-api-keys * operationId: "PostPublishableApiKeys" - * summary: "Create PublishableApiKey" - * description: "Creates a PublishableApiKey." + * summary: "Create Publishable API Key" + * description: "Creates a Publishable API Key." * requestBody: * content: * application/json: @@ -33,9 +33,9 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/publishable-api-keys' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "title": "Web API Key" * }' @@ -90,7 +90,7 @@ export default async (req: Request, res: Response) => { * - title * properties: * title: - * description: A title for the publishable api key + * description: The title of the publishable API key * type: string */ export class AdminPostPublishableApiKeysReq { diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-channels-batch.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-channels-batch.ts index 9782659540..8107b58d64 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-channels-batch.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-channels-batch.ts @@ -9,11 +9,11 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [delete] /admin/publishable-api-keys/{id}/sales-channels/batch * operationId: "DeletePublishableApiKeySalesChannelsChannelsBatch" - * summary: "Delete SalesChannels" - * description: "Remove a batch of sales channels from a publishable api key." + * summary: "Remove Sales Channels" + * description: "Remove a list of sales channels from a publishable API key. This doesn't delete the sales channels and only removes the association between them and the publishable API key." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Publishable Api Key. + * - (path) id=* {string} The ID of the Publishable API Key. * requestBody: * content: * application/json: @@ -31,7 +31,7 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" * medusa.admin.publishableApiKeys.deleteSalesChannelsBatch(publishableApiKeyId, { * sales_channel_ids: [ * { - * id: channel_id + * id: channelId * } * ] * }) @@ -41,9 +41,9 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/publishable-api-keys/{id}/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "sales_channel_ids": [ * { @@ -110,7 +110,7 @@ export default async (req: Request, res: Response): Promise => { * - sales_channel_ids * properties: * sales_channel_ids: - * description: The IDs of the sales channels to delete from the publishable api key + * description: The IDs of the sales channels to remove from the publishable API key * type: array * items: * type: object diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-publishable-api-key.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-publishable-api-key.ts index eb29fbc270..c67847e24c 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-publishable-api-key.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-publishable-api-key.ts @@ -5,11 +5,11 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [delete] /admin/publishable-api-keys/{id} * operationId: "DeletePublishableApiKeysPublishableApiKey" - * summary: "Delete PublishableApiKey" - * description: "Deletes a PublishableApiKeys" + * summary: "Delete Publishable API Key" + * description: "Delete a Publishable API Key. Associated resources, such as sales channels, are not deleted." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the PublishableApiKeys to delete. + * - (path) id=* {string} The ID of the Publishable API Key to delete. * x-codegen: * method: delete * x-codeSamples: @@ -26,8 +26,8 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/publishable-api-key/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/get-publishable-api-key.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/get-publishable-api-key.ts index 33e0495e9f..93dff6b144 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/get-publishable-api-key.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/get-publishable-api-key.ts @@ -5,10 +5,10 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [get] /admin/publishable-api-keys/{id} * operationId: "GetPublishableApiKeysPublishableApiKey" - * summary: "Get a PublishableApiKey" - * description: "Retrieve the Publishable Api Key." + * summary: "Get a Publishable API Key" + * description: "Retrieve a publishable API key's details." * parameters: - * - (path) id=* {string} The ID of the PublishableApiKey. + * - (path) id=* {string} The ID of the Publishable API Key. * x-authenticated: true * x-codegen: * method: retrieve @@ -26,8 +26,8 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/publishable-api-keys/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/index.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/index.ts index 2b64489b66..092611b375 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/index.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/index.ts @@ -81,6 +81,7 @@ export default (app) => { * - publishable_api_key * properties: * publishable_api_key: + * description: "Publishable API key details." * $ref: "#/components/schemas/PublishableApiKey" */ export type AdminPublishableApiKeysRes = { @@ -98,6 +99,7 @@ export type AdminPublishableApiKeysRes = { * properties: * publishable_api_keys: * type: array + * description: "An array of publishable API keys details." * items: * $ref: "#/components/schemas/PublishableApiKey" * count: @@ -105,7 +107,7 @@ export type AdminPublishableApiKeysRes = { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of publishable API keys skipped when retrieving the publishable API keys. * limit: * type: integer * description: The number of items per page @@ -124,14 +126,14 @@ export type AdminPublishableApiKeysListRes = PaginatedResponse & { * properties: * id: * type: string - * description: The ID of the deleted PublishableApiKey. + * description: The ID of the deleted publishable API key. * object: * type: string * description: The type of the object that was deleted. * default: publishable_api_key * deleted: * type: boolean - * description: Whether the PublishableApiKeys was deleted. + * description: Whether the publishable API key was deleted. * default: true */ export type AdminPublishableApiKeyDeleteRes = DeleteResponse @@ -143,6 +145,7 @@ export type AdminPublishableApiKeyDeleteRes = DeleteResponse * - sales_channels * properties: * sales_channels: + * description: "An array of sales channels details." * type: array * items: * $ref: "#/components/schemas/SalesChannel" diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-key-sales-channels.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-key-sales-channels.ts index 96fbbd8dfd..8624de2645 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-key-sales-channels.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-key-sales-channels.ts @@ -7,12 +7,12 @@ import { extendedFindParamsMixin } from "../../../../types/common" /** * @oas [get] /admin/publishable-api-keys/{id}/sales-channels * operationId: "GetPublishableApiKeySalesChannels" - * summary: "List SalesChannels" - * description: "List PublishableApiKey's SalesChannels" + * summary: "List Sales Channels" + * description: "List the sales channels associated with a publishable API key. The sales channels can be filtered by fields such as `q`." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Publishable Api Key. - * - (query) q {string} Query used for searching sales channels' names and descriptions. + * - (path) id=* {string} The ID of the publishable API key. + * - (query) q {string} query to search sales channels' names and descriptions. * x-codegen: * method: listSalesChannels * queryParams: GetPublishableApiKeySalesChannelsParams @@ -30,8 +30,8 @@ import { extendedFindParamsMixin } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/sales-channels' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/publishable-api-keys/{id}/sales-channels' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-keys.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-keys.ts index e3638c89a5..f77b6d4290 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-keys.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-keys.ts @@ -7,15 +7,15 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [get] /admin/publishable-api-keys * operationId: "GetPublishableApiKeys" - * summary: "List PublishableApiKeys" - * description: "List PublishableApiKeys." + * summary: "List Publishable API keys" + * description: "Retrieve a list of publishable API keys. The publishable API keys can be filtered by fields such as `q`. The publishable API keys can also be paginated." * x-authenticated: true * parameters: - * - (query) q {string} Query used for searching publishable api keys by title. - * - (query) limit=20 {number} The number of items in the response - * - (query) offset=0 {number} The offset of items in response - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) q {string} term to search publishable API keys' titles. + * - (query) limit=20 {number} Limit the number of publishable API keys returned. + * - (query) offset=0 {number} The number of publishable API keys to skip when retrieving the publishable API keys. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned publishable API keys. + * - (query) fields {string} Comma-separated fields that should be included in the returned publishable API keys. * x-codegen: * method: list * queryParams: GetPublishableApiKeysParams @@ -33,8 +33,8 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/publishable-api-keys' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/revoke-publishable-api-key.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/revoke-publishable-api-key.ts index 59ebd764b3..36809f917d 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/revoke-publishable-api-key.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/revoke-publishable-api-key.ts @@ -6,10 +6,10 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [post] /admin/publishable-api-keys/{id}/revoke * operationId: "PostPublishableApiKeysPublishableApiKeyRevoke" - * summary: "Revoke PublishableApiKey" - * description: "Revokes a PublishableApiKey." + * summary: "Revoke a Publishable API Key" + * description: "Revoke a Publishable API Key. Revoking the publishable API Key can't be undone, and the key can't be used in future requests." * parameters: - * - (path) id=* {string} The ID of the PublishableApiKey. + * - (path) id=* {string} The ID of the Publishable API Key. * x-authenticated: true * x-codegen: * method: revoke @@ -27,8 +27,8 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/revoke' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/publishable-api-keys/{id}/revoke' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts index 495b6fdb07..2f24d39b42 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts @@ -7,11 +7,11 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [post] /admin/publishable-api-key/{id} * operationId: "PostPublishableApiKysPublishableApiKey" - * summary: "Update PublishableApiKey" - * description: "Updates a PublishableApiKey." + * summary: "Update Publishable API Key" + * description: "Update a Publishable API Key's details." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the PublishableApiKey. + * - (path) id=* {string} The ID of the Publishable API Key. * requestBody: * content: * application/json: @@ -35,9 +35,9 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/publishable-api-key/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "title": "new title" * }' @@ -92,7 +92,7 @@ export default async (req: Request, res: Response) => { * type: object * properties: * title: - * description: A title to update for the key. + * description: The title of the Publishable API Key. * type: string */ export class AdminPostPublishableApiKeysPublishableApiKeyReq { diff --git a/packages/medusa/src/api/routes/admin/regions/add-country.ts b/packages/medusa/src/api/routes/admin/regions/add-country.ts index 8e0dc7a904..ba5eedad0b 100644 --- a/packages/medusa/src/api/routes/admin/regions/add-country.ts +++ b/packages/medusa/src/api/routes/admin/regions/add-country.ts @@ -10,7 +10,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/regions/{id}/countries * operationId: "PostRegionsRegionCountries" * summary: "Add Country" - * description: "Adds a Country to the list of Countries in a Region" + * description: "Add a Country to the list of Countries in a Region" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Region. @@ -28,8 +28,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.regions.addCountry(region_id, { - * country_code: 'dk' + * medusa.admin.regions.addCountry(regionId, { + * country_code: "dk" * }) * .then(({ region }) => { * console.log(region.id); @@ -37,9 +37,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/regions/{region_id}/countries' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/regions/{region_id}/countries' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "country_code": "dk" * }' diff --git a/packages/medusa/src/api/routes/admin/regions/add-fulfillment-provider.ts b/packages/medusa/src/api/routes/admin/regions/add-fulfillment-provider.ts index 5d560ff4d3..4a17335929 100644 --- a/packages/medusa/src/api/routes/admin/regions/add-fulfillment-provider.ts +++ b/packages/medusa/src/api/routes/admin/regions/add-fulfillment-provider.ts @@ -10,7 +10,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/regions/{id}/fulfillment-providers * operationId: "PostRegionsRegionFulfillmentProviders" * summary: "Add Fulfillment Provider" - * description: "Adds a Fulfillment Provider to a Region" + * description: "Add a Fulfillment Provider to the list of fulfullment providers in a Region." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Region. @@ -28,8 +28,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.regions.addFulfillmentProvider(region_id, { - * provider_id: 'manual' + * medusa.admin.regions.addFulfillmentProvider(regionId, { + * provider_id: "manual" * }) * .then(({ region }) => { * console.log(region.id); @@ -37,9 +37,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "provider_id": "manual" * }' @@ -97,7 +97,7 @@ export default async (req, res) => { * - provider_id * properties: * provider_id: - * description: "The ID of the Fulfillment Provider to add." + * description: "The ID of the Fulfillment Provider." * type: string */ export class AdminPostRegionsRegionFulfillmentProvidersReq { diff --git a/packages/medusa/src/api/routes/admin/regions/add-payment-provider.ts b/packages/medusa/src/api/routes/admin/regions/add-payment-provider.ts index f68765698e..ca8c41c044 100644 --- a/packages/medusa/src/api/routes/admin/regions/add-payment-provider.ts +++ b/packages/medusa/src/api/routes/admin/regions/add-payment-provider.ts @@ -10,7 +10,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/regions/{id}/payment-providers * operationId: "PostRegionsRegionPaymentProviders" * summary: "Add Payment Provider" - * description: "Adds a Payment Provider to a Region" + * description: "Add a Payment Provider to the list of payment providers in a Region." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Region. @@ -28,8 +28,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.regions.addPaymentProvider(region_id, { - * provider_id: 'manual' + * medusa.admin.regions.addPaymentProvider(regionId, { + * provider_id: "manual" * }) * .then(({ region }) => { * console.log(region.id); @@ -37,9 +37,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/regions/{id}/payment-providers' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/regions/{id}/payment-providers' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "provider_id": "manual" * }' @@ -97,7 +97,7 @@ export default async (req, res) => { * - provider_id * properties: * provider_id: - * description: "The ID of the Payment Provider to add." + * description: "The ID of the Payment Provider." * type: string */ export class AdminPostRegionsRegionPaymentProvidersReq { diff --git a/packages/medusa/src/api/routes/admin/regions/create-region.ts b/packages/medusa/src/api/routes/admin/regions/create-region.ts index 897ea567f7..2cf476e83a 100644 --- a/packages/medusa/src/api/routes/admin/regions/create-region.ts +++ b/packages/medusa/src/api/routes/admin/regions/create-region.ts @@ -18,7 +18,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/regions * operationId: "PostRegions" * summary: "Create a Region" - * description: "Creates a Region" + * description: "Create a Region." * x-authenticated: true * requestBody: * content: @@ -35,17 +35,17 @@ import { validator } from "../../../../utils/validator" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.regions.create({ - * name: 'Europe', - * currency_code: 'eur', + * name: "Europe", + * currency_code: "eur", * tax_rate: 0, * payment_providers: [ - * 'manual' + * "manual" * ], * fulfillment_providers: [ - * 'manual' + * "manual" * ], * countries: [ - * 'DK' + * "DK" * ] * }) * .then(({ region }) => { @@ -54,9 +54,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/regions' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/regions' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "Europe", * "currency_code": "eur", @@ -132,35 +132,36 @@ export default async (req, res) => { * description: "The name of the Region" * type: string * currency_code: - * description: "The 3 character ISO currency code to use for the Region." + * description: "The 3 character ISO currency code to use in the Region." * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * tax_code: - * description: "An optional tax code the Region." + * description: "The tax code of the Region." * type: string * tax_rate: - * description: "The tax rate to use on Orders in the Region." + * description: "The tax rate to use in the Region." * type: number * payment_providers: - * description: "A list of Payment Provider IDs that should be enabled for the Region" + * description: "A list of Payment Provider IDs that can be used in the Region" * type: array * items: * type: string * fulfillment_providers: - * description: "A list of Fulfillment Provider IDs that should be enabled for the Region" + * description: "A list of Fulfillment Provider IDs that can be used in the Region" * type: array * items: * type: string * countries: - * description: "A list of countries' 2 ISO Characters that should be included in the Region." + * description: "A list of countries' 2 ISO characters that should be included in the Region." * example: ["US"] * type: array * items: * type: string * includes_tax: - * description: "[EXPERIMENTAL] Tax included in prices of region" + * x-featureFlag: "tax_inclusive_pricing" + * description: "Whether taxes are included in the prices of the region." * type: boolean */ export class AdminPostRegionsReq { diff --git a/packages/medusa/src/api/routes/admin/regions/delete-region.ts b/packages/medusa/src/api/routes/admin/regions/delete-region.ts index 7bdbaf470c..0f3ff0b838 100644 --- a/packages/medusa/src/api/routes/admin/regions/delete-region.ts +++ b/packages/medusa/src/api/routes/admin/regions/delete-region.ts @@ -5,7 +5,7 @@ import RegionService from "../../../../services/region" * @oas [delete] /admin/regions/{id} * operationId: "DeleteRegionsRegion" * summary: "Delete a Region" - * description: "Deletes a Region." + * description: "Delete a Region. Associated resources, such as providers or currencies are not deleted. Associated tax rates are deleted." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Region. @@ -18,15 +18,15 @@ import RegionService from "../../../../services/region" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.regions.delete(region_id) + * medusa.admin.regions.delete(regionId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/regions/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/regions/get-fulfillment-options.ts b/packages/medusa/src/api/routes/admin/regions/get-fulfillment-options.ts index 51c8c35d3c..000b39d512 100644 --- a/packages/medusa/src/api/routes/admin/regions/get-fulfillment-options.ts +++ b/packages/medusa/src/api/routes/admin/regions/get-fulfillment-options.ts @@ -6,7 +6,7 @@ import RegionService from "../../../../services/region" * @oas [get] /admin/regions/{id}/fulfillment-options * operationId: "GetRegionsRegionFulfillmentOptions" * summary: "List Fulfillment Options" - * description: "Gathers all the fulfillment options available to in the Region." + * description: "Retrieve a list of fulfillment options available in a Region." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Region. @@ -19,15 +19,15 @@ import RegionService from "../../../../services/region" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.regions.retrieveFulfillmentOptions(region_id) + * medusa.admin.regions.retrieveFulfillmentOptions(regionId) * .then(({ fulfillment_options }) => { * console.log(fulfillment_options.length); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/regions/{id}/fulfillment-options' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/regions/{id}/fulfillment-options' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/regions/get-region.ts b/packages/medusa/src/api/routes/admin/regions/get-region.ts index 00708de4c7..089f31011e 100644 --- a/packages/medusa/src/api/routes/admin/regions/get-region.ts +++ b/packages/medusa/src/api/routes/admin/regions/get-region.ts @@ -6,7 +6,7 @@ import RegionService from "../../../../services/region" * @oas [get] /admin/regions/{id} * operationId: "GetRegionsRegion" * summary: "Get a Region" - * description: "Retrieves a Region." + * description: "Retrieve a Region's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Region. @@ -19,15 +19,15 @@ import RegionService from "../../../../services/region" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.regions.retrieve(region_id) + * medusa.admin.regions.retrieve(regionId) * .then(({ region }) => { * console.log(region.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/regions/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/regions/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/regions/index.ts b/packages/medusa/src/api/routes/admin/regions/index.ts index 3dbe4d72e7..86f50e3871 100644 --- a/packages/medusa/src/api/routes/admin/regions/index.ts +++ b/packages/medusa/src/api/routes/admin/regions/index.ts @@ -101,6 +101,7 @@ export const defaultAdminRegionRelations = [ * - region * properties: * region: + * description: "Region details." * $ref: "#/components/schemas/Region" */ export class AdminRegionsRes { @@ -127,6 +128,7 @@ export class AdminRegionsRes { * properties: * regions: * type: array + * description: "An array of regions details." * items: * $ref: "#/components/schemas/Region" * count: @@ -134,7 +136,7 @@ export class AdminRegionsRes { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of regions skipped when retrieving the regions. * limit: * type: integer * description: The number of items per page @@ -178,6 +180,7 @@ export class FulfillmentOption { * properties: * fulfillment_options: * type: array + * description: Fulfillment providers details. * items: * type: object * required: diff --git a/packages/medusa/src/api/routes/admin/regions/list-regions.ts b/packages/medusa/src/api/routes/admin/regions/list-regions.ts index 8c74284212..e4d3e6a20a 100644 --- a/packages/medusa/src/api/routes/admin/regions/list-regions.ts +++ b/packages/medusa/src/api/routes/admin/regions/list-regions.ts @@ -12,7 +12,7 @@ import { validator } from "../../../../utils/validator" * @oas [get] /admin/regions * operationId: "GetRegions" * summary: "List Regions" - * description: "Retrieves a list of Regions." + * description: "Retrieve a list of Regions. The regions can be filtered by fields such as `created_at`. The regions can also be paginated" * x-authenticated: true * parameters: * - in: query @@ -21,32 +21,83 @@ import { validator } from "../../../../utils/validator" * type: integer * default: 50 * required: false - * description: limit the number of regions in response + * description: Limit the number of regions returned. * - in: query * name: offset * schema: * type: integer * default: 0 * required: false - * description: Offset of regions in response (used for pagination) + * description: The number of regions to skip when retrieving the regions. * - in: query * name: created_at + * required: false + * description: Filter by a creation date range. * schema: * type: object - * required: false - * description: Date comparison for when resulting region was created, i.e. less than, greater than etc. + * properties: + * lt: + * type: string + * description: filter by dates less than this date + * format: date + * gt: + * type: string + * description: filter by dates greater than this date + * format: date + * lte: + * type: string + * description: filter by dates less than or equal to this date + * format: date + * gte: + * type: string + * description: filter by dates greater than or equal to this date + * format: date * - in: query * name: updated_at + * required: false + * description: Filter by an update date range. * schema: * type: object - * required: false - * description: Date comparison for when resulting region was updated, i.e. less than, greater than etc. + * properties: + * lt: + * type: string + * description: filter by dates less than this date + * format: date + * gt: + * type: string + * description: filter by dates greater than this date + * format: date + * lte: + * type: string + * description: filter by dates less than or equal to this date + * format: date + * gte: + * type: string + * description: filter by dates greater than or equal to this date + * format: date * - in: query * name: deleted_at + * required: false + * description: Filter by a deletion date range. * schema: * type: object - * required: false - * description: Date comparison for when resulting region was deleted, i.e. less than, greater than etc. + * properties: + * lt: + * type: string + * description: filter by dates less than this date + * format: date + * gt: + * type: string + * description: filter by dates greater than this date + * format: date + * lte: + * type: string + * description: filter by dates less than or equal to this date + * format: date + * gte: + * type: string + * description: filter by dates greater than or equal to this date + * format: date * x-codegen: * method: list * queryParams: AdminGetRegionsParams @@ -64,8 +115,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/regions' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/regions' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/regions/remove-country.ts b/packages/medusa/src/api/routes/admin/regions/remove-country.ts index 85b10037b7..e88a1c76fc 100644 --- a/packages/medusa/src/api/routes/admin/regions/remove-country.ts +++ b/packages/medusa/src/api/routes/admin/regions/remove-country.ts @@ -6,9 +6,9 @@ import RegionService from "../../../../services/region" /** * @oas [delete] /admin/regions/{id}/countries/{country_code} * operationId: "PostRegionsRegionCountriesCountry" - * summary: "Delete Country" + * summary: "Remove Country" * x-authenticated: true - * description: "Removes a Country from the list of Countries in a Region" + * description: "Remove a Country from the list of Countries in a Region. The country will still be available in the system, and it can be used in other regions." * parameters: * - (path) id=* {string} The ID of the Region. * - in: path @@ -29,15 +29,15 @@ import RegionService from "../../../../services/region" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.regions.deleteCountry(region_id, 'dk') + * medusa.admin.regions.deleteCountry(regionId, "dk") * .then(({ region }) => { * console.log(region.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/countries/dk' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/regions/{id}/countries/{country_code}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/regions/remove-fulfillment-provider.ts b/packages/medusa/src/api/routes/admin/regions/remove-fulfillment-provider.ts index 7505a9055e..b85a2ac7c7 100644 --- a/packages/medusa/src/api/routes/admin/regions/remove-fulfillment-provider.ts +++ b/packages/medusa/src/api/routes/admin/regions/remove-fulfillment-provider.ts @@ -6,8 +6,8 @@ import RegionService from "../../../../services/region" /** * @oas [delete] /admin/regions/{id}/fulfillment-providers/{provider_id} * operationId: "PostRegionsRegionFulfillmentProvidersProvider" - * summary: "Del. Fulfillment Provider" - * description: "Removes a Fulfillment Provider." + * summary: "Remove Fulfillment Provider" + * description: "Remove a Fulfillment Provider from a Region. The fulfillment provider will still be available for usage in other regions." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Region. @@ -21,15 +21,15 @@ import RegionService from "../../../../services/region" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.regions.deleteFulfillmentProvider(region_id, 'manual') + * medusa.admin.regions.deleteFulfillmentProvider(regionId, "manual") * .then(({ region }) => { * console.log(region.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers/manual' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers/{provider_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/regions/remove-payment-provider.ts b/packages/medusa/src/api/routes/admin/regions/remove-payment-provider.ts index d8dd6423f9..f52de6fb83 100644 --- a/packages/medusa/src/api/routes/admin/regions/remove-payment-provider.ts +++ b/packages/medusa/src/api/routes/admin/regions/remove-payment-provider.ts @@ -6,8 +6,8 @@ import RegionService from "../../../../services/region" /** * @oas [delete] /admin/regions/{id}/payment-providers/{provider_id} * operationId: "PostRegionsRegionPaymentProvidersProvider" - * summary: "Delete Payment Provider" - * description: "Removes a Payment Provider." + * summary: "Remove Payment Provider" + * description: "Remove a Payment Provider from a Region. The payment provider will still be available for usage in other regions." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Region. @@ -21,15 +21,15 @@ import RegionService from "../../../../services/region" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.regions.deletePaymentProvider(region_id, 'manual') + * medusa.admin.regions.deletePaymentProvider(regionId, "manual") * .then(({ region }) => { * console.log(region.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/payment-providers/manual' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/regions/{id}/payment-providers/{provider_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/regions/update-region.ts b/packages/medusa/src/api/routes/admin/regions/update-region.ts index 8aa4acb28e..dbff7ac972 100644 --- a/packages/medusa/src/api/routes/admin/regions/update-region.ts +++ b/packages/medusa/src/api/routes/admin/regions/update-region.ts @@ -18,7 +18,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/regions/{id} * operationId: "PostRegionsRegion" * summary: "Update a Region" - * description: "Updates a Region" + * description: "Update a Region's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Region. @@ -36,8 +36,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.regions.update(region_id, { - * name: 'Europe' + * medusa.admin.regions.update(regionId, { + * name: "Europe" * }) * .then(({ region }) => { * console.log(region.id); @@ -45,9 +45,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/regions/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/regions/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "Europe" * }' @@ -104,41 +104,45 @@ export default async (req, res) => { * description: "The name of the Region" * type: string * currency_code: - * description: "The 3 character ISO currency code to use for the Region." + * description: "The 3 character ISO currency code to use in the Region." * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * automatic_taxes: - * description: "If true Medusa will automatically calculate taxes for carts in this region. If false you have to manually call POST /carts/:id/taxes." + * description: "If set to `true`, the Medusa backend will automatically calculate taxes for carts in this region. If set to `false`, the taxes must be calculated manually." + * externalDocs: + * url: https://docs.medusajs.com/modules/taxes/storefront/manual-calculation + * description: How to calculate taxes in a storefront. * type: boolean * gift_cards_taxable: - * description: "Whether gift cards in this region should be applied sales tax when purchasing a gift card" + * description: "If set to `true`, taxes will be applied on gift cards." * type: boolean * tax_provider_id: - * description: "The ID of the tax provider to use; if null the system tax provider is used" + * description: "The ID of the tax provider to use. If none provided, the system tax provider is used." * type: string * tax_code: - * description: "An optional tax code the Region." + * description: "The tax code of the Region." * type: string * tax_rate: - * description: "The tax rate to use on Orders in the Region." + * description: "The tax rate to use in the Region." * type: number * includes_tax: - * description: "[EXPERIMENTAL] Tax included in prices of region" + * x-featureFlag: "tax_inclusive_pricing" + * description: "Whether taxes are included in the prices of the region." * type: boolean * payment_providers: - * description: "A list of Payment Provider IDs that should be enabled for the Region" + * description: "A list of Payment Provider IDs that can be used in the Region" * type: array * items: * type: string * fulfillment_providers: - * description: "A list of Fulfillment Provider IDs that should be enabled for the Region" + * description: "A list of Fulfillment Provider IDs that can be used in the Region" * type: array * items: * type: string * countries: - * description: "A list of countries' 2 ISO Characters that should be included in the Region." + * description: "A list of countries' 2 ISO characters that should be included in the Region." * type: array * items: * type: string diff --git a/packages/medusa/src/api/routes/admin/reservations/create-reservation.ts b/packages/medusa/src/api/routes/admin/reservations/create-reservation.ts index 489a2e0951..5e978d982f 100644 --- a/packages/medusa/src/api/routes/admin/reservations/create-reservation.ts +++ b/packages/medusa/src/api/routes/admin/reservations/create-reservation.ts @@ -8,7 +8,7 @@ import { validateUpdateReservationQuantity } from "./utils/validate-reservation- * @oas [post] /admin/reservations * operationId: "PostReservations" * summary: "Create a Reservation" - * description: "Create a Reservation which can be associated with any resource as required." + * description: "Create a Reservation which can be associated with any resource, such as an order's line item." * x-authenticated: true * requestBody: * content: @@ -23,9 +23,9 @@ import { validateUpdateReservationQuantity } from "./utils/validate-reservation- * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.reservations.create({ - * line_item_id: 'item_123', - * location_id: 'loc_123', - * inventory_item_id: 'iitem_123', + * line_item_id: "item_123", + * location_id: "loc_123", + * inventory_item_id: "iitem_123", * quantity: 1 * }) * .then(({ reservation }) => { @@ -34,9 +34,9 @@ import { validateUpdateReservationQuantity } from "./utils/validate-reservation- * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/reservations' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/reservations' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "line_item_id": "item_123", * "location_id": "loc_123", @@ -104,16 +104,16 @@ export default async (req, res) => { * - quantity * properties: * line_item_id: - * description: "The id of the location of the reservation" + * description: "The ID of the line item of the reservation." * type: string * location_id: - * description: "The id of the location of the reservation" + * description: "The ID of the location of the reservation." * type: string * inventory_item_id: - * description: "The id of the inventory item the reservation relates to" + * description: "The ID of the inventory item the reservation is associated with." * type: string * quantity: - * description: "The id of the reservation item" + * description: "The quantity to reserve." * type: number * metadata: * description: An optional set of key-value pairs with additional information. diff --git a/packages/medusa/src/api/routes/admin/reservations/delete-reservation.ts b/packages/medusa/src/api/routes/admin/reservations/delete-reservation.ts index 76ff8cf1f0..964f20a2fc 100644 --- a/packages/medusa/src/api/routes/admin/reservations/delete-reservation.ts +++ b/packages/medusa/src/api/routes/admin/reservations/delete-reservation.ts @@ -5,7 +5,7 @@ import { EntityManager } from "typeorm" * @oas [delete] /admin/reservations/{id} * operationId: "DeleteReservationsReservation" * summary: "Delete a Reservation" - * description: "Deletes a Reservation." + * description: "Delete a Reservation. Associated resources, such as the line item, will not be deleted." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Reservation to delete. @@ -25,8 +25,8 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/reservations/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/reservations/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/reservations/get-reservation.ts b/packages/medusa/src/api/routes/admin/reservations/get-reservation.ts index 5f158f91ab..a189bf4079 100644 --- a/packages/medusa/src/api/routes/admin/reservations/get-reservation.ts +++ b/packages/medusa/src/api/routes/admin/reservations/get-reservation.ts @@ -5,10 +5,10 @@ import { MedusaError } from "@medusajs/utils" * @oas [get] /admin/reservations/{id} * operationId: "GetReservationsReservation" * summary: "Get a Reservation" - * description: "Retrieves a single reservation using its ID" + * description: "Retrieve a reservation's details.'" * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the reservation to retrieve. + * - (path) id=* {string} The ID of the reservation. * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -23,8 +23,8 @@ import { MedusaError } from "@medusajs/utils" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/reservations/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/reservations/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/reservations/index.ts b/packages/medusa/src/api/routes/admin/reservations/index.ts index 33eda25a3e..bf49b75de4 100644 --- a/packages/medusa/src/api/routes/admin/reservations/index.ts +++ b/packages/medusa/src/api/routes/admin/reservations/index.ts @@ -63,6 +63,7 @@ export default (app) => { * - reservation * properties: * reservation: + * description: Reservation details. * $ref: "#/components/schemas/ReservationItemDTO" */ export type AdminReservationsRes = { @@ -77,10 +78,10 @@ export type AdminReservationsRes = { * - type: object * properties: * line_item: - * description: optional line item + * description: The line item associated with the reservation. * $ref: "#/components/schemas/LineItem" * inventory_item: - * description: inventory item from inventory module + * description: The inventory item associated with the reservation. * $ref: "#/components/schemas/InventoryItemDTO" */ export type ExtendedReservationItem = ReservationItemDTO & { @@ -99,6 +100,7 @@ export type ExtendedReservationItem = ReservationItemDTO & { * properties: * reservations: * type: array + * description: An array of reservations details. * items: * $ref: "#/components/schemas/ExtendedReservationItem" * count: @@ -106,7 +108,7 @@ export type ExtendedReservationItem = ReservationItemDTO & { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of reservations skipped when retrieving the reservations. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/reservations/list-reservations.ts b/packages/medusa/src/api/routes/admin/reservations/list-reservations.ts index 40cf0cd073..0826e2a227 100644 --- a/packages/medusa/src/api/routes/admin/reservations/list-reservations.ts +++ b/packages/medusa/src/api/routes/admin/reservations/list-reservations.ts @@ -19,14 +19,14 @@ import { joinLineItems } from "./utils/join-line-items" * @oas [get] /admin/reservations * operationId: "GetReservations" * summary: "List Reservations" - * description: "Retrieve a list of Reservations." + * description: "Retrieve a list of Reservations. The reservations can be filtered by fields such as `location_id` or `quantity`. The reservations can also be paginated." * x-authenticated: true * parameters: * - in: query * name: location_id * style: form * explode: false - * description: Location ids to search for. + * description: Filter by location ID * schema: * type: array * items: @@ -35,7 +35,7 @@ import { joinLineItems } from "./utils/join-line-items" * name: inventory_item_id * style: form * explode: false - * description: Inventory Item ids to search for. + * description: Filter by inventory item ID. * schema: * type: array * items: @@ -44,7 +44,7 @@ import { joinLineItems } from "./utils/join-line-items" * name: line_item_id * style: form * explode: false - * description: Line Item ids to search for. + * description: Filter by line item ID. * schema: * type: array * items: @@ -69,10 +69,11 @@ import { joinLineItems } from "./utils/join-line-items" * description: filter by reservation quantity greater than or equal to this number * - in: query * name: description - * description: A param for search reservation descriptions + * description: Filter by description. * schema: * oneOf: * - type: string + * description: description value to filter by. * - type: object * properties: * contains: @@ -86,7 +87,7 @@ import { joinLineItems } from "./utils/join-line-items" * description: filter by reservation description ending with search string. * - in: query * name: created_at - * description: Date comparison for when resulting reservations were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -106,10 +107,10 @@ import { joinLineItems } from "./utils/join-line-items" * type: string * description: filter by dates greater than or equal to this date * format: date - * - (query) offset=0 {integer} How many Reservations to skip in the result. - * - (query) limit=20 {integer} Limit the number of Reservations returned. - * - (query) expand {string} (Comma separated) Which fields should be expanded in the product category. - * - (query) fields {string} (Comma separated) Which fields should be included in the product category. + * - (query) offset=0 {integer} The number of reservations to skip when retrieving the reservations. + * - (query) limit=20 {integer} Limit the number of reservations returned. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned reservations. + * - (query) fields {string} Comma-separated fields that should be included in the returned reservations. * x-codegen: * method: list * queryParams: AdminGetReservationsParams @@ -127,8 +128,8 @@ import { joinLineItems } from "./utils/join-line-items" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/product-categories' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/product-categories' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/reservations/update-reservation.ts b/packages/medusa/src/api/routes/admin/reservations/update-reservation.ts index e16de26a8f..5e050a00de 100644 --- a/packages/medusa/src/api/routes/admin/reservations/update-reservation.ts +++ b/packages/medusa/src/api/routes/admin/reservations/update-reservation.ts @@ -10,10 +10,10 @@ import { validateUpdateReservationQuantity } from "./utils/validate-reservation- * @oas [post] /admin/reservations/{id} * operationId: "PostReservationsReservation" * summary: "Update a Reservation" - * description: "Updates a Reservation which can be associated with any resource as required." + * description: "Update a Reservation's details.'" * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Reservation to update. + * - (path) id=* {string} The ID of the Reservation. * requestBody: * content: * application/json: @@ -35,9 +35,9 @@ import { validateUpdateReservationQuantity } from "./utils/validate-reservation- * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/reservations/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/reservations/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "quantity": 3, * }' @@ -103,10 +103,10 @@ export default async (req, res) => { * type: object * properties: * location_id: - * description: "The id of the location of the reservation" + * description: "The ID of the location associated with the reservation." * type: string * quantity: - * description: "The id of the reservation item" + * description: "The quantity to reserve." * type: number * metadata: * description: An optional set of key-value pairs with additional information. diff --git a/packages/medusa/src/api/routes/admin/return-reasons/create-reason.ts b/packages/medusa/src/api/routes/admin/return-reasons/create-reason.ts index fe855fd030..ad4c0bf738 100644 --- a/packages/medusa/src/api/routes/admin/return-reasons/create-reason.ts +++ b/packages/medusa/src/api/routes/admin/return-reasons/create-reason.ts @@ -12,7 +12,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/return-reasons * operationId: "PostReturnReasons" * summary: "Create a Return Reason" - * description: "Creates a Return Reason" + * description: "Create a Return Reason." * x-authenticated: true * requestBody: * content: @@ -29,8 +29,8 @@ import { EntityManager } from "typeorm" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.returnReasons.create({ - * label: 'Damaged', - * value: 'damaged' + * label: "Damaged", + * value: "damaged" * }) * .then(({ return_reason }) => { * console.log(return_reason.id); @@ -38,9 +38,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/return-reasons' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/return-reasons' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "label": "Damaged", * "value": "damaged" @@ -102,13 +102,13 @@ export default async (req, res) => { * description: "The label to display to the Customer." * type: string * value: - * description: "The value that the Return Reason will be identified by. Must be unique." + * description: "A unique value of the return reason." * type: string * parent_return_reason_id: * description: "The ID of the parent return reason." * type: string * description: - * description: "An optional description to for the Reason." + * description: "The description of the Reason." * type: string * metadata: * description: An optional set of key-value pairs with additional information. diff --git a/packages/medusa/src/api/routes/admin/return-reasons/delete-reason.ts b/packages/medusa/src/api/routes/admin/return-reasons/delete-reason.ts index 51bbd264f8..8226851fc3 100644 --- a/packages/medusa/src/api/routes/admin/return-reasons/delete-reason.ts +++ b/packages/medusa/src/api/routes/admin/return-reasons/delete-reason.ts @@ -5,7 +5,7 @@ import { ReturnReasonService } from "../../../../services" * @oas [delete] /admin/return-reasons/{id} * operationId: "DeleteReturnReason" * summary: "Delete a Return Reason" - * description: "Deletes a return reason." + * description: "Delete a return reason." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the return reason @@ -18,15 +18,15 @@ import { ReturnReasonService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.returnReasons.delete(return_reason_id) + * medusa.admin.returnReasons.delete(returnReasonId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/return-reasons/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/return-reasons/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/return-reasons/get-reason.ts b/packages/medusa/src/api/routes/admin/return-reasons/get-reason.ts index 79299351b9..1708d906d3 100644 --- a/packages/medusa/src/api/routes/admin/return-reasons/get-reason.ts +++ b/packages/medusa/src/api/routes/admin/return-reasons/get-reason.ts @@ -9,7 +9,7 @@ import { ReturnReasonService } from "../../../../services" * @oas [get] /admin/return-reasons/{id} * operationId: "GetReturnReasonsReason" * summary: "Get a Return Reason" - * description: "Retrieves a Return Reason." + * description: "Retrieve a Return Reason's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Return Reason. @@ -22,15 +22,15 @@ import { ReturnReasonService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.returnReasons.retrieve(return_reason_id) + * medusa.admin.returnReasons.retrieve(returnReasonId) * .then(({ return_reason }) => { * console.log(return_reason.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/return-reasons/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/return-reasons/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/return-reasons/list-reasons.ts b/packages/medusa/src/api/routes/admin/return-reasons/list-reasons.ts index 38c94e9a8d..6f515cc672 100644 --- a/packages/medusa/src/api/routes/admin/return-reasons/list-reasons.ts +++ b/packages/medusa/src/api/routes/admin/return-reasons/list-reasons.ts @@ -10,7 +10,7 @@ import { Selector } from "../../../../types/common" * @oas [get] /admin/return-reasons * operationId: "GetReturnReasons" * summary: "List Return Reasons" - * description: "Retrieves a list of Return Reasons." + * description: "Retrieve a list of Return Reasons." * x-authenticated: true * x-codegen: * method: list @@ -28,8 +28,8 @@ import { Selector } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/return-reasons' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/return-reasons' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/return-reasons/update-reason.ts b/packages/medusa/src/api/routes/admin/return-reasons/update-reason.ts index db8a051728..e63b46433c 100644 --- a/packages/medusa/src/api/routes/admin/return-reasons/update-reason.ts +++ b/packages/medusa/src/api/routes/admin/return-reasons/update-reason.ts @@ -12,7 +12,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/return-reasons/{id} * operationId: "PostReturnReasonsReason" * summary: "Update a Return Reason" - * description: "Updates a Return Reason" + * description: "Update a Return Reason's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Return Reason. @@ -30,8 +30,8 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.returnReasons.update(return_reason_id, { - * label: 'Damaged' + * medusa.admin.returnReasons.update(returnReasonId, { + * label: "Damaged" * }) * .then(({ return_reason }) => { * console.log(return_reason.id); @@ -39,9 +39,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/return-reasons/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/return-reasons/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "label": "Damaged" * }' @@ -102,10 +102,10 @@ export default async (req, res) => { * description: "The label to display to the Customer." * type: string * value: - * description: "The value that the Return Reason will be identified by. Must be unique." + * description: "A unique value of the return reason." * type: string * description: - * description: "An optional description to for the Reason." + * description: "The description of the Reason." * type: string * metadata: * description: An optional set of key-value pairs with additional information. diff --git a/packages/medusa/src/api/routes/admin/returns/cancel-return.ts b/packages/medusa/src/api/routes/admin/returns/cancel-return.ts index 49e3787448..cb850fa23b 100644 --- a/packages/medusa/src/api/routes/admin/returns/cancel-return.ts +++ b/packages/medusa/src/api/routes/admin/returns/cancel-return.ts @@ -6,7 +6,7 @@ import { defaultReturnCancelFields, defaultReturnCancelRelations } from "." * @oas [post] /admin/returns/{id}/cancel * operationId: "PostReturnsReturnCancel" * summary: "Cancel a Return" - * description: "Registers a Return as canceled." + * description: "Registers a Return as canceled. The return can be associated with an order, claim, or swap." * parameters: * - (path) id=* {string} The ID of the Return. * x-codegen: @@ -18,15 +18,15 @@ import { defaultReturnCancelFields, defaultReturnCancelRelations } from "." * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.returns.cancel(return_id) + * medusa.admin.returns.cancel(returnId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/returns/{id}/cancel' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/returns/{id}/cancel' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/returns/index.ts b/packages/medusa/src/api/routes/admin/returns/index.ts index 0d240a3fce..b149320201 100644 --- a/packages/medusa/src/api/routes/admin/returns/index.ts +++ b/packages/medusa/src/api/routes/admin/returns/index.ts @@ -91,6 +91,7 @@ export const defaultReturnCancelFields = [...defaultAdminOrdersFields] * - order * properties: * order: + * description: Order details. * $ref: "#/components/schemas/Order" */ export type AdminReturnsCancelRes = { @@ -113,6 +114,7 @@ export type AdminReturnsCancelRes = { * properties: * returns: * type: array + * description: An array of returns details. * items: * $ref: "#/components/schemas/Return" * count: @@ -120,7 +122,7 @@ export type AdminReturnsCancelRes = { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of returns skipped when retrieving the returns. * limit: * type: integer * description: The number of items per page @@ -140,6 +142,7 @@ export type AdminReturnsListRes = PaginatedResponse & { * - return * properties: * return: + * description: Return details. * $ref: "#/components/schemas/Return" */ export type AdminReturnsRes = { diff --git a/packages/medusa/src/api/routes/admin/returns/list-returns.ts b/packages/medusa/src/api/routes/admin/returns/list-returns.ts index 8e608344cb..dc3c261768 100644 --- a/packages/medusa/src/api/routes/admin/returns/list-returns.ts +++ b/packages/medusa/src/api/routes/admin/returns/list-returns.ts @@ -11,10 +11,10 @@ import { validator } from "../../../../utils/validator" * @oas [get] /admin/returns * operationId: "GetReturns" * summary: "List Returns" - * description: "Retrieves a list of Returns" + * description: "Retrieve a list of Returns. The returns can be paginated." * parameters: - * - (query) limit=50 {number} The upper limit for the amount of responses returned. - * - (query) offset=0 {number} The offset of the list returned. + * - (query) limit=50 {number} Limit the number of Returns returned. + * - (query) offset=0 {number} The number of Returns to skip when retrieving the Returns. * x-codegen: * method: list * queryParams: AdminGetReturnsParams @@ -32,8 +32,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/returns' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/returns' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/returns/receive-return.ts b/packages/medusa/src/api/routes/admin/returns/receive-return.ts index b13b42a25b..115f3cd843 100644 --- a/packages/medusa/src/api/routes/admin/returns/receive-return.ts +++ b/packages/medusa/src/api/routes/admin/returns/receive-return.ts @@ -17,7 +17,7 @@ import { defaultRelations } from "." * @oas [post] /admin/returns/{id}/receive * operationId: "PostReturnsReturnReceive" * summary: "Receive a Return" - * description: "Registers a Return as received. Updates statuses on Orders and Swaps accordingly." + * description: "Mark a Return as received. This also updates the status of associated order, claim, or swap accordingly." * parameters: * - (path) id=* {string} The ID of the Return. * requestBody: @@ -34,7 +34,7 @@ import { defaultRelations } from "." * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.returns.receive(return_id, { + * medusa.admin.returns.receive(returnId, { * items: [ * { * item_id, @@ -48,9 +48,9 @@ import { defaultRelations } from "." * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/returns/{id}/receive' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/returns/{id}/receive' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "items": [ * { diff --git a/packages/medusa/src/api/routes/admin/sales-channels/add-product-batch.ts b/packages/medusa/src/api/routes/admin/sales-channels/add-product-batch.ts index fcc11cd72f..0452d2e993 100644 --- a/packages/medusa/src/api/routes/admin/sales-channels/add-product-batch.ts +++ b/packages/medusa/src/api/routes/admin/sales-channels/add-product-batch.ts @@ -9,8 +9,8 @@ import { Type } from "class-transformer" /** * @oas [post] /admin/sales-channels/{id}/products/batch * operationId: "PostSalesChannelsChannelProductsBatch" - * summary: "Add Products" - * description: "Assign a batch of product to a sales channel." + * summary: "Add Products to Sales Channel" + * description: "Add a list of products to a sales channel." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Sales channel. @@ -28,10 +28,10 @@ import { Type } from "class-transformer" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.salesChannels.addProducts(sales_channel_id, { + * medusa.admin.salesChannels.addProducts(salesChannelId, { * product_ids: [ * { - * id: product_id + * id: productId * } * ] * }) @@ -41,9 +41,9 @@ import { Type } from "class-transformer" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/sales-channels/afasf/products/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/sales-channels/{id}/products/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "product_ids": [ * { diff --git a/packages/medusa/src/api/routes/admin/sales-channels/associate-stock-location.ts b/packages/medusa/src/api/routes/admin/sales-channels/associate-stock-location.ts index 2c6678894d..ab27e3225d 100644 --- a/packages/medusa/src/api/routes/admin/sales-channels/associate-stock-location.ts +++ b/packages/medusa/src/api/routes/admin/sales-channels/associate-stock-location.ts @@ -11,7 +11,7 @@ import { * @oas [post] /admin/sales-channels/{id}/stock-locations * operationId: "PostSalesChannelsSalesChannelStockLocation" * summary: "Associate a Stock Location" - * description: "Associates a stock location with a Sales Channel." + * description: "Associate a stock location with a Sales Channel." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Sales Channel. @@ -30,7 +30,7 @@ import { * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.salesChannels.addLocation(salesChannelId, { - * location_id: 'loc_123' + * location_id: "loc_123" * }) * .then(({ sales_channel }) => { * console.log(sales_channel.id); @@ -38,9 +38,9 @@ import { * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "locaton_id": "loc_123" * }' diff --git a/packages/medusa/src/api/routes/admin/sales-channels/create-sales-channel.ts b/packages/medusa/src/api/routes/admin/sales-channels/create-sales-channel.ts index 6216bc5dab..3685f01b08 100644 --- a/packages/medusa/src/api/routes/admin/sales-channels/create-sales-channel.ts +++ b/packages/medusa/src/api/routes/admin/sales-channels/create-sales-channel.ts @@ -9,7 +9,7 @@ import SalesChannelService from "../../../../services/sales-channel" * @oas [post] /admin/sales-channels * operationId: "PostSalesChannels" * summary: "Create a Sales Channel" - * description: "Creates a Sales Channel." + * description: "Create a Sales Channel." * x-authenticated: true * requestBody: * content: @@ -26,8 +26,8 @@ import SalesChannelService from "../../../../services/sales-channel" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.salesChannels.create({ - * name: 'App', - * description: 'Mobile app' + * name: "App", + * description: "Mobile app" * }) * .then(({ sales_channel }) => { * console.log(sales_channel.id); @@ -35,9 +35,9 @@ import SalesChannelService from "../../../../services/sales-channel" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/sales-channels' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/sales-channels' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "App" * }' @@ -96,7 +96,7 @@ export default async (req: Request, res: Response) => { * description: The description of the Sales Channel * type: string * is_disabled: - * description: Whether the Sales Channel is disabled or not. + * description: Whether the Sales Channel is disabled. * type: boolean */ export class AdminPostSalesChannelsReq { diff --git a/packages/medusa/src/api/routes/admin/sales-channels/delete-products-batch.ts b/packages/medusa/src/api/routes/admin/sales-channels/delete-products-batch.ts index c63073f8ed..9497e5fa87 100644 --- a/packages/medusa/src/api/routes/admin/sales-channels/delete-products-batch.ts +++ b/packages/medusa/src/api/routes/admin/sales-channels/delete-products-batch.ts @@ -9,8 +9,8 @@ import { Type } from "class-transformer" /** * @oas [delete] /admin/sales-channels/{id}/products/batch * operationId: "DeleteSalesChannelsChannelProductsBatch" - * summary: "Delete Products" - * description: "Remove a list of products from a sales channel." + * summary: "Remove Products from Sales Channel" + * description: "Remove a list of products from a sales channel. This does not delete the product. It only removes the association between the product and the sales channel." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Sales Channel @@ -28,10 +28,10 @@ import { Type } from "class-transformer" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.salesChannels.removeProducts(sales_channel_id, { + * medusa.admin.salesChannels.removeProducts(salesChannelId, { * product_ids: [ * { - * id: product_id + * id: productId * } * ] * }) @@ -41,9 +41,9 @@ import { Type } from "class-transformer" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/products/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/sales-channels/{id}/products/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "product_ids": [ * { @@ -106,7 +106,7 @@ export default async (req: Request, res: Response) => { * - product_ids * properties: * product_ids: - * description: The IDs of the products to delete from the Sales Channel. + * description: The IDs of the products to remove from the Sales Channel. * type: array * items: * type: object diff --git a/packages/medusa/src/api/routes/admin/sales-channels/delete-sales-channel.ts b/packages/medusa/src/api/routes/admin/sales-channels/delete-sales-channel.ts index 1575889733..4f85b72d2f 100644 --- a/packages/medusa/src/api/routes/admin/sales-channels/delete-sales-channel.ts +++ b/packages/medusa/src/api/routes/admin/sales-channels/delete-sales-channel.ts @@ -7,7 +7,7 @@ import { SalesChannelService } from "../../../../services/" * @oas [delete] /admin/sales-channels/{id} * operationId: "DeleteSalesChannelsSalesChannel" * summary: "Delete a Sales Channel" - * description: "Deletes the sales channel." + * description: "Delete a sales channel. Associated products, stock locations, and other resources are not deleted." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Sales channel. @@ -20,15 +20,15 @@ import { SalesChannelService } from "../../../../services/" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.salesChannels.delete(sales_channel_id) + * medusa.admin.salesChannels.delete(salesChannelId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/sales-channels/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/sales-channels/get-sales-channel.ts b/packages/medusa/src/api/routes/admin/sales-channels/get-sales-channel.ts index 155c1e48cd..8e1bdfd0c6 100644 --- a/packages/medusa/src/api/routes/admin/sales-channels/get-sales-channel.ts +++ b/packages/medusa/src/api/routes/admin/sales-channels/get-sales-channel.ts @@ -6,7 +6,7 @@ import { SalesChannelService } from "../../../../services" * @oas [get] /admin/sales-channels/{id} * operationId: "GetSalesChannelsSalesChannel" * summary: "Get a Sales Channel" - * description: "Retrieves the sales channel." + * description: "Retrieve a sales channel's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Sales channel. @@ -19,15 +19,15 @@ import { SalesChannelService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.salesChannels.retrieve(sales_channel_id) + * medusa.admin.salesChannels.retrieve(salesChannelId) * .then(({ sales_channel }) => { * console.log(sales_channel.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/sales-channels/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/sales-channels/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/sales-channels/index.ts b/packages/medusa/src/api/routes/admin/sales-channels/index.ts index 58a4fa680f..3aab522bb7 100644 --- a/packages/medusa/src/api/routes/admin/sales-channels/index.ts +++ b/packages/medusa/src/api/routes/admin/sales-channels/index.ts @@ -92,6 +92,7 @@ export default (app) => { * - sales_channel * properties: * sales_channel: + * description: Sales Channel's details. * $ref: "#/components/schemas/SalesChannel" */ export type AdminSalesChannelsRes = { @@ -153,6 +154,7 @@ export type AdminSalesChannelsDeleteLocationRes = DeleteResponse * properties: * sales_channels: * type: array + * description: "An array of sales channels details." * items: * $ref: "#/components/schemas/SalesChannel" * count: @@ -160,7 +162,7 @@ export type AdminSalesChannelsDeleteLocationRes = DeleteResponse * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of items skipped before the returned results * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/sales-channels/list-sales-channels.ts b/packages/medusa/src/api/routes/admin/sales-channels/list-sales-channels.ts index a2e860fca6..0598ef4736 100644 --- a/packages/medusa/src/api/routes/admin/sales-channels/list-sales-channels.ts +++ b/packages/medusa/src/api/routes/admin/sales-channels/list-sales-channels.ts @@ -12,17 +12,17 @@ import { Type } from "class-transformer" * @oas [get] /admin/sales-channels * operationId: "GetSalesChannels" * summary: "List Sales Channels" - * description: "Retrieves a list of sales channels" + * description: "Retrieve a list of sales channels. The sales channels can be filtered by fields such as `q` or `name`. The sales channels can also be sorted or paginated." * x-authenticated: true * parameters: - * - (query) id {string} ID of the sales channel - * - (query) name {string} Name of the sales channel - * - (query) description {string} Description of the sales channel - * - (query) q {string} Query used for searching sales channels' names and descriptions. - * - (query) order {string} The field to order the results by. + * - (query) id {string} Filter by a sales channel ID. + * - (query) name {string} Filter by name. + * - (query) description {string} Filter by description. + * - (query) q {string} term used to search sales channels' names and descriptions. + * - (query) order {string} A sales-channel field to sort-order the retrieved sales channels by. * - in: query * name: created_at - * description: Date comparison for when resulting collections were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -44,7 +44,7 @@ import { Type } from "class-transformer" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting collections were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -66,7 +66,7 @@ import { Type } from "class-transformer" * format: date * - in: query * name: deleted_at - * description: Date comparison for when resulting collections were deleted. + * description: Filter by a deletion date range. * schema: * type: object * properties: @@ -86,10 +86,10 @@ import { Type } from "class-transformer" * type: string * description: filter by dates greater than or equal to this date * format: date - * - (query) offset=0 {integer} How many sales channels to skip in the result. + * - (query) offset=0 {integer} The number of sales channels to skip when retrieving the sales channels. * - (query) limit=20 {integer} Limit the number of sales channels returned. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each sales channel of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each sales channel of the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned sales channels. + * - (query) fields {string} Comma-separated fields that should be included in the returned sales channels. * x-codegen: * method: list * queryParams: AdminGetSalesChannelsParams @@ -107,8 +107,8 @@ import { Type } from "class-transformer" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/sales-channels' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/sales-channels' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/sales-channels/remove-stock-location.ts b/packages/medusa/src/api/routes/admin/sales-channels/remove-stock-location.ts index 50000d344f..d70a880abf 100644 --- a/packages/medusa/src/api/routes/admin/sales-channels/remove-stock-location.ts +++ b/packages/medusa/src/api/routes/admin/sales-channels/remove-stock-location.ts @@ -7,8 +7,8 @@ import { SalesChannelLocationService } from "../../../../services" /** * @oas [delete] /admin/sales-channels/{id}/stock-locations * operationId: "DeleteSalesChannelsSalesChannelStockLocation" - * summary: "Remove a Stock Location Association" - * description: "Removes a stock location from a Sales Channel." + * summary: "Remove Stock Location from Sales Channels." + * description: "Remove a stock location from a Sales Channel. This only removes the association between the stock location and the sales channel. It does not delete the stock location." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Sales Channel. @@ -27,7 +27,7 @@ import { SalesChannelLocationService } from "../../../../services" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.salesChannels.removeLocation(salesChannelId, { - * location_id: 'loc_id' + * location_id: "loc_id" * }) * .then(({ sales_channel }) => { * console.log(sales_channel.id); @@ -35,9 +35,9 @@ import { SalesChannelLocationService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "locaton_id": "loc_id" * }' diff --git a/packages/medusa/src/api/routes/admin/sales-channels/update-sales-channel.ts b/packages/medusa/src/api/routes/admin/sales-channels/update-sales-channel.ts index fd8d7ada28..b88d5095e5 100644 --- a/packages/medusa/src/api/routes/admin/sales-channels/update-sales-channel.ts +++ b/packages/medusa/src/api/routes/admin/sales-channels/update-sales-channel.ts @@ -8,7 +8,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/sales-channels/{id} * operationId: "PostSalesChannelsSalesChannel" * summary: "Update a Sales Channel" - * description: "Updates a Sales Channel." + * description: "Update a Sales Channel's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Sales Channel. @@ -26,8 +26,8 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.salesChannels.update(sales_channel_id, { - * name: 'App' + * medusa.admin.salesChannels.update(salesChannelId, { + * name: "App" * }) * .then(({ sales_channel }) => { * console.log(sales_channel.id); @@ -35,9 +35,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/sales-channels/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "App" * }' @@ -93,13 +93,13 @@ export default async (req: Request, res: Response) => { * properties: * name: * type: string - * description: Name of the sales channel. + * description: The name of the sales channel * description: * type: string - * description: Sales Channel description. + * description: The description of the sales channel. * is_disabled: * type: boolean - * description: Indication of if the sales channel is active. + * description: Whether the Sales Channel is disabled. */ export class AdminPostSalesChannelsSalesChannelReq { @IsOptional() diff --git a/packages/medusa/src/api/routes/admin/shipping-options/create-shipping-option.ts b/packages/medusa/src/api/routes/admin/shipping-options/create-shipping-option.ts index 0dbb5d37d1..57645d9fc9 100644 --- a/packages/medusa/src/api/routes/admin/shipping-options/create-shipping-option.ts +++ b/packages/medusa/src/api/routes/admin/shipping-options/create-shipping-option.ts @@ -19,7 +19,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/shipping-options * operationId: "PostShippingOptions" * summary: "Create Shipping Option" - * description: "Creates a Shipping Option" + * description: "Create a Shipping Option." * x-authenticated: true * requestBody: * content: @@ -36,12 +36,12 @@ import { validator } from "../../../../utils/validator" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.shippingOptions.create({ - * name: 'PostFake', - * region_id: "saasf", - * provider_id: "manual", + * name: "PostFake", + * region_id, + * provider_id, * data: { * }, - * price_type: 'flat_rate' + * price_type: "flat_rate" * }) * .then(({ shipping_option }) => { * console.log(shipping_option.id); @@ -49,9 +49,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/shipping-options' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/shipping-options' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "PostFake", * "region_id": "afasf", @@ -144,13 +144,13 @@ class OptionRequirement { * description: "The data needed for the Fulfillment Provider to handle shipping with this Shipping Option." * type: object * price_type: - * description: "The type of the Shipping Option price." + * description: "The type of the Shipping Option price. `flat_rate` indicates fixed pricing, whereas `calculated` indicates that the price will be calculated each time by the fulfillment provider." * type: string * enum: * - flat_rate * - calculated * amount: - * description: "The amount to charge for the Shipping Option." + * description: "The amount to charge for the Shipping Option. If the `price_type` is set to `calculated`, this amount will not actually be used." * type: integer * requirements: * description: "The requirements that must be satisfied for the Shipping Option to be available." @@ -171,18 +171,19 @@ class OptionRequirement { * description: The amount to compare with. * type: integer * is_return: - * description: Whether the Shipping Option defines a return shipment. + * description: Whether the Shipping Option can be used for returns or during checkout. * type: boolean * default: false * admin_only: - * description: If true, the option can be used for draft orders + * description: If set to `true`, the shipping option can only be used when creating draft orders. * type: boolean * default: false * metadata: * description: An optional set of key-value pairs with additional information. * type: object * includes_tax: - * description: "[EXPERIMENTAL] Tax included in prices of shipping option" + * description: "Tax included in prices of shipping option" + * x-featureFlag: "tax_inclusive_pricing" * type: boolean */ export class AdminPostShippingOptionsReq { diff --git a/packages/medusa/src/api/routes/admin/shipping-options/delete-shipping-option.ts b/packages/medusa/src/api/routes/admin/shipping-options/delete-shipping-option.ts index 1e5dd03174..538eeebf4e 100644 --- a/packages/medusa/src/api/routes/admin/shipping-options/delete-shipping-option.ts +++ b/packages/medusa/src/api/routes/admin/shipping-options/delete-shipping-option.ts @@ -3,8 +3,8 @@ import { EntityManager } from "typeorm" /** * @oas [delete] /admin/shipping-options/{id} * operationId: "DeleteShippingOptionsOption" - * summary: "Delete a Shipping Option" - * description: "Deletes a Shipping Option." + * summary: "Delete Shipping Option" + * description: "Delete a Shipping Option. Once deleted, it can't be used when creating orders or returns." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Shipping Option. @@ -17,15 +17,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.shippingOptions.delete(option_id) + * medusa.admin.shippingOptions.delete(optionId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/shipping-options/{option_id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/shipping-options/{option_id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/shipping-options/get-shipping-option.ts b/packages/medusa/src/api/routes/admin/shipping-options/get-shipping-option.ts index f6a1f6e317..973f0b6900 100644 --- a/packages/medusa/src/api/routes/admin/shipping-options/get-shipping-option.ts +++ b/packages/medusa/src/api/routes/admin/shipping-options/get-shipping-option.ts @@ -4,7 +4,7 @@ import { defaultFields, defaultRelations } from "." * @oas [get] /admin/shipping-options/{id} * operationId: "GetShippingOptionsOption" * summary: "Get a Shipping Option" - * description: "Retrieves a Shipping Option." + * description: "Retrieve a Shipping Option's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Shipping Option. @@ -17,15 +17,15 @@ import { defaultFields, defaultRelations } from "." * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.shippingOptions.retrieve(option_id) + * medusa.admin.shippingOptions.retrieve(optionId) * .then(({ shipping_option }) => { * console.log(shipping_option.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/shipping-options/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/shipping-options/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/shipping-options/index.ts b/packages/medusa/src/api/routes/admin/shipping-options/index.ts index 59101fdf06..44246560cf 100644 --- a/packages/medusa/src/api/routes/admin/shipping-options/index.ts +++ b/packages/medusa/src/api/routes/admin/shipping-options/index.ts @@ -72,6 +72,7 @@ export const defaultRelations = ["region", "profile", "requirements"] * properties: * shipping_options: * type: array + * description: "An array of shipping options details." * items: * $ref: "#/components/schemas/ShippingOption" * count: @@ -79,7 +80,7 @@ export const defaultRelations = ["region", "profile", "requirements"] * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of shipping options skipped when retrieving the shipping options. * limit: * type: integer * description: The number of items per page @@ -104,6 +105,7 @@ export type AdminShippingOptionsListRes = PaginatedResponse & { * - shipping_option * properties: * shipping_option: + * description: "Shipping option details." * $ref: "#/components/schemas/ShippingOption" */ export type AdminShippingOptionsRes = { diff --git a/packages/medusa/src/api/routes/admin/shipping-options/list-shipping-options.ts b/packages/medusa/src/api/routes/admin/shipping-options/list-shipping-options.ts index 359f0822fc..730e4c6675 100644 --- a/packages/medusa/src/api/routes/admin/shipping-options/list-shipping-options.ts +++ b/packages/medusa/src/api/routes/admin/shipping-options/list-shipping-options.ts @@ -10,24 +10,24 @@ import { validator } from "../../../../utils/validator" * @oas [get] /admin/shipping-options * operationId: "GetShippingOptions" * summary: "List Shipping Options" - * description: "Retrieves a list of Shipping Options." + * description: "Retrieve a list of Shipping Options. The shipping options can be filtered by fields such as `region_id` or `is_return`." * x-authenticated: true * parameters: * - in: query * name: region_id * schema: * type: string - * description: Region ID to fetch options from + * description: Filter by a region ID. * - in: query * name: is_return + * description: Filter by whether the shipping option is used for returns or orders. * schema: * type: boolean - * description: Flag for fetching return options only * - in: query * name: admin_only * schema: * type: boolean - * description: Flag for fetching admin specific options + * description: Filter by whether the shipping option is used only by admins or not. * x-codegen: * method: list * queryParams: AdminGetShippingOptionsParams @@ -45,8 +45,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/shipping-options' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/shipping-options' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/shipping-options/update-shipping-option.ts b/packages/medusa/src/api/routes/admin/shipping-options/update-shipping-option.ts index 2e6fd569d3..afe1768ad7 100644 --- a/packages/medusa/src/api/routes/admin/shipping-options/update-shipping-option.ts +++ b/packages/medusa/src/api/routes/admin/shipping-options/update-shipping-option.ts @@ -21,7 +21,7 @@ import { UpdateShippingOptionInput } from "../../../../types/shipping-options" * @oas [post] /admin/shipping-options/{id} * operationId: "PostShippingOptionsOption" * summary: "Update Shipping Option" - * description: "Updates a Shipping Option" + * description: "Update a Shipping Option's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Shipping Option. @@ -39,12 +39,12 @@ import { UpdateShippingOptionInput } from "../../../../types/shipping-options" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.shippingOptions.update(option_id, { - * name: 'PostFake', + * medusa.admin.shippingOptions.update(optionId, { + * name: "PostFake", * requirements: [ * { * id, - * type: 'max_subtotal', + * type: "max_subtotal", * amount: 1000 * } * ] @@ -55,9 +55,9 @@ import { UpdateShippingOptionInput } from "../../../../types/shipping-options" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/shipping-options/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/shipping-options/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "requirements": [ * { @@ -138,10 +138,10 @@ class OptionRequirement { * description: "The name of the Shipping Option" * type: string * amount: - * description: "The amount to charge for the Shipping Option." + * description: "The amount to charge for the Shipping Option. If the `price_type` of the shipping option is `calculated`, this amount will not actually be used." * type: integer * admin_only: - * description: "If true, the option can be used for draft orders" + * description: If set to `true`, the shipping option can only be used when creating draft orders. * type: boolean * metadata: * description: "An optional set of key-value pairs with additional information." @@ -156,7 +156,7 @@ class OptionRequirement { * - amount * properties: * id: - * description: The ID of the requirement + * description: The ID of an existing requirement. If an ID is passed, the existing requirement's details are updated. Otherwise, a new requirement is created. * type: string * type: * description: The type of the requirement @@ -168,7 +168,8 @@ class OptionRequirement { * description: The amount to compare with. * type: integer * includes_tax: - * description: "[EXPERIMENTAL] Tax included in prices of shipping option" + * description: "Tax included in prices of shipping option" + * x-featureFlag: "tax_inclusive_pricing" * type: boolean */ export class AdminPostShippingOptionsOptionReq { diff --git a/packages/medusa/src/api/routes/admin/shipping-profiles/create-shipping-profile.ts b/packages/medusa/src/api/routes/admin/shipping-profiles/create-shipping-profile.ts index e4c6726430..08d5a2ae25 100644 --- a/packages/medusa/src/api/routes/admin/shipping-profiles/create-shipping-profile.ts +++ b/packages/medusa/src/api/routes/admin/shipping-profiles/create-shipping-profile.ts @@ -8,7 +8,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/shipping-profiles * operationId: "PostShippingProfiles" * summary: "Create a Shipping Profile" - * description: "Creates a Shipping Profile" + * description: "Create a Shipping Profile." * x-authenticated: true * requestBody: * content: @@ -25,7 +25,7 @@ import { validator } from "../../../../utils/validator" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.shippingProfiles.create({ - * name: 'Large Products' + * name: "Large Products" * }) * .then(({ shipping_profile }) => { * console.log(shipping_profile.id); @@ -33,9 +33,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/shipping-profiles' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/shipping-profiles' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "Large Products" * }' diff --git a/packages/medusa/src/api/routes/admin/shipping-profiles/delete-shipping-profile.ts b/packages/medusa/src/api/routes/admin/shipping-profiles/delete-shipping-profile.ts index 01b73a6f5c..fac174c632 100644 --- a/packages/medusa/src/api/routes/admin/shipping-profiles/delete-shipping-profile.ts +++ b/packages/medusa/src/api/routes/admin/shipping-profiles/delete-shipping-profile.ts @@ -5,7 +5,7 @@ import { ShippingProfileService } from "../../../../services" * @oas [delete] /admin/shipping-profiles/{id} * operationId: "DeleteShippingProfilesProfile" * summary: "Delete a Shipping Profile" - * description: "Deletes a Shipping Profile." + * description: "Delete a Shipping Profile. Associated shipping options are deleted as well." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Shipping Profile. @@ -18,15 +18,15 @@ import { ShippingProfileService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.shippingProfiles.delete(profile_id) + * medusa.admin.shippingProfiles.delete(profileId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/shipping-profiles/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/shipping-profiles/get-shipping-profile.ts b/packages/medusa/src/api/routes/admin/shipping-profiles/get-shipping-profile.ts index 62b281227a..8e1f96566f 100644 --- a/packages/medusa/src/api/routes/admin/shipping-profiles/get-shipping-profile.ts +++ b/packages/medusa/src/api/routes/admin/shipping-profiles/get-shipping-profile.ts @@ -9,7 +9,7 @@ import { ShippingProfileService } from "../../../../services" * @oas [get] /admin/shipping-profiles/{id} * operationId: "GetShippingProfilesProfile" * summary: "Get a Shipping Profile" - * description: "Retrieves a Shipping Profile." + * description: "Retrieve a Shipping Profile's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Shipping Profile. @@ -22,15 +22,15 @@ import { ShippingProfileService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.shippingProfiles.retrieve(profile_id) + * medusa.admin.shippingProfiles.retrieve(profileId) * .then(({ shipping_profile }) => { * console.log(shipping_profile.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/shipping-profiles/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/shipping-profiles/index.ts b/packages/medusa/src/api/routes/admin/shipping-profiles/index.ts index b9d177aea8..f20763e481 100644 --- a/packages/medusa/src/api/routes/admin/shipping-profiles/index.ts +++ b/packages/medusa/src/api/routes/admin/shipping-profiles/index.ts @@ -80,6 +80,7 @@ export type AdminDeleteShippingProfileRes = DeleteResponse * - shipping_profile * properties: * shipping_profile: + * description: Shipping profile details. * $ref: "#/components/schemas/ShippingProfile" */ export type AdminShippingProfilesRes = { @@ -94,6 +95,7 @@ export type AdminShippingProfilesRes = { * properties: * shipping_profiles: * type: array + * description: An array of shipping profiles details. * items: * $ref: "#/components/schemas/ShippingProfile" */ diff --git a/packages/medusa/src/api/routes/admin/shipping-profiles/list-shipping-profiles.ts b/packages/medusa/src/api/routes/admin/shipping-profiles/list-shipping-profiles.ts index 426b4e9196..c77689bdd5 100644 --- a/packages/medusa/src/api/routes/admin/shipping-profiles/list-shipping-profiles.ts +++ b/packages/medusa/src/api/routes/admin/shipping-profiles/list-shipping-profiles.ts @@ -4,7 +4,7 @@ import { ShippingProfileService } from "../../../../services" * @oas [get] /admin/shipping-profiles * operationId: "GetShippingProfiles" * summary: "List Shipping Profiles" - * description: "Retrieves a list of Shipping Profile." + * description: "Retrieve a list of Shipping Profiles." * x-authenticated: true * x-codegen: * method: list @@ -22,8 +22,8 @@ import { ShippingProfileService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/shipping-profiles' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/shipping-profiles' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/shipping-profiles/update-shipping-profile.ts b/packages/medusa/src/api/routes/admin/shipping-profiles/update-shipping-profile.ts index 5dc2799bd3..ab0ecccbcc 100644 --- a/packages/medusa/src/api/routes/admin/shipping-profiles/update-shipping-profile.ts +++ b/packages/medusa/src/api/routes/admin/shipping-profiles/update-shipping-profile.ts @@ -19,7 +19,7 @@ import { * @oas [post] /admin/shipping-profiles/{id} * operationId: "PostShippingProfilesProfile" * summary: "Update a Shipping Profile" - * description: "Updates a Shipping Profile" + * description: "Update a Shipping Profile's details." * parameters: * - (path) id=* {string} The ID of the Shipping Profile. * requestBody: @@ -36,7 +36,7 @@ import { * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.shippingProfiles.update(shipping_profile_id, { + * medusa.admin.shippingProfiles.update(shippingProfileId, { * name: 'Large Products' * }) * .then(({ shipping_profile }) => { @@ -45,9 +45,9 @@ import { * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/shipping-profiles/{id} \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/shipping-profiles/{id} \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "Large Products" * }' @@ -118,10 +118,10 @@ export default async (req, res) => { * type: string * enum: [default, gift_card, custom] * products: - * description: An optional array of product ids to associate with the Shipping Profile + * description: product IDs to associate with the Shipping Profile * type: array * shipping_options: - * description: An optional array of shipping option ids to associate with the Shipping Profile + * description: Shipping option IDs to associate with the Shipping Profile * type: array */ export class AdminPostShippingProfilesProfileReq { diff --git a/packages/medusa/src/api/routes/admin/stock-locations/create-stock-location.ts b/packages/medusa/src/api/routes/admin/stock-locations/create-stock-location.ts index 24b932a279..459dd4c4c5 100644 --- a/packages/medusa/src/api/routes/admin/stock-locations/create-stock-location.ts +++ b/packages/medusa/src/api/routes/admin/stock-locations/create-stock-location.ts @@ -15,11 +15,11 @@ import { IStockLocationService } from "@medusajs/types" * @oas [post] /admin/stock-locations * operationId: "PostStockLocations" * summary: "Create a Stock Location" - * description: "Creates a Stock Location." + * description: "Create a Stock Location." * x-authenticated: true * parameters: - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned stock location. + * - (query) fields {string} Comma-separated fields that should be included in the returned stock location. * requestBody: * content: * application/json: @@ -35,7 +35,7 @@ import { IStockLocationService } from "@medusajs/types" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.stockLocations.create({ - * name: 'Main Warehouse', + * name: "Main Warehouse", * }) * .then(({ stock_location }) => { * console.log(stock_location.id); @@ -43,9 +43,9 @@ import { IStockLocationService } from "@medusajs/types" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/stock-locations' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/stock-locations' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "App" * }' @@ -91,6 +91,47 @@ export default async (req: Request, res: Response) => { res.status(200).json({ stock_location: stockLocation }) } +/** + * @schema AdminPostStockLocationsReqAddress + * type: object + * required: + * - address_1 + * - country_code + * properties: + * address_1: + * type: string + * description: Stock location address + * example: 35, Jhon Doe Ave + * address_2: + * type: string + * description: Stock location address' complement + * example: apartment 4432 + * company: + * type: string + * description: Stock location address' company + * city: + * type: string + * description: Stock location address' city + * example: Mexico city + * country_code: + * description: "The 2 character ISO code for the country." + * type: string + * externalDocs: + * url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * description: See a list of codes. + * phone: + * type: string + * description: Stock location address' phone number + * example: +1 555 61646 + * postal_code: + * type: string + * description: Stock location address' postal code + * example: HD3-1G8 + * province: + * type: string + * description: Stock location address' province + * example: Sinaloa + */ class StockLocationAddress { @IsString() address_1: string @@ -133,13 +174,14 @@ class StockLocationAddress { * description: the name of the stock location * type: string * address_id: - * description: the stock location address ID + * description: the ID of an existing stock location address to associate with the stock location. Only required if `address` is not provided. * type: string * metadata: * type: object * description: An optional key-value map with additional details * example: {car: "white"} * address: + * description: A new stock location address to create and associate with the stock location. Only required if `address_id` is not provided. * $ref: "#/components/schemas/StockLocationAddressInput" */ export class AdminPostStockLocationsReq { diff --git a/packages/medusa/src/api/routes/admin/stock-locations/delete-stock-location.ts b/packages/medusa/src/api/routes/admin/stock-locations/delete-stock-location.ts index d9fbfabc66..c50776ca90 100644 --- a/packages/medusa/src/api/routes/admin/stock-locations/delete-stock-location.ts +++ b/packages/medusa/src/api/routes/admin/stock-locations/delete-stock-location.ts @@ -6,10 +6,10 @@ import { SalesChannelLocationService } from "../../../../services" * @oas [delete] /admin/stock-locations/{id} * operationId: "DeleteStockLocationsStockLocation" * summary: "Delete a Stock Location" - * description: "Delete a Stock Location" + * description: "Delete a Stock Location." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the Stock Location to delete. + * - (path) id=* {string} The ID of the Stock Location. * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -17,15 +17,15 @@ import { SalesChannelLocationService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.stockLocations.delete(stock_location_id) + * medusa.admin.stockLocations.delete(stockLocationId) * .then(({ id, object, deleted }) => { * console.log(id) * }) * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/stock-locations/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/stock-locations/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] @@ -37,19 +37,7 @@ import { SalesChannelLocationService } from "../../../../services" * content: * application/json: * schema: - * type: object - * properties: - * id: - * type: string - * description: The ID of the deleted Stock Location. - * object: - * type: string - * description: The type of the object that was deleted. - * format: stock_location - * deleted: - * type: boolean - * description: Whether or not the Stock Location was deleted. - * default: true + * $ref: "#/components/schemas/AdminStockLocationsDeleteRes" * "400": * $ref: "#/components/responses/400_error" */ diff --git a/packages/medusa/src/api/routes/admin/stock-locations/get-stock-location.ts b/packages/medusa/src/api/routes/admin/stock-locations/get-stock-location.ts index f4e83d3b11..8752489e2f 100644 --- a/packages/medusa/src/api/routes/admin/stock-locations/get-stock-location.ts +++ b/packages/medusa/src/api/routes/admin/stock-locations/get-stock-location.ts @@ -11,12 +11,12 @@ import { joinSalesChannels } from "./utils/join-sales-channels" * @oas [get] /admin/stock-locations/{id} * operationId: "GetStockLocationsStockLocation" * summary: "Get a Stock Location" - * description: "Retrieves the Stock Location." + * description: "Retrieve a Stock Location's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Stock Location. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned stock location. + * - (query) fields {string} Comma-separated fields that should be included in the returned stock location. * x-codegen: * method: retrieve * queryParams: AdminGetStockLocationsLocationParams @@ -34,8 +34,8 @@ import { joinSalesChannels } from "./utils/join-sales-channels" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/stock-locations/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ + * curl 'https://medusa-url.com/admin/stock-locations/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/stock-locations/index.ts b/packages/medusa/src/api/routes/admin/stock-locations/index.ts index 0d9879678f..32ffe97fb4 100644 --- a/packages/medusa/src/api/routes/admin/stock-locations/index.ts +++ b/packages/medusa/src/api/routes/admin/stock-locations/index.ts @@ -116,6 +116,7 @@ export type AdminStockLocationsDeleteRes = DeleteResponse * - stock_location * properties: * stock_location: + * description: "Stock location details." * $ref: "#/components/schemas/StockLocationExpandedDTO" */ export type AdminStockLocationsRes = { @@ -140,7 +141,7 @@ export type AdminStockLocationsRes = { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of stock locations skipped when retrieving the stock locations. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/admin/stock-locations/list-stock-locations.ts b/packages/medusa/src/api/routes/admin/stock-locations/list-stock-locations.ts index a0abf615ba..038b084612 100644 --- a/packages/medusa/src/api/routes/admin/stock-locations/list-stock-locations.ts +++ b/packages/medusa/src/api/routes/admin/stock-locations/list-stock-locations.ts @@ -13,15 +13,15 @@ import { joinSalesChannels } from "./utils/join-sales-channels" * @oas [get] /admin/stock-locations * operationId: "GetStockLocations" * summary: "List Stock Locations" - * description: "Retrieves a list of stock locations" + * description: "Retrieve a list of stock locations. The stock locations can be filtered by fields such as `name` or `created_at`. The stock locations can also be sorted or paginated." * x-authenticated: true * parameters: - * - (query) id {string} ID of the stock location - * - (query) name {string} Name of the stock location - * - (query) order {string} The field to order the results by. + * - (query) id {string} Filter by ID. + * - (query) name {string} Filter by name. + * - (query) order {string} A stock-location field to sort-order the retrieved stock locations by. * - in: query * name: created_at - * description: Date comparison for when resulting collections were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -43,7 +43,7 @@ import { joinSalesChannels } from "./utils/join-sales-channels" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting collections were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -65,7 +65,7 @@ import { joinSalesChannels } from "./utils/join-sales-channels" * format: date * - in: query * name: deleted_at - * description: Date comparison for when resulting collections were deleted. + * description: Filter by a deletion date range. * schema: * type: object * properties: @@ -85,10 +85,10 @@ import { joinSalesChannels } from "./utils/join-sales-channels" * type: string * description: filter by dates greater than or equal to this date * format: date - * - (query) offset=0 {integer} How many stock locations to skip in the result. + * - (query) offset=0 {integer} The number of stock locations to skip when retrieving the stock locations. * - (query) limit=20 {integer} Limit the number of stock locations returned. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each stock location of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each stock location of the result. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned stock locations. + * - (query) fields {string} Comma-separated fields that should be included in the returned stock locations. * x-codegen: * method: list * queryParams: AdminGetStockLocationsParams @@ -106,8 +106,8 @@ import { joinSalesChannels } from "./utils/join-sales-channels" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/stock-locations' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/stock-locations' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/stock-locations/update-stock-location.ts b/packages/medusa/src/api/routes/admin/stock-locations/update-stock-location.ts index fdb47c27e2..e5b80a57b5 100644 --- a/packages/medusa/src/api/routes/admin/stock-locations/update-stock-location.ts +++ b/packages/medusa/src/api/routes/admin/stock-locations/update-stock-location.ts @@ -8,12 +8,12 @@ import { FindParams } from "../../../../types/common" * @oas [post] /admin/stock-locations/{id} * operationId: "PostStockLocationsStockLocation" * summary: "Update a Stock Location" - * description: "Updates a Stock Location." + * description: "Update a Stock Location's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Stock Location. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned stock location. + * - (query) fields {string} Comma-separated fields that should be included in the returned stock location. * requestBody: * content: * application/json: @@ -37,9 +37,9 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/stock-locations/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/stock-locations/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "Main Warehouse" * }' diff --git a/packages/medusa/src/api/routes/admin/store/add-currency.ts b/packages/medusa/src/api/routes/admin/store/add-currency.ts index 89798a0329..1f40d40ace 100644 --- a/packages/medusa/src/api/routes/admin/store/add-currency.ts +++ b/packages/medusa/src/api/routes/admin/store/add-currency.ts @@ -5,7 +5,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/store/currencies/{code} * operationId: "PostStoreCurrenciesCode" * summary: "Add a Currency Code" - * description: "Adds a Currency Code to the available currencies." + * description: "Add a Currency Code to the available currencies in a store. This does not create new currencies, as currencies are defined within the Medusa backend. To create a currency, you can create a migration that inserts the currency into the database." * x-authenticated: true * parameters: * - in: path @@ -26,15 +26,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.store.addCurrency('eur') + * medusa.admin.store.addCurrency("eur") * .then(({ store }) => { * console.log(store.currencies); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/store/currencies/eur' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X POST 'https://medusa-url.com/admin/store/currencies/{currency_code}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/store/get-store.ts b/packages/medusa/src/api/routes/admin/store/get-store.ts index e8f483979e..a07212011c 100644 --- a/packages/medusa/src/api/routes/admin/store/get-store.ts +++ b/packages/medusa/src/api/routes/admin/store/get-store.ts @@ -12,7 +12,7 @@ import { FlagRouter } from "../../../../utils/flag-router" * @oas [get] /admin/store * operationId: "GetStore" * summary: "Get Store details" - * description: "Retrieves the Store details" + * description: "Retrieve the Store's details." * x-authenticated: true * x-codegen: * method: retrieve @@ -30,8 +30,8 @@ import { FlagRouter } from "../../../../utils/flag-router" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/store' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/store' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/store/index.ts b/packages/medusa/src/api/routes/admin/store/index.ts index 61db135a58..316bf489a5 100644 --- a/packages/medusa/src/api/routes/admin/store/index.ts +++ b/packages/medusa/src/api/routes/admin/store/index.ts @@ -44,6 +44,7 @@ export const defaultRelationsExtended = ["currencies", "default_currency"] * - store * properties: * store: + * description: Store details. * $ref: "#/components/schemas/ExtendedStoreDTO" */ export type AdminExtendedStoresRes = { @@ -57,6 +58,7 @@ export type AdminExtendedStoresRes = { * - store * properties: * store: + * description: Store details. * $ref: "#/components/schemas/Store" */ export type AdminStoresRes = { @@ -71,6 +73,7 @@ export type AdminStoresRes = { * properties: * tax_providers: * type: array + * description: An array of tax providers details. * items: * $ref: "#/components/schemas/TaxProvider" */ @@ -86,6 +89,7 @@ export type AdminTaxProvidersList = { * properties: * payment_providers: * type: array + * description: An array of payment providers details. * items: * $ref: "#/components/schemas/PaymentProvider" */ diff --git a/packages/medusa/src/api/routes/admin/store/list-payment-providers.ts b/packages/medusa/src/api/routes/admin/store/list-payment-providers.ts index bb14683a04..d9e82a8afe 100644 --- a/packages/medusa/src/api/routes/admin/store/list-payment-providers.ts +++ b/packages/medusa/src/api/routes/admin/store/list-payment-providers.ts @@ -4,7 +4,7 @@ import { PaymentProviderService } from "../../../../services" * @oas [get] /admin/store/payment-providers * operationId: "GetStorePaymentProviders" * summary: "List Payment Providers" - * description: "Retrieves the configured Payment Providers" + * description: "Retrieve a list of available Payment Providers in a store." * x-authenticated: true * x-codegen: * method: listPaymentProviders @@ -22,8 +22,8 @@ import { PaymentProviderService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/store/payment-providers' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/store/payment-providers' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/store/list-tax-providers.ts b/packages/medusa/src/api/routes/admin/store/list-tax-providers.ts index e0a4e4b1f3..a12d77003b 100644 --- a/packages/medusa/src/api/routes/admin/store/list-tax-providers.ts +++ b/packages/medusa/src/api/routes/admin/store/list-tax-providers.ts @@ -4,7 +4,7 @@ import { TaxProviderService } from "../../../../services" * @oas [get] /admin/store/tax-providers * operationId: "GetStoreTaxProviders" * summary: "List Tax Providers" - * description: "Retrieves the configured Tax Providers" + * description: "Retrieve a list of available Tax Providers in a store." * x-authenticated: true * x-codegen: * method: listTaxProviders @@ -22,8 +22,8 @@ import { TaxProviderService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/store/tax-providers' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/store/tax-providers' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/store/remove-currency.ts b/packages/medusa/src/api/routes/admin/store/remove-currency.ts index 39ace9ecda..ce8ef004dc 100644 --- a/packages/medusa/src/api/routes/admin/store/remove-currency.ts +++ b/packages/medusa/src/api/routes/admin/store/remove-currency.ts @@ -4,8 +4,8 @@ import { EntityManager } from "typeorm" /** * @oas [delete] /admin/store/currencies/{code} * operationId: "DeleteStoreCurrenciesCode" - * summary: "Delete a Currency Code" - * description: "Removes a Currency Code from the available currencies." + * summary: "Remove a Currency" + * description: "Remove a Currency Code from the available currencies in a store. This does not completely delete the currency and it can be added again later to the store." * x-authenticated: true * parameters: * - in: path @@ -26,15 +26,15 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.store.deleteCurrency('eur') + * medusa.admin.store.deleteCurrency("eur") * .then(({ store }) => { * console.log(store.currencies); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/store/currencies/eur' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/store/currencies/{currency_code}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/store/update-store.ts b/packages/medusa/src/api/routes/admin/store/update-store.ts index 006f2d633c..bc9d4ef71d 100644 --- a/packages/medusa/src/api/routes/admin/store/update-store.ts +++ b/packages/medusa/src/api/routes/admin/store/update-store.ts @@ -8,7 +8,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/store * operationId: "PostStore" * summary: "Update Store Details" - * description: "Updates the Store details" + * description: "Update the Store's details." * x-authenticated: true * requestBody: * content: @@ -25,7 +25,7 @@ import { EntityManager } from "typeorm" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.store.update({ - * name: 'Medusa Store' + * name: "Medusa Store" * }) * .then(({ store }) => { * console.log(store.id); @@ -33,9 +33,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/store' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/store' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "Medusa Store" * }' @@ -87,25 +87,31 @@ export default async (req, res) => { * description: "The name of the Store" * type: string * swap_link_template: - * description: "A template for Swap links - use `{{cart_id}}` to insert the Swap Cart id" + * description: "A template for Swap links - use `{{cart_id}}` to insert the Swap Cart ID" * type: string + * example: "http://example.com/swaps/{{cart_id}}" * payment_link_template: - * description: "A template for payment links links - use `{{cart_id}}` to insert the Cart id" + * description: "A template for payment links - use `{{cart_id}}` to insert the Cart ID" + * example: "http://example.com/payments/{{cart_id}}" * type: string * invite_link_template: * description: "A template for invite links - use `{{invite_token}}` to insert the invite token" + * example: "http://example.com/invite?token={{invite_token}}" * type: string * default_currency_code: - * description: "The default currency code for the Store." + * description: "The default currency code of the Store." * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * currencies: - * description: "Array of currencies in 2 character ISO code format." + * description: "Array of available currencies in the store. Each currency is in 3 character ISO code format." * type: array * items: * type: string + * externalDocs: + * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + * description: See a list of codes. * metadata: * description: "An optional set of key-value pairs with additional information." * type: object diff --git a/packages/medusa/src/api/routes/admin/swaps/get-swap.ts b/packages/medusa/src/api/routes/admin/swaps/get-swap.ts index 46d8b25b44..7547e1f2aa 100644 --- a/packages/medusa/src/api/routes/admin/swaps/get-swap.ts +++ b/packages/medusa/src/api/routes/admin/swaps/get-swap.ts @@ -6,7 +6,7 @@ import { SwapService } from "../../../../services" * @oas [get] /admin/swaps/{id} * operationId: "GetSwapsSwap" * summary: "Get a Swap" - * description: "Retrieves a Swap." + * description: "Retrieve a Swap's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Swap. @@ -19,15 +19,15 @@ import { SwapService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.swaps.retrieve(swap_id) + * medusa.admin.swaps.retrieve(swapId) * .then(({ swap }) => { * console.log(swap.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/swaps/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/swaps/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/swaps/index.ts b/packages/medusa/src/api/routes/admin/swaps/index.ts index ed67ce031f..0b73125db1 100644 --- a/packages/medusa/src/api/routes/admin/swaps/index.ts +++ b/packages/medusa/src/api/routes/admin/swaps/index.ts @@ -66,6 +66,7 @@ export const defaultAdminSwapFields = [ * properties: * swaps: * type: array + * description: "An array of swaps details." * items: * $ref: "#/components/schemas/Swap" * count: @@ -73,7 +74,7 @@ export const defaultAdminSwapFields = [ * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of swaps skipped when retrieving the swaps. * limit: * type: integer * description: The number of items per page @@ -107,6 +108,7 @@ export type AdminSwapsListRes = PaginatedResponse & { * - swap * properties: * swap: + * description: "Swap details." * $ref: "#/components/schemas/Swap" */ export type AdminSwapsRes = { diff --git a/packages/medusa/src/api/routes/admin/swaps/list-swaps.ts b/packages/medusa/src/api/routes/admin/swaps/list-swaps.ts index deb8d1faea..45685522f4 100644 --- a/packages/medusa/src/api/routes/admin/swaps/list-swaps.ts +++ b/packages/medusa/src/api/routes/admin/swaps/list-swaps.ts @@ -10,10 +10,10 @@ import { validator } from "../../../../utils/validator" * @oas [get] /admin/swaps * operationId: "GetSwaps" * summary: "List Swaps" - * description: "Retrieves a list of Swaps." + * description: "Retrieve a list of Swaps. The swaps can be paginated." * parameters: - * - (query) limit=50 {number} The upper limit for the amount of responses returned. - * - (query) offset=0 {number} The offset of the list returned. + * - (query) limit=50 {number} Limit the number of swaps returned. + * - (query) offset=0 {number} The number of swaps to skip when retrieving the swaps. * x-authenticated: true * x-codegen: * method: list @@ -32,8 +32,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/swaps' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/swaps' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/tax-rates/add-to-product-types.ts b/packages/medusa/src/api/routes/admin/tax-rates/add-to-product-types.ts index 6b1b23d4d4..d366cbe69a 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/add-to-product-types.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/add-to-product-types.ts @@ -15,7 +15,7 @@ import { validator } from "../../../../utils/validator" * - (path) id=* {string} ID of the tax rate. * - in: query * name: fields - * description: "Which fields should be included in the result." + * description: "Comma-separated fields that should be included in the returned tax rate." * style: form * explode: false * schema: @@ -24,7 +24,7 @@ import { validator } from "../../../../utils/validator" * type: string * - in: query * name: expand - * description: "Which fields should be expanded and retrieved in the result." + * description: "Comma-separated relations that should be expanded in the returned tax rate." * style: form * explode: false * schema: @@ -47,9 +47,9 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.taxRates.addProductTypes(tax_rate_id, { + * medusa.admin.taxRates.addProductTypes(taxRateId, { * product_types: [ - * product_type_id + * productTypeId * ] * }) * .then(({ tax_rate }) => { @@ -58,9 +58,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "product_types": [ * "{product_type_id}" diff --git a/packages/medusa/src/api/routes/admin/tax-rates/add-to-products.ts b/packages/medusa/src/api/routes/admin/tax-rates/add-to-products.ts index d06dbfce43..0f4d90b2a0 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/add-to-products.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/add-to-products.ts @@ -10,12 +10,12 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/tax-rates/{id}/products/batch * operationId: "PostTaxRatesTaxRateProducts" * summary: "Add to Products" - * description: "Associates a Tax Rate with a list of Products" + * description: "Associates a Tax Rate with a list of Products." * parameters: * - (path) id=* {string} ID of the tax rate. * - in: query * name: fields - * description: "Which fields should be included in the result." + * description: "Comma-separated fields that should be included in the returned tax rate." * style: form * explode: false * schema: @@ -24,7 +24,7 @@ import { validator } from "../../../../utils/validator" * type: string * - in: query * name: expand - * description: "Which fields should be expanded and retrieved in the result." + * description: "Comma-separated relations that should be expanded in the returned tax rate." * style: form * explode: false * schema: @@ -47,9 +47,9 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.taxRates.addProducts(tax_rate_id, { + * medusa.admin.taxRates.addProducts(taxRateId, { * products: [ - * product_id + * productId * ] * }) * .then(({ tax_rate }) => { @@ -58,9 +58,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "products": [ * "{product_id}" diff --git a/packages/medusa/src/api/routes/admin/tax-rates/add-to-shipping-options.ts b/packages/medusa/src/api/routes/admin/tax-rates/add-to-shipping-options.ts index 95cb8ef5ea..9f8da8c918 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/add-to-shipping-options.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/add-to-shipping-options.ts @@ -10,12 +10,12 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/tax-rates/{id}/shipping-options/batch * operationId: "PostTaxRatesTaxRateShippingOptions" * summary: "Add to Shipping Options" - * description: "Associates a Tax Rate with a list of Shipping Options" + * description: "Associates a Tax Rate with a list of Shipping Options." * parameters: * - (path) id=* {string} ID of the tax rate. * - in: query * name: fields - * description: "Which fields should be included in the result." + * description: "Comma-separated fields that should be included in the returned tax rate." * style: form * explode: false * schema: @@ -24,7 +24,7 @@ import { validator } from "../../../../utils/validator" * type: string * - in: query * name: expand - * description: "Which fields should be expanded and retrieved in the result." + * description: "Comma-separated relations that should be expanded in the returned tax rate." * style: form * explode: false * schema: @@ -47,9 +47,9 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.taxRates.addShippingOptions(tax_rate_id, { + * medusa.admin.taxRates.addShippingOptions(taxRateId, { * shipping_options: [ - * shipping_option_id + * shippingOptionId * ] * }) * .then(({ tax_rate }) => { @@ -58,9 +58,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "shipping_options": [ * "{shipping_option_id}" diff --git a/packages/medusa/src/api/routes/admin/tax-rates/create-tax-rate.ts b/packages/medusa/src/api/routes/admin/tax-rates/create-tax-rate.ts index 9a24565bc3..e517a9413f 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/create-tax-rate.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/create-tax-rate.ts @@ -12,11 +12,11 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/tax-rates * operationId: "PostTaxRates" * summary: "Create a Tax Rate" - * description: "Creates a Tax Rate" + * description: "Create a Tax Rate." * parameters: * - in: query * name: fields - * description: "Which fields should be included in the result." + * description: "Comma-separated fields that should be included in the returned tax rate." * style: form * explode: false * schema: @@ -25,7 +25,7 @@ import { validator } from "../../../../utils/validator" * type: string * - in: query * name: expand - * description: "Which fields should be expanded and retrieved in the result." + * description: "Comma-separated relations that should be expanded in the returned tax rate." * style: form * explode: false * schema: @@ -49,8 +49,8 @@ import { validator } from "../../../../utils/validator" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.taxRates.create({ - * code: 'TEST', - * name: 'New Tax Rate', + * code: "TEST", + * name: "New Tax Rate", * region_id * }) * .then(({ tax_rate }) => { @@ -59,9 +59,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/tax-rates' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/tax-rates' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "code": "TEST", * "name": "New Tax Rate", @@ -149,19 +149,19 @@ export default async (req, res) => { * properties: * code: * type: string - * description: "A code to identify the tax type by" + * description: "The code of the tax rate." * name: * type: string - * description: "A human friendly name for the tax" + * description: "The name of the tax rate." * region_id: * type: string - * description: "The ID of the Region that the rate belongs to" + * description: "The ID of the Region that the tax rate belongs to." * rate: * type: number - * description: "The numeric rate to charge" + * description: "The numeric rate to charge." * products: * type: array - * description: "The IDs of the products associated with this tax rate" + * description: "The IDs of the products associated with this tax rate." * items: * type: string * shipping_options: diff --git a/packages/medusa/src/api/routes/admin/tax-rates/delete-tax-rate.ts b/packages/medusa/src/api/routes/admin/tax-rates/delete-tax-rate.ts index 0f6c3047d8..5bdc70b34d 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/delete-tax-rate.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/delete-tax-rate.ts @@ -5,7 +5,7 @@ import { TaxRateService } from "../../../../services" * @oas [delete] /admin/tax-rates/{id} * operationId: "DeleteTaxRatesTaxRate" * summary: "Delete a Tax Rate" - * description: "Deletes a Tax Rate" + * description: "Delete a Tax Rate. Resources associated with the tax rate, such as products or product types, are not deleted." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Shipping Option. @@ -18,15 +18,15 @@ import { TaxRateService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.taxRates.delete(tax_rate_id) + * medusa.admin.taxRates.delete(taxRateId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/tax-rates/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/tax-rates/get-tax-rate.ts b/packages/medusa/src/api/routes/admin/tax-rates/get-tax-rate.ts index f64d4679d4..dfb11ec8c8 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/get-tax-rate.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/get-tax-rate.ts @@ -9,12 +9,12 @@ import { validator } from "../../../../utils/validator" * @oas [get] /admin/tax-rates/{id} * operationId: "GetTaxRatesTaxRate" * summary: "Get a Tax Rate" - * description: "Retrieves a TaxRate" + * description: "Retrieve a Tax Rate's details." * parameters: * - (path) id=* {string} ID of the tax rate. * - in: query * name: fields - * description: "Which fields should be included in the result." + * description: "Comma-separated fields that should be included in the returned tax rate." * style: form * explode: false * schema: @@ -23,7 +23,7 @@ import { validator } from "../../../../utils/validator" * type: string * - in: query * name: expand - * description: "Which fields should be expanded and retrieved in the result." + * description: "Comma-separated relations that should be expanded in the returned tax rate." * style: form * explode: false * schema: @@ -41,15 +41,15 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.taxRates.retrieve(tax_rate_id) + * medusa.admin.taxRates.retrieve(taxRateId) * .then(({ tax_rate }) => { * console.log(tax_rate.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/tax-rates/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/tax-rates/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/tax-rates/index.ts b/packages/medusa/src/api/routes/admin/tax-rates/index.ts index fdc6729743..e5362848c8 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/index.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/index.ts @@ -129,6 +129,7 @@ export type AdminTaxRatesDeleteRes = DeleteResponse * properties: * tax_rates: * type: array + * description: "An array of tax rate details." * items: * $ref: "#/components/schemas/TaxRate" * count: @@ -136,7 +137,7 @@ export type AdminTaxRatesDeleteRes = DeleteResponse * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of tax rates to skip when retrieving the tax rates. * limit: * type: integer * description: The number of items per page @@ -152,6 +153,7 @@ export type AdminTaxRatesListRes = PaginatedResponse & { * - tax_rate * properties: * tax_rate: + * description: "Tax rate details." * $ref: "#/components/schemas/TaxRate" */ export type AdminTaxRatesRes = { diff --git a/packages/medusa/src/api/routes/admin/tax-rates/list-tax-rates.ts b/packages/medusa/src/api/routes/admin/tax-rates/list-tax-rates.ts index 6391403fdb..71a1cdd383 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/list-tax-rates.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/list-tax-rates.ts @@ -13,22 +13,22 @@ import { validator } from "../../../../utils/validator" * @oas [get] /admin/tax-rates * operationId: "GetTaxRates" * summary: "List Tax Rates" - * description: "Retrieves a list of TaxRates" + * description: "Retrieve a list of Tax Rates. The tax rates can be filtered by fields such as `name` or `rate`. The tax rates can also be paginated." * x-authenticated: true * parameters: - * - (query) name {string} Name of tax rate to retrieve + * - (query) name {string} Filter by name. * - in: query * name: region_id * style: form * explode: false - * description: Filter by Region ID + * description: Filter by Region IDs * schema: * oneOf: * - type: string * - type: array * items: * type: string - * - (query) code {string} code to search for. + * - (query) code {string} Filter by code. * - in: query * name: rate * style: form @@ -51,11 +51,11 @@ import { validator } from "../../../../utils/validator" * gte: * type: number * description: filter by rates greater than or equal to this number - * - (query) offset=0 {integer} How many tax rates to skip before retrieving the result. + * - (query) offset=0 {integer} The number of tax rates to skip when retrieving the tax rates. * - (query) limit=50 {integer} Limit the number of tax rates returned. * - in: query * name: fields - * description: "Which fields should be included in each item." + * description: "Comma-separated fields that should be included in the returned tax rate." * style: form * explode: false * schema: @@ -64,7 +64,7 @@ import { validator } from "../../../../utils/validator" * type: string * - in: query * name: expand - * description: "Which fields should be expanded and retrieved for each item." + * description: "Comma-separated relations that should be expanded in the returned tax rate." * style: form * explode: false * schema: @@ -88,8 +88,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/tax-rates' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/tax-rates' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/tax-rates/remove-from-product-types.ts b/packages/medusa/src/api/routes/admin/tax-rates/remove-from-product-types.ts index 5de48f9b2f..e750bd1169 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/remove-from-product-types.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/remove-from-product-types.ts @@ -9,13 +9,13 @@ import { validator } from "../../../../utils/validator" /** * @oas [delete] /admin/tax-rates/{id}/product-types/batch * operationId: "DeleteTaxRatesTaxRateProductTypes" - * summary: "Delete from Product Types" - * description: "Removes a Tax Rate from a list of Product Types" + * summary: "Remove Product Types from Rate" + * description: "Remove product types from a tax rate. This only removes the association between the product types and the tax rate. It does not delete the product types." * parameters: * - (path) id=* {string} ID of the tax rate. * - in: query * name: fields - * description: "Which fields should be included in the result." + * description: "Comma-separated fields that should be included in the returned tax rate." * style: form * explode: false * schema: @@ -24,7 +24,7 @@ import { validator } from "../../../../utils/validator" * type: string * - in: query * name: expand - * description: "Which fields should be expanded and retrieved in the result." + * description: "Comma-separated relations that should be expanded in the returned tax rate." * style: form * explode: false * schema: @@ -47,9 +47,9 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.taxRates.removeProductTypes(tax_rate_id, { + * medusa.admin.taxRates.removeProductTypes(taxRateId, { * product_types: [ - * product_type_id + * productTypeId * ] * }) * .then(({ tax_rate }) => { @@ -58,9 +58,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "product_types": [ * "{product_type_id}" @@ -129,7 +129,7 @@ export default async (req, res) => { * properties: * product_types: * type: array - * description: "The IDs of the types of products to remove association with this tax rate" + * description: "The IDs of the product types to remove their association with this tax rate." * items: * type: string */ diff --git a/packages/medusa/src/api/routes/admin/tax-rates/remove-from-products.ts b/packages/medusa/src/api/routes/admin/tax-rates/remove-from-products.ts index 4e363900f7..c2f139650d 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/remove-from-products.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/remove-from-products.ts @@ -9,13 +9,13 @@ import { validator } from "../../../../utils/validator" /** * @oas [delete] /admin/tax-rates/{id}/products/batch * operationId: "DeleteTaxRatesTaxRateProducts" - * summary: "Delete from Products" - * description: "Removes a Tax Rate from a list of Products" + * summary: "Remove Products from Rate" + * description: "Remove products from a tax rate. This only removes the association between the products and the tax rate. It does not delete the products." * parameters: * - (path) id=* {string} ID of the tax rate. * - in: query * name: fields - * description: "Which fields should be included in the result." + * description: "Comma-separated fields that should be included in the returned tax rate." * style: form * explode: false * schema: @@ -24,7 +24,7 @@ import { validator } from "../../../../utils/validator" * type: string * - in: query * name: expand - * description: "Which fields should be expanded and retrieved in the result." + * description: "Comma-separated relations that should be expanded in the returned tax rate." * style: form * explode: false * schema: @@ -47,9 +47,9 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.taxRates.removeProducts(tax_rate_id, { + * medusa.admin.taxRates.removeProducts(taxRateId, { * products: [ - * product_id + * productId * ] * }) * .then(({ tax_rate }) => { @@ -58,9 +58,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "products": [ * "{product_id}" @@ -126,7 +126,7 @@ export default async (req, res) => { * properties: * products: * type: array - * description: "The IDs of the products to remove association with this tax rate" + * description: "The IDs of the products to remove their association with this tax rate." * items: * type: string */ diff --git a/packages/medusa/src/api/routes/admin/tax-rates/remove-from-shipping-options.ts b/packages/medusa/src/api/routes/admin/tax-rates/remove-from-shipping-options.ts index b438aebadb..5a84dcca1e 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/remove-from-shipping-options.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/remove-from-shipping-options.ts @@ -9,13 +9,13 @@ import { validator } from "../../../../utils/validator" /** * @oas [delete] /admin/tax-rates/{id}/shipping-options/batch * operationId: "DeleteTaxRatesTaxRateShippingOptions" - * summary: "Del. for Shipping Options" - * description: "Removes a Tax Rate from a list of Shipping Options" + * summary: "Remove Shipping Options from Rate" + * description: "Remove shipping options from a tax rate. This only removes the association between the shipping options and the tax rate. It does not delete the shipping options." * parameters: * - (path) id=* {string} ID of the tax rate. * - in: query * name: fields - * description: "Which fields should be included in the result." + * description: "Comma-separated fields that should be included in the returned tax rate." * style: form * explode: false * schema: @@ -24,7 +24,7 @@ import { validator } from "../../../../utils/validator" * type: string * - in: query * name: expand - * description: "Which fields should be expanded and retrieved in the result." + * description: "Comma-separated relations that should be expanded in the returned tax rate." * style: form * explode: false * schema: @@ -47,9 +47,9 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.taxRates.removeShippingOptions(tax_rate_id, { + * medusa.admin.taxRates.removeShippingOptions(taxRateId, { * shipping_options: [ - * shipping_option_id + * shippingOptionId * ] * }) * .then(({ tax_rate }) => { @@ -58,9 +58,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "shipping_options": [ * "{shipping_option_id}" @@ -129,7 +129,7 @@ export default async (req, res) => { * properties: * shipping_options: * type: array - * description: "The IDs of the shipping options to remove association with this tax rate" + * description: "The IDs of the shipping options to remove their association with this tax rate." * items: * type: string */ diff --git a/packages/medusa/src/api/routes/admin/tax-rates/update-tax-rate.ts b/packages/medusa/src/api/routes/admin/tax-rates/update-tax-rate.ts index 0966b8c10c..5e3e0f44c4 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/update-tax-rate.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/update-tax-rate.ts @@ -12,12 +12,12 @@ import { validator } from "../../../../utils/validator" * @oas [post] /admin/tax-rates/{id} * operationId: "PostTaxRatesTaxRate" * summary: "Update a Tax Rate" - * description: "Updates a Tax Rate" + * description: "Update a Tax Rate's details." * parameters: * - (path) id=* {string} ID of the tax rate. * - in: query * name: fields - * description: "Which fields should be included in the result." + * description: "Comma-separated fields that should be included in the returned tax rate." * style: form * explode: false * schema: @@ -26,7 +26,7 @@ import { validator } from "../../../../utils/validator" * type: string * - in: query * name: expand - * description: "Which fields should be expanded and retrieved in the result." + * description: "Comma-separated relations that should be expanded in the returned tax rate." * style: form * explode: false * schema: @@ -49,8 +49,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.taxRates.update(tax_rate_id, { - * name: 'New Tax Rate' + * medusa.admin.taxRates.update(taxRateId, { + * name: "New Tax Rate" * }) * .then(({ tax_rate }) => { * console.log(tax_rate.id); @@ -58,9 +58,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/tax-rates/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "name": "New Tax Rate" * }' @@ -142,16 +142,16 @@ export default async (req, res) => { * properties: * code: * type: string - * description: "A code to identify the tax type by" + * description: "The code of the tax rate." * name: * type: string - * description: "A human friendly name for the tax" + * description: "The name of the tax rate." * region_id: * type: string - * description: "The ID of the Region that the rate belongs to" + * description: "The ID of the Region that the tax rate belongs to." * rate: * type: number - * description: "The numeric rate to charge" + * description: "The numeric rate to charge." * products: * type: array * description: "The IDs of the products associated with this tax rate" @@ -164,7 +164,7 @@ export default async (req, res) => { * type: string * product_types: * type: array - * description: "The IDs of the types of products associated with this tax rate" + * description: "The IDs of the types of product types associated with this tax rate" * items: * type: string */ diff --git a/packages/medusa/src/api/routes/admin/uploads/create-protected-upload.ts b/packages/medusa/src/api/routes/admin/uploads/create-protected-upload.ts index 58b026ec80..b9c7b832ef 100644 --- a/packages/medusa/src/api/routes/admin/uploads/create-protected-upload.ts +++ b/packages/medusa/src/api/routes/admin/uploads/create-protected-upload.ts @@ -5,7 +5,7 @@ import { IFileService } from "../../../../interfaces" * @oas [post] /admin/uploads/protected * operationId: "PostUploadsProtected" * summary: "Protected File Upload" - * description: "Uploads at least one file with ACL or a non-public bucket to the specific fileservice that is installed in Medusa." + * description: "Upload at least one file to an ACL or a non-public bucket. The file upload is handled by the file service installed on the Medusa backend." * x-authenticated: true * requestBody: * content: @@ -30,9 +30,9 @@ import { IFileService } from "../../../../interfaces" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/uploads/protected' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: image/jpeg' \ + * curl -X POST 'https://medusa-url.com/admin/uploads/protected' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: image/jpeg' \ * --form 'files=@""' \ * --form 'files=@""' * security: diff --git a/packages/medusa/src/api/routes/admin/uploads/create-upload.ts b/packages/medusa/src/api/routes/admin/uploads/create-upload.ts index 8ac621fb25..1168474be4 100644 --- a/packages/medusa/src/api/routes/admin/uploads/create-upload.ts +++ b/packages/medusa/src/api/routes/admin/uploads/create-upload.ts @@ -3,8 +3,8 @@ import fs from "fs" /** * @oas [post] /admin/uploads * operationId: "PostUploads" - * summary: "Upload files" - * description: "Uploads at least one file to the specific fileservice that is installed in Medusa." + * summary: "Upload Files" + * description: "Upload at least one file to a public bucket or storage. The file upload is handled by the file service installed on the Medusa backend." * x-authenticated: true * requestBody: * content: @@ -29,9 +29,9 @@ import fs from "fs" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/uploads' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: image/jpeg' \ + * curl -X POST 'https://medusa-url.com/admin/uploads' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: image/jpeg' \ * --form 'files=@""' \ * --form 'files=@""' * security: diff --git a/packages/medusa/src/api/routes/admin/uploads/delete-upload.ts b/packages/medusa/src/api/routes/admin/uploads/delete-upload.ts index db4892997f..383d01f5dc 100644 --- a/packages/medusa/src/api/routes/admin/uploads/delete-upload.ts +++ b/packages/medusa/src/api/routes/admin/uploads/delete-upload.ts @@ -4,7 +4,7 @@ import { IsString } from "class-validator" * @oas [delete] /admin/uploads * operationId: "DeleteUploads" * summary: "Delete an Uploaded File" - * description: "Removes an uploaded file using the installed fileservice" + * description: "Delete an uploaded file from storage. The file is deleted using the installed file service on the Medusa backend." * x-authenticated: true * requestBody: * content: @@ -27,9 +27,9 @@ import { IsString } from "class-validator" * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/uploads' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X DELETE 'https://medusa-url.com/admin/uploads' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "file_key": "{file_key}" * }' diff --git a/packages/medusa/src/api/routes/admin/uploads/get-download-url.ts b/packages/medusa/src/api/routes/admin/uploads/get-download-url.ts index 3b1129f862..b477301544 100644 --- a/packages/medusa/src/api/routes/admin/uploads/get-download-url.ts +++ b/packages/medusa/src/api/routes/admin/uploads/get-download-url.ts @@ -5,7 +5,7 @@ import { IsString } from "class-validator" * @oas [post] /admin/uploads/download-url * operationId: "PostUploadsDownloadUrl" * summary: "Get a File's Download URL" - * description: "Creates a presigned download url for a file" + * description: "Create and retrieve a presigned or public download URL for a file. The URL creation is handled by the file service installed on the Medusa backend." * x-authenticated: true * requestBody: * content: @@ -28,9 +28,9 @@ import { IsString } from "class-validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/uploads/download-url' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/uploads/download-url' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "file_key": "{file_key}" * }' diff --git a/packages/medusa/src/api/routes/admin/uploads/index.ts b/packages/medusa/src/api/routes/admin/uploads/index.ts index 05b97d21a2..0f665f25bd 100644 --- a/packages/medusa/src/api/routes/admin/uploads/index.ts +++ b/packages/medusa/src/api/routes/admin/uploads/index.ts @@ -47,6 +47,7 @@ export default (app) => { * properties: * uploads: * type: array + * description: "Uploaded files details." * items: * type: object * required: diff --git a/packages/medusa/src/api/routes/admin/users/create-user.ts b/packages/medusa/src/api/routes/admin/users/create-user.ts index 93dc3c9f80..7ce7ca71c6 100644 --- a/packages/medusa/src/api/routes/admin/users/create-user.ts +++ b/packages/medusa/src/api/routes/admin/users/create-user.ts @@ -10,7 +10,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/users * operationId: "PostUsers" * summary: "Create a User" - * description: "Creates a User" + * description: "Create an admin User. The user has the same privileges as all admin users, and will be able to authenticate and perform admin functionalities right after creation." * x-authenticated: true * requestBody: * content: @@ -27,8 +27,8 @@ import { EntityManager } from "typeorm" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.users.create({ - * email: 'user@example.com', - * password: 'supersecret' + * email: "user@example.com", + * password: "supersecret" * }) * .then(({ user }) => { * console.log(user.id); @@ -36,9 +36,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/users' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/users' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com", * "password": "supersecret" @@ -92,21 +92,21 @@ export default async (req, res) => { * - password * properties: * email: - * description: "The Users email." + * description: "The User's email." * type: string * format: email * first_name: - * description: "The name of the User." + * description: "The first name of the User." * type: string * last_name: - * description: "The name of the User." + * description: "The last name of the User." * type: string * role: - * description: "Userrole assigned to the user." + * description: "The role assigned to the user. These roles don't provide any different privileges." * type: string * enum: [admin, member, developer] * password: - * description: "The Users password." + * description: "The User's password." * type: string * format: password */ diff --git a/packages/medusa/src/api/routes/admin/users/delete-user.ts b/packages/medusa/src/api/routes/admin/users/delete-user.ts index 20c306fb76..25a36012b0 100644 --- a/packages/medusa/src/api/routes/admin/users/delete-user.ts +++ b/packages/medusa/src/api/routes/admin/users/delete-user.ts @@ -5,7 +5,7 @@ import UserService from "../../../../services/user" * @oas [delete] /admin/users/{id} * operationId: "DeleteUsersUser" * summary: "Delete a User" - * description: "Deletes a User" + * description: "Delete a User. Once deleted, the user will not be able to authenticate or perform admin functionalities." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the User. @@ -18,15 +18,15 @@ import UserService from "../../../../services/user" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.users.delete(user_id) + * medusa.admin.users.delete(userId) * .then(({ id, object, deleted }) => { * console.log(id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/admin/users/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl -X DELETE 'https://medusa-url.com/admin/users/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/users/get-user.ts b/packages/medusa/src/api/routes/admin/users/get-user.ts index 0b86dd8423..d92bcd2edc 100644 --- a/packages/medusa/src/api/routes/admin/users/get-user.ts +++ b/packages/medusa/src/api/routes/admin/users/get-user.ts @@ -4,7 +4,7 @@ import UserService from "../../../../services/user" * @oas [get] /admin/users/{id} * operationId: "GetUsersUser" * summary: "Get a User" - * description: "Retrieves a User." + * description: "Retrieve an admin user's details." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the User. @@ -17,15 +17,15 @@ import UserService from "../../../../services/user" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.users.retrieve(user_id) + * medusa.admin.users.retrieve(userId) * .then(({ user }) => { * console.log(user.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/users/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/users/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/users/index.ts b/packages/medusa/src/api/routes/admin/users/index.ts index afeef90d7e..8797e0d27b 100644 --- a/packages/medusa/src/api/routes/admin/users/index.ts +++ b/packages/medusa/src/api/routes/admin/users/index.ts @@ -42,6 +42,7 @@ export default (app) => { * - user * properties: * user: + * description: "User details." * $ref: "#/components/schemas/User" */ export type AdminUserRes = { @@ -56,6 +57,7 @@ export type AdminUserRes = { * properties: * users: * type: array + * description: "An array of users details." * items: * $ref: "#/components/schemas/User" */ diff --git a/packages/medusa/src/api/routes/admin/users/list-users.ts b/packages/medusa/src/api/routes/admin/users/list-users.ts index 008f3a4710..65d95b1962 100644 --- a/packages/medusa/src/api/routes/admin/users/list-users.ts +++ b/packages/medusa/src/api/routes/admin/users/list-users.ts @@ -4,7 +4,7 @@ import UserService from "../../../../services/user" * @oas [get] /admin/users * operationId: "GetUsers" * summary: "List Users" - * description: "Retrieves all users." + * description: "Retrieve all admin users." * x-authenticated: true * x-codegen: * method: list @@ -22,8 +22,8 @@ import UserService from "../../../../services/user" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/users' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/users' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/users/reset-password-token.ts b/packages/medusa/src/api/routes/admin/users/reset-password-token.ts index 77e4e86e88..f382d2114d 100644 --- a/packages/medusa/src/api/routes/admin/users/reset-password-token.ts +++ b/packages/medusa/src/api/routes/admin/users/reset-password-token.ts @@ -7,8 +7,10 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/users/password-token * operationId: "PostUsersUserPasswordToken" * summary: "Request Password Reset" - * description: "Generates a password token for a User with a given email." - * x-authenticated: true + * description: "Generate a password token for an admin user with a given email." + * externalDocs: + * description: How to reset a user's password + * url: https://docs.medusajs.com/modules/users/admin/manage-profile#reset-password * requestBody: * content: * application/json: @@ -24,7 +26,7 @@ import { EntityManager } from "typeorm" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.users.sendResetPasswordToken({ - * email: 'user@example.com' + * email: "user@example.com" * }) * .then(() => { * // successful @@ -35,9 +37,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/users/password-token' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/users/password-token' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com" * }' @@ -90,7 +92,7 @@ export default async (req, res) => { * - email * properties: * email: - * description: "The Users email." + * description: "The User's email." * type: string * format: email */ diff --git a/packages/medusa/src/api/routes/admin/users/reset-password.ts b/packages/medusa/src/api/routes/admin/users/reset-password.ts index 2cb115c498..18e27dfaca 100644 --- a/packages/medusa/src/api/routes/admin/users/reset-password.ts +++ b/packages/medusa/src/api/routes/admin/users/reset-password.ts @@ -12,8 +12,10 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/users/reset-password * operationId: "PostUsersUserPassword" * summary: "Reset Password" - * description: "Sets the password for a User given the correct token." - * x-authenticated: true + * description: "Reset the password of an admin User using their reset password token. A user must request to reset their password first before attempting to reset their password with this request." + * externalDocs: + * description: How to reset a user's password + * url: https://docs.medusajs.com/modules/users/admin/manage-profile#reset-password * requestBody: * content: * application/json: @@ -29,8 +31,8 @@ import { EntityManager } from "typeorm" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.users.resetPassword({ - * token: 'supersecrettoken', - * password: 'supersecret' + * token: "supersecrettoken", + * password: "supersecret" * }) * .then(({ user }) => { * console.log(user.id); @@ -38,9 +40,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/users/reset-password' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/users/reset-password' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "token": "supersecrettoken", * "password": "supersecret" @@ -129,14 +131,14 @@ export type payload = { * - password * properties: * email: - * description: "The Users email." + * description: "The User's email." * type: string * format: email * token: - * description: "The token generated from the 'password-token' endpoint." + * description: "The password-reset token generated when the password reset was requested." * type: string * password: - * description: "The Users new password." + * description: "The User's new password." * type: string * format: password */ diff --git a/packages/medusa/src/api/routes/admin/users/update-user.ts b/packages/medusa/src/api/routes/admin/users/update-user.ts index c1bc01594e..497dc47d1f 100644 --- a/packages/medusa/src/api/routes/admin/users/update-user.ts +++ b/packages/medusa/src/api/routes/admin/users/update-user.ts @@ -9,7 +9,7 @@ import { EntityManager } from "typeorm" * @oas [post] /admin/users/{id} * operationId: "PostUsersUser" * summary: "Update a User" - * description: "Updates a User" + * description: "Update an admin user's details." * parameters: * - (path) id=* {string} The ID of the User. * x-authenticated: true @@ -27,8 +27,8 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.users.update(user_id, { - * first_name: 'Marcellus' + * medusa.admin.users.update(userId, { + * first_name: "Marcellus" * }) * .then(({ user }) => { * console.log(user.id); @@ -36,9 +36,9 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/users/{id}' \ - * --header 'Authorization: Bearer {api_token}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/admin/users/{id}' \ + * -H 'Authorization: Bearer {api_token}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "first_name": "Marcellus" * }' @@ -88,17 +88,17 @@ export default async (req, res) => { * type: object * properties: * first_name: - * description: "The name of the User." + * description: "The first name of the User." * type: string * last_name: - * description: "The name of the User." + * description: "The last name of the User." * type: string * role: - * description: "Userrole assigned to the user." + * description: "The role assigned to the user. These roles don't provide any different privileges." * type: string * enum: [admin, member, developer] * api_token: - * description: "The api token of the User." + * description: "The API token of the User." * type: string * metadata: * description: An optional set of key-value pairs with additional information. diff --git a/packages/medusa/src/api/routes/admin/variants/get-inventory.ts b/packages/medusa/src/api/routes/admin/variants/get-inventory.ts index 1effc12b25..c735df61aa 100644 --- a/packages/medusa/src/api/routes/admin/variants/get-inventory.ts +++ b/packages/medusa/src/api/routes/admin/variants/get-inventory.ts @@ -15,11 +15,11 @@ import { joinLevels } from "../inventory-items/utils/join-levels" /** * @oas [get] /admin/variants/{id}/inventory * operationId: "GetVariantsVariantInventory" - * summary: "Get inventory of Variant." - * description: "Returns the available inventory of a Variant." + * summary: "Get Variant's Inventory" + * description: "Retrieve the available inventory of a Product Variant." * x-authenticated: true * parameters: - * - (path) id {string} The Product Variant id to get inventory for. + * - (path) id {string} The Product Variant ID. * x-codegen: * method: getInventory * x-codeSamples: @@ -30,14 +30,14 @@ import { joinLevels } from "../inventory-items/utils/join-levels" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token * medusa.admin.variants.list() - * .then(({ variants, limit, offset, count }) => { - * console.log(variants.length) - * }) + * .then(({ variants, limit, offset, count }) => { + * console.log(variants.length) + * }) * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/variants' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/variants' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] @@ -159,11 +159,20 @@ export type LevelWithAvailability = InventoryLevelDTO & { * allOf: * - $ref: "#/components/schemas/InventoryItemDTO" * - type: object - * required: - * - available_quantity * properties: - * available_quantity: - * type: number + * location_levels: + * type: array + * description: The inventory's location levels. + * items: + * allOf: + * - $ref: "#/components/schemas/InventoryItemDTO" + * - type: object + * required: + * - available_quantity + * properties: + * available_quantity: + * description: The available quantity in the inventory location. + * type: number */ export type ResponseInventoryItem = Partial & { location_levels?: LevelWithAvailability[] @@ -172,26 +181,36 @@ export type ResponseInventoryItem = Partial & { /** * @schema VariantInventory * type: object + * required: + * - id + * - inventory + * - sales_channel_availability * properties: * id: - * description: the id of the variant + * description: the ID of the variant * type: string * inventory: - * description: the stock location address ID + * description: The inventory details. * $ref: "#/components/schemas/ResponseInventoryItem" * sales_channel_availability: - * type: object - * description: An optional key-value map with additional details - * properties: - * channel_name: - * description: Sales channel name - * type: string - * channel_id: - * description: Sales channel id - * type: string - * available_quantity: - * description: Available quantity in sales channel - * type: number + * type: array + * description: An array of details about the variant's inventory availability in sales channels. + * items: + * type: object + * required: + * - channel_name + * - channel_id + * - available_quantity + * properties: + * channel_name: + * description: Sales channel's name + * type: string + * channel_id: + * description: Sales channel's ID + * type: string + * available_quantity: + * description: Available quantity in the sales channel + * type: number */ export type VariantInventory = { id: string @@ -209,6 +228,7 @@ export type VariantInventory = { * properties: * variant: * type: object + * description: "The product variant's." * $ref: "#/components/schemas/VariantInventory" */ export type AdminGetVariantsVariantInventoryRes = { diff --git a/packages/medusa/src/api/routes/admin/variants/get-variant.ts b/packages/medusa/src/api/routes/admin/variants/get-variant.ts index 9bb0e86091..57e69229a9 100644 --- a/packages/medusa/src/api/routes/admin/variants/get-variant.ts +++ b/packages/medusa/src/api/routes/admin/variants/get-variant.ts @@ -6,12 +6,12 @@ import { FindParams } from "../../../../types/common" * @oas [get] /admin/variants/{id} * operationId: "GetVariantsVariant" * summary: "Get a Product variant" - * description: "Retrieves a Product variant." + * description: "Retrieve a product variant's details." * x-authenticated: true * parameters: - * - (path) id=* {string} The ID of the variant. - * - (query) expand {string} (Comma separated) Which fields should be expanded the order of the result. - * - (query) fields {string} (Comma separated) Which fields should be included the order of the result. + * - (path) id=* {string} The ID of the product variant. + * - (query) expand {string} "Comma-separated relations that should be expanded in the returned product variant." + * - (query) fields {string} "Comma-separated fields that should be included in the returned product variant." * x-codegen: * method: retrieve * queryParams: AdminGetVariantParams @@ -22,15 +22,15 @@ import { FindParams } from "../../../../types/common" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.admin.variants.retrieve(product_id) - * .then(({ product }) => { - * console.log(product.id); + * medusa.admin.variants.retrieve(variantId) + * .then(({ variant }) => { + * console.log(variant.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/variants/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/variants/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/admin/variants/index.ts b/packages/medusa/src/api/routes/admin/variants/index.ts index d78823a094..ab917ea2f2 100644 --- a/packages/medusa/src/api/routes/admin/variants/index.ts +++ b/packages/medusa/src/api/routes/admin/variants/index.ts @@ -91,6 +91,7 @@ export const defaultAdminVariantFields: (keyof ProductVariant)[] = [ * properties: * variants: * type: array + * description: "An array of product variant details." * items: * $ref: "#/components/schemas/PricedVariant" * count: @@ -98,7 +99,7 @@ export const defaultAdminVariantFields: (keyof ProductVariant)[] = [ * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of product variants skipped when retrieving the product variants. * limit: * type: integer * description: The number of items per page @@ -120,6 +121,7 @@ export type AdminVariantsListRes = PaginatedResponse & { * - variant * properties: * variant: + * description: "Product variant's details." * $ref: "#/components/schemas/PricedVariant" */ export type AdminVariantsRes = { diff --git a/packages/medusa/src/api/routes/admin/variants/list-variants.ts b/packages/medusa/src/api/routes/admin/variants/list-variants.ts index 9467ec2e52..1eede1367c 100644 --- a/packages/medusa/src/api/routes/admin/variants/list-variants.ts +++ b/packages/medusa/src/api/routes/admin/variants/list-variants.ts @@ -20,30 +20,74 @@ import { omit } from "lodash" * @oas [get] /admin/variants * operationId: "GetVariants" * summary: "List Product Variants" - * description: "Retrieves a list of Product Variants" + * description: "Retrieve a list of Product Variants. The product variant can be filtered by fields such as `id` or `title`. The product variant can also be paginated." * x-authenticated: true * parameters: - * - (query) id {string} A Product Variant id to filter by. - * - (query) ids {string} A comma separated list of Product Variant ids to filter by. - * - (query) expand {string} A comma separated list of Product Variant relations to load. - * - (query) fields {string} A comma separated list of Product Variant fields to include. - * - (query) offset=0 {number} How many product variants to skip in the result. - * - (query) limit=100 {number} Maximum number of Product Variants to return. - * - (query) cart_id {string} The id of the cart to use for price selection. - * - (query) region_id {string} The id of the region to use for price selection. - * - (query) currency_code {string} The currency code to use for price selection. - * - (query) customer_id {string} The id of the customer to use for price selection. + * - in: query + * name: id + * style: form + * explode: false + * description: Filter by product variant IDs. + * schema: + * oneOf: + * - type: string + * description: A product variant ID. + * - type: array + * description: An array of product variant IDs. + * items: + * type: string + * - (query) expand {string} "Comma-separated relations that should be expanded in the returned product variants." + * - (query) fields {string} "Comma-separated fields that should be included in the returned product variants." + * - (query) offset=0 {number} The number of product variants to skip when retrieving the product variants. + * - (query) limit=100 {number} Limit the number of product variants returned. + * - in: query + * name: cart_id + * style: form + * explode: false + * description: The ID of the cart to use for the price selection context. + * schema: + * type: string + * - in: query + * name: region_id + * style: form + * explode: false + * description: The ID of the region to use for the price selection context. + * schema: + * type: string + * externalDocs: + * description: "Price selection context overview" + * url: "https://docs.medusajs.com/modules/price-lists/price-selection-strategy#context-object" + * - in: query + * name: currency_code + * style: form + * explode: false + * description: The 3 character ISO currency code to use for the price selection context. + * schema: + * type: string + * externalDocs: + * description: "Price selection context overview" + * url: "https://docs.medusajs.com/modules/price-lists/price-selection-strategy#context-object" + * - in: query + * name: customer_id + * style: form + * explode: false + * description: The ID of the customer to use for the price selection context. + * schema: + * type: string + * externalDocs: + * description: "Price selection context overview" + * url: "https://docs.medusajs.com/modules/price-lists/price-selection-strategy#context-object" * - in: query * name: title * style: form * explode: false - * description: product variant title to search for. + * description: Filter by title. * schema: * oneOf: * - type: string - * description: a single title to search by + * description: a single title to filter by * - type: array - * description: multiple titles to search by + * description: multiple titles to filter by * items: * type: string * - in: query @@ -52,9 +96,9 @@ import { omit } from "lodash" * schema: * oneOf: * - type: number - * description: a specific number to search by. + * description: a specific number to filter by. * - type: object - * description: search using less and greater than comparisons. + * description: filter using less and greater than comparisons. * properties: * lt: * type: number @@ -85,8 +129,8 @@ import { omit } from "lodash" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/admin/variants' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/admin/variants' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/store/auth/create-session.ts b/packages/medusa/src/api/routes/store/auth/create-session.ts index 4e5f06dbd9..46976870ac 100644 --- a/packages/medusa/src/api/routes/store/auth/create-session.ts +++ b/packages/medusa/src/api/routes/store/auth/create-session.ts @@ -10,7 +10,8 @@ import { defaultRelations } from "." * @oas [post] /store/auth * operationId: "PostAuth" * summary: "Customer Login" - * description: "Logs a Customer in and authorizes them to view their details. Successful authentication will set a session cookie in the Customer's browser." + * description: "Log a customer in and includes the Cookie session in the response header. The cookie session can be used in subsequent requests to authenticate the customer. + * When using Medusa's JS or Medusa React clients, the cookie is automatically attached to subsequent requests." * requestBody: * content: * application/json: @@ -25,8 +26,8 @@ import { defaultRelations } from "." * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * medusa.auth.authenticate({ - * email: 'user@example.com', - * password: 'user@example.com' + * email: "user@example.com", + * password: "user@example.com" * }) * .then(({ customer }) => { * console.log(customer.id); @@ -34,8 +35,8 @@ import { defaultRelations } from "." * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/auth' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/auth' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com", * "password": "supersecret" diff --git a/packages/medusa/src/api/routes/store/auth/delete-session.ts b/packages/medusa/src/api/routes/store/auth/delete-session.ts index 2663fc6553..c17229d799 100644 --- a/packages/medusa/src/api/routes/store/auth/delete-session.ts +++ b/packages/medusa/src/api/routes/store/auth/delete-session.ts @@ -2,7 +2,7 @@ * @oas [delete] /store/auth * operationId: "DeleteAuth" * summary: "Customer Log out" - * description: "Destroys a Customer's authenticated session." + * description: "Delete the current session for the logged in customer." * x-authenticated: true * x-codegen: * method: deleteSession @@ -10,8 +10,8 @@ * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/store/auth' \ - * --header 'Cookie: connect.sid={sid}' + * curl -X DELETE 'https://medusa-url.com/store/auth' \ + * -H 'Cookie: connect.sid={sid}' * security: * - cookie_auth: [] * tags: diff --git a/packages/medusa/src/api/routes/store/auth/exists.ts b/packages/medusa/src/api/routes/store/auth/exists.ts index e3d1b60bf6..168fb7f2bf 100644 --- a/packages/medusa/src/api/routes/store/auth/exists.ts +++ b/packages/medusa/src/api/routes/store/auth/exists.ts @@ -3,8 +3,8 @@ import CustomerService from "../../../../services/customer" /** * @oas [get] /store/auth/{email} * operationId: "GetAuthEmail" - * summary: "Check if email exists" - * description: "Checks if a Customer with the given email has signed up." + * summary: "Check if Email Exists" + * description: "Check if there's a customer already registered with the provided email." * parameters: * - in: path * name: email @@ -12,7 +12,7 @@ import CustomerService from "../../../../services/customer" * type: string * format: email * required: true - * description: The email to check if exists. + * description: The email to check. * x-codegen: * method: exists * x-codeSamples: @@ -21,12 +21,11 @@ import CustomerService from "../../../../services/customer" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.auth.exists('user@example.com') + * medusa.auth.exists("user@example.com") * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/auth/user@example.com' \ - * --header 'Cookie: connect.sid={sid}' + * curl 'https://medusa-url.com/store/auth/user@example.com' * tags: * - Auth * responses: diff --git a/packages/medusa/src/api/routes/store/auth/get-session.ts b/packages/medusa/src/api/routes/store/auth/get-session.ts index 700d6d7619..daaf1a85d6 100644 --- a/packages/medusa/src/api/routes/store/auth/get-session.ts +++ b/packages/medusa/src/api/routes/store/auth/get-session.ts @@ -5,7 +5,7 @@ import { defaultRelations } from "." * @oas [get] /store/auth * operationId: "GetAuth" * summary: "Get Current Customer" - * description: "Gets the currently logged in Customer." + * description: "Retrieve the currently logged in Customer's details." * x-authenticated: true * x-codegen: * method: getSession @@ -23,8 +23,8 @@ import { defaultRelations } from "." * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/auth' \ - * --header 'Cookie: connect.sid={sid}' + * curl 'https://medusa-url.com/store/auth' \ + * -H 'Cookie: connect.sid={sid}' * security: * - cookie_auth: [] * tags: diff --git a/packages/medusa/src/api/routes/store/auth/index.ts b/packages/medusa/src/api/routes/store/auth/index.ts index fbf750ce42..9e17064de7 100644 --- a/packages/medusa/src/api/routes/store/auth/index.ts +++ b/packages/medusa/src/api/routes/store/auth/index.ts @@ -34,6 +34,7 @@ export const defaultRelations = ["orders", "orders.items", "shipping_addresses"] * - customer * properties: * customer: + * description: "Customer's details." * $ref: "#/components/schemas/Customer" */ export type StoreAuthRes = { diff --git a/packages/medusa/src/api/routes/store/carts/add-shipping-method.ts b/packages/medusa/src/api/routes/store/carts/add-shipping-method.ts index 07539a8cbf..7850f7f15d 100644 --- a/packages/medusa/src/api/routes/store/carts/add-shipping-method.ts +++ b/packages/medusa/src/api/routes/store/carts/add-shipping-method.ts @@ -8,8 +8,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [post] /store/carts/{id}/shipping-methods * operationId: "PostCartsCartShippingMethod" - * description: "Adds a Shipping Method to the Cart." - * summary: "Add a Shipping Method" + * summary: "Add Shipping Method" + * description: "Add a Shipping Method to the Cart. The validation of the `data` field is handled by the fulfillment provider of the chosen shipping option." * parameters: * - (path) id=* {string} The cart ID. * requestBody: @@ -25,7 +25,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.addShippingMethod(cart_id, { + * medusa.carts.addShippingMethod(cartId, { * option_id * }) * .then(({ cart }) => { @@ -34,8 +34,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "option_id": "{option_id}", * }' @@ -102,10 +102,10 @@ export default async (req, res) => { * properties: * option_id: * type: string - * description: ID of the shipping option to create the method from + * description: ID of the shipping option to create the method from. * data: * type: object - * description: Used to hold any data that the shipping method may need to process the fulfillment of the order. Look at the documentation for your installed fulfillment providers to find out what to send. + * description: Used to hold any data that the shipping method may need to process the fulfillment of the order. This depends on the fulfillment provider you're using. */ export class StorePostCartsCartShippingMethodReq { @IsString() diff --git a/packages/medusa/src/api/routes/store/carts/calculate-taxes.ts b/packages/medusa/src/api/routes/store/carts/calculate-taxes.ts index 55f6b1c150..99ddd718a0 100644 --- a/packages/medusa/src/api/routes/store/carts/calculate-taxes.ts +++ b/packages/medusa/src/api/routes/store/carts/calculate-taxes.ts @@ -6,10 +6,13 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [post] /store/carts/{id}/taxes - * summary: "Calculate Cart Taxes" * operationId: "PostCartsCartTaxes" - * description: "Calculates taxes for a cart. Depending on the cart's region - * this may involve making 3rd party API calls to a Tax Provider service." + * summary: "Calculate Cart Taxes" + * description: "Calculate the taxes for a cart. This is useful if the `automatic_taxes` field of the cart's region is set to `false`. If the cart's region uses a tax provider other than + * Medusa's system provider, this may lead to sending requests to third-party services." + * externalDocs: + * description: "How to calculate taxes manually during checkout" + * url: "https://docs.medusajs.com/modules/taxes/storefront/manual-calculation" * parameters: * - (path) id=* {String} The Cart ID. * x-codegen: @@ -18,7 +21,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/carts/{id}/taxes' + * curl -X POST 'https://medusa-url.com/store/carts/{id}/taxes' * tags: * - Carts * responses: diff --git a/packages/medusa/src/api/routes/store/carts/complete-cart.ts b/packages/medusa/src/api/routes/store/carts/complete-cart.ts index a7c21abb9e..68a5f94cad 100644 --- a/packages/medusa/src/api/routes/store/carts/complete-cart.ts +++ b/packages/medusa/src/api/routes/store/carts/complete-cart.ts @@ -8,14 +8,18 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /store/carts/{id}/complete * summary: "Complete a Cart" * operationId: "PostCartsCartComplete" - * description: "Completes a cart. The following steps will be performed. Payment - * authorization is attempted and if more work is required, we simply return - * the cart for further updates. If payment is authorized and order is not yet - * created, we make sure to do so. The completion of a cart can be performed - * idempotently with a provided header `Idempotency-Key`. If not provided, we - * will generate one for the request." + * description: | + * Complete a cart and place an order or create a swap, based on what the cart is created for. This includes attempting to authorize the cart's payment. + * If authorizing the payment requires more action, the cart will not be completed and the order will not be placed or the swap will not be created. + * + * An idempotency key will be generated if none is provided in the header `Idempotency-Key` and added to + * the response. If an error occurs during cart completion or the request is interrupted for any reason, the cart completion can be retried by passing the idempotency + * key in the `Idempotency-Key` header. + * externalDocs: + * description: "Cart completion overview" + * url: "https://docs.medusajs.com/modules/carts-and-checkout/cart#cart-completion" * parameters: - * - (path) id=* {String} The Cart id. + * - (path) id=* {String} The Cart ID. * x-codegen: * method: complete * x-codeSamples: @@ -24,22 +28,22 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.complete(cart_id) + * medusa.carts.complete(cartId) * .then(({ cart }) => { * console.log(cart.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/carts/{id}/complete' + * curl -X POST 'https://medusa-url.com/store/carts/{id}/complete' * tags: * - Carts * responses: * 200: - * description: "If a cart was successfully authorized, but requires further - * action from the user the response body will contain the cart with an - * updated payment session. If the Cart was successfully completed the - * response body will contain the newly created Order." + * description: "If the payment of the cart was successfully authorized, but requires further + * action from the customer, the response body will contain the cart with an + * updated payment session. Otherwise, if the payment was authorized and the cart was successfully completed, the + * response body will contain either the newly created order or swap, depending on what the cart was created for." * content: * application/json: * schema: diff --git a/packages/medusa/src/api/routes/store/carts/create-cart.ts b/packages/medusa/src/api/routes/store/carts/create-cart.ts index 6ba9d7fa87..2457ba1cf5 100644 --- a/packages/medusa/src/api/routes/store/carts/create-cart.ts +++ b/packages/medusa/src/api/routes/store/carts/create-cart.ts @@ -26,12 +26,13 @@ import { FlagRouter } from "../../../../utils/flag-router" /** * @oas [post] /store/carts - * summary: "Create a Cart" * operationId: "PostCart" - * description: "Creates a Cart within the given region and with the initial items. If no - * `region_id` is provided the cart will be associated with the first Region - * available. If no items are provided the cart will be empty after creation. - * If a user is logged in the cart's customer id and email will be set." + * summary: "Create a Cart" + * description: | + * Create a Cart. Although optional, specifying the cart's region and sales channel can affect the cart's pricing and + * the products that can be added to the cart respectively. So, make sure to set those early on and change them if necessary, such as when the customer changes their region. + * + * If a customer is logged in, the cart's customer ID and email will automatically be set. * requestBody: * content: * application/json: @@ -52,7 +53,7 @@ import { FlagRouter } from "../../../../utils/flag-router" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/carts' + * curl -X POST 'https://medusa-url.com/store/carts' * tags: * - Carts * responses: @@ -192,18 +193,24 @@ export class Item { * properties: * region_id: * type: string - * description: The ID of the Region to create the Cart in. + * description: "The ID of the Region to create the Cart in. Setting the cart's region can affect the pricing of the items in the cart as well as the used currency. + * If this parameter is not provided, the first region in the store is used by default." * sales_channel_id: * type: string - * description: "[EXPERIMENTAL] The ID of the Sales channel to create the Cart in." + * description: "The ID of the Sales channel to create the Cart in. The cart's sales channel affects which products can be added to the cart. If a product does not + * exist in the cart's sales channel, it cannot be added to the cart. If you add a publishable API key in the header of this request and specify a sales channel ID, + * the specified sales channel must be within the scope of the publishable API key's resources. If you add a publishable API key in the header of this request, + * you don't specify a sales channel ID, and the publishable API key is associated with one sales channel, that sales channel will be attached to the cart. + * If no sales channel is passed and no publishable API key header is passed or the publishable API key isn't associated with any sales channel, + * the cart will not be associated with any sales channel." * country_code: * type: string - * description: "The 2 character ISO country code to create the Cart in." + * description: "The 2 character ISO country code to create the Cart in. Setting this parameter will set the country code of the shipping address." * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements * description: See a list of codes. * items: - * description: "An optional array of `variant_id`, `quantity` pairs to generate Line Items from." + * description: "An array of product variants to generate line items from." * type: array * items: * type: object @@ -212,13 +219,13 @@ export class Item { * - quantity * properties: * variant_id: - * description: The id of the Product Variant to generate a Line Item from. + * description: The ID of the Product Variant. * type: string * quantity: - * description: The quantity of the Product Variant to add + * description: The quantity to add into the cart. * type: integer * context: - * description: "An optional object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent`" + * description: "An object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent`" * type: object * example: * ip: "::1" diff --git a/packages/medusa/src/api/routes/store/carts/create-line-item/index.ts b/packages/medusa/src/api/routes/store/carts/create-line-item/index.ts index cd18774c7e..52ad53cd86 100644 --- a/packages/medusa/src/api/routes/store/carts/create-line-item/index.ts +++ b/packages/medusa/src/api/routes/store/carts/create-line-item/index.ts @@ -44,8 +44,8 @@ import { cleanResponseData } from "../../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/carts/{id}/line-items' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/carts/{id}/line-items' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "variant_id": "{variant_id}", * "quantity": 1 diff --git a/packages/medusa/src/api/routes/store/carts/create-payment-sessions.ts b/packages/medusa/src/api/routes/store/carts/create-payment-sessions.ts index 6de27441fa..6628904890 100644 --- a/packages/medusa/src/api/routes/store/carts/create-payment-sessions.ts +++ b/packages/medusa/src/api/routes/store/carts/create-payment-sessions.ts @@ -8,9 +8,10 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /store/carts/{id}/payment-sessions * operationId: "PostCartsCartPaymentSessions" * summary: "Create Payment Sessions" - * description: "Creates Payment Sessions for each of the available Payment Providers in the Cart's Region." + * description: "Create Payment Sessions for each of the available Payment Providers in the Cart's Region. If there only one payment session is created, + * it will be selected by default. The creation of the payment session uses the payment provider and may require sending requests to third-party services." * parameters: - * - (path) id=* {string} The id of the Cart. + * - (path) id=* {string} The ID of the Cart. * x-codegen: * method: createPaymentSessions * x-codeSamples: @@ -19,14 +20,14 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.createPaymentSessions(cart_id) + * medusa.carts.createPaymentSessions(cartId) * .then(({ cart }) => { * console.log(cart.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions' + * curl -X POST 'https://medusa-url.com/store/carts/{id}/payment-sessions' * tags: * - Carts * responses: diff --git a/packages/medusa/src/api/routes/store/carts/delete-discount.ts b/packages/medusa/src/api/routes/store/carts/delete-discount.ts index a9382e00f0..f923f1e1de 100644 --- a/packages/medusa/src/api/routes/store/carts/delete-discount.ts +++ b/packages/medusa/src/api/routes/store/carts/delete-discount.ts @@ -6,11 +6,12 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" /** * @oas [delete] /store/carts/{id}/discounts/{code} * operationId: DeleteCartsCartDiscountsDiscount - * description: "Removes a Discount from a Cart." * summary: "Remove Discount" + * description: "Remove a Discount from a Cart. This only removes the application of the discount, and not completely delete it. The totals will be re-calculated and the payment sessions + * will be refreshed after the removal." * parameters: - * - (path) id=* {string} The id of the Cart. - * - (path) code=* {string} The unique Discount code. + * - (path) id=* {string} The ID of the Cart. + * - (path) code=* {string} The unique discount code. * x-codegen: * method: deleteDiscount * x-codeSamples: @@ -19,14 +20,14 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.deleteDiscount(cart_id, code) + * medusa.carts.deleteDiscount(cartId, code) * .then(({ cart }) => { * console.log(cart.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/discounts/{code}' + * curl -X DELETE 'https://medusa-url.com/store/carts/{id}/discounts/{code}' * tags: * - Carts * responses: diff --git a/packages/medusa/src/api/routes/store/carts/delete-line-item.ts b/packages/medusa/src/api/routes/store/carts/delete-line-item.ts index 36a0cbed58..dbc7fff5ac 100644 --- a/packages/medusa/src/api/routes/store/carts/delete-line-item.ts +++ b/packages/medusa/src/api/routes/store/carts/delete-line-item.ts @@ -7,10 +7,10 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [delete] /store/carts/{id}/line-items/{line_id} * operationId: DeleteCartsCartLineItemsItem * summary: Delete a Line Item - * description: "Removes a Line Item from a Cart." + * description: "Delete a Line Item from a Cart. The payment sessions will be updated and the totals will be recalculated." * parameters: - * - (path) id=* {string} The id of the Cart. - * - (path) line_id=* {string} The id of the Line Item. + * - (path) id=* {string} The ID of the Cart. + * - (path) line_id=* {string} The ID of the Line Item. * x-codegen: * method: deleteLineItem * x-codeSamples: @@ -19,14 +19,14 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.lineItems.delete(cart_id, line_id) + * medusa.carts.lineItems.delete(cartId, lineId) * .then(({ cart }) => { * console.log(cart.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' + * curl -X DELETE 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' * tags: * - Carts * responses: diff --git a/packages/medusa/src/api/routes/store/carts/delete-payment-session.ts b/packages/medusa/src/api/routes/store/carts/delete-payment-session.ts index 3e363ef960..a645536a89 100644 --- a/packages/medusa/src/api/routes/store/carts/delete-payment-session.ts +++ b/packages/medusa/src/api/routes/store/carts/delete-payment-session.ts @@ -7,10 +7,10 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [delete] /store/carts/{id}/payment-sessions/{provider_id} * operationId: DeleteCartsCartPaymentSessionsSession * summary: "Delete a Payment Session" - * description: "Deletes a Payment Session on a Cart. May be useful if a payment has failed." + * description: "Delete a Payment Session in a Cart. May be useful if a payment has failed. The totals will be recalculated." * parameters: - * - (path) id=* {string} The id of the Cart. - * - (path) provider_id=* {string} The id of the Payment Provider used to create the Payment Session to be deleted. + * - (path) id=* {string} The ID of the Cart. + * - (path) provider_id=* {string} The ID of the Payment Provider used to create the Payment Session to be deleted. * x-codegen: * method: deletePaymentSession * x-codeSamples: @@ -19,14 +19,14 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.deletePaymentSession(cart_id, 'manual') + * medusa.carts.deletePaymentSession(cartId, "manual") * .then(({ cart }) => { * console.log(cart.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' + * curl -X DELETE 'https://medusa-url.com/store/carts/{id}/payment-sessions/{provider_id}' * tags: * - Carts * responses: diff --git a/packages/medusa/src/api/routes/store/carts/get-cart.ts b/packages/medusa/src/api/routes/store/carts/get-cart.ts index 82e64488cc..dad1443db6 100644 --- a/packages/medusa/src/api/routes/store/carts/get-cart.ts +++ b/packages/medusa/src/api/routes/store/carts/get-cart.ts @@ -6,9 +6,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [get] /store/carts/{id} * operationId: "GetCartsCart" * summary: "Get a Cart" - * description: "Retrieves a Cart." + * description: "Retrieve a Cart's details. This includes recalculating its totals." * parameters: - * - (path) id=* {string} The id of the Cart. + * - (path) id=* {string} The ID of the Cart. * x-codegen: * method: retrieve * x-codeSamples: @@ -17,14 +17,14 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.retrieve(cart_id) + * medusa.carts.retrieve(cartId) * .then(({ cart }) => { * console.log(cart.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/carts/{id}' + * curl 'https://medusa-url.com/store/carts/{id}' * tags: * - Carts * responses: diff --git a/packages/medusa/src/api/routes/store/carts/index.ts b/packages/medusa/src/api/routes/store/carts/index.ts index cdc2cecdca..af0694dc69 100644 --- a/packages/medusa/src/api/routes/store/carts/index.ts +++ b/packages/medusa/src/api/routes/store/carts/index.ts @@ -297,6 +297,7 @@ export const defaultStoreCartRelations = [ * - cart * properties: * cart: + * description: "Cart details." * $ref: "#/components/schemas/Cart" */ export type StoreCartsRes = { @@ -312,7 +313,9 @@ export type StoreCartsRes = { * properties: * type: * type: string - * description: The type of the data property. + * description: "The type of the data property. If the cart completion fails, type will be `cart` and the data object will be the cart's details. + * If the cart completion is successful and the cart is used for checkout, type will be `order` and the data object will be the order's details. + * If the cart completion is successful and the cart is used for swap creation, type will be `swap` and the data object will be the swap's details." * enum: [order, cart, swap] * data: * type: object @@ -328,7 +331,7 @@ export type StoreCartsRes = { * - $ref: "#/components/schemas/Cart" * - type: object * allOf: - * - description: When cart is used for a swap and it has been completed successfully. + * - description: Cart was used for a swap and it has been completed successfully. * - $ref: "#/components/schemas/Swap" */ export type StoreCompleteCartRes = diff --git a/packages/medusa/src/api/routes/store/carts/refresh-payment-session.ts b/packages/medusa/src/api/routes/store/carts/refresh-payment-session.ts index 0e1252a4d2..7763cc9abb 100644 --- a/packages/medusa/src/api/routes/store/carts/refresh-payment-session.ts +++ b/packages/medusa/src/api/routes/store/carts/refresh-payment-session.ts @@ -6,10 +6,10 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /store/carts/{id}/payment-sessions/{provider_id}/refresh * operationId: PostCartsCartPaymentSessionsSession * summary: Refresh a Payment Session - * description: "Refreshes a Payment Session to ensure that it is in sync with the Cart - this is usually not necessary." + * description: "Refresh a Payment Session to ensure that it is in sync with the Cart. This is usually not necessary, but is provided for edge cases." * parameters: - * - (path) id=* {string} The id of the Cart. - * - (path) provider_id=* {string} The id of the Payment Provider that created the Payment Session to be refreshed. + * - (path) id=* {string} The ID of the Cart. + * - (path) provider_id=* {string} The ID of the Payment Provider that created the Payment Session to be refreshed. * x-codegen: * method: refreshPaymentSession * x-codeSamples: @@ -18,14 +18,14 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.refreshPaymentSession(cart_id, 'manual') + * medusa.carts.refreshPaymentSession(cartId, "manual") * .then(({ cart }) => { * console.log(cart.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + * curl -X POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/{provider_id}/refresh' * tags: * - Carts * responses: diff --git a/packages/medusa/src/api/routes/store/carts/set-payment-session.ts b/packages/medusa/src/api/routes/store/carts/set-payment-session.ts index a7b1282239..91c918f811 100644 --- a/packages/medusa/src/api/routes/store/carts/set-payment-session.ts +++ b/packages/medusa/src/api/routes/store/carts/set-payment-session.ts @@ -9,7 +9,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /store/carts/{id}/payment-session * operationId: PostCartsCartPaymentSession * summary: Select a Payment Session - * description: "Selects a Payment Session as the session intended to be used towards the completion of the Cart." + * description: "Select the Payment Session that will be used to complete the cart. This is typically used when the customer chooses their preferred payment method during checkout. + * The totals of the cart will be recalculated." * parameters: * - (path) id=* {string} The ID of the Cart. * requestBody: @@ -25,8 +26,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.setPaymentSession(cart_id, { - * provider_id: 'manual' + * medusa.carts.setPaymentSession(cartId, { + * provider_id: "manual" * }) * .then(({ cart }) => { * console.log(cart.id); @@ -34,8 +35,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "provider_id": "manual" * }' diff --git a/packages/medusa/src/api/routes/store/carts/update-cart.ts b/packages/medusa/src/api/routes/store/carts/update-cart.ts index 04abb99f40..815ed456c6 100644 --- a/packages/medusa/src/api/routes/store/carts/update-cart.ts +++ b/packages/medusa/src/api/routes/store/carts/update-cart.ts @@ -20,9 +20,9 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /store/carts/{id} * operationId: PostCartsCart * summary: Update a Cart - * description: "Updates a Cart." + * description: "Update a Cart's details. If the cart has payment sessions and the region was not changed, the payment sessions are updated. The cart's totals are also recalculated." * parameters: - * - (path) id=* {string} The id of the Cart. + * - (path) id=* {string} The ID of the Cart. * requestBody: * content: * application/json: @@ -36,8 +36,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.update(cart_id, { - * email: 'user@example.com' + * medusa.carts.update(cartId, { + * email: "user@example.com" * }) * .then(({ cart }) => { * console.log(cart.id); @@ -45,8 +45,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/carts/{id}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/carts/{id}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com" * }' @@ -120,10 +120,10 @@ class Discount { * properties: * region_id: * type: string - * description: The id of the Region to create the Cart in. + * description: "The ID of the Region to create the Cart in. Setting the cart's region can affect the pricing of the items in the cart as well as the used currency." * country_code: * type: string - * description: "The 2 character ISO country code to create the Cart in." + * description: "The 2 character ISO country code to create the Cart in. Setting this parameter will set the country code of the shipping address." * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements * description: See a list of codes. @@ -133,7 +133,9 @@ class Discount { * format: email * sales_channel_id: * type: string - * description: The ID of the Sales channel to update the Cart with. + * description: "The ID of the Sales channel to create the Cart in. The cart's sales channel affects which products can be added to the cart. If a product does not + * exist in the cart's sales channel, it cannot be added to the cart. If you add a publishable API key in the header of this request and specify a sales channel ID, + * the specified sales channel must be within the scope of the publishable API key's resources." * billing_address: * description: "The Address to be used for billing purposes." * anyOf: @@ -142,7 +144,7 @@ class Discount { * - type: string * description: The billing address ID * shipping_address: - * description: "The Address to be used for shipping." + * description: "The Address to be used for shipping purposes." * anyOf: * - $ref: "#/components/schemas/AddressPayload" * description: A full shipping address object. @@ -157,7 +159,7 @@ class Discount { * - code * properties: * code: - * description: "The code that a Gift Card is identified by." + * description: "The code of a gift card." * type: string * discounts: * description: "An array of Discount codes to add to the Cart." @@ -168,13 +170,13 @@ class Discount { * - code * properties: * code: - * description: "The code that a Discount is identified by." + * description: "The code of the discount." * type: string * customer_id: * description: "The ID of the Customer to associate the Cart with." * type: string * context: - * description: "An optional object to provide context to the Cart." + * description: "An object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent`" * type: object * example: * ip: "::1" diff --git a/packages/medusa/src/api/routes/store/carts/update-line-item.ts b/packages/medusa/src/api/routes/store/carts/update-line-item.ts index 33c1160680..cf8622a040 100644 --- a/packages/medusa/src/api/routes/store/carts/update-line-item.ts +++ b/packages/medusa/src/api/routes/store/carts/update-line-item.ts @@ -9,10 +9,10 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /store/carts/{id}/line-items/{line_id} * operationId: PostCartsCartLineItemsItem * summary: Update a Line Item - * description: "Updates a Line Item if the desired quantity can be fulfilled." + * description: "Update a line item's quantity." * parameters: - * - (path) id=* {string} The id of the Cart. - * - (path) line_id=* {string} The id of the Line Item. + * - (path) id=* {string} The ID of the Cart. + * - (path) line_id=* {string} The ID of the Line Item. * requestBody: * content: * application/json: @@ -26,7 +26,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.lineItems.update(cart_id, line_id, { + * medusa.carts.lineItems.update(cartId, lineId, { * quantity: 1 * }) * .then(({ cart }) => { @@ -35,8 +35,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "quantity": 1 * }' @@ -123,7 +123,7 @@ export default async (req, res) => { * properties: * quantity: * type: number - * description: The quantity to set the Line Item to. + * description: The quantity of the line item in the cart. * metadata: * type: object * description: An optional key-value map with additional details about the Line Item. If omitted, the metadata will remain unchanged." diff --git a/packages/medusa/src/api/routes/store/carts/update-payment-session.ts b/packages/medusa/src/api/routes/store/carts/update-payment-session.ts index 886e8cf4d7..c717007d8c 100644 --- a/packages/medusa/src/api/routes/store/carts/update-payment-session.ts +++ b/packages/medusa/src/api/routes/store/carts/update-payment-session.ts @@ -8,10 +8,11 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [post] /store/carts/{id}/payment-sessions/{provider_id} * operationId: PostCartsCartPaymentSessionUpdate * summary: Update a Payment Session - * description: "Updates a Payment Session with additional data." + * description: "Update a Payment Session with additional data. This can be useful depending on the payment provider used. + * All payment sessions are updated and cart totals are recalculated afterwards." * parameters: - * - (path) id=* {string} The id of the Cart. - * - (path) provider_id=* {string} The id of the payment provider. + * - (path) id=* {string} The ID of the Cart. + * - (path) provider_id=* {string} The ID of the payment provider. * requestBody: * content: * application/json: @@ -25,7 +26,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.carts.updatePaymentSession(cart_id, 'manual', { + * medusa.carts.updatePaymentSession(cartId, "manual", { * data: { * * } @@ -36,8 +37,8 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "data": {} * }' diff --git a/packages/medusa/src/api/routes/store/collections/get-collection.ts b/packages/medusa/src/api/routes/store/collections/get-collection.ts index ee72261e6a..e500ef25f3 100644 --- a/packages/medusa/src/api/routes/store/collections/get-collection.ts +++ b/packages/medusa/src/api/routes/store/collections/get-collection.ts @@ -4,7 +4,7 @@ import ProductCollectionService from "../../../../services/product-collection" * @oas [get] /store/collections/{id} * operationId: "GetCollectionsCollection" * summary: "Get a Collection" - * description: "Retrieves a Product Collection." + * description: "Retrieve a Product Collection's details." * parameters: * - (path) id=* {string} The id of the Product Collection * x-codegen: @@ -15,16 +15,16 @@ import ProductCollectionService from "../../../../services/product-collection" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.collections.retrieve(collection_id) + * medusa.collections.retrieve(collectionId) * .then(({ collection }) => { * console.log(collection.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/collections/{id}' + * curl 'https://medusa-url.com/store/collections/{id}' * tags: - * - Collections + * - Product Collections * responses: * "200": * description: OK diff --git a/packages/medusa/src/api/routes/store/collections/index.ts b/packages/medusa/src/api/routes/store/collections/index.ts index ce549b0d75..90ff75d121 100644 --- a/packages/medusa/src/api/routes/store/collections/index.ts +++ b/packages/medusa/src/api/routes/store/collections/index.ts @@ -46,6 +46,7 @@ export const allowedFields = [ * properties: * collections: * type: array + * description: "An array of product collections details" * items: * $ref: "#/components/schemas/ProductCollection" * count: @@ -53,7 +54,7 @@ export const allowedFields = [ * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of product collections skipped when retrieving the product collections. * limit: * type: integer * description: The number of items per page @@ -69,6 +70,7 @@ export type StoreCollectionsListRes = PaginatedResponse & { * - collection * properties: * collection: + * description: "Product collection details." * $ref: "#/components/schemas/ProductCollection" */ export type StoreCollectionsRes = { diff --git a/packages/medusa/src/api/routes/store/collections/list-collections.ts b/packages/medusa/src/api/routes/store/collections/list-collections.ts index 7e11ceafaa..5ea38abb59 100644 --- a/packages/medusa/src/api/routes/store/collections/list-collections.ts +++ b/packages/medusa/src/api/routes/store/collections/list-collections.ts @@ -8,22 +8,22 @@ import { Type } from "class-transformer" * @oas [get] /store/collections * operationId: "GetCollections" * summary: "List Collections" - * description: "Retrieve a list of Product Collection." + * description: "Retrieve a list of product collections. The product collections can be filtered by fields such as `handle` or `created_at`. The product collections can also be paginated." * parameters: - * - (query) offset=0 {integer} The number of collections to skip before starting to collect the collections set - * - (query) limit=10 {integer} The number of collections to return + * - (query) offset=0 {integer} The number of product collections to skip when retrieving the product collections. + * - (query) limit=10 {integer} Limit the number of product collections returned. * - in: query * name: handle * style: form * explode: false - * description: Filter by the collection handle + * description: Filter by handles * schema: * type: array * items: * type: string * - in: query * name: created_at - * description: Date comparison for when resulting collections were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -45,7 +45,7 @@ import { Type } from "class-transformer" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting collections were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -81,9 +81,9 @@ import { Type } from "class-transformer" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/collections' + * curl 'https://medusa-url.com/store/collections' * tags: - * - Collections + * - Product Collections * responses: * "200": * description: OK diff --git a/packages/medusa/src/api/routes/store/customers/create-address.ts b/packages/medusa/src/api/routes/store/customers/create-address.ts index bfe2f4e587..ca0f016759 100644 --- a/packages/medusa/src/api/routes/store/customers/create-address.ts +++ b/packages/medusa/src/api/routes/store/customers/create-address.ts @@ -10,7 +10,7 @@ import { validator } from "../../../../utils/validator" * @oas [post] /store/customers/me/addresses * operationId: PostCustomersCustomerAddresses * summary: "Add a Shipping Address" - * description: "Adds a Shipping Address to a Customer's saved addresses." + * description: "Add a Shipping Address to a Customer's saved addresses." * x-authenticated: true * requestBody: * content: @@ -28,17 +28,15 @@ import { validator } from "../../../../utils/validator" * // must be previously logged * medusa.customers.addresses.addAddress({ * address: { - * first_name: 'Celia', - * last_name: 'Schumm', - * address_1: '225 Bednar Curve', - * city: 'Danielville', - * country_code: 'US', - * postal_code: '85137', - * phone: '981-596-6748 x90188', - * company: 'Wyman LLC', - * address_2: '', - * province: 'Georgia', - * metadata: {} + * first_name: "Celia", + * last_name: "Schumm", + * address_1: "225 Bednar Curve", + * city: "Danielville", + * country_code: "US", + * postal_code: "85137", + * phone: "981-596-6748 x90188", + * company: "Wyman LLC", + * province: "Georgia", * } * }) * .then(({ customer }) => { @@ -47,9 +45,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/customers/me/addresses' \ - * --header 'Cookie: connect.sid={sid}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/customers/me/addresses' \ + * -H 'Cookie: connect.sid={sid}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "address": { * "first_name": "Celia", @@ -116,7 +114,7 @@ export default async (req, res) => { * - address * properties: * address: - * description: "The Address to add to the Customer." + * description: "The Address to add to the Customer's saved addresses." * $ref: "#/components/schemas/AddressCreatePayload" */ export class StorePostCustomersCustomerAddressesReq { diff --git a/packages/medusa/src/api/routes/store/customers/create-customer.ts b/packages/medusa/src/api/routes/store/customers/create-customer.ts index 2b1867bedf..5cae353037 100644 --- a/packages/medusa/src/api/routes/store/customers/create-customer.ts +++ b/packages/medusa/src/api/routes/store/customers/create-customer.ts @@ -11,7 +11,9 @@ import { validator } from "../../../../utils/validator" * @oas [post] /store/customers * operationId: PostCustomers * summary: Create a Customer - * description: "Creates a Customer account." + * description: "Register a new customer. This will also automatically authenticate the customer and set their login session in the response Cookie header. + * The cookie session can be used in subsequent requests to authenticate the customer. + * When using Medusa's JS or Medusa React clients, the cookie is automatically attached to subsequent requests." * requestBody: * content: * application/json: @@ -26,10 +28,10 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * medusa.customers.create({ - * first_name: 'Alec', - * last_name: 'Reynolds', - * email: 'user@example.com', - * password: 'supersecret' + * first_name: "Alec", + * last_name: "Reynolds", + * email: "user@example.com", + * password: "supersecret" * }) * .then(({ customer }) => { * console.log(customer.id); @@ -37,8 +39,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/customers' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/customers' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "first_name": "Alec", * "last_name": "Reynolds", @@ -122,21 +124,21 @@ export default async (req, res) => { * - password * properties: * first_name: - * description: "The Customer's first name." + * description: "The customer's first name." * type: string * last_name: - * description: "The Customer's last name." + * description: "The customer's last name." * type: string * email: - * description: "The email of the customer." + * description: "The customer's email." * type: string * format: email * password: - * description: "The Customer's password." + * description: "The customer's password." * type: string * format: password * phone: - * description: "The Customer's phone number." + * description: "The customer's phone number." * type: string */ export class StorePostCustomersReq { diff --git a/packages/medusa/src/api/routes/store/customers/delete-address.ts b/packages/medusa/src/api/routes/store/customers/delete-address.ts index 88cfda3459..1059d9a36f 100644 --- a/packages/medusa/src/api/routes/store/customers/delete-address.ts +++ b/packages/medusa/src/api/routes/store/customers/delete-address.ts @@ -7,7 +7,7 @@ import CustomerService from "../../../../services/customer" * @oas [delete] /store/customers/me/addresses/{address_id} * operationId: DeleteCustomersCustomerAddressesAddress * summary: Delete an Address - * description: "Removes an Address from the Customer's saved addresses." + * description: "Delete an Address from the Customer's saved addresses." * x-authenticated: true * parameters: * - (path) address_id=* {string} The id of the Address to remove. @@ -20,15 +20,15 @@ import CustomerService from "../../../../services/customer" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged - * medusa.customers.addresses.deleteAddress(address_id) + * medusa.customers.addresses.deleteAddress(addressId) * .then(({ customer }) => { * console.log(customer.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request DELETE 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ - * --header 'Cookie: connect.sid={sid}' + * curl -X DELETE 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + * -H 'Cookie: connect.sid={sid}' * security: * - cookie_auth: [] * tags: diff --git a/packages/medusa/src/api/routes/store/customers/get-customer.ts b/packages/medusa/src/api/routes/store/customers/get-customer.ts index 4010403d8f..0f5398dfea 100644 --- a/packages/medusa/src/api/routes/store/customers/get-customer.ts +++ b/packages/medusa/src/api/routes/store/customers/get-customer.ts @@ -5,7 +5,7 @@ import CustomerService from "../../../../services/customer" * @oas [get] /store/customers/me * operationId: GetCustomersCustomer * summary: Get a Customer - * description: "Retrieves a Customer - the Customer must be logged in to retrieve their details." + * description: "Retrieve the logged-in Customer's details." * x-authenticated: true * x-codegen: * method: retrieve @@ -23,8 +23,8 @@ import CustomerService from "../../../../services/customer" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/customers/me' \ - * --header 'Cookie: connect.sid={sid}' + * curl 'https://medusa-url.com/store/customers/me' \ + * -H 'Cookie: connect.sid={sid}' * security: * - cookie_auth: [] * tags: diff --git a/packages/medusa/src/api/routes/store/customers/get-payment-methods.ts b/packages/medusa/src/api/routes/store/customers/get-payment-methods.ts index f927656afb..fc25386749 100644 --- a/packages/medusa/src/api/routes/store/customers/get-payment-methods.ts +++ b/packages/medusa/src/api/routes/store/customers/get-payment-methods.ts @@ -6,9 +6,11 @@ import { PaymentProvider } from "../../../../models" /** * @oas [get] /store/customers/me/payment-methods * operationId: GetCustomersCustomerPaymentMethods - * summary: Get Payment Methods - * description: "Retrieves a list of a Customer's saved payment methods. Payment methods are saved with Payment Providers and it is their responsibility to fetch saved methods." + * summary: Get Saved Payment Methods + * description: "Retrieve the logged-in customer's saved payment methods. This endpoint only works with payment providers created with the deprecated Payment Service interface. + * The payment methods are saved using the Payment Service's third-party service, and not on the Medusa backend. So, they're retrieved from the third-party service." * x-authenticated: true + * deprecated: true * x-codegen: * method: listPaymentMethods * x-codeSamples: @@ -25,8 +27,8 @@ import { PaymentProvider } from "../../../../models" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/customers/me/payment-methods' \ - * --header 'Cookie: connect.sid={sid}' + * curl 'https://medusa-url.com/store/customers/me/payment-methods' \ + * -H 'Cookie: connect.sid={sid}' * security: * - cookie_auth: [] * tags: diff --git a/packages/medusa/src/api/routes/store/customers/index.ts b/packages/medusa/src/api/routes/store/customers/index.ts index 41ffcc2fa3..014313f97c 100644 --- a/packages/medusa/src/api/routes/store/customers/index.ts +++ b/packages/medusa/src/api/routes/store/customers/index.ts @@ -123,6 +123,7 @@ export const allowedStoreCustomersFields = [ * - customer * properties: * customer: + * description: "Customer details." * $ref: "#/components/schemas/Customer" */ export type StoreCustomersRes = { @@ -136,6 +137,7 @@ export type StoreCustomersRes = { * - customer * properties: * customer: + * description: "Customer details." * $ref: "#/components/schemas/Customer" */ export type StoreCustomersResetPasswordRes = { @@ -235,13 +237,14 @@ export type StoreCustomersResetPasswordRes = { * properties: * orders: * type: array + * description: "An array of orders details." * items: * $ref: "#/components/schemas/Order" * count: * description: The total number of items available * type: integer * offset: - * description: The number of items skipped before these items + * description: The number of orders skipped when retrieving the orders. * type: integer * limit: * description: The number of items per page @@ -259,6 +262,7 @@ export type StoreCustomersListOrdersRes = PaginatedResponse & { * properties: * payment_methods: * type: array + * description: "An array of saved payment method details." * items: * type: object * required: @@ -266,7 +270,7 @@ export type StoreCustomersListOrdersRes = PaginatedResponse & { * - data * properties: * provider_id: - * description: The id of the Payment Provider where the payment method is saved. + * description: The ID of the Payment Provider where the payment method is saved. * type: string * data: * description: The data needed for the Payment Provider to use the saved payment method. diff --git a/packages/medusa/src/api/routes/store/customers/list-orders.ts b/packages/medusa/src/api/routes/store/customers/list-orders.ts index b48be0e30b..703a798828 100644 --- a/packages/medusa/src/api/routes/store/customers/list-orders.ts +++ b/packages/medusa/src/api/routes/store/customers/list-orders.ts @@ -20,20 +20,21 @@ import { DateComparisonOperator } from "../../../../types/common" * @oas [get] /store/customers/me/orders * operationId: GetCustomersCustomerOrders * summary: List Orders - * description: "Retrieves a list of a Customer's Orders." + * description: "Retrieve a list of the logged-in Customer's Orders. The orders can be filtered by fields such as `status` or `fulfillment_status`. The orders can also be paginated." * x-authenticated: true * parameters: - * - (query) q {string} Query used for searching orders. - * - (query) id {string} Id of the order to search for. + * - (query) q {string} term to search orders' display ID, email, shipping address's first name, customer's first name, customer's last name, and customer's phone number. + * - (query) id {string} Filter by ID. * - in: query * name: status * style: form * explode: false - * description: Status to search for. + * description: Filter by status. * schema: * type: array * items: * type: string + * enum: [pending, completed, archived, canceled, requires_action] * - in: query * name: fulfillment_status * style: form @@ -43,6 +44,7 @@ import { DateComparisonOperator } from "../../../../types/common" * type: array * items: * type: string + * enum: [not_fulfilled, partially_fulfilled, fulfilled, partially_shipped, shipped, partially_returned, returned, canceled, requires_action] * - in: query * name: payment_status * style: form @@ -52,24 +54,25 @@ import { DateComparisonOperator } from "../../../../types/common" * type: array * items: * type: string - * - (query) display_id {string} Display id to search for. - * - (query) cart_id {string} to search for. - * - (query) email {string} to search for. - * - (query) region_id {string} to search for. + * enum: [not_paid, awaiting, captured, partially_refunded, refunded, canceled, requires_action] + * - (query) display_id {string} Filter by display ID. + * - (query) cart_id {string} Filter by cart ID. + * - (query) email {string} Filter by email. + * - (query) region_id {string} Filter by region ID. * - in: query * name: currency_code * style: form * explode: false - * description: The 3 character ISO currency code to set prices based on. + * description: Filter by the 3 character ISO currency code of the order. * schema: * type: string * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. - * - (query) tax_rate {string} to search for. + * - (query) tax_rate {string} Filter by tax rate. * - in: query * name: created_at - * description: Date comparison for when resulting collections were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -91,7 +94,7 @@ import { DateComparisonOperator } from "../../../../types/common" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting collections were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -113,7 +116,7 @@ import { DateComparisonOperator } from "../../../../types/common" * format: date * - in: query * name: canceled_at - * description: Date comparison for when resulting collections were canceled. + * description: Filter by a cancelation date range. * schema: * type: object * properties: @@ -133,10 +136,10 @@ import { DateComparisonOperator } from "../../../../types/common" * type: string * description: filter by dates greater than or equal to this date * format: date - * - (query) limit=10 {integer} How many orders to return. - * - (query) offset=0 {integer} The offset in the resulting orders. - * - (query) fields {string} (Comma separated string) Which fields should be included in the resulting orders. - * - (query) expand {string} (Comma separated string) Which relations should be expanded in the resulting orders. + * - (query) limit=10 {integer} Limit the number of orders returned. + * - (query) offset=0 {integer} The number of orders to skip when retrieving the orders. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned orders. + * - (query) fields {string} Comma-separated fields that should be included in the returned orders. * x-codegen: * method: listOrders * queryParams: StoreGetCustomersCustomerOrdersParams @@ -154,8 +157,8 @@ import { DateComparisonOperator } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/customers/me/orders' \ - * --header 'Cookie: connect.sid={sid}' + * curl 'https://medusa-url.com/store/customers/me/orders' \ + * -H 'Cookie: connect.sid={sid}' * security: * - cookie_auth: [] * tags: diff --git a/packages/medusa/src/api/routes/store/customers/reset-password-token.ts b/packages/medusa/src/api/routes/store/customers/reset-password-token.ts index 3231cd84c0..6eccb51d50 100644 --- a/packages/medusa/src/api/routes/store/customers/reset-password-token.ts +++ b/packages/medusa/src/api/routes/store/customers/reset-password-token.ts @@ -7,7 +7,11 @@ import { EntityManager } from "typeorm" * @oas [post] /store/customers/password-token * operationId: PostCustomersCustomerPasswordToken * summary: Request Password Reset - * description: "Creates a reset password token to be used in a subsequent /reset-password request. The password token should be sent out of band e.g. via email and will not be returned." + * description: "Create a reset password token to be used in a subsequent Reset Password endpoint. This emits the event `customer.password_reset`. If a notification provider is + * installed in the Medusa backend and is configured to handle this event, a notification to the customer, such as an email, may be sent with reset instructions." + * externalDocs: + * description: "How to reset password" + * url: "https://docs.medusajs.com/modules/customers/storefront/implement-customer-profiles#reset-password" * requestBody: * content: * application/json: @@ -22,7 +26,7 @@ import { EntityManager } from "typeorm" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * medusa.customers.generatePasswordToken({ - * email: 'user@example.com' + * email: "user@example.com" * }) * .then(() => { * // successful @@ -33,8 +37,8 @@ import { EntityManager } from "typeorm" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/customers/password-token' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/customers/password-token' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com" * }' @@ -90,7 +94,7 @@ export default async (req, res) => { * - email * properties: * email: - * description: "The email of the customer." + * description: "The customer's email." * type: string * format: email */ diff --git a/packages/medusa/src/api/routes/store/customers/reset-password.ts b/packages/medusa/src/api/routes/store/customers/reset-password.ts index cb55f744d9..6f93cd3a7a 100644 --- a/packages/medusa/src/api/routes/store/customers/reset-password.ts +++ b/packages/medusa/src/api/routes/store/customers/reset-password.ts @@ -10,7 +10,11 @@ import { MedusaError } from "medusa-core-utils" * @oas [post] /store/customers/password-reset * operationId: PostCustomersResetPassword * summary: Reset Password - * description: "Resets a Customer's password using a password token created by a previous /password-token request." + * description: "Reset a Customer's password using a password token created by a previous request to the Request Password Reset endpoint. If the password token expired, + * you must create a new one." + * externalDocs: + * description: "How to reset password" + * url: "https://docs.medusajs.com/modules/customers/storefront/implement-customer-profiles#reset-password" * requestBody: * content: * application/json: @@ -25,9 +29,9 @@ import { MedusaError } from "medusa-core-utils" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * medusa.customers.resetPassword({ - * email: 'user@example.com', - * password: 'supersecret', - * token: 'supersecrettoken' + * email: "user@example.com", + * password: "supersecret", + * token: "supersecrettoken" * }) * .then(({ customer }) => { * console.log(customer.id); @@ -35,8 +39,8 @@ import { MedusaError } from "medusa-core-utils" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/customers/password-reset' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/customers/password-reset' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com", * "password": "supersecret", @@ -114,11 +118,11 @@ export default async (req, res) => { * - token * properties: * email: - * description: "The email of the customer." + * description: "The customer's email." * type: string * format: email * password: - * description: "The Customer's password." + * description: "The customer's password." * type: string * format: password * token: diff --git a/packages/medusa/src/api/routes/store/customers/update-address.ts b/packages/medusa/src/api/routes/store/customers/update-address.ts index b1b45db1db..5f51864119 100644 --- a/packages/medusa/src/api/routes/store/customers/update-address.ts +++ b/packages/medusa/src/api/routes/store/customers/update-address.ts @@ -9,10 +9,10 @@ import { validator } from "../../../../utils/validator" * @oas [post] /store/customers/me/addresses/{address_id} * operationId: PostCustomersCustomerAddressesAddress * summary: "Update a Shipping Address" - * description: "Updates a Customer's saved Shipping Address." + * description: "Update the logged-in customer's saved Shipping Address's details." * x-authenticated: true * parameters: - * - (path) address_id=* {String} The id of the Address to update. + * - (path) address_id=* {String} The ID of the Address. * requestBody: * content: * application/json: @@ -27,8 +27,8 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged - * medusa.customers.addresses.updateAddress(address_id, { - * first_name: 'Gina' + * medusa.customers.addresses.updateAddress(addressId, { + * first_name: "Gina" * }) * .then(({ customer }) => { * console.log(customer.id); @@ -36,9 +36,9 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ - * --header 'Cookie: connect.sid={sid}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + * -H 'Cookie: connect.sid={sid}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "first_name": "Gina" * }' diff --git a/packages/medusa/src/api/routes/store/customers/update-customer.ts b/packages/medusa/src/api/routes/store/customers/update-customer.ts index 86a0304cf1..8fc2184358 100644 --- a/packages/medusa/src/api/routes/store/customers/update-customer.ts +++ b/packages/medusa/src/api/routes/store/customers/update-customer.ts @@ -11,7 +11,7 @@ import { IsType } from "../../../../utils/validators/is-type" * @oas [post] /store/customers/me * operationId: PostCustomersCustomer * summary: Update Customer - * description: "Updates a Customer's saved details." + * description: "Update the logged-in customer's details." * x-authenticated: true * requestBody: * content: @@ -28,7 +28,7 @@ import { IsType } from "../../../../utils/validators/is-type" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged * medusa.customers.update({ - * first_name: 'Laury' + * first_name: "Laury" * }) * .then(({ customer }) => { * console.log(customer.id); @@ -36,9 +36,9 @@ import { IsType } from "../../../../utils/validators/is-type" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/customers/me' \ - * --header 'Cookie: connect.sid={sid}' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/customers/me' \ + * -H 'Cookie: connect.sid={sid}' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "first_name": "Laury" * }' @@ -92,29 +92,29 @@ export default async (req, res) => { * type: object * properties: * first_name: - * description: "The Customer's first name." + * description: "The customer's first name." * type: string * last_name: - * description: "The Customer's last name." + * description: "The customer's last name." * type: string * billing_address: - * description: "The Address to be used for billing purposes." + * description: "The address to be used for billing purposes." * anyOf: * - $ref: "#/components/schemas/AddressPayload" * description: The full billing address object * - type: string * description: The ID of an existing billing address * password: - * description: "The Customer's password." + * description: "The customer's password." * type: string * phone: - * description: "The Customer's phone number." + * description: "The customer's phone number." * type: string * email: - * description: "The email of the customer." + * description: "The customer's email." * type: string * metadata: - * description: "Metadata about the customer." + * description: "Additional custom data about the customer." * type: object */ export class StorePostCustomersCustomerReq { diff --git a/packages/medusa/src/api/routes/store/gift-cards/get-gift-card.ts b/packages/medusa/src/api/routes/store/gift-cards/get-gift-card.ts index 2952d49956..cde26ee262 100644 --- a/packages/medusa/src/api/routes/store/gift-cards/get-gift-card.ts +++ b/packages/medusa/src/api/routes/store/gift-cards/get-gift-card.ts @@ -6,7 +6,7 @@ import GiftCardService from "../../../../services/gift-card" * @oas [get] /store/gift-cards/{code} * operationId: "GetGiftCardsCode" * summary: "Get Gift Card by Code" - * description: "Retrieves a Gift Card by its associated unique code." + * description: "Retrieve a Gift Card's details by its associated unique code." * parameters: * - (path) code=* {string} The unique Gift Card code. * x-codegen: @@ -24,7 +24,7 @@ import GiftCardService from "../../../../services/gift-card" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/gift-cards/{code}' + * curl 'https://medusa-url.com/store/gift-cards/{code}' * tags: * - Gift Cards * responses: diff --git a/packages/medusa/src/api/routes/store/gift-cards/index.ts b/packages/medusa/src/api/routes/store/gift-cards/index.ts index d9b7706785..b4e0d2ea57 100644 --- a/packages/medusa/src/api/routes/store/gift-cards/index.ts +++ b/packages/medusa/src/api/routes/store/gift-cards/index.ts @@ -32,6 +32,7 @@ export const allowedStoreGiftCardFields = ["id", "code", "value", "balance"] * - gift_card * properties: * gift_card: + * description: "Gift card details." * $ref: "#/components/schemas/GiftCard" */ export type StoreGiftCardsRes = { diff --git a/packages/medusa/src/api/routes/store/order-edits/complete-order-edit.ts b/packages/medusa/src/api/routes/store/order-edits/complete-order-edit.ts index e7b0fbf549..f64ee5c86a 100644 --- a/packages/medusa/src/api/routes/store/order-edits/complete-order-edit.ts +++ b/packages/medusa/src/api/routes/store/order-edits/complete-order-edit.ts @@ -11,8 +11,11 @@ import { /** * @oas [post] /store/order-edits/{id}/complete * operationId: "PostOrderEditsOrderEditComplete" - * summary: "Completes an OrderEdit" - * description: "Completes an OrderEdit." + * summary: "Complete an Order Edit" + * description: "Complete an Order Edit and reflect its changes on the original order. Any additional payment required must be authorized first using the Payment Collection endpoints." + * externalDocs: + * description: "How to handle order edits in a storefront" + * url: "https://docs.medusajs.com/modules/orders/storefront/handle-order-edits" * parameters: * - (path) id=* {string} The ID of the Order Edit. * x-codegen: @@ -23,14 +26,14 @@ import { * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.orderEdits.complete(order_edit_id) + * medusa.orderEdits.complete(orderEditId) * .then(({ order_edit }) => { * console.log(order_edit.id) * }) * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/order-edits/{id}/complete' + * curl -X POST 'https://medusa-url.com/store/order-edits/{id}/complete' * tags: * - Order Edits * responses: diff --git a/packages/medusa/src/api/routes/store/order-edits/decline-order-edit.ts b/packages/medusa/src/api/routes/store/order-edits/decline-order-edit.ts index 91716eb614..88e03ecfe6 100644 --- a/packages/medusa/src/api/routes/store/order-edits/decline-order-edit.ts +++ b/packages/medusa/src/api/routes/store/order-edits/decline-order-edit.ts @@ -10,8 +10,8 @@ import { /** * @oas [post] /store/order-edits/{id}/decline * operationId: "PostOrderEditsOrderEditDecline" - * summary: "Decline an OrderEdit" - * description: "Declines an OrderEdit." + * summary: "Decline an Order Edit" + * description: "Decline an Order Edit. The changes are not reflected on the original order." * parameters: * - (path) id=* {string} The ID of the OrderEdit. * requestBody: @@ -27,14 +27,14 @@ import { * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.orderEdits.decline(order_edit_id) + * medusa.orderEdits.decline(orderEditId) * .then(({ order_edit }) => { * console.log(order_edit.id); * }) * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/order-edits/{id}/decline' + * curl -X POST 'https://medusa-url.com/store/order-edits/{id}/decline' * tags: * - Order Edits * responses: @@ -88,7 +88,7 @@ export default async (req: Request, res: Response) => { * properties: * declined_reason: * type: string - * description: The reason for declining the OrderEdit. + * description: The reason for declining the Order Edit. */ export class StorePostOrderEditsOrderEditDecline { @IsOptional() diff --git a/packages/medusa/src/api/routes/store/order-edits/get-order-edit.ts b/packages/medusa/src/api/routes/store/order-edits/get-order-edit.ts index 3473f370cf..b341d90c32 100644 --- a/packages/medusa/src/api/routes/store/order-edits/get-order-edit.ts +++ b/packages/medusa/src/api/routes/store/order-edits/get-order-edit.ts @@ -4,8 +4,8 @@ import { OrderEditService } from "../../../../services" /** * @oas [get] /store/order-edits/{id} * operationId: "GetOrderEditsOrderEdit" - * summary: "Retrieve an OrderEdit" - * description: "Retrieves a OrderEdit." + * summary: "Retrieve an Order Edit" + * description: "Retrieve an Order Edit's details." * parameters: * - (path) id=* {string} The ID of the OrderEdit. * x-codegen: @@ -16,14 +16,14 @@ import { OrderEditService } from "../../../../services" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.orderEdits.retrieve(order_edit_id) + * medusa.orderEdits.retrieve(orderEditId) * .then(({ order_edit }) => { * console.log(order_edit.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/order-edits/{id}' + * curl 'https://medusa-url.com/store/order-edits/{id}' * tags: * - Order Edits * responses: diff --git a/packages/medusa/src/api/routes/store/order-edits/index.ts b/packages/medusa/src/api/routes/store/order-edits/index.ts index f73a10564c..baf5792ac8 100644 --- a/packages/medusa/src/api/routes/store/order-edits/index.ts +++ b/packages/medusa/src/api/routes/store/order-edits/index.ts @@ -83,6 +83,7 @@ export default (app) => { * - order_edit * properties: * order_edit: + * description: "Order edit details." * $ref: "#/components/schemas/OrderEdit" */ export type StoreOrderEditsRes = { diff --git a/packages/medusa/src/api/routes/store/orders/confirm-order-request.ts b/packages/medusa/src/api/routes/store/orders/confirm-order-request.ts index f9af5e7e59..10dc377051 100644 --- a/packages/medusa/src/api/routes/store/orders/confirm-order-request.ts +++ b/packages/medusa/src/api/routes/store/orders/confirm-order-request.ts @@ -9,8 +9,11 @@ import { /** * @oas [post] /store/orders/customer/confirm * operationId: "PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept" - * summary: "Verify an Order Claim" - * description: "Verifies the claim order token provided to the customer upon request of order ownership" + * summary: "Verify Order Claim" + * description: "Verify the claim order token provided to the customer when they request ownership of an order." + * externalDocs: + * description: "How to implement claim-order flow in a storefront" + * url: "https://docs.medusajs.com/modules/orders/storefront/implement-claim-order" * requestBody: * content: * application/json: @@ -37,8 +40,8 @@ import { * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/orders/customer/confirm' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/orders/customer/confirm' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "token": "{token}", * }' @@ -114,7 +117,7 @@ export default async (req, res) => { * - token * properties: * token: - * description: "The invite token provided by the admin." + * description: "The claim token generated by previous request to the Claim Order endpoint." * type: string */ export class StorePostCustomersCustomerAcceptClaimReq { diff --git a/packages/medusa/src/api/routes/store/orders/get-order-by-cart.ts b/packages/medusa/src/api/routes/store/orders/get-order-by-cart.ts index 72634d9380..7e1086e938 100644 --- a/packages/medusa/src/api/routes/store/orders/get-order-by-cart.ts +++ b/packages/medusa/src/api/routes/store/orders/get-order-by-cart.ts @@ -5,7 +5,7 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [get] /store/orders/cart/{cart_id} * operationId: GetOrdersOrderCartId * summary: Get by Cart ID - * description: "Retrieves an Order by the id of the Cart that was used to create the Order." + * description: "Retrieve an Order's details by the ID of the Cart that was used to create the Order." * parameters: * - (path) cart_id=* {string} The ID of Cart. * x-codegen: @@ -16,14 +16,14 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.orders.retrieveByCartId(cart_id) + * medusa.orders.retrieveByCartId(cartId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/orders/cart/{id}' + * curl 'https://medusa-url.com/store/orders/cart/{cart_id}' * tags: * - Orders * responses: diff --git a/packages/medusa/src/api/routes/store/orders/get-order.ts b/packages/medusa/src/api/routes/store/orders/get-order.ts index fb99dcfef0..58be964717 100644 --- a/packages/medusa/src/api/routes/store/orders/get-order.ts +++ b/packages/medusa/src/api/routes/store/orders/get-order.ts @@ -6,11 +6,11 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [get] /store/orders/{id} * operationId: GetOrdersOrder * summary: Get an Order - * description: "Retrieves an Order" + * description: "Retrieve an Order's details." * parameters: - * - (path) id=* {string} The id of the Order. - * - (query) fields {string} (Comma separated) Which fields should be included in the result. - * - (query) expand {string} (Comma separated) Which fields should be expanded in the result. + * - (path) id=* {string} The ID of the Order. + * - (query) fields {string} Comma-separated fields that should be expanded in the returned order. + * - (query) expand {string} Comma-separated relations that should be included in the returned order. * x-codegen: * method: retrieve * x-codeSamples: @@ -19,14 +19,14 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.orders.retrieve(order_id) + * medusa.orders.retrieve(orderId) * .then(({ order }) => { * console.log(order.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/orders/{id}' + * curl 'https://medusa-url.com/store/orders/{id}' * tags: * - Orders * responses: diff --git a/packages/medusa/src/api/routes/store/orders/index.ts b/packages/medusa/src/api/routes/store/orders/index.ts index 09a1c97251..357b84f5e9 100644 --- a/packages/medusa/src/api/routes/store/orders/index.ts +++ b/packages/medusa/src/api/routes/store/orders/index.ts @@ -215,6 +215,7 @@ export const allowedStoreOrdersFields = [ * - swaps.additional_items.total * properties: * order: + * description: "Order details." * $ref: "#/components/schemas/Order" */ export type StoreOrdersRes = { diff --git a/packages/medusa/src/api/routes/store/orders/lookup-order.ts b/packages/medusa/src/api/routes/store/orders/lookup-order.ts index 7c2b5b03b9..c7560a7288 100644 --- a/packages/medusa/src/api/routes/store/orders/lookup-order.ts +++ b/packages/medusa/src/api/routes/store/orders/lookup-order.ts @@ -15,16 +15,16 @@ import { FindParams } from "../../../../types/common" * @oas [get] /store/orders * operationId: "GetOrders" * summary: "Look Up an Order" - * description: "Look up an order using filters." + * description: "Look up an order using filters. If the filters don't narrow down the results to a single order, a 404 response is returned with no orders." * parameters: - * - (query) display_id=* {number} The display id given to the Order. - * - (query) fields {string} (Comma separated) Which fields should be included in the result. - * - (query) expand {string} (Comma separated) Which fields should be expanded in the result. + * - (query) display_id=* {number} Filter by ID. + * - (query) fields {string} Comma-separated fields that should be expanded in the returned order. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned order. * - in: query * name: email * style: form * explode: false - * description: The email associated with this order. + * description: Filter by email. * required: true * schema: * type: string @@ -33,7 +33,7 @@ import { FindParams } from "../../../../types/common" * name: shipping_address * style: form * explode: false - * description: The shipping address associated with this order. + * description: Filter by the shipping address's postal code. * schema: * type: object * properties: @@ -51,7 +51,7 @@ import { FindParams } from "../../../../types/common" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * medusa.orders.lookupOrder({ * display_id: 1, - * email: 'user@example.com' + * email: "user@example.com" * }) * .then(({ order }) => { * console.log(order.id); @@ -59,7 +59,7 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' + * curl 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' * tags: * - Orders * responses: diff --git a/packages/medusa/src/api/routes/store/orders/request-order.ts b/packages/medusa/src/api/routes/store/orders/request-order.ts index 00d0fc1f5f..e5dac9ac83 100644 --- a/packages/medusa/src/api/routes/store/orders/request-order.ts +++ b/packages/medusa/src/api/routes/store/orders/request-order.ts @@ -8,8 +8,14 @@ import { TokenEvents } from "../../../../types/token" /** * @oas [post] /store/orders/batch/customer/token * operationId: "PostOrdersCustomerOrderClaim" - * summary: "Claim an Order" - * description: "Sends an email to emails registered to orders provided with link to transfer order ownership" + * summary: "Claim Order" + * description: "Allow the logged-in customer to claim ownership of one or more orders. This generates a token that can be used later on to verify the claim using the endpoint Verify Order Claim. + * This also emits the event `order-update-token.created`. So, if you have a notification provider installed that handles this event and sends the customer a notification, such as an email, + * the customer should receive instructions on how to finalize their claim ownership." + * externalDocs: + * description: "How to implement claim-order flow in a storefront" + * url: "https://docs.medusajs.com/modules/orders/storefront/implement-claim-order" + * x-authenticated: true * requestBody: * content: * application/json: @@ -24,8 +30,8 @@ import { TokenEvents } from "../../../../types/token" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.orders.claimOrders({ - * display_ids, + * medusa.orders.requestCustomerOrders({ + * order_ids, * }) * .then(() => { * // successful @@ -36,10 +42,10 @@ import { TokenEvents } from "../../../../types/token" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/batch/customer/token' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/batch/customer/token' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ - * "display_ids": ["id"], + * "order_ids": ["id"], * }' * security: * - api_token: [] @@ -124,7 +130,7 @@ export default async (req, res) => { * - order_ids * properties: * order_ids: - * description: "The ids of the orders to claim" + * description: "The ID of the orders to claim" * type: array * items: * type: string diff --git a/packages/medusa/src/api/routes/store/payment-collections/authorize-batch-payment-sessions.ts b/packages/medusa/src/api/routes/store/payment-collections/authorize-batch-payment-sessions.ts index 2bc9625422..595beb1890 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/authorize-batch-payment-sessions.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/authorize-batch-payment-sessions.ts @@ -5,7 +5,7 @@ import { PaymentCollectionService } from "../../../../services" * @oas [post] /store/payment-collections/{id}/sessions/batch/authorize * operationId: "PostPaymentCollectionsSessionsBatchAuthorize" * summary: "Authorize PaymentSessions" - * description: "Authorizes Payment Sessions of a Payment Collection." + * description: "Authorize the Payment Sessions of a Payment Collection." * x-authenticated: false * parameters: * - (path) id=* {string} The ID of the Payment Collections. @@ -23,14 +23,14 @@ import { PaymentCollectionService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.paymentCollections.authorize(payment_id) + * medusa.paymentCollections.authorize(paymentId) * .then(({ payment_collection }) => { * console.log(payment_collection.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' + * curl -X POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/store/payment-collections/authorize-payment-session.ts b/packages/medusa/src/api/routes/store/payment-collections/authorize-payment-session.ts index a6bf4917e8..a20458715a 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/authorize-payment-session.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/authorize-payment-session.ts @@ -6,7 +6,7 @@ import { PaymentCollectionService } from "../../../../services" * @oas [post] /store/payment-collections/{id}/sessions/{session_id}/authorize * operationId: "PostPaymentCollectionsSessionsSessionAuthorize" * summary: "Authorize Payment Session" - * description: "Authorizes a Payment Session of a Payment Collection." + * description: "Authorize a Payment Session of a Payment Collection." * x-authenticated: false * parameters: * - (path) id=* {string} The ID of the Payment Collections. @@ -20,14 +20,14 @@ import { PaymentCollectionService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.paymentCollections.authorize(payment_id, session_id) + * medusa.paymentCollections.authorize(paymentId, sessionId) * .then(({ payment_collection }) => { * console.log(payment_collection.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' + * curl -X POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts b/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts index ef84fa106b..3f43ebd52b 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts @@ -5,12 +5,12 @@ import { FindParams } from "../../../../types/common" * @oas [get] /store/payment-collections/{id} * operationId: "GetPaymentCollectionsPaymentCollection" * summary: "Get a PaymentCollection" - * description: "Get a Payment Collection" + * description: "Retrieve a Payment Collection's details." * x-authenticated: false * parameters: * - (path) id=* {string} The ID of the PaymentCollection. - * - (query) expand {string} Comma separated list of relations to include in the results. - * - (query) fields {string} Comma separated list of fields to include in the results. + * - (query) fields {string} Comma-separated fields that should be expanded in the returned payment collection. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned payment collection. * x-codegen: * method: retrieve * queryParams: StoreGetPaymentCollectionsParams @@ -28,7 +28,7 @@ import { FindParams } from "../../../../types/common" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/payment-collections/{id}' + * curl 'https://medusa-url.com/store/payment-collections/{id}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/store/payment-collections/index.ts b/packages/medusa/src/api/routes/store/payment-collections/index.ts index 7d10af88c5..61f808bafe 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/index.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/index.ts @@ -86,6 +86,7 @@ export const defaultPaymentCollectionRelations = ["region", "payment_sessions"] * - payment_collection * properties: * payment_collection: + * description: "Payment collection's details." * $ref: "#/components/schemas/PaymentCollection" */ export type StorePaymentCollectionsRes = { @@ -99,6 +100,7 @@ export type StorePaymentCollectionsRes = { * - payment_session * properties: * payment_session: + * description: "Payment session's details." * $ref: "#/components/schemas/PaymentSession" */ export type StorePaymentCollectionsSessionRes = { diff --git a/packages/medusa/src/api/routes/store/payment-collections/manage-batch-payment-sessions.ts b/packages/medusa/src/api/routes/store/payment-collections/manage-batch-payment-sessions.ts index 3bd5089e78..f2a62a53d1 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/manage-batch-payment-sessions.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/manage-batch-payment-sessions.ts @@ -8,7 +8,7 @@ import { PaymentCollectionService } from "../../../../services" * @oas [post] /store/payment-collections/{id}/sessions/batch * operationId: "PostPaymentCollectionsPaymentCollectionSessionsBatch" * summary: "Manage Payment Sessions" - * description: "Manages Multiple Payment Sessions from Payment Collections." + * description: "Create, update, or delete a list of payment sessions of a Payment Collections. If a payment session is not provided in the `sessions` array, it's deleted." * x-authenticated: false * parameters: * - (path) id=* {string} The ID of the Payment Collections. @@ -29,36 +29,53 @@ import { PaymentCollectionService } from "../../../../services" * * // Total amount = 10000 * - * // Adding two new sessions - * medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ - * { - * provider_id: "stripe", - * amount: 5000, - * }, - * { - * provider_id: "manual", - * amount: 5000, - * }, - * ]) + * // Example 1: Adding two new sessions + * medusa.paymentCollections.managePaymentSessionsBatch(paymentId, { + * sessions: [ + * { + * provider_id: "stripe", + * amount: 5000, + * }, + * { + * provider_id: "manual", + * amount: 5000, + * }, + * ] + * }) * .then(({ payment_collection }) => { * console.log(payment_collection.id); * }); * - * // Updating one session and removing the other - * medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ - * { - * provider_id: "stripe", - * amount: 10000, - * session_id: "ps_123456" - * }, - * ]) + * // Example 2: Updating one session and removing the other + * medusa.paymentCollections.managePaymentSessionsBatch(paymentId, { + * sessions: [ + * { + * provider_id: "stripe", + * amount: 10000, + * session_id: "ps_123456" + * }, + * ] + * }) * .then(({ payment_collection }) => { * console.log(payment_collection.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' + * curl -X POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "sessions": [ + * { + * "provider_id": "stripe", + * "amount": 5000 + * }, + * { + * "provider_id": "manual", + * "amount": 5000 + * } + * ] + * }' * security: * - api_token: [] * - cookie_auth: [] @@ -126,7 +143,7 @@ export class StorePostPaymentCollectionsSessionsReq { * - sessions * properties: * sessions: - * description: "An array of payment sessions related to the Payment Collection. If the session_id is not provided, existing sessions not present will be deleted and the provided ones will be created." + * description: "An array of payment sessions related to the Payment Collection. Existing sessions that are not added in this array will be deleted." * type: array * items: * type: object @@ -139,10 +156,10 @@ export class StorePostPaymentCollectionsSessionsReq { * description: The ID of the Payment Provider. * amount: * type: integer - * description: "The amount ." + * description: "The payment amount" * session_id: * type: string - * description: "The ID of the Payment Session to be updated." + * description: "The ID of the Payment Session to be updated. If no ID is provided, a new payment session is created." */ export class StorePostPaymentCollectionsBatchSessionsReq { @IsType([[StorePostPaymentCollectionsSessionsReq]]) diff --git a/packages/medusa/src/api/routes/store/payment-collections/manage-payment-session.ts b/packages/medusa/src/api/routes/store/payment-collections/manage-payment-session.ts index 6bf55b8dc4..2bd4f01f14 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/manage-payment-session.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/manage-payment-session.ts @@ -6,8 +6,8 @@ import { PaymentCollectionService } from "../../../../services" /** * @oas [post] /store/payment-collections/{id}/sessions * operationId: "PostPaymentCollectionsSessions" - * summary: "Manage a Payment Session" - * description: "Manages Payment Sessions from Payment Collections." + * summary: "Create a Payment Session" + * description: "Create a Payment Session for a payment provider in a Payment Collection." * x-authenticated: false * parameters: * - (path) id=* {string} The ID of the Payment Collection. @@ -25,10 +25,6 @@ import { PaymentCollectionService } from "../../../../services" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * - * // Total amount = 10000 - * - * // Adding a payment session * medusa.paymentCollections.managePaymentSession(payment_id, { provider_id: "stripe" }) * .then(({ payment_collection }) => { * console.log(payment_collection.id); @@ -37,7 +33,11 @@ import { PaymentCollectionService } from "../../../../services" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions' + * curl -X POST 'https://medusa-url.com/store/payment-collections/{id}/sessions' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "provider_id": "stripe" + * }' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/store/payment-collections/refresh-payment-session.ts b/packages/medusa/src/api/routes/store/payment-collections/refresh-payment-session.ts index 9fd3dfc6a8..5c5f0b9c3c 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/refresh-payment-session.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/refresh-payment-session.ts @@ -5,7 +5,7 @@ import { PaymentCollectionService } from "../../../../services" * @oas [post] /store/payment-collections/{id}/sessions/{session_id} * operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession * summary: "Refresh a Payment Session" - * description: "Refreshes a Payment Session to ensure that it is in sync with the Payment Collection." + * description: "Refresh a Payment Session's data to ensure that it is in sync with the Payment Collection." * x-authenticated: false * parameters: * - (path) id=* {string} The id of the PaymentCollection. @@ -18,14 +18,14 @@ import { PaymentCollectionService } from "../../../../services" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.paymentCollections.refreshPaymentSession(payment_collection_id, session_id) + * medusa.paymentCollections.refreshPaymentSession(paymentCollectionId, sessionId) * .then(({ payment_session }) => { * console.log(payment_session.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' + * curl -X POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' * tags: * - Payment Collections * responses: diff --git a/packages/medusa/src/api/routes/store/product-categories/get-product-category.ts b/packages/medusa/src/api/routes/store/product-categories/get-product-category.ts index 69b706664b..674b8f7a35 100644 --- a/packages/medusa/src/api/routes/store/product-categories/get-product-category.ts +++ b/packages/medusa/src/api/routes/store/product-categories/get-product-category.ts @@ -9,12 +9,12 @@ import { defaultStoreCategoryScope } from "." * @oas [get] /store/product-categories/{id} * operationId: "GetProductCategoriesCategory" * summary: "Get a Product Category" - * description: "Retrieves a Product Category." - * x-authenticated: false + * description: "Retrieve a Product Category's details." + * x-featureFlag: "product_categories" * parameters: * - (path) id=* {string} The ID of the Product Category - * - (query) expand {string} (Comma separated) Which fields should be expanded in each product category. - * - (query) fields {string} (Comma separated) Which fields should be retrieved in each product category. + * - (query) fields {string} Comma-separated fields that should be expanded in the returned product category. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned product category. * x-codegen: * method: retrieve * queryParams: StoreGetProductCategoriesCategoryParams @@ -25,15 +25,15 @@ import { defaultStoreCategoryScope } from "." * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * // must be previously logged in or use api token - * medusa.productCategories.retrieve(product_category_id) + * medusa.productCategories.retrieve(productCategoryId) * .then(({ product_category }) => { * console.log(product_category.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/product-categories/{id}' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/store/product-categories/{id}' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/store/product-categories/index.ts b/packages/medusa/src/api/routes/store/product-categories/index.ts index 1b8940c27b..7629f3ec1b 100644 --- a/packages/medusa/src/api/routes/store/product-categories/index.ts +++ b/packages/medusa/src/api/routes/store/product-categories/index.ts @@ -85,6 +85,7 @@ export const allowedStoreProductCategoryFields = [ * - product_category * properties: * product_category: + * description: "Product category details." * $ref: "#/components/schemas/ProductCategory" */ export type StoreGetProductCategoriesCategoryRes = { @@ -107,6 +108,7 @@ export type StoreGetProductCategoriesCategoryRes = { * properties: * product_categories: * type: array + * description: "An array of product categories details." * items: * $ref: "#/components/schemas/ProductCategory" * count: @@ -114,7 +116,7 @@ export type StoreGetProductCategoriesCategoryRes = { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of product categories skipped when retrieving the product categories. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/store/product-categories/list-product-categories.ts b/packages/medusa/src/api/routes/store/product-categories/list-product-categories.ts index 3c0dcabc81..903c681a50 100644 --- a/packages/medusa/src/api/routes/store/product-categories/list-product-categories.ts +++ b/packages/medusa/src/api/routes/store/product-categories/list-product-categories.ts @@ -11,15 +11,21 @@ import { defaultStoreCategoryScope } from "." * @oas [get] /store/product-categories * operationId: "GetProductCategories" * summary: "List Product Categories" - * description: "Retrieve a list of product categories." - * x-authenticated: false + * description: "Retrieve a list of product categories. The product categories can be filtered by fields such as `handle` or `q`. The product categories can also be paginated. + * This endpoint can also be used to retrieve a product category by its handle." + * x-featureFlag: "product_categories" + * externalDocs: + * description: "How to retrieve a product category by its handle" + * url: "https://docs.medusajs.com/modules/products/storefront/use-categories#get-a-category-by-its-handle" * parameters: - * - (query) q {string} Query used for searching product category names or handles. - * - (query) handle {string} Query used for searching product category by handle. - * - (query) parent_category_id {string} Returns categories scoped by parent - * - (query) include_descendants_tree {boolean} Include all nested descendants of category - * - (query) offset=0 {integer} How many product categories to skip in the result. + * - (query) q {string} term used to search product category's names and handles. + * - (query) handle {string} Filter by handle. + * - (query) parent_category_id {string} Filter by the ID of a parent category. Only children of the provided parent category are retrieved. + * - (query) include_descendants_tree {boolean} Whether all nested categories inside a category should be retrieved. + * - (query) offset=0 {integer} The number of product categories to skip when retrieving the product categories. * - (query) limit=100 {integer} Limit the number of product categories returned. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned product categories. + * - (query) fields {string} Comma-separated fields that should be included in the returned product categories. * x-codegen: * method: list * queryParams: StoreGetProductCategoriesParams @@ -36,8 +42,8 @@ import { defaultStoreCategoryScope } from "." * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/product-categories' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/store/product-categories' \ + * -H 'Authorization: Bearer {api_token}' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/store/product-tags/index.ts b/packages/medusa/src/api/routes/store/product-tags/index.ts index fcdb1765ce..3524fd3133 100644 --- a/packages/medusa/src/api/routes/store/product-tags/index.ts +++ b/packages/medusa/src/api/routes/store/product-tags/index.ts @@ -45,6 +45,7 @@ export const defaultStoreProductTagRelations = [] * properties: * product_tags: * type: array + * description: "An array of product tags details." * items: * $ref: "#/components/schemas/ProductTag" * count: @@ -52,7 +53,7 @@ export const defaultStoreProductTagRelations = [] * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of product tags skipped when retrieving the product tags. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/store/product-tags/list-product-tags.ts b/packages/medusa/src/api/routes/store/product-tags/list-product-tags.ts index a0500ad5ff..6d2f536dd8 100644 --- a/packages/medusa/src/api/routes/store/product-tags/list-product-tags.ts +++ b/packages/medusa/src/api/routes/store/product-tags/list-product-tags.ts @@ -13,21 +13,21 @@ import { IsType } from "../../../../utils/validators/is-type" * @oas [get] /store/product-tags * operationId: "GetProductTags" * summary: "List Product Tags" - * description: "Retrieve a list of Product Tags." + * description: "Retrieve a list of product tags. The product tags can be filtered by fields such as `id` or `q`. The product tags can also be sorted or paginated." * x-authenticated: true * x-codegen: * method: list * queryParams: StoreGetProductTagsParams * parameters: - * - (query) limit=20 {integer} The number of types to return. - * - (query) offset=0 {integer} The number of items to skip before the results. - * - (query) order {string} The field to sort items by. - * - (query) discount_condition_id {string} The discount condition id on which to filter the product tags. + * - (query) limit=20 {integer} Limit the number of product tags returned. + * - (query) offset=0 {integer} The number of product tags to skip when retrieving the product tags. + * - (query) order {string} A product-tag field to sort-order the retrieved product tags by. + * - (query) discount_condition_id {string} Filter by the ID of a discount condition. When provided, only tags that the discount condition applies for will be retrieved. * - in: query * name: value * style: form * explode: false - * description: The tag values to search for + * description: Filter by tag values. * schema: * type: array * items: @@ -36,15 +36,15 @@ import { IsType } from "../../../../utils/validators/is-type" * name: id * style: form * explode: false - * description: The tag IDs to search for + * description: Filter by IDs. * schema: * type: array * items: * type: string - * - (query) q {string} A query string to search values for + * - (query) q {string} term to search product tag's value. * - in: query * name: created_at - * description: Date comparison for when resulting product tags were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -66,7 +66,7 @@ import { IsType } from "../../../../utils/validators/is-type" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting product tags were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -99,7 +99,7 @@ import { IsType } from "../../../../utils/validators/is-type" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/product-tags' + * curl 'https://medusa-url.com/store/product-tags' * tags: * - Product Tags * responses: diff --git a/packages/medusa/src/api/routes/store/product-types/index.ts b/packages/medusa/src/api/routes/store/product-types/index.ts index 6b30b20a03..5083283fc8 100644 --- a/packages/medusa/src/api/routes/store/product-types/index.ts +++ b/packages/medusa/src/api/routes/store/product-types/index.ts @@ -50,6 +50,7 @@ export const defaultStoreProductTypeRelations = [] * properties: * product_types: * type: array + * description: "An array of product types details." * items: * $ref: "#/components/schemas/ProductType" * count: @@ -57,7 +58,7 @@ export const defaultStoreProductTypeRelations = [] * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of product types skipped when retrieving the product types. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/store/product-types/list-product-types.ts b/packages/medusa/src/api/routes/store/product-types/list-product-types.ts index 18610ea4a3..935ea61142 100644 --- a/packages/medusa/src/api/routes/store/product-types/list-product-types.ts +++ b/packages/medusa/src/api/routes/store/product-types/list-product-types.ts @@ -12,18 +12,18 @@ import ProductTypeService from "../../../../services/product-type" * @oas [get] /store/product-types * operationId: "GetProductTypes" * summary: "List Product Types" - * description: "Retrieve a list of Product Types." + * description: "Retrieve a list of product types. The product types can be filtered by fields such as `value` or `q`. The product types can also be sorted or paginated." * x-authenticated: true * parameters: - * - (query) limit=20 {integer} The number of types to return. - * - (query) offset=0 {integer} The number of items to skip before the results. - * - (query) order {string} The field to sort items by. - * - (query) discount_condition_id {string} The discount condition id on which to filter the product types. + * - (query) limit=20 {integer} Limit the number of product types returned. + * - (query) offset=0 {integer} The number of product types to skip when retrieving the product types. + * - (query) order {string} A product-type field to sort-order the retrieved product types by. + * - (query) discount_condition_id {string} Filter by the ID of a discount condition. When provided, only types that the discount condition applies for will be retrieved. * - in: query * name: value * style: form * explode: false - * description: The type values to search for + * description: Filter by type values. * schema: * type: array * items: @@ -32,15 +32,15 @@ import ProductTypeService from "../../../../services/product-type" * name: id * style: form * explode: false - * description: The type IDs to search for + * description: Filter by IDs. * schema: * type: array * items: * type: string - * - (query) q {string} A query string to search values for + * - (query) q {string} term to search product type's value. * - in: query * name: created_at - * description: Date comparison for when resulting product types were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -62,7 +62,7 @@ import ProductTypeService from "../../../../services/product-type" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting product types were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -99,8 +99,7 @@ import ProductTypeService from "../../../../services/product-type" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/product-types' \ - * --header 'Authorization: Bearer {api_token}' + * curl 'https://medusa-url.com/store/product-types' * security: * - api_token: [] * - cookie_auth: [] diff --git a/packages/medusa/src/api/routes/store/products/get-product.ts b/packages/medusa/src/api/routes/store/products/get-product.ts index c967ad1786..ee2fbfa1f1 100644 --- a/packages/medusa/src/api/routes/store/products/get-product.ts +++ b/packages/medusa/src/api/routes/store/products/get-product.ts @@ -14,19 +14,27 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * @oas [get] /store/products/{id} * operationId: GetProductsProduct * summary: Get a Product - * description: "Retrieves a Product." + * description: | + * Retrieve a Product's details. For accurate and correct pricing of the product based on the customer's context, it's highly recommended to pass fields such as + * `region_id`, `currency_code`, and `cart_id` when available. + * + * Passing `sales_channel_id` ensures retrieving only products available in the current sales channel. + * You can alternatively use a publishable API key in the request header instead of passing a `sales_channel_id`. + * externalDocs: + * description: "How to pass product pricing parameters" + * url: "https://docs.medusajs.com/modules/products/storefront/show-products#product-pricing-parameters" * parameters: - * - (path) id=* {string} The id of the Product. - * - (query) sales_channel_id {string} The sales channel used when fetching the product. - * - (query) cart_id {string} The ID of the customer's cart. - * - (query) region_id {string} The ID of the region the customer is using. This is helpful to ensure correct prices are retrieved for a region. - * - (query) fields {string} (Comma separated) Which fields should be included in the result. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each product of the result. + * - (path) id=* {string} The ID of the Product. + * - (query) sales_channel_id {string} The ID of the sales channel the customer is viewing the product from. + * - (query) cart_id {string} The ID of the cart. This is useful for accurate pricing based on the cart's context. + * - (query) region_id {string} The ID of the region. This is useful for accurate pricing based on the selected region. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned product. + * - (query) fields {string} Comma-separated fields that should be included in the returned product. * - in: query * name: currency_code * style: form * explode: false - * description: The 3 character ISO currency code to set prices based on. This is helpful to ensure correct prices are retrieved for a currency. + * description: A 3 character ISO currency code. This is useful for accurate pricing based on the selected currency. * schema: * type: string * externalDocs: @@ -41,14 +49,14 @@ import { cleanResponseData } from "../../../../utils/clean-response-data" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.products.retrieve(product_id) + * medusa.products.retrieve(productId) * .then(({ product }) => { * console.log(product.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/products/{id}' + * curl 'https://medusa-url.com/store/products/{id}' * tags: * - Products * responses: diff --git a/packages/medusa/src/api/routes/store/products/index.ts b/packages/medusa/src/api/routes/store/products/index.ts index 1d579d9fa5..068448027e 100644 --- a/packages/medusa/src/api/routes/store/products/index.ts +++ b/packages/medusa/src/api/routes/store/products/index.ts @@ -135,6 +135,7 @@ export * from "./search" * - product * properties: * product: + * description: "Product details." * $ref: "#/components/schemas/PricedProduct" */ export type StoreProductsRes = { @@ -149,7 +150,7 @@ export type StoreProductsRes = { * - hits * properties: * hits: - * description: Array of results. The format of the items depends on the search engine installed on the server. + * description: "Array of search results. The format of the items depends on the search engine installed on the Medusa backend." * type: array * - type: object */ @@ -182,6 +183,7 @@ export type StorePostSearchRes = { * properties: * products: * type: array + * description: "An array of products details." * items: * $ref: "#/components/schemas/PricedProduct" * count: @@ -189,7 +191,7 @@ export type StorePostSearchRes = { * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of products skipped when retrieving the products. * limit: * type: integer * description: The number of items per page diff --git a/packages/medusa/src/api/routes/store/products/list-products.ts b/packages/medusa/src/api/routes/store/products/list-products.ts index d12595c7cc..6b83302197 100644 --- a/packages/medusa/src/api/routes/store/products/list-products.ts +++ b/packages/medusa/src/api/routes/store/products/list-products.ts @@ -27,14 +27,25 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * @oas [get] /store/products * operationId: GetProducts * summary: List Products - * description: "Retrieves a list of Products." + * description: | + * Retrieves a list of products. The products can be filtered by fields such as `id` or `q`. The products can also be sorted or paginated. + * This endpoint can also be used to retrieve a product by its handle. + * + * For accurate and correct pricing of the products based on the customer's context, it's highly recommended to pass fields such as + * `region_id`, `currency_code`, and `cart_id` when available. + * + * Passing `sales_channel_id` ensures retrieving only products available in the specified sales channel. + * You can alternatively use a publishable API key in the request header instead of passing a `sales_channel_id`. + * externalDocs: + * description: "How to retrieve a product by its handle" + * url: "https://docs.medusajs.com/modules/products/storefront/show-products#retrieve-product-by-handle" * parameters: - * - (query) q {string} Query used for searching products by title, description, variant's title, variant's sku, and collection's title + * - (query) q {string} term used to search products' title, description, variant's title, variant's sku, and collection's title. * - in: query * name: id * style: form * explode: false - * description: product IDs to search for. + * description: Filter by IDs. * schema: * oneOf: * - type: string @@ -45,7 +56,8 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * name: sales_channel_id * style: form * explode: false - * description: an array of sales channel IDs to filter the retrieved products by. + * description: "Filter by sales channel IDs. When provided, only products available in the selected sales channels are retrieved. Alternatively, you can pass a + * publishable API key in the request header and this will have the same effect." * schema: * type: array * items: @@ -54,7 +66,7 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * name: collection_id * style: form * explode: false - * description: Collection IDs to search for + * description: Filter by product collection IDs. When provided, only products that belong to the specified product collections are retrieved. * schema: * type: array * items: @@ -63,7 +75,7 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * name: type_id * style: form * explode: false - * description: Type IDs to search for + * description: Filter by product type IDs. When provided, only products that belong to the specified product types are retrieved. * schema: * type: array * items: @@ -72,18 +84,18 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * name: tags * style: form * explode: false - * description: Tag IDs to search for + * description: Filter by product tag IDs. When provided, only products that belong to the specified product tags are retrieved. * schema: * type: array * items: * type: string - * - (query) title {string} title to search for. - * - (query) description {string} description to search for. - * - (query) handle {string} handle to search for. - * - (query) is_giftcard {boolean} Search for giftcards using is_giftcard=true. + * - (query) title {string} Filter by title. + * - (query) description {string} Filter by description + * - (query) handle {string} Filter by handle. + * - (query) is_giftcard {boolean} Whether to retrieve regular products or gift-card products. * - in: query * name: created_at - * description: Date comparison for when resulting products were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -105,7 +117,7 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting products were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -129,20 +141,37 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * name: category_id * style: form * explode: false - * description: Category ids to filter by. + * description: Filter by product category IDs. When provided, only products that belong to the specified product categories are retrieved. * schema: * type: array + * x-featureFlag: "product_categories" * items: * type: string - * - (query) include_category_children {boolean} Include category children when filtering by category_id. - * - (query) offset=0 {integer} How many products to skip in the result. + * - in: query + * name: include_category_children + * style: form + * explode: false + * description: Whether to include child product categories when filtering using the `category_id` field. + * schema: + * type: boolean + * x-featureFlag: "product_categories" + * - (query) offset=0 {integer} The number of products to skip when retrieving the products. * - (query) limit=100 {integer} Limit the number of products returned. - * - (query) expand {string} (Comma separated) Which fields should be expanded in each product of the result. - * - (query) fields {string} (Comma separated) Which fields should be included in each product of the result. - * - (query) order {string} the field used to order the products. - * - (query) cart_id {string} The id of the Cart to set prices based on. - * - (query) region_id {string} The id of the Region to set prices based on. - * - (query) currency_code {string} The currency code to use for price selection. + * - (query) expand {string} Comma-separated relations that should be expanded in the returned products. + * - (query) fields {string} Comma-separated fields that should be included in the returned products. + * - (query) order {string} A product field to sort-order the retrieved products by. + * - (query) cart_id {string} The ID of the cart. This is useful for accurate pricing based on the cart's context. + * - (query) region_id {string} The ID of the region. This is useful for accurate pricing based on the selected region. + * - in: query + * name: currency_code + * style: form + * explode: false + * description: A 3 character ISO currency code. This is useful for accurate pricing based on the selected currency. + * schema: + * type: string + * externalDocs: + * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + * description: See a list of codes. * x-codegen: * method: list * queryParams: StoreGetProductsParams @@ -159,7 +188,7 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/products' + * curl 'https://medusa-url.com/store/products' * tags: * - Products * responses: diff --git a/packages/medusa/src/api/routes/store/products/search.ts b/packages/medusa/src/api/routes/store/products/search.ts index f0d4f6bf6f..0bdbf36df6 100644 --- a/packages/medusa/src/api/routes/store/products/search.ts +++ b/packages/medusa/src/api/routes/store/products/search.ts @@ -9,7 +9,8 @@ import { validator } from "../../../../utils/validator" * @oas [post] /store/products/search * operationId: PostProductsSearch * summary: Search Products - * description: "Run a search query on products using the search engine installed on Medusa" + * description: "Run a search query on products using the search service installed on the Medusa backend. The searching is handled through the search service, so the returned data's + * format depends on the search service you're using." * requestBody: * content: * application/json: @@ -24,7 +25,7 @@ import { validator } from "../../../../utils/validator" * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) * medusa.products.search({ - * q: 'Shirt' + * q: "Shirt" * }) * .then(({ hits }) => { * console.log(hits.length); @@ -32,8 +33,8 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/products/search' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/products/search' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "q": "Shirt" * }' @@ -85,15 +86,15 @@ export default async (req, res) => { * properties: * q: * type: string - * description: The query to run the search with. + * description: The search query. * offset: * type: number - * description: How many products to skip in the result. + * description: The number of products to skip when retrieving the products. * limit: * type: number * description: Limit the number of products returned. * filter: - * description: Filter based on the search engine. + * description: Pass filters based on the search service. */ export class StorePostSearchReq { @IsOptional() diff --git a/packages/medusa/src/api/routes/store/regions/get-region.ts b/packages/medusa/src/api/routes/store/regions/get-region.ts index bc4b967950..1a2efa934d 100644 --- a/packages/medusa/src/api/routes/store/regions/get-region.ts +++ b/packages/medusa/src/api/routes/store/regions/get-region.ts @@ -5,9 +5,9 @@ import { defaultRelations } from "." * @oas [get] /store/regions/{id} * operationId: GetRegionsRegion * summary: Get a Region - * description: "Retrieves a Region." + * description: "Retrieve a Region's details." * parameters: - * - (path) id=* {string} The id of the Region. + * - (path) id=* {string} The ID of the Region. * x-codegen: * method: retrieve * x-codeSamples: @@ -16,14 +16,14 @@ import { defaultRelations } from "." * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.regions.retrieve(region_id) + * medusa.regions.retrieve(regionId) * .then(({ region }) => { * console.log(region.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/regions/{id}' + * curl 'https://medusa-url.com/store/regions/{id}' * tags: * - Regions * responses: diff --git a/packages/medusa/src/api/routes/store/regions/index.ts b/packages/medusa/src/api/routes/store/regions/index.ts index 3b48dbac33..dea5f5dca4 100644 --- a/packages/medusa/src/api/routes/store/regions/index.ts +++ b/packages/medusa/src/api/routes/store/regions/index.ts @@ -37,6 +37,7 @@ export const defaultRelations = [ * properties: * regions: * type: array + * description: "An array of regions details." * items: * $ref: "#/components/schemas/Region" * count: @@ -44,7 +45,7 @@ export const defaultRelations = [ * description: The total number of items available * offset: * type: integer - * description: The number of items skipped before these items + * description: The number of regions skipped when retrieving the regions. * limit: * type: integer * description: The number of items per page @@ -69,6 +70,7 @@ export type StoreRegionsListRes = PaginatedResponse & { * - region * properties: * region: + * description: "Region details." * $ref: "#/components/schemas/Region" */ export type StoreRegionsRes = { diff --git a/packages/medusa/src/api/routes/store/regions/list-regions.ts b/packages/medusa/src/api/routes/store/regions/list-regions.ts index 6c1f9ac514..c267c11f3c 100644 --- a/packages/medusa/src/api/routes/store/regions/list-regions.ts +++ b/packages/medusa/src/api/routes/store/regions/list-regions.ts @@ -11,13 +11,17 @@ import { validator } from "../../../../utils/validator" * @oas [get] /store/regions * operationId: GetRegions * summary: List Regions - * description: "Retrieves a list of Regions." + * description: "Retrieve a list of regions. The regions can be filtered by fields such as `created_at`. The regions can also be paginated. This endpoint is useful to + * show the customer all available regions to choose from." + * externalDocs: + * description: "How to use regions in a storefront" + * url: "https://docs.medusajs.com/modules/regions-and-currencies/storefront/use-regions" * parameters: - * - (query) offset=0 {integer} How many regions to skip in the result. + * - (query) offset=0 {integer} The number of regions to skip when retrieving the regions. * - (query) limit=100 {integer} Limit the number of regions returned. * - in: query * name: created_at - * description: Date comparison for when resulting regions were created. + * description: Filter by a creation date range. * schema: * type: object * properties: @@ -39,7 +43,7 @@ import { validator } from "../../../../utils/validator" * format: date * - in: query * name: updated_at - * description: Date comparison for when resulting regions were updated. + * description: Filter by an update date range. * schema: * type: object * properties: @@ -75,7 +79,7 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/regions' + * curl 'https://medusa-url.com/store/regions' * tags: * - Regions * responses: diff --git a/packages/medusa/src/api/routes/store/return-reasons/get-reason.ts b/packages/medusa/src/api/routes/store/return-reasons/get-reason.ts index 889efbca8f..17b340c65b 100644 --- a/packages/medusa/src/api/routes/store/return-reasons/get-reason.ts +++ b/packages/medusa/src/api/routes/store/return-reasons/get-reason.ts @@ -8,7 +8,7 @@ import ReturnReasonService from "../../../../services/return-reason" * @oas [get] /store/return-reasons/{id} * operationId: "GetReturnReasonsReason" * summary: "Get a Return Reason" - * description: "Retrieves a Return Reason." + * description: "Retrieve a Return Reason's details." * parameters: * - (path) id=* {string} The id of the Return Reason. * x-codegen: @@ -19,14 +19,14 @@ import ReturnReasonService from "../../../../services/return-reason" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.returnReasons.retrieve(reason_id) + * medusa.returnReasons.retrieve(reasonId) * .then(({ return_reason }) => { * console.log(return_reason.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/return-reasons/{id}' + * curl 'https://medusa-url.com/store/return-reasons/{id}' * tags: * - Return Reasons * responses: diff --git a/packages/medusa/src/api/routes/store/return-reasons/index.ts b/packages/medusa/src/api/routes/store/return-reasons/index.ts index 7e4960dd0a..36cadf3bee 100644 --- a/packages/medusa/src/api/routes/store/return-reasons/index.ts +++ b/packages/medusa/src/api/routes/store/return-reasons/index.ts @@ -49,6 +49,7 @@ export const defaultStoreReturnReasonRelations: (keyof ReturnReason)[] = [ * properties: * return_reasons: * type: array + * description: "An array of return reasons details." * items: * $ref: "#/components/schemas/ReturnReason" */ @@ -68,6 +69,7 @@ export type StoreReturnReasonsListRes = { * - return_reason * properties: * return_reason: + * description: "Return reason details." * $ref: "#/components/schemas/ReturnReason" */ export type StoreReturnReasonsRes = { diff --git a/packages/medusa/src/api/routes/store/return-reasons/list-reasons.ts b/packages/medusa/src/api/routes/store/return-reasons/list-reasons.ts index 9bfccb2e57..3a44ebc46a 100644 --- a/packages/medusa/src/api/routes/store/return-reasons/list-reasons.ts +++ b/packages/medusa/src/api/routes/store/return-reasons/list-reasons.ts @@ -8,7 +8,7 @@ import ReturnReasonService from "../../../../services/return-reason" * @oas [get] /store/return-reasons * operationId: "GetReturnReasons" * summary: "List Return Reasons" - * description: "Retrieves a list of Return Reasons." + * description: "Retrieve a list of Return Reasons. This is useful when implementing a Create Return flow in the storefront." * x-codegen: * method: list * x-codeSamples: @@ -24,7 +24,7 @@ import ReturnReasonService from "../../../../services/return-reason" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/return-reasons' + * curl 'https://medusa-url.com/store/return-reasons' * tags: * - Return Reasons * responses: diff --git a/packages/medusa/src/api/routes/store/returns/create-return.ts b/packages/medusa/src/api/routes/store/returns/create-return.ts index d4590fe8dd..d18fdf272d 100644 --- a/packages/medusa/src/api/routes/store/returns/create-return.ts +++ b/packages/medusa/src/api/routes/store/returns/create-return.ts @@ -21,7 +21,10 @@ import { defaultRelations } from "." * @oas [post] /store/returns * operationId: "PostReturns" * summary: "Create Return" - * description: "Creates a Return for an Order." + * description: "Create a Return for an Order. If a return shipping method is specified, the return is automatically fulfilled." + * externalDocs: + * description: "How to create a return in a storefront" + * url: "https://docs.medusajs.com/modules/orders/storefront/create-return" * requestBody: * content: * application/json: @@ -50,8 +53,8 @@ import { defaultRelations } from "." * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/returns' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/returns' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "order_id": "asfasf", * "items": [ @@ -260,9 +263,9 @@ class Item { * properties: * order_id: * type: string - * description: The ID of the Order to create the Return from. + * description: The ID of the Order to create the return for. * items: - * description: "The items to include in the Return." + * description: "The items to include in the return." * type: array * items: * type: object @@ -271,19 +274,19 @@ class Item { * - quantity * properties: * item_id: - * description: The ID of the Line Item from the Order. + * description: The ID of the line item to return. * type: string * quantity: * description: The quantity to return. * type: integer * reason_id: - * description: The ID of the return reason. + * description: The ID of the return reason. Return reasons can be retrieved from the List Return Reasons endpoint. * type: string * note: * description: A note to add to the item returned. * type: string * return_shipping: - * description: If the Return is to be handled by the store operator the Customer can choose a Return Shipping Method. Alternatvely the Customer can handle the Return themselves. + * description: The return shipping method used to return the items. If provided, a fulfillment is automatically created for the return. * type: object * required: * - option_id diff --git a/packages/medusa/src/api/routes/store/returns/index.ts b/packages/medusa/src/api/routes/store/returns/index.ts index b1d9000860..472d54527c 100644 --- a/packages/medusa/src/api/routes/store/returns/index.ts +++ b/packages/medusa/src/api/routes/store/returns/index.ts @@ -28,6 +28,7 @@ export const defaultRelations = ["items", "items.reason"] * - return * properties: * return: + * description: "Return details." * $ref: "#/components/schemas/Return" */ export type StoreReturnsRes = { diff --git a/packages/medusa/src/api/routes/store/shipping-options/index.ts b/packages/medusa/src/api/routes/store/shipping-options/index.ts index 305f54efc6..627a869483 100644 --- a/packages/medusa/src/api/routes/store/shipping-options/index.ts +++ b/packages/medusa/src/api/routes/store/shipping-options/index.ts @@ -30,6 +30,7 @@ export const defaultRelations = ["requirements"] * properties: * shipping_options: * type: array + * description: "An array of shipping options details." * items: * $ref: "#/components/schemas/PricedShippingOption" */ @@ -50,6 +51,7 @@ export type StoreShippingOptionsListRes = { * properties: * shipping_options: * type: array + * description: "An array of shipping options details." * items: * $ref: "#/components/schemas/PricedShippingOption" */ diff --git a/packages/medusa/src/api/routes/store/shipping-options/list-options.ts b/packages/medusa/src/api/routes/store/shipping-options/list-options.ts index d849a7d39e..37b6b5574e 100644 --- a/packages/medusa/src/api/routes/store/shipping-options/list-options.ts +++ b/packages/medusa/src/api/routes/store/shipping-options/list-options.ts @@ -8,11 +8,11 @@ import { defaultRelations } from "." * @oas [get] /store/shipping-options * operationId: GetShippingOptions * summary: Get Shipping Options - * description: "Retrieves a list of Shipping Options." + * description: "Retrieve a list of Shipping Options." * parameters: - * - (query) is_return {boolean} Whether return Shipping Options should be included. By default all Shipping Options are returned. - * - (query) product_ids {string} A comma separated list of Product ids to filter Shipping Options by. - * - (query) region_id {string} the Region to retrieve Shipping Options from. + * - (query) is_return {boolean} Whether return shipping options should be included. By default, all shipping options are returned. + * - (query) product_ids {string} "Comma-separated list of Product IDs to filter Shipping Options by. If provided, only shipping options that can be used with the provided products are retrieved." + * - (query) region_id {string} "The ID of the region that the shipping options belong to. If not provided, all shipping options are retrieved." * x-codegen: * method: list * queryParams: StoreGetShippingOptionsParams @@ -29,7 +29,7 @@ import { defaultRelations } from "." * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/shipping-options' + * curl 'https://medusa-url.com/store/shipping-options' * tags: * - Shipping Options * responses: diff --git a/packages/medusa/src/api/routes/store/shipping-options/list-shipping-options.ts b/packages/medusa/src/api/routes/store/shipping-options/list-shipping-options.ts index e2cd920a6a..36a5fda41b 100644 --- a/packages/medusa/src/api/routes/store/shipping-options/list-shipping-options.ts +++ b/packages/medusa/src/api/routes/store/shipping-options/list-shipping-options.ts @@ -5,9 +5,12 @@ import ShippingProfileService from "../../../../services/shipping-profile" * @oas [get] /store/shipping-options/{cart_id} * operationId: GetShippingOptionsCartId * summary: List for Cart - * description: "Retrieves a list of Shipping Options available to a cart." + * description: "Retrieve a list of Shipping Options available for a cart." + * externalDocs: + * description: "How to implement shipping step in checkout" + * url: "https://docs.medusajs.com/modules/carts-and-checkout/storefront/implement-checkout-flow#shipping-step" * parameters: - * - (path) cart_id {string} The id of the Cart. + * - (path) cart_id {string} The ID of the Cart. * x-codegen: * method: listCartOptions * x-codeSamples: @@ -16,14 +19,14 @@ import ShippingProfileService from "../../../../services/shipping-profile" * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.shippingOptions.listCartOptions(cart_id) + * medusa.shippingOptions.listCartOptions(cartId) * .then(({ shipping_options }) => { * console.log(shipping_options.length); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/shipping-options/{cart_id}' + * curl 'https://medusa-url.com/store/shipping-options/{cart_id}' * tags: * - Shipping Options * responses: diff --git a/packages/medusa/src/api/routes/store/swaps/create-swap.ts b/packages/medusa/src/api/routes/store/swaps/create-swap.ts index cc8633b757..1650646a7c 100644 --- a/packages/medusa/src/api/routes/store/swaps/create-swap.ts +++ b/packages/medusa/src/api/routes/store/swaps/create-swap.ts @@ -22,7 +22,16 @@ import { validator } from "../../../../utils/validator" * @oas [post] /store/swaps * operationId: PostSwaps * summary: Create a Swap - * description: "Creates a Swap on an Order by providing some items to return along with some items to send back" + * description: | + * Create a Swap for an Order. This will also create a return and associate it with the swap. If a return shipping option is specified, the return will automatically be fulfilled. + * To complete the swap, you must use the Complete Cart endpoint passing it the ID of the swap's cart. + * + * An idempotency key will be generated if none is provided in the header `Idempotency-Key` and added to + * the response. If an error occurs during swap creation or the request is interrupted for any reason, the swap creation can be retried by passing the idempotency + * key in the `Idempotency-Key` header. + * externalDocs: + * description: "How to create a swap" + * url: "https://docs.medusajs.com/modules/orders/storefront/create-swap" * requestBody: * content: * application/json: @@ -57,19 +66,19 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/swaps' \ - * --header 'Content-Type: application/json' \ + * curl -X POST 'https://medusa-url.com/store/swaps' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ - * "order_id": "asfasf", + * "order_id": "{order_id}", * "return_items": [ * { - * "item_id": "asfas", + * "item_id": "{item_id}", * "quantity": 1 * } * ], * "additional_items": [ * { - * "variant_id": "asfas", + * "variant_id": "{variant_id}", * "quantity": 1 * } * ] @@ -301,13 +310,13 @@ class AdditionalItem { * - quantity * properties: * item_id: - * description: The ID of the Line Item from the Order. + * description: The ID of the order's line item to return. * type: string * quantity: - * description: The quantity to swap. + * description: The quantity to return. * type: integer * reason_id: - * description: The ID of the reason of this return. + * description: The ID of the reason of this return. Return reasons can be retrieved from the List Return Reasons endpoint. * type: string * note: * description: The note to add to the item being swapped. @@ -316,7 +325,7 @@ class AdditionalItem { * type: string * description: The ID of the Shipping Option to create the Shipping Method from. * additional_items: - * description: "The items to exchange the returned items to." + * description: "The items to exchange the returned items with." * type: array * items: * type: object @@ -325,10 +334,10 @@ class AdditionalItem { * - quantity * properties: * variant_id: - * description: The ID of the Product Variant to send. + * description: The ID of the Product Variant. * type: string * quantity: - * description: The quantity to send of the variant. + * description: The quantity of the variant. * type: integer */ export class StorePostSwapsReq { diff --git a/packages/medusa/src/api/routes/store/swaps/get-swap-by-cart.ts b/packages/medusa/src/api/routes/store/swaps/get-swap-by-cart.ts index b8398b9b84..2a40f6fab6 100644 --- a/packages/medusa/src/api/routes/store/swaps/get-swap-by-cart.ts +++ b/packages/medusa/src/api/routes/store/swaps/get-swap-by-cart.ts @@ -5,7 +5,7 @@ import { defaultStoreSwapRelations } from "." * @oas [get] /store/swaps/{cart_id} * operationId: GetSwapsSwapCartId * summary: Get by Cart ID - * description: "Retrieves a Swap by the id of the Cart used to confirm the Swap." + * description: "Retrieve a Swap's details by the ID of its cart." * parameters: * - (path) cart_id {string} The id of the Cart * x-codegen: @@ -16,14 +16,14 @@ import { defaultStoreSwapRelations } from "." * source: | * import Medusa from "@medusajs/medusa-js" * const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - * medusa.swaps.retrieveByCartId(cart_id) + * medusa.swaps.retrieveByCartId(cartId) * .then(({ swap }) => { * console.log(swap.id); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/swaps/{cart_id}' + * curl 'https://medusa-url.com/store/swaps/{cart_id}' * tags: * - Swaps * responses: diff --git a/packages/medusa/src/api/routes/store/swaps/index.ts b/packages/medusa/src/api/routes/store/swaps/index.ts index 18f7c3cf74..f2571b143a 100644 --- a/packages/medusa/src/api/routes/store/swaps/index.ts +++ b/packages/medusa/src/api/routes/store/swaps/index.ts @@ -70,6 +70,7 @@ export const defaultStoreSwapFields: FindConfig["select"] = [ * - swap * properties: * swap: + * description: "Swap details." * $ref: "#/components/schemas/Swap" */ export type StoreSwapsRes = { diff --git a/packages/medusa/src/api/routes/store/variants/get-variant.ts b/packages/medusa/src/api/routes/store/variants/get-variant.ts index af2a9e9a7a..dd12f9c661 100644 --- a/packages/medusa/src/api/routes/store/variants/get-variant.ts +++ b/packages/medusa/src/api/routes/store/variants/get-variant.ts @@ -13,20 +13,28 @@ import { defaultStoreVariantRelations } from "." import { validator } from "../../../../utils/validator" /** - * @oas [get] /store/variants/{variant_id} + * @oas [get] /store/variants/{id} * operationId: GetVariantsVariant * summary: Get a Product Variant - * description: "Retrieves a Product Variant by id" + * description: | + * Retrieve a Product Variant's details. For accurate and correct pricing of the product variant based on the customer's context, it's highly recommended to pass fields such as + * `region_id`, `currency_code`, and `cart_id` when available. + * + * Passing `sales_channel_id` ensures retrieving only variants of products available in the current sales channel. + * You can alternatively use a publishable API key in the request header instead of passing a `sales_channel_id`. + * externalDocs: + * description: "How to pass product pricing parameters" + * url: "https://docs.medusajs.com/modules/products/storefront/show-products#product-pricing-parameters" * parameters: - * - (path) variant_id=* {string} The id of the Product Variant. - * - (query) cart_id {string} The id of the Cart to set prices based on. - * - (query) sales_channel_id {string} A sales channel id for result configuration. - * - (query) region_id {string} The id of the Region to set prices based on. + * - (path) id=* {string} The ID of the Product Variant. + * - (query) sales_channel_id {string} The ID of the sales channel the customer is viewing the product variant from. + * - (query) cart_id {string} The ID of the cart. This is useful for accurate pricing based on the cart's context. + * - (query) region_id {string} The ID of the region. This is useful for accurate pricing based on the selected region. * - in: query * name: currency_code * style: form * explode: false - * description: The 3 character ISO currency code to set prices based on. + * description: A 3 character ISO currency code. This is useful for accurate pricing based on the selected currency. * schema: * type: string * externalDocs: @@ -39,7 +47,7 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/variants/{id}' + * curl 'https://medusa-url.com/store/variants/{id}' * tags: * - Variants * responses: diff --git a/packages/medusa/src/api/routes/store/variants/index.ts b/packages/medusa/src/api/routes/store/variants/index.ts index a24a2f83d3..c0854e025e 100644 --- a/packages/medusa/src/api/routes/store/variants/index.ts +++ b/packages/medusa/src/api/routes/store/variants/index.ts @@ -57,6 +57,7 @@ export const allowedStoreVariantRelations = [ * - variant * properties: * variant: + * description: "Product variant description." * $ref: "#/components/schemas/PricedVariant" */ export type StoreVariantsRes = { @@ -79,6 +80,7 @@ export type StoreVariantsRes = { * properties: * variants: * type: array + * description: "An array of product variant descriptions." * items: * $ref: "#/components/schemas/PricedVariant" */ diff --git a/packages/medusa/src/api/routes/store/variants/list-variants.ts b/packages/medusa/src/api/routes/store/variants/list-variants.ts index 609b5cd020..39e5dce024 100644 --- a/packages/medusa/src/api/routes/store/variants/list-variants.ts +++ b/packages/medusa/src/api/routes/store/variants/list-variants.ts @@ -20,27 +20,61 @@ import { validator } from "../../../../utils/validator" * @oas [get] /store/variants * operationId: GetVariants * summary: Get Product Variants - * description: "Retrieves a list of Product Variants" + * description: | + * Retrieves a list of product variants. The product variants can be filtered by fields such as `id` or `title`. The product variants can also be paginated. + * + * For accurate and correct pricing of the product variants based on the customer's context, it's highly recommended to pass fields such as + * `region_id`, `currency_code`, and `cart_id` when available. + * + * Passing `sales_channel_id` ensures retrieving only variants of products available in the specified sales channel. + * You can alternatively use a publishable API key in the request header instead of passing a `sales_channel_id`. + * externalDocs: + * description: "How to pass product pricing parameters" + * url: "https://docs.medusajs.com/modules/products/storefront/show-products#product-pricing-parameters" * parameters: - * - (query) ids {string} A comma separated list of Product Variant ids to filter by. - * - (query) sales_channel_id {string} A sales channel id for result configuration. - * - (query) expand {string} A comma separated list of Product Variant relations to load. - * - (query) offset=0 {number} How many product variants to skip in the result. - * - (query) limit=100 {number} Maximum number of Product Variants to return. - * - (query) cart_id {string} The id of the Cart to set prices based on. - * - (query) region_id {string} The id of the Region to set prices based on. - * - (query) currency_code {string} The currency code to use for price selection. + * - (query) ids {string} Filter by a comma-separated list of IDs. If supplied, it overrides the `id` parameter. + * - in: query + * name: id + * style: form + * explode: false + * description: Filter by one or more IDs. If `ids` is supplied, it's overrides the value of this parameter. + * schema: + * oneOf: + * - type: string + * description: Filter by an ID. + * - type: array + * description: Filter by IDs. + * items: + * type: string + * - (query) sales_channel_id {string} "Filter by sales channel IDs. When provided, only products available in the selected sales channels are retrieved. Alternatively, you can pass a + * publishable API key in the request header and this will have the same effect." + * - (query) expand {string} Comma-separated relations that should be expanded in the returned product variants. + * - (query) fields {string} Comma-separated fields that should be included in the returned product variants. + * - (query) offset=0 {number} The number of products to skip when retrieving the product variants. + * - (query) limit=100 {number} Limit the number of product variants returned. + * - (query) cart_id {string} The ID of the cart. This is useful for accurate pricing based on the cart's context. + * - (query) region_id {string} The ID of the region. This is useful for accurate pricing based on the selected region. + * - in: query + * name: currency_code + * style: form + * explode: false + * description: A 3 character ISO currency code. This is useful for accurate pricing based on the selected currency. + * schema: + * type: string + * externalDocs: + * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + * description: See a list of codes. * - in: query * name: title * style: form * explode: false - * description: product variant title to search for. + * description: Filter by title * schema: * oneOf: * - type: string - * description: a single title to search by + * description: a single title to filter by * - type: array - * description: multiple titles to search by + * description: multiple titles to filter by * items: * type: string * - in: query @@ -49,22 +83,22 @@ import { validator } from "../../../../utils/validator" * schema: * oneOf: * - type: number - * description: a specific number to search by. + * description: A specific number to filter by. * - type: object - * description: search using less and greater than comparisons. + * description: Filter using less and greater than comparisons. * properties: * lt: * type: number - * description: filter by inventory quantity less than this number + * description: Filter by inventory quantity less than this number * gt: * type: number - * description: filter by inventory quantity greater than this number + * description: Filter by inventory quantity greater than this number * lte: * type: number - * description: filter by inventory quantity less than or equal to this number + * description: Filter by inventory quantity less than or equal to this number * gte: * type: number - * description: filter by inventory quantity greater than or equal to this number + * description: Filter by inventory quantity greater than or equal to this number * x-codegen: * method: list * queryParams: StoreGetVariantsParams @@ -72,7 +106,7 @@ import { validator } from "../../../../utils/validator" * - lang: Shell * label: cURL * source: | - * curl --location --request GET 'https://medusa-url.com/store/variants' + * curl 'https://medusa-url.com/store/variants' * tags: * - Variants * responses: diff --git a/packages/medusa/src/models/address.ts b/packages/medusa/src/models/address.ts index f32bbc47ad..64f8d36f6f 100644 --- a/packages/medusa/src/models/address.ts +++ b/packages/medusa/src/models/address.ts @@ -69,7 +69,7 @@ export class Address extends SoftDeletableEntity { /** * @schema Address * title: "Address" - * description: "An address." + * description: "An address is used across the Medusa backend within other schemas and object types. For example, a customer's billing and shipping addresses both use the Address entity." * type: object * required: * - address_1 @@ -141,7 +141,8 @@ export class Address extends SoftDeletableEntity { * description: See a list of codes. * example: st * country: - * description: A country object. Available if the relation `country` is expanded. + * description: A country object. + * x-expandable: "country" * nullable: true * $ref: "#/components/schemas/Country" * province: diff --git a/packages/medusa/src/models/batch-job.ts b/packages/medusa/src/models/batch-job.ts index 07e8d6f64d..1f8d736aa3 100644 --- a/packages/medusa/src/models/batch-job.ts +++ b/packages/medusa/src/models/batch-job.ts @@ -105,7 +105,7 @@ export class BatchJob extends SoftDeletableEntity { /** * @schema BatchJob * title: "Batch Job" - * description: "A Batch Job." + * description: "A Batch Job indicates an asynchronus task stored in the Medusa backend. Its status determines whether it has been executed or not." * type: object * required: * - canceled_at @@ -153,7 +153,8 @@ export class BatchJob extends SoftDeletableEntity { * type: string * example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V * created_by_user: - * description: A user object. Available if the relation `created_by_user` is expanded. + * description: The details of the user that created the batch job. + * x-expandable: "created_by_user" * nullable: true * $ref: "#/components/schemas/User" * context: diff --git a/packages/medusa/src/models/cart.ts b/packages/medusa/src/models/cart.ts index 291a54d56d..fc63cb2d26 100644 --- a/packages/medusa/src/models/cart.ts +++ b/packages/medusa/src/models/cart.ts @@ -1,7 +1,7 @@ /** * @schema Cart * title: "Cart" - * description: "Represents a user cart" + * description: "A cart represents a virtual shopping bag. It can be used to complete an order, a swap, or a claim." * type: object * required: * - billing_address_id @@ -37,7 +37,8 @@ * type: string * example: addr_01G8ZH853YPY9B94857DY91YGW * billing_address: - * description: Available if the relation `billing_address` is expanded. + * description: The details of the billing address associated with the cart. + * x-expandable: "billing_address" * nullable: true * $ref: "#/components/schemas/Address" * shipping_address_id: @@ -46,12 +47,14 @@ * type: string * example: addr_01G8ZH853YPY9B94857DY91YGW * shipping_address: - * description: Available if the relation `shipping_address` is expanded. + * description: The details of the shipping address associated with the cart. + * x-expandable: "shipping_address" * nullable: true * $ref: "#/components/schemas/Address" * items: - * description: Available if the relation `items` is expanded. + * description: The line items added to the cart. * type: array + * x-expandable: "items" * items: * $ref: "#/components/schemas/LineItem" * region_id: @@ -59,17 +62,20 @@ * type: string * example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G * region: - * description: A region object. Available if the relation `region` is expanded. + * description: The details of the region associated with the cart. + * x-expandable: "region" * nullable: true * $ref: "#/components/schemas/Region" * discounts: - * description: Available if the relation `discounts` is expanded. + * description: An array of details of all discounts applied to the cart. * type: array + * x-expandable: "discounts" * items: * $ref: "#/components/schemas/Discount" * gift_cards: - * description: Available if the relation `gift_cards` is expanded. + * description: An array of details of all gift cards applied to the cart. * type: array + * x-expandable: "gift_cards" * items: * $ref: "#/components/schemas/GiftCard" * customer_id: @@ -78,16 +84,19 @@ * type: string * example: cus_01G2SG30J8C85S4A5CHM2S1NS2 * customer: - * description: A customer object. Available if the relation `customer` is expanded. + * description: The details of the customer the cart belongs to. + * x-expandable: "customer" * nullable: true * $ref: "#/components/schemas/Customer" * payment_session: - * description: The selected payment session in the cart. + * description: The details of the selected payment session in the cart. + * x-expandable: "payment_session" * nullable: true * $ref: "#/components/schemas/PaymentSession" * payment_sessions: - * description: The payment sessions created on the cart. + * description: The details of all payment sessions created on the cart. * type: array + * x-expandable: "payment_sessions" * items: * $ref: "#/components/schemas/PaymentSession" * payment_id: @@ -96,12 +105,14 @@ * type: string * example: pay_01G8ZCC5W42ZNY842124G7P5R9 * payment: - * description: Available if the relation `payment` is expanded. + * description: The details of the payment associated with the cart. * nullable: true + * x-expandable: "payment" * $ref: "#/components/schemas/Payment" * shipping_methods: - * description: The shipping methods added to the cart. + * description: The details of the shipping methods added to the cart. * type: array + * x-expandable: "shipping_methods" * items: * $ref: "#/components/schemas/ShippingMethod" * type: @@ -144,8 +155,9 @@ * type: string * example: null * sales_channel: - * description: A sales channel object. Available if the relation `sales_channel` is expanded. + * description: The details of the sales channel associated with the cart. * nullable: true + * x-expandable: "sales_channel" * $ref: "#/components/schemas/SalesChannel" * created_at: * description: The date with timezone at which the resource was created. diff --git a/packages/medusa/src/models/claim-image.ts b/packages/medusa/src/models/claim-image.ts index a9ed58c86a..6245dba114 100644 --- a/packages/medusa/src/models/claim-image.ts +++ b/packages/medusa/src/models/claim-image.ts @@ -37,7 +37,7 @@ export class ClaimImage extends SoftDeletableEntity { /** * @schema ClaimImage * title: "Claim Image" - * description: "Represents photo documentation of a claim." + * description: "The details of an image attached to a claim." * type: object * required: * - claim_item_id @@ -56,8 +56,9 @@ export class ClaimImage extends SoftDeletableEntity { * description: The ID of the claim item associated with the image * type: string * claim_item: - * description: A claim item object. Available if the relation `claim_item` is expanded. + * description: The details of the claim item this image is associated with. * nullable: true + * x-expandable: "claim_item" * $ref: "#/components/schemas/ClaimItem" * url: * description: The URL of the image diff --git a/packages/medusa/src/models/claim-item.ts b/packages/medusa/src/models/claim-item.ts index d783197b50..864645e9fe 100644 --- a/packages/medusa/src/models/claim-item.ts +++ b/packages/medusa/src/models/claim-item.ts @@ -92,7 +92,7 @@ export class ClaimItem extends SoftDeletableEntity { /** * @schema ClaimItem * title: "Claim Item" - * description: "Represents a claimed item along with information about the reasons for the claim." + * description: "A claim item is an item created as part of a claim. It references an item in the order that should be exchanged or refunded." * type: object * required: * - claim_order_id @@ -112,15 +112,17 @@ export class ClaimItem extends SoftDeletableEntity { * type: string * example: citm_01G8ZH853Y6TFXWPG5EYE81X63 * images: - * description: Available if the relation `images` is expanded. + * description: The claim images that are attached to the claim item. * type: array + * x-expandable: "images" * items: * $ref: "#/components/schemas/ClaimImage" * claim_order_id: * description: The ID of the claim this item is associated with. * type: string * claim_order: - * description: A claim order object. Available if the relation `claim_order` is expanded. + * description: The details of the claim this item belongs to. + * x-expandable: "claim_order" * nullable: true * $ref: "#/components/schemas/ClaimOrder" * item_id: @@ -128,7 +130,8 @@ export class ClaimItem extends SoftDeletableEntity { * type: string * example: item_01G8ZM25TN49YV9EQBE2NC27KC * item: - * description: Available if the relation `item` is expanded. + * description: The details of the line item in the original order that this claim item refers to. + * x-expandable: "item" * nullable: true * $ref: "#/components/schemas/LineItem" * variant_id: @@ -136,7 +139,8 @@ export class ClaimItem extends SoftDeletableEntity { * type: string * example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 * variant: - * description: A variant object. Available if the relation `variant` is expanded. + * description: The details of the product variant to potentially replace the item in the original order. + * x-expandable: "variant" * nullable: true * $ref: "#/components/schemas/ProductVariant" * reason: @@ -157,8 +161,9 @@ export class ClaimItem extends SoftDeletableEntity { * type: integer * example: 1 * tags: - * description: User defined tags for easy filtering and grouping. Available if the relation 'tags' is expanded. + * description: User defined tags for easy filtering and grouping. * type: array + * x-expandable: "tags" * items: * $ref: "#/components/schemas/ClaimTag" * created_at: diff --git a/packages/medusa/src/models/claim-order.ts b/packages/medusa/src/models/claim-order.ts index 31610143fd..52100acd78 100644 --- a/packages/medusa/src/models/claim-order.ts +++ b/packages/medusa/src/models/claim-order.ts @@ -132,8 +132,8 @@ export class ClaimOrder extends SoftDeletableEntity { /** * @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." + * title: "Claim" + * description: "A Claim represents a group of faulty or missing items. It consists of claim items that refer to items in the original order that should be replaced or refunded. It also includes details related to shipping and fulfillment." * type: object * required: * - canceled_at @@ -184,13 +184,15 @@ export class ClaimOrder extends SoftDeletableEntity { * - requires_action * default: not_fulfilled * claim_items: - * description: The items that have been claimed + * description: The details of the items that should be replaced or refunded. * type: array + * x-expandable: "claim_items" * items: * $ref: "#/components/schemas/ClaimItem" * additional_items: - * description: Refers to the new items to be shipped when the claim order has the type `replace` + * description: The details of the new items to be shipped when the claim's type is `replace` * type: array + * x-expandable: "additional_items" * items: * $ref: "#/components/schemas/LineItem" * order_id: @@ -198,11 +200,13 @@ export class ClaimOrder extends SoftDeletableEntity { * type: string * example: order_01G8TJSYT9M6AVS5N4EMNFS1EK * order: - * description: An order object. Available if the relation `order` is expanded. + * description: The details of the order that this claim was created for. + * x-expandable: "order" * nullable: true * $ref: "#/components/schemas/Order" * return_order: - * description: A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded + * description: The details of the return associated with the claim if the claim's type is `replace`. + * x-expandable: "return_order" * nullable: true * $ref: "#/components/schemas/Return" * shipping_address_id: @@ -211,17 +215,20 @@ export class ClaimOrder extends SoftDeletableEntity { * type: string * example: addr_01G8ZH853YPY9B94857DY91YGW * shipping_address: - * description: Available if the relation `shipping_address` is expanded. + * description: The details of the address that new items should be shipped to. + * x-expandable: "shipping_address" * nullable: true * $ref: "#/components/schemas/Address" * shipping_methods: - * description: The shipping methods that the claim order will be shipped with. + * description: The details of the shipping methods that the claim order will be shipped with. * type: array + * x-expandable: "shipping_methods" * items: * $ref: "#/components/schemas/ShippingMethod" * fulfillments: * description: The fulfillments of the new items to be shipped * type: array + * x-expandable: "fulfillments" * items: * $ref: "#/components/schemas/Fulfillment" * refund_amount: diff --git a/packages/medusa/src/models/country.ts b/packages/medusa/src/models/country.ts index ddcded302d..47e90d91fd 100644 --- a/packages/medusa/src/models/country.ts +++ b/packages/medusa/src/models/country.ts @@ -92,7 +92,8 @@ export class Country { * type: string * example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G * region: - * description: A region object. Available if the relation `region` is expanded. + * description: The details of the region the country is associated with. + * x-expandable: "region" * nullable: true * $ref: "#/components/schemas/Region" */ diff --git a/packages/medusa/src/models/currency.ts b/packages/medusa/src/models/currency.ts index d7ac5dc857..6d10ca3788 100644 --- a/packages/medusa/src/models/currency.ts +++ b/packages/medusa/src/models/currency.ts @@ -51,7 +51,8 @@ export class Currency { * type: string * example: US Dollar * includes_tax: - * description: "[EXPERIMENTAL] Does the currency prices include tax" + * description: "Whether the currency prices include tax" * type: boolean + * x-featureFlag: "tax_inclusive_pricing" * default: false */ diff --git a/packages/medusa/src/models/custom-shipping-option.ts b/packages/medusa/src/models/custom-shipping-option.ts index 9e7e3bb5da..4e7aca9813 100644 --- a/packages/medusa/src/models/custom-shipping-option.ts +++ b/packages/medusa/src/models/custom-shipping-option.ts @@ -48,7 +48,7 @@ export class CustomShippingOption extends SoftDeletableEntity { /** * @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" + * description: "Custom Shipping Options are overriden Shipping Options. Admins can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option." * type: object * required: * - cart_id @@ -73,7 +73,8 @@ export class CustomShippingOption extends SoftDeletableEntity { * type: string * example: so_01G1G5V27GYX4QXNARRQCW1N8T * shipping_option: - * description: A shipping option object. Available if the relation `shipping_option` is expanded. + * description: The details of the overriden shipping options. + * x-expandable: "shipping_option" * nullable: true * $ref: "#/components/schemas/ShippingOption" * cart_id: @@ -82,7 +83,8 @@ export class CustomShippingOption extends SoftDeletableEntity { * type: string * example: cart_01G8ZH853Y6TFXWPG5EYE81X63 * cart: - * description: A cart object. Available if the relation `cart` is expanded. + * description: The details of the cart this shipping option belongs to. + * x-expandable: "cart" * nullable: true * $ref: "#/components/schemas/Cart" * created_at: diff --git a/packages/medusa/src/models/customer-group.ts b/packages/medusa/src/models/customer-group.ts index d41a3a405b..812e006acf 100644 --- a/packages/medusa/src/models/customer-group.ts +++ b/packages/medusa/src/models/customer-group.ts @@ -34,7 +34,7 @@ export class CustomerGroup extends SoftDeletableEntity { /** * @schema CustomerGroup * title: "Customer Group" - * description: "Represents a customer group" + * description: "A customer group that can be used to organize customers into groups of similar traits." * type: object * required: * - created_at @@ -53,13 +53,15 @@ export class CustomerGroup extends SoftDeletableEntity { * type: string * example: VIP * customers: - * description: The customers that belong to the customer group. Available if the relation `customers` is expanded. + * description: The details of the customers that belong to the customer group. * type: array + * x-expandable: "customers" * items: * $ref: "#/components/schemas/Customer" * price_lists: - * description: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. + * description: The price lists that are associated with the customer group. * type: array + * x-expandable: "price_lists" * items: * $ref: "#/components/schemas/PriceList" * created_at: diff --git a/packages/medusa/src/models/customer.ts b/packages/medusa/src/models/customer.ts index 593c50f660..eee78e2ca9 100644 --- a/packages/medusa/src/models/customer.ts +++ b/packages/medusa/src/models/customer.ts @@ -82,7 +82,7 @@ export class Customer extends SoftDeletableEntity { /** * @schema Customer * title: "Customer" - * description: "Represents a customer" + * description: "A customer can make purchases in your store and manage their profile." * type: object * required: * - billing_address_id @@ -121,12 +121,14 @@ export class Customer extends SoftDeletableEntity { * type: string * example: addr_01G8ZH853YPY9B94857DY91YGW * billing_address: - * description: Available if the relation `billing_address` is expanded. + * description: The details of the billing address associated with the customer. + * x-expandable: "billing_address" * nullable: true * $ref: "#/components/schemas/Address" * shipping_addresses: - * description: Available if the relation `shipping_addresses` is expanded. + * description: The details of the shipping addresses associated with the customer. * type: array + * x-expandable: "shipping_addresses" * items: * $ref: "#/components/schemas/Address" * phone: @@ -139,13 +141,15 @@ export class Customer extends SoftDeletableEntity { * type: boolean * default: false * orders: - * description: Available if the relation `orders` is expanded. + * description: The details of the orders this customer placed. * type: array + * x-expandable: "orders" * items: * $ref: "#/components/schemas/Order" * groups: - * description: The customer groups the customer belongs to. Available if the relation `groups` is expanded. + * description: The customer groups the customer belongs to. * type: array + * x-expandable: "groups" * items: * $ref: "#/components/schemas/CustomerGroup" * created_at: diff --git a/packages/medusa/src/models/discount-condition-product-collection.ts b/packages/medusa/src/models/discount-condition-product-collection.ts index fe069ba33d..cfaf50364f 100644 --- a/packages/medusa/src/models/discount-condition-product-collection.ts +++ b/packages/medusa/src/models/discount-condition-product-collection.ts @@ -40,7 +40,7 @@ export class DiscountConditionProductCollection { /** * @schema DiscountConditionProductCollection * title: "Product Collection Discount Condition" - * description: "Associates a discount condition with a product collection" + * description: "This represents the association between a discount condition and a product collection" * type: object * required: * - condition_id @@ -58,11 +58,13 @@ export class DiscountConditionProductCollection { * type: string * example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A * product_collection: - * description: Available if the relation `product_collection` is expanded. + * description: The details of the product collection. + * x-expandable: "product_collection" * nullable: true * $ref: "#/components/schemas/ProductCollection" * discount_condition: - * description: Available if the relation `discount_condition` is expanded. + * description: The details of the discount condition. + * x-expandable: "discount_condition" * nullable: true * $ref: "#/components/schemas/DiscountCondition" * created_at: diff --git a/packages/medusa/src/models/discount-condition-product-tag.ts b/packages/medusa/src/models/discount-condition-product-tag.ts index c09065e54f..ae85efb2b6 100644 --- a/packages/medusa/src/models/discount-condition-product-tag.ts +++ b/packages/medusa/src/models/discount-condition-product-tag.ts @@ -40,7 +40,7 @@ export class DiscountConditionProductTag { /** * @schema DiscountConditionProductTag * title: "Product Tag Discount Condition" - * description: "Associates a discount condition with a product tag" + * description: "This represents the association between a discount condition and a product tag" * type: object * required: * - condition_id @@ -58,11 +58,13 @@ export class DiscountConditionProductTag { * type: string * example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A * product_tag: - * description: Available if the relation `product_tag` is expanded. + * description: The details of the product tag. + * x-expandable: "product_tag" * nullable: true * $ref: "#/components/schemas/ProductTag" * discount_condition: - * description: Available if the relation `discount_condition` is expanded. + * description: The details of the discount condition. + * x-expandable: "discount_condition" * nullable: true * $ref: "#/components/schemas/DiscountCondition" * created_at: diff --git a/packages/medusa/src/models/discount-condition-product-type.ts b/packages/medusa/src/models/discount-condition-product-type.ts index 2bbc438859..ddf8f9c08b 100644 --- a/packages/medusa/src/models/discount-condition-product-type.ts +++ b/packages/medusa/src/models/discount-condition-product-type.ts @@ -40,7 +40,7 @@ export class DiscountConditionProductType { /** * @schema DiscountConditionProductType * title: "Product Type Discount Condition" - * description: "Associates a discount condition with a product type" + * description: "This represents the association between a discount condition and a product type" * type: object * required: * - condition_id @@ -58,11 +58,13 @@ export class DiscountConditionProductType { * type: string * example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A * product_type: - * description: Available if the relation `product_type` is expanded. + * description: The details of the product type. + * x-expandable: "product_type" * nullable: true * $ref: "#/components/schemas/ProductType" * discount_condition: - * description: Available if the relation `discount_condition` is expanded. + * description: The details of the discount condition. + * x-expandable: "discount_condition" * nullable: true * $ref: "#/components/schemas/DiscountCondition" * created_at: diff --git a/packages/medusa/src/models/discount-condition-product.ts b/packages/medusa/src/models/discount-condition-product.ts index 89d929b753..c1b6e0b240 100644 --- a/packages/medusa/src/models/discount-condition-product.ts +++ b/packages/medusa/src/models/discount-condition-product.ts @@ -40,7 +40,7 @@ export class DiscountConditionProduct { /** * @schema DiscountConditionProduct * title: "Product Discount Condition" - * description: "Associates a discount condition with a product" + * description: "This represents the association between a discount condition and a product" * type: object * required: * - condition_id @@ -58,11 +58,13 @@ export class DiscountConditionProduct { * type: string * example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A * product: - * description: Available if the relation `product` is expanded. + * description: The details of the product. + * x-expandable: "product" * nullable: true * $ref: "#/components/schemas/Product" * discount_condition: - * description: Available if the relation `discount_condition` is expanded. + * description: The details of the discount condition. + * x-expandable: "discount_condition" * nullable: true * $ref: "#/components/schemas/DiscountCondition" * created_at: diff --git a/packages/medusa/src/models/discount-condition.ts b/packages/medusa/src/models/discount-condition.ts index c44616c947..26b80bdefa 100644 --- a/packages/medusa/src/models/discount-condition.ts +++ b/packages/medusa/src/models/discount-condition.ts @@ -157,7 +157,8 @@ export class DiscountCondition extends SoftDeletableEntity { * type: string * example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A * type: - * description: "The type of the Condition" + * description: "The type of the condition. The type affects the available resources associated with the condition. For example, if the type is `products`, + * that means the `products` relation will hold the products associated with this condition and other relations will be empty." * type: string * enum: * - products @@ -166,7 +167,8 @@ export class DiscountCondition extends SoftDeletableEntity { * - product_tags * - customer_groups * operator: - * description: "The operator of the Condition" + * description: "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that + * discountable resources are everything but the specified resources." * type: string * enum: * - in @@ -176,32 +178,38 @@ export class DiscountCondition extends SoftDeletableEntity { * type: string * example: dru_01F0YESMVK96HVX7N419E3CJ7C * discount_rule: - * description: Available if the relation `discount_rule` is expanded. + * description: The details of the discount rule associated with the condition. + * x-expandable: "discount_rule" * nullable: true * $ref: "#/components/schemas/DiscountRule" * products: - * description: products associated with this condition if type = products. Available if the relation `products` is expanded. + * description: products associated with this condition if `type` is `products`. * type: array + * x-expandable: "products" * items: * $ref: "#/components/schemas/Product" * product_types: - * description: Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. + * description: Product types associated with this condition if `type` is `product_types`. * type: array + * x-expandable: "product_types" * items: * $ref: "#/components/schemas/ProductType" * product_tags: - * description: Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. + * description: Product tags associated with this condition if `type` is `product_tags`. * type: array + * x-expandable: "product_tags" * items: * $ref: "#/components/schemas/ProductTag" * product_collections: - * description: Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. + * description: Product collections associated with this condition if `type` is `product_collections`. * type: array + * x-expandable: "product_collections" * items: * $ref: "#/components/schemas/ProductCollection" * customer_groups: - * description: Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. + * description: Customer groups associated with this condition if `type` is `customer_groups`. * type: array + * x-expandable: "customer_groups" * items: * $ref: "#/components/schemas/CustomerGroup" * created_at: diff --git a/packages/medusa/src/models/discount-rule.ts b/packages/medusa/src/models/discount-rule.ts index 326838abda..bdf9abb6bf 100644 --- a/packages/medusa/src/models/discount-rule.ts +++ b/packages/medusa/src/models/discount-rule.ts @@ -52,7 +52,7 @@ export class DiscountRule extends SoftDeletableEntity { /** * @schema DiscountRule * title: "Discount Rule" - * description: "Holds the rules that governs how a Discount is calculated when applied to a Cart." + * description: "A discount rule defines how a Discount is calculated when applied to a Cart." * type: object * required: * - allocation @@ -95,8 +95,9 @@ export class DiscountRule extends SoftDeletableEntity { * - item * example: total * conditions: - * description: A set of conditions that can be used to limit when the discount can be used. Available if the relation `conditions` is expanded. + * description: The details of the discount conditions associated with the rule. They can be used to limit when the discount can be used. * type: array + * x-expandable: "conditions" * items: * $ref: "#/components/schemas/DiscountCondition" * created_at: diff --git a/packages/medusa/src/models/discount.ts b/packages/medusa/src/models/discount.ts index a4eec23526..8293ef473a 100644 --- a/packages/medusa/src/models/discount.ts +++ b/packages/medusa/src/models/discount.ts @@ -91,7 +91,7 @@ export class Discount extends SoftDeletableEntity { /** * @schema Discount * title: "Discount" - * description: "Represents a discount that can be applied to a cart for promotional purposes." + * description: "A discount can be applied to a cart for promotional purposes." * type: object * required: * - code @@ -123,12 +123,13 @@ export class Discount extends SoftDeletableEntity { * type: boolean * example: false * rule_id: - * description: The Discount Rule that governs the behaviour of the Discount + * description: The ID of the discount rule that defines how the discount will be applied to a cart. * nullable: true * type: string * example: dru_01F0YESMVK96HVX7N419E3CJ7C * rule: - * description: Available if the relation `rule` is expanded. + * description: The details of the discount rule that defines how the discount will be applied to a cart.. + * x-expandable: "rule" * nullable: true * $ref: "#/components/schemas/DiscountRule" * is_disabled: @@ -141,7 +142,8 @@ export class Discount extends SoftDeletableEntity { * type: string * example: disc_01G8ZH853YPY9B94857DY91YGW * parent_discount: - * description: Available if the relation `parent_discount` is expanded. + * description: The details of the parent discount that this discount was created from. + * x-expandable: "parent_discount" * nullable: true * $ref: "#/components/schemas/Discount" * starts_at: @@ -159,8 +161,9 @@ export class Discount extends SoftDeletableEntity { * type: string * example: P3Y6M4DT12H30M5S * regions: - * description: The Regions in which the Discount can be used. Available if the relation `regions` is expanded. + * description: The details of the regions in which the Discount can be used. * type: array + * x-expandable: "regions" * items: * $ref: "#/components/schemas/Region" * usage_limit: diff --git a/packages/medusa/src/models/draft-order.ts b/packages/medusa/src/models/draft-order.ts index 17ac8e098e..703a3b8dfa 100644 --- a/packages/medusa/src/models/draft-order.ts +++ b/packages/medusa/src/models/draft-order.ts @@ -81,7 +81,7 @@ export class DraftOrder extends BaseEntity { /** * @schema DraftOrder * title: "DraftOrder" - * description: "Represents a draft order" + * description: "A draft order is created by an admin without direct involvement of the customer. Once its payment is marked as captured, it is transformed into an order." * type: object * required: * - canceled_at @@ -102,7 +102,7 @@ export class DraftOrder extends BaseEntity { * type: string * example: dorder_01G8TJFKBG38YYFQ035MSVG03C * status: - * description: The status of the draft order + * description: The status of the draft order. It's changed to `completed` when it's transformed to an order. * type: string * enum: * - open @@ -118,16 +118,18 @@ export class DraftOrder extends BaseEntity { * type: string * example: cart_01G8ZH853Y6TFXWPG5EYE81X63 * cart: - * description: A cart object. Available if the relation `cart` is expanded. + * description: The details of the cart associated with the draft order. + * x-expandable: "cart" * nullable: true * $ref: "#/components/schemas/Cart" * order_id: - * description: The ID of the order associated with the draft order. + * description: The ID of the order created from the draft order when its payment is captured. * nullable: true * type: string * example: order_01G8TJSYT9M6AVS5N4EMNFS1EK * order: - * description: An order object. Available if the relation `order` is expanded. + * description: The details of the order created from the draft order when its payment is captured. + * x-expandable: "order" * nullable: true * $ref: "#/components/schemas/Order" * canceled_at: diff --git a/packages/medusa/src/models/fulfillment-item.ts b/packages/medusa/src/models/fulfillment-item.ts index 37a9937cbc..9f47883af0 100644 --- a/packages/medusa/src/models/fulfillment-item.ts +++ b/packages/medusa/src/models/fulfillment-item.ts @@ -26,7 +26,7 @@ export class FulfillmentItem { /** * @schema FulfillmentItem * title: "Fulfillment Item" - * description: "Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item." + * description: "This represents the association between a Line Item and a Fulfillment." * type: object * required: * - fulfillment_id @@ -34,19 +34,21 @@ 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. + * description: The details of the fulfillment. + * x-expandable: "fulfillment" * nullable: true * $ref: "#/components/schemas/Fulfillment" * item: - * description: Available if the relation `item` is expanded. + * description: The details of the line item. + * x-expandable: "item" * nullable: true * $ref: "#/components/schemas/LineItem" * quantity: diff --git a/packages/medusa/src/models/fulfillment-provider.ts b/packages/medusa/src/models/fulfillment-provider.ts index 852574db18..b750d2c321 100644 --- a/packages/medusa/src/models/fulfillment-provider.ts +++ b/packages/medusa/src/models/fulfillment-provider.ts @@ -12,18 +12,19 @@ export class FulfillmentProvider { /** * @schema FulfillmentProvider * title: "Fulfillment Provider" - * description: "Represents a fulfillment provider plugin and holds its installation status." + * description: "A fulfillment provider represents a fulfillment service installed in the Medusa backend, either through a plugin or backend customizations. + * It holds the fulfillment service's 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 fulfillment service. * 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 fulfillment service is installed in the current version. If a fulfillment service is no longer installed, the `is_installed` attribute is set to `false`. * type: boolean * default: true */ diff --git a/packages/medusa/src/models/fulfillment.ts b/packages/medusa/src/models/fulfillment.ts index 68f624761d..57d564bc1c 100644 --- a/packages/medusa/src/models/fulfillment.ts +++ b/packages/medusa/src/models/fulfillment.ts @@ -96,7 +96,7 @@ export class Fulfillment extends BaseEntity { /** * @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." + * description: "A Fulfillment is created once an admin can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a fulfillment provider, which typically integrates a third-party shipping service. Fulfillments can be associated with orders, claims, swaps, and returns." * type: object * required: * - canceled_at @@ -120,53 +120,59 @@ export class Fulfillment extends BaseEntity { * type: string * 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. + * description: The details of the claim that the fulfillment may belong to. + * x-expandable: "claim_order" * 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. + * description: The details of the swap that the fulfillment may belong to. + * x-expandable: "swap" * 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. + * description: The details of the order that the fulfillment may belong to. + * x-expandable: "order" * 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 * provider: - * description: Available if the relation `provider` is expanded. + * description: The details of the fulfillment provider responsible for handling the fulfillment. + * x-expandable: "provider" * nullable: true * $ref: "#/components/schemas/FulfillmentProvider" * location_id: - * description: The id of the stock location the fulfillment will be shipped from + * 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. + * description: The Fulfillment Items in the Fulfillment. These hold information about how many of each Line Item has been fulfilled. * type: array + * x-expandable: "items" * items: * $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. + * description: The Tracking Links that can be used to track the status of the Fulfillment. These will usually be provided by the Fulfillment Provider. * type: array + * x-expandable: "tracking_links" * items: * $ref: "#/components/schemas/TrackingLink" * tracking_numbers: diff --git a/packages/medusa/src/models/gift-card-transaction.ts b/packages/medusa/src/models/gift-card-transaction.ts index 32808f9d02..b3db0eb44d 100644 --- a/packages/medusa/src/models/gift-card-transaction.ts +++ b/packages/medusa/src/models/gift-card-transaction.ts @@ -57,7 +57,7 @@ export class GiftCardTransaction { /** * @schema GiftCardTransaction * title: "Gift Card Transaction" - * description: "Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order" + * description: "Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order." * type: object * required: * - amount @@ -77,15 +77,17 @@ export class GiftCardTransaction { * type: string * example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ * gift_card: - * description: A gift card object. Available if the relation `gift_card` is expanded. + * description: The details of the gift card associated used in this transaction. + * x-expandable: "gift_card" * 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 for payment. * type: string * example: order_01G8TJSYT9M6AVS5N4EMNFS1EK * order: - * description: An order object. Available if the relation `order` is expanded. + * description: The details of the order that the gift card was used for payment. + * x-expandable: "order" * nullable: true * $ref: "#/components/schemas/Order" * amount: diff --git a/packages/medusa/src/models/gift-card.ts b/packages/medusa/src/models/gift-card.ts index ddf90d122d..ed9f3c512e 100644 --- a/packages/medusa/src/models/gift-card.ts +++ b/packages/medusa/src/models/gift-card.ts @@ -99,20 +99,22 @@ export class GiftCard extends SoftDeletableEntity { * type: integer * example: 10 * region_id: - * description: The id of the Region in which the Gift Card is available. + * description: The ID of the region this gift card is available in. * type: string * example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G * region: - * description: A region object. Available if the relation `region` is expanded. + * description: The details of the region this gift card is available in. + * x-expandable: "region" * nullable: true * $ref: "#/components/schemas/Region" * order_id: - * description: The id of the Order that the Gift Card was purchased in. + * description: The ID of the order that the gift card was purchased in. * nullable: true * type: string * example: order_01G8TJSYT9M6AVS5N4EMNFS1EK * order: - * description: An order object. Available if the relation `order` is expanded. + * description: The details of the order that the gift card was purchased in. + * x-expandable: "region" * nullable: true * $ref: "#/components/schemas/Order" * is_disabled: diff --git a/packages/medusa/src/models/image.ts b/packages/medusa/src/models/image.ts index e02abc1e48..cf3055a257 100644 --- a/packages/medusa/src/models/image.ts +++ b/packages/medusa/src/models/image.ts @@ -21,7 +21,7 @@ export class Image extends SoftDeletableEntity { /** * @schema Image * title: "Image" - * description: "Images holds a reference to a URL at which the image file can be found." + * description: "An Image is used to store details about uploaded images. Images are uploaded by the File Service, and the URL is provided by the File Service." * type: object * required: * - created_at diff --git a/packages/medusa/src/models/invite.ts b/packages/medusa/src/models/invite.ts index 30a1b99ed8..dfbe065bf9 100644 --- a/packages/medusa/src/models/invite.ts +++ b/packages/medusa/src/models/invite.ts @@ -40,7 +40,7 @@ export class Invite extends SoftDeletableEntity { /** * @schema Invite * title: "Invite" - * description: "Represents an invite" + * description: "An invite is created when an admin user invites a new user to join the store's team. Once the invite is accepted, it's deleted." * type: object * required: * - accepted @@ -63,7 +63,7 @@ export class Invite extends SoftDeletableEntity { * type: string * format: email * role: - * description: The user's role. + * description: The user's role. These roles don't change the privileges of the user. * nullable: true * type: string * enum: diff --git a/packages/medusa/src/models/line-item-adjustment.ts b/packages/medusa/src/models/line-item-adjustment.ts index af0245dc8b..3734e38752 100644 --- a/packages/medusa/src/models/line-item-adjustment.ts +++ b/packages/medusa/src/models/line-item-adjustment.ts @@ -55,7 +55,7 @@ export class LineItemAdjustment { /** * @schema LineItemAdjustment * title: "Line Item Adjustment" - * description: "Represents a Line Item Adjustment" + * description: "A Line Item Adjustment includes details on discounts applied on a line item." * type: object * required: * - amount @@ -74,7 +74,8 @@ export class LineItemAdjustment { * type: string * example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN * item: - * description: Available if the relation `item` is expanded. + * description: The details of the line item. + * x-expandable: "item" * nullable: true * $ref: "#/components/schemas/LineItem" * description: @@ -87,7 +88,8 @@ export class LineItemAdjustment { * type: string * example: disc_01F0YESMW10MGHWJKZSDDMN0VN * discount: - * description: Available if the relation `discount` is expanded. + * description: The details of the discount associated with the adjustment. + * x-expandable: "discount" * nullable: true * $ref: "#/components/schemas/Discount" * amount: diff --git a/packages/medusa/src/models/line-item-tax-line.ts b/packages/medusa/src/models/line-item-tax-line.ts index e5d57d03d1..47bf29fcba 100644 --- a/packages/medusa/src/models/line-item-tax-line.ts +++ b/packages/medusa/src/models/line-item-tax-line.ts @@ -32,7 +32,7 @@ export class LineItemTaxLine extends TaxLine { /** * @schema LineItemTaxLine * title: "Line Item Tax Line" - * description: "Represents a Line Item Tax Line" + * description: "A Line Item Tax Line represents the taxes applied on a line item." * type: object * required: * - code @@ -66,7 +66,8 @@ export class LineItemTaxLine extends TaxLine { * type: string * example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN * item: - * description: Available if the relation `item` is expanded. + * description: The details of the line item. + * x-expandable: "item" * nullable: true * $ref: "#/components/schemas/LineItem" * created_at: diff --git a/packages/medusa/src/models/line-item.ts b/packages/medusa/src/models/line-item.ts index f708dc14ac..7031cf96d8 100644 --- a/packages/medusa/src/models/line-item.ts +++ b/packages/medusa/src/models/line-item.ts @@ -161,7 +161,7 @@ export class LineItem extends BaseEntity { /** * @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." + * description: "Line Items are created when a product is added to a Cart. When Line Items are purchased they will get copied to the resulting order, swap, or claim, and can eventually be referenced in Fulfillments and Returns. Line items may also be used for order edits." * type: object * required: * - allow_discounts @@ -194,65 +194,72 @@ export class LineItem extends BaseEntity { * type: string * 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 may belongs to. * nullable: true * type: string * example: cart_01G8ZH853Y6TFXWPG5EYE81X63 * cart: - * description: A cart object. Available if the relation `cart` is expanded. + * description: The details of the cart that the line item may belongs to. + * x-expandable: "cart" * 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 may belongs to. * nullable: true * type: string * example: order_01G8TJSYT9M6AVS5N4EMNFS1EK * order: - * description: An order object. Available if the relation `order` is expanded. + * description: The details of the order that the line item may belongs to. + * x-expandable: "order" * 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 may belong to. * nullable: true * type: string * example: null * swap: - * description: A swap object. Available if the relation `swap` is expanded. + * description: The details of the swap that the line item may belong to. + * x-expandable: "swap" * 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 may belong to. * nullable: true * type: string * example: null * claim_order: - * description: A claim order object. Available if the relation `claim_order` is expanded. + * description: The details of the claim that the line item may belong to. + * x-expandable: "claim_order" * nullable: true * $ref: "#/components/schemas/ClaimOrder" * tax_lines: - * description: Available if the relation `tax_lines` is expanded. + * description: The details of the item's tax lines. + * x-expandable: "tax_lines" * type: array * items: * $ref: "#/components/schemas/LineItemTaxLine" * adjustments: - * description: Available if the relation `adjustments` is expanded. + * description: The details of the item's adjustments, which are available when a discount is applied on the item. + * x-expandable: "adjustments" * type: array * items: * $ref: "#/components/schemas/LineItemAdjustment" * original_item_id: - * description: The id of the original line item + * description: The ID of the original line item. This is useful if the line item belongs to a resource that references an order, such as a return or an order edit. * nullable: true * type: string * order_edit_id: - * description: The ID of the order edit to which a cloned item belongs + * description: The ID of the order edit that the item may belong to. * nullable: true * type: string * order_edit: - * description: The order edit joined. Available if the relation `order_edit` is expanded. + * description: The details of the order edit. + * x-expandable: "order_edit" * 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. * type: string * example: Medusa Coffee Mug * description: @@ -297,7 +304,8 @@ export class LineItem extends BaseEntity { * 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. + * description: The details of the product variant that this item was created from. + * x-expandable: "variant" * nullable: true * $ref: "#/components/schemas/ProductVariant" * quantity: @@ -356,7 +364,8 @@ export class LineItem extends BaseEntity { * type: integer * example: 0 * includes_tax: - * description: "[EXPERIMENTAL] Indicates if the line item unit_price include tax" + * description: "Indicates if the line item unit_price include tax" + * x-featureFlag: "tax_inclusive_pricing" * type: boolean * default: false * created_at: diff --git a/packages/medusa/src/models/money-amount.ts b/packages/medusa/src/models/money-amount.ts index c2fb5f6bce..6251008249 100644 --- a/packages/medusa/src/models/money-amount.ts +++ b/packages/medusa/src/models/money-amount.ts @@ -70,7 +70,7 @@ export class MoneyAmount extends SoftDeletableEntity { /** * @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." + * description: "A Money Amount represent a price amount, for example, a product variant's price or a price in a price list. 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 Region." * type: object * required: * - amount @@ -90,14 +90,15 @@ export class MoneyAmount extends SoftDeletableEntity { * 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 may belong to. * type: string * example: usd * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * currency: - * description: Available if the relation `currency` is expanded. + * description: The details of the currency that the money amount may belong to. + * x-expandable: "currency" * nullable: true * $ref: "#/components/schemas/Currency" * amount: @@ -115,21 +116,23 @@ export class MoneyAmount extends SoftDeletableEntity { * type: integer * example: 1 * price_list_id: - * description: The ID of the price list associated with the money amount + * description: The ID of the price list that the money amount may belong to. * nullable: true * type: string * example: pl_01G8X3CKJXCG5VXVZ87H9KC09W * price_list: - * description: Available if the relation `price_list` is expanded. + * description: The details of the price list that the money amount may belong to. + * x-expandable: "price_list" * 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. + * description: The details of the product variant that the money amount may belong to. + * x-expandable: "variant" * nullable: true * $ref: "#/components/schemas/ProductVariant" * region_id: @@ -138,7 +141,8 @@ export class MoneyAmount extends SoftDeletableEntity { * type: string * example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G * region: - * description: A region object. Available if the relation `region` is expanded. + * description: The details of the region that the money amount may belong to. + * x-expandable: "region" * nullable: true * $ref: "#/components/schemas/Region" * created_at: diff --git a/packages/medusa/src/models/note.ts b/packages/medusa/src/models/note.ts index d99dc32f94..36b8c996db 100644 --- a/packages/medusa/src/models/note.ts +++ b/packages/medusa/src/models/note.ts @@ -44,7 +44,7 @@ export class Note extends SoftDeletableEntity { /** * @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." + * description: "A Note is an element that can be used in association with different resources to allow admin users to describe additional information. For example, they can be used to add additional information about orders." * type: object * required: * - author_id @@ -74,12 +74,13 @@ export class Note extends SoftDeletableEntity { * type: string * example: This order must be fulfilled on Monday * author_id: - * description: The ID of the author (user) + * description: The ID of the user that created the note. * nullable: true * type: string * example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V * author: - * description: Available if the relation `author` is expanded. + * description: The details of the user that created the note. + * x-expandable: "author" * nullable: true * $ref: "#/components/schemas/User" * created_at: diff --git a/packages/medusa/src/models/notification-provider.ts b/packages/medusa/src/models/notification-provider.ts index 447ae4180f..3e06c20f17 100644 --- a/packages/medusa/src/models/notification-provider.ts +++ b/packages/medusa/src/models/notification-provider.ts @@ -12,18 +12,19 @@ export class NotificationProvider { /** * @schema NotificationProvider * title: "Notification Provider" - * description: "Represents a notification provider plugin and holds its installation status." + * description: "A notification provider represents a notification service installed in the Medusa backend, either through a plugin or backend customizations. + * It holds the notification service's installation status." * 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 notification service. * 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 notification service is installed in the current version. If a notification service is no longer installed, the `is_installed` attribute is set to `false`. * type: boolean * default: true */ diff --git a/packages/medusa/src/models/notification.ts b/packages/medusa/src/models/notification.ts index bc18ae1ae2..e002fddb94 100644 --- a/packages/medusa/src/models/notification.ts +++ b/packages/medusa/src/models/notification.ts @@ -67,7 +67,7 @@ export class Notification extends BaseEntity { /** * @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." + * description: "A notification is an alert sent, typically to customers, using the installed Notification Provider as a reaction to internal events such as `order.placed`. Notifications can be resent." * type: object * required: * - created_at @@ -100,16 +100,17 @@ export class Notification extends BaseEntity { * 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 this notification was sent to. * nullable: true * type: string * example: cus_01G2SG30J8C85S4A5CHM2S1NS2 * customer: - * description: A customer object. Available if the relation `customer` is expanded. + * description: The details of the customer that this notification was sent to. + * x-expandable: "customer" * 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 can represent other addresses such as a chat bot user ID. * type: string * example: user@example.com * data: @@ -122,21 +123,24 @@ export class Notification extends BaseEntity { * type: string * example: noti_01G53V9Y6CKMCGBM1P0X7C28RX * parent_notification: - * description: Available if the relation `parent_notification` is expanded. + * description: The details of the parent notification. + * x-expandable: "parent_notification" * 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. + * description: The details of all resends of the notification. * type: array + * x-expandable: "resends" * 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 used to send the notification. * nullable: true * type: string * example: sengrid * provider: - * description: Available if the relation `provider` is expanded. + * description: The notification provider used to send the notification. + * x-expandable: "provider" * nullable: true * $ref: "#/components/schemas/NotificationProvider" * created_at: diff --git a/packages/medusa/src/models/oauth.ts b/packages/medusa/src/models/oauth.ts index 7588d597ee..f91d3677f5 100644 --- a/packages/medusa/src/models/oauth.ts +++ b/packages/medusa/src/models/oauth.ts @@ -33,7 +33,7 @@ export class Oauth { /** * @schema OAuth * title: "OAuth" - * description: "Represent an OAuth app" + * description: "An Oauth app is typically created by a plugin to handle authentication to third-party services." * type: object * required: * - application_name diff --git a/packages/medusa/src/models/order-edit.ts b/packages/medusa/src/models/order-edit.ts index 6b68c62366..c9c53cb31c 100644 --- a/packages/medusa/src/models/order-edit.ts +++ b/packages/medusa/src/models/order-edit.ts @@ -123,7 +123,7 @@ export class OrderEdit extends BaseEntity { /** * @schema OrderEdit * title: "Order Edit" - * description: "Order edit keeps track of order items changes." + * description: "Order edit allows modifying items in an order, such as adding, updating, or deleting items from the original order. Once the order edit is confirmed, the changes are reflected on the original order." * type: object * required: * - canceled_at @@ -153,11 +153,13 @@ export class OrderEdit extends BaseEntity { * type: string * example: order_01G2SG30J8C85S4A5CHM2S1NS2 * order: - * description: Available if the relation `order` is expanded. + * description: The details of the order that this order edit was created for. + * x-expandable: "order" * nullable: true * $ref: "#/components/schemas/Order" * changes: - * description: Available if the relation `changes` is expanded. + * description: The details of all the changes on the original order's line items. + * x-expandable: "changes" * type: array * items: * $ref: "#/components/schemas/OrderItemChange" @@ -251,8 +253,9 @@ export class OrderEdit extends BaseEntity { * - created * - canceled * items: - * description: Available if the relation `items` is expanded. + * description: The details of the cloned items from the original order with the new changes. Once the order edit is confirmed, these line items are associated with the original order. * type: array + * x-expandable: "items" * items: * $ref: "#/components/schemas/LineItem" * payment_collection_id: @@ -261,7 +264,8 @@ export class OrderEdit extends BaseEntity { * type: string * example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK * payment_collection: - * description: Available if the relation `payment_collection` is expanded. + * description: The details of the payment collection used to authorize additional payment if necessary. + * x-expandable: "payment_collection" * nullable: true * $ref: "#/components/schemas/PaymentCollection" * created_at: diff --git a/packages/medusa/src/models/order-item-change.ts b/packages/medusa/src/models/order-item-change.ts index 4c57b0de2e..93cbd8f9c5 100644 --- a/packages/medusa/src/models/order-item-change.ts +++ b/packages/medusa/src/models/order-item-change.ts @@ -60,7 +60,7 @@ export class OrderItemChange extends SoftDeletableEntity { /** * @schema OrderItemChange * title: "Order Item Change" - * description: "Represents an order edit item change" + * description: "An order item change is a change made within an order edit to an order's items. These changes are not reflected on the original order until the order edit is confirmed." * type: object * required: * - created_at @@ -88,7 +88,8 @@ export class OrderItemChange extends SoftDeletableEntity { * type: string * example: oe_01G2SG30J8C85S4A5CHM2S1NS2 * order_edit: - * description: Available if the relation `order_edit` is expanded. + * description: The details of the order edit the item change is associated with. + * x-expandable: "order_edit" * nullable: true * $ref: "#/components/schemas/OrderEdit" * original_line_item_id: @@ -97,7 +98,8 @@ export class OrderItemChange extends SoftDeletableEntity { * type: string * example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN * original_line_item: - * description: Available if the relation `original_line_item` is expanded. + * description: The details of the original line item this item change references. This is used if the item change updates or deletes the original item. + * x-expandable: "original_line_item" * nullable: true * $ref: "#/components/schemas/LineItem" * line_item_id: @@ -106,7 +108,8 @@ export class OrderItemChange extends SoftDeletableEntity { * type: string * example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN * line_item: - * description: Available if the relation `line_item` is expanded. + * description: The details of the resulting line item after the item change. This line item is then used in the original order once the order edit is confirmed. + * x-expandable: "line_item" * nullable: true * $ref: "#/components/schemas/LineItem" * created_at: diff --git a/packages/medusa/src/models/order.ts b/packages/medusa/src/models/order.ts index 36d68b1d1f..383fdf695c 100644 --- a/packages/medusa/src/models/order.ts +++ b/packages/medusa/src/models/order.ts @@ -270,7 +270,7 @@ export class Order extends BaseEntity { /** * @schema Order * title: "Order" - * description: "Represents an order" + * description: "An order is a purchase made by a customer. It holds details about payment and fulfillment of the order. An order may also be created from a draft order, which is created by an admin user." * type: object * required: * - billing_address_id @@ -346,7 +346,8 @@ export class Order extends BaseEntity { * type: string * example: cart_01G8ZH853Y6TFXWPG5EYE81X63 * cart: - * description: A cart object. Available if the relation `cart` is expanded. + * description: The details of the cart associated with the order. + * x-expandable: "cart" * nullable: true * $ref: "#/components/schemas/Cart" * customer_id: @@ -354,7 +355,8 @@ export class Order extends BaseEntity { * type: string * example: cus_01G2SG30J8C85S4A5CHM2S1NS2 * customer: - * description: A customer object. Available if the relation `customer` is expanded. + * description: The details of the customer associated with the order. + * x-expandable: "customer" * nullable: true * $ref: "#/components/schemas/Customer" * email: @@ -367,7 +369,8 @@ export class Order extends BaseEntity { * type: string * example: addr_01G8ZH853YPY9B94857DY91YGW * billing_address: - * description: Available if the relation `billing_address` is expanded. + * description: The details of the billing address associated with the order. + * x-expandable: "billing_address" * nullable: true * $ref: "#/components/schemas/Address" * shipping_address_id: @@ -376,15 +379,17 @@ export class Order extends BaseEntity { * type: string * example: addr_01G8ZH853YPY9B94857DY91YGW * shipping_address: - * description: Available if the relation `shipping_address` is expanded. + * description: The details of the shipping address associated with the order. + * x-expandable: "shipping_address" * nullable: true * $ref: "#/components/schemas/Address" * region_id: - * description: The region's ID + * description: The ID of the region this order was created in. * type: string * example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G * region: - * description: A region object. Available if the relation `region` is expanded. + * description: The details of the region this order was created in. + * x-expandable: "region" * nullable: true * $ref: "#/components/schemas/Region" * currency_code: @@ -395,7 +400,8 @@ export class Order extends BaseEntity { * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * currency: - * description: Available if the relation `currency` is expanded. + * description: The details of the currency used in the order. + * x-expandable: "currency" * nullable: true * $ref: "#/components/schemas/Currency" * tax_rate: @@ -404,72 +410,85 @@ export class Order extends BaseEntity { * type: number * example: 0 * discounts: - * description: The discounts used in the order. Available if the relation `discounts` is expanded. + * description: The details of the discounts applied on the order. * type: array + * x-expandable: "discounts" * items: * $ref: "#/components/schemas/Discount" * gift_cards: - * description: The gift cards used in the order. Available if the relation `gift_cards` is expanded. + * description: The details of the gift card used in the order. * type: array + * x-expandable: "gift_cards" * items: * $ref: "#/components/schemas/GiftCard" * shipping_methods: - * description: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. + * description: The details of the shipping methods used in the order. * type: array + * x-expandable: "shipping_methods" * items: * $ref: "#/components/schemas/ShippingMethod" * payments: - * description: The payments used in the order. Available if the relation `payments` is expanded. + * description: The details of the payments used in the order. * type: array + * x-expandable: "payments" * items: * $ref: "#/components/schemas/Payment" * fulfillments: - * description: The fulfillments used in the order. Available if the relation `fulfillments` is expanded. + * description: The details of the fulfillments created for the order. * type: array + * x-expandable: "fulfillments" * items: * $ref: "#/components/schemas/Fulfillment" * returns: - * description: The returns associated with the order. Available if the relation `returns` is expanded. + * description: The details of the returns created for the order. * type: array + * x-expandable: "returns" * items: * $ref: "#/components/schemas/Return" * claims: - * description: The claims associated with the order. Available if the relation `claims` is expanded. + * description: The details of the claims created for the order. * type: array + * x-expandable: "claims" * items: * $ref: "#/components/schemas/ClaimOrder" * refunds: - * description: The refunds associated with the order. Available if the relation `refunds` is expanded. + * description: The details of the refunds created for the order. * type: array + * x-expandable: "refunds" * items: * $ref: "#/components/schemas/Refund" * swaps: - * description: The swaps associated with the order. Available if the relation `swaps` is expanded. + * description: The details of the swaps created for the order. * type: array + * x-expandable: "swaps" * items: * $ref: "#/components/schemas/Swap" * draft_order_id: - * description: The ID of the draft order this order is associated with. + * description: The ID of the draft order this order was created from. * nullable: true * type: string * example: null * draft_order: - * description: A draft order object. Available if the relation `draft_order` is expanded. + * description: The details of the draft order this order was created from. + * x-expandable: "draft_order" * nullable: true * $ref: "#/components/schemas/DraftOrder" * items: - * description: The line items that belong to the order. Available if the relation `items` is expanded. + * description: The details of the line items that belong to the order. + * x-expandable: "items" * type: array * items: * $ref: "#/components/schemas/LineItem" * edits: - * description: Order edits done on the order. Available if the relation `edits` is expanded. + * description: The details of the order edits done on the order. * type: array + * x-expandable: "edits" * items: * $ref: "#/components/schemas/OrderEdit" * gift_card_transactions: - * description: The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. + * description: The gift card transactions made in the order. * type: array + * x-expandable: "gift_card_transactions" * items: * $ref: "#/components/schemas/GiftCardTransaction" * canceled_at: @@ -495,12 +514,13 @@ export class Order extends BaseEntity { * type: string * example: null * sales_channel_id: - * description: The ID of the sales channel this order is associated with. + * description: The ID of the sales channel this order belongs to. * nullable: true * type: string * example: null * sales_channel: - * description: A sales channel object. Available if the relation `sales_channel` is expanded. + * description: The details of the sales channel this order belongs to. + * x-expandable: "sales_channel" * nullable: true * $ref: "#/components/schemas/SalesChannel" * shipping_total: @@ -548,8 +568,9 @@ export class Order extends BaseEntity { * type: integer * example: 0 * returnable_items: - * description: The items that are returnable as part of the order, order swaps or order claims + * description: The details of the line items that are returnable as part of the order, swaps, or claims * type: array + * x-expandable: "returnable_items" * items: * $ref: "#/components/schemas/LineItem" * created_at: diff --git a/packages/medusa/src/models/payment-collection.ts b/packages/medusa/src/models/payment-collection.ts index 0c07fb3105..e24e474e07 100644 --- a/packages/medusa/src/models/payment-collection.ts +++ b/packages/medusa/src/models/payment-collection.ts @@ -102,7 +102,7 @@ export class PaymentCollection extends SoftDeletableEntity { /** * @schema PaymentCollection * title: "Payment Collection" - * description: "Payment Collection" + * description: "A payment collection allows grouping and managing a list of payments at one. This can be helpful when making additional payment for order edits or integrating installment payments." * type: object * required: * - amount @@ -149,32 +149,36 @@ export class PaymentCollection extends SoftDeletableEntity { * nullable: true * type: integer * region_id: - * description: The region's ID + * description: The ID of the region this payment collection is associated with. * type: string * example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G * region: - * description: Available if the relation `region` is expanded. + * description: The details of the region this payment collection is associated with. + * x-expandable: "region" * nullable: true * $ref: "#/components/schemas/Region" * currency_code: - * description: The 3 character ISO code for the currency. + * description: The 3 character ISO code for the currency this payment collection is associated with. * type: string * example: usd * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * currency: - * description: Available if the relation `currency` is expanded. + * description: The details of the currency this payment collection is associated with. + * x-expandable: "currency" * nullable: true * $ref: "#/components/schemas/Currency" * payment_sessions: - * description: Available if the relation `payment_sessions` is expanded. + * description: The details of the payment sessions created as part of the payment collection. * type: array + * x-expandable: "payment_sessions" * items: * $ref: "#/components/schemas/PaymentSession" * payments: - * description: Available if the relation `payments` is expanded. + * description: The details of the payments created as part of the payment collection. * type: array + * x-expandable: "payments" * items: * $ref: "#/components/schemas/Payment" * created_by: diff --git a/packages/medusa/src/models/payment-provider.ts b/packages/medusa/src/models/payment-provider.ts index 620e33fe2f..6736c88440 100644 --- a/packages/medusa/src/models/payment-provider.ts +++ b/packages/medusa/src/models/payment-provider.ts @@ -12,18 +12,19 @@ export class PaymentProvider { /** * @schema PaymentProvider * title: "Payment Provider" - * description: "Represents a Payment Provider plugin and holds its installation status." + * description: "A payment provider represents a payment service installed in the Medusa backend, either through a plugin or backend customizations. + * It holds the payment service's installation status." * type: object * required: * - id * - is_installed * properties: * id: - * description: The id of the payment provider as given by the plugin. + * description: The ID of the payment provider as given by the payment service. * 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 payment service is installed in the current version. If a payment service is no longer installed, the `is_installed` attribute is set to `false`. * type: boolean * default: true */ diff --git a/packages/medusa/src/models/payment-session.ts b/packages/medusa/src/models/payment-session.ts index 324c427b67..726badcf74 100644 --- a/packages/medusa/src/models/payment-session.ts +++ b/packages/medusa/src/models/payment-session.ts @@ -70,7 +70,7 @@ export class PaymentSession extends BaseEntity { /** * @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." + * description: "A Payment Session is 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, which 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 payment processing such as capture or refund. Payment sessions can also be used as part of payment collections." * type: object * required: * - amount @@ -91,16 +91,17 @@ export class PaymentSession extends BaseEntity { * type: string * example: ps_01G901XNSRM2YS3ASN9H5KG3FZ * cart_id: - * description: The id of the Cart that the Payment Session is created for. + * description: The ID of the cart that the payment session was created for. * nullable: true * type: string * example: cart_01G8ZH853Y6TFXWPG5EYE81X63 * cart: - * description: A cart object. Available if the relation `cart` is expanded. + * description: The details of the cart that the payment session was created for. + * x-expandable: "cart" * nullable: true * $ref: "#/components/schemas/Cart" * provider_id: - * description: The id of the Payment Provider that is responsible for the Payment Session + * description: The ID of the Payment Provider that is responsible for the Payment Session * type: string * example: manual * is_selected: diff --git a/packages/medusa/src/models/payment.ts b/packages/medusa/src/models/payment.ts index 1434fc52f8..5a4e3351e2 100644 --- a/packages/medusa/src/models/payment.ts +++ b/packages/medusa/src/models/payment.ts @@ -89,7 +89,7 @@ export class Payment extends BaseEntity { /** * @schema Payment * title: "Payment" - * description: "Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded." + * description: "A payment is originally created from a payment session. Once a payment session is authorized, the payment is created to represent the authorized amount with a given payment method. Payments can be captured, canceled or refunded. Payments can be made towards orders, swaps, order edits, or other resources." * type: object * required: * - amount @@ -113,29 +113,32 @@ export class Payment extends BaseEntity { * type: string * example: pay_01G2SJNT6DEEWDFNAJ4XWDTHKE * swap_id: - * description: The ID of the Swap that the Payment is used for. + * description: The ID of the swap that this payment was potentially created for. * nullable: true * type: string * example: null * swap: - * description: A swap object. Available if the relation `swap` is expanded. + * description: The details of the swap that this payment was potentially created for. + * x-expandable: "swap" * nullable: true * $ref: "#/components/schemas/Swap" * cart_id: - * description: The id of the Cart that the Payment Session is created for. + * description: The ID of the cart that the payment session was potentially created for. * nullable: true * type: string * cart: - * description: A cart object. Available if the relation `cart` is expanded. + * description: The details of the cart that the payment session was potentially created for. + * x-expandable: "cart" * nullable: true * $ref: "#/components/schemas/Cart" * order_id: - * description: The ID of the Order that the Payment is used for. + * description: The ID of the order that the payment session was potentially created for. * nullable: true * type: string * example: order_01G8TJSYT9M6AVS5N4EMNFS1EK * order: - * description: An order object. Available if the relation `order` is expanded. + * description: The details of the order that the payment session was potentially created for. + * x-expandable: "order" * nullable: true * $ref: "#/components/schemas/Order" * amount: @@ -143,14 +146,15 @@ export class Payment extends BaseEntity { * type: integer * example: 100 * currency_code: - * description: The 3 character ISO currency code that the Payment is completed in. + * description: The 3 character ISO currency code of the payment. * type: string * example: usd * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * currency: - * description: Available if the relation `currency` is expanded. + * description: The details of the currency of the payment. + * x-expandable: "currency" * nullable: true * $ref: "#/components/schemas/Currency" * amount_refunded: diff --git a/packages/medusa/src/models/price-list.ts b/packages/medusa/src/models/price-list.ts index 6fdc25f082..6021c85bb9 100644 --- a/packages/medusa/src/models/price-list.ts +++ b/packages/medusa/src/models/price-list.ts @@ -72,7 +72,7 @@ export class PriceList extends SoftDeletableEntity { /** * @schema PriceList * title: "Price List" - * description: "Price Lists represents a set of prices that overrides the default price for one or more product variants." + * description: "A Price List represents a set of prices that override the default price for one or more product variants." * type: object * required: * - created_at @@ -123,18 +123,21 @@ export class PriceList extends SoftDeletableEntity { * type: string * format: date-time * customer_groups: - * description: The Customer Groups that the Price List applies to. Available if the relation `customer_groups` is expanded. + * description: The details of the customer groups that the Price List can apply to. * type: array + * x-expandable: "customer_groups" * items: * $ref: "#/components/schemas/CustomerGroup" * prices: - * description: The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded. + * description: The prices that belong to the price list, represented as a Money Amount. * type: array + * x-expandable: "prices" * items: * $ref: "#/components/schemas/MoneyAmount" * includes_tax: - * description: "[EXPERIMENTAL] Does the price list prices include tax" + * description: "Whether the price list prices include tax" * type: boolean + * x-featureFlag: "tax_inclusive_pricing" * default: false * created_at: * description: The date with timezone at which the resource was created. diff --git a/packages/medusa/src/models/product-category.ts b/packages/medusa/src/models/product-category.ts index 8f84bfe060..d86245be47 100644 --- a/packages/medusa/src/models/product-category.ts +++ b/packages/medusa/src/models/product-category.ts @@ -84,9 +84,10 @@ export class ProductCategory extends BaseEntity { /** * @schema ProductCategory - * title: "ProductCategory" - * description: "Represents a product category" + * title: "Product Category" + * description: "A product category can be used to categorize products into a hierarchy of categories." * x-resourceId: ProductCategory + * x-featureFlag: "product_categories" * type: object * required: * - category_children @@ -130,8 +131,9 @@ export class ProductCategory extends BaseEntity { * description: An integer that depicts the rank of category in a tree node * default: 0 * category_children: - * description: Available if the relation `category_children` are expanded. + * description: The details of the category's children. * type: array + * x-expandable: "category_children" * items: * $ref: "#/components/schemas/ProductCategory" * parent_category_id: @@ -140,12 +142,14 @@ export class ProductCategory extends BaseEntity { * type: string * default: null * parent_category: - * description: A product category object. Available if the relation `parent_category` is expanded. + * description: The details of the parent of this category. + * x-expandable: "parent_category" * nullable: true * $ref: "#/components/schemas/ProductCategory" * products: - * description: Products associated with category. Available if the relation `products` is expanded. + * description: The details of the products that belong to this category. * type: array + * x-expandable: "products" * items: * $ref: "#/components/schemas/Product" * created_at: diff --git a/packages/medusa/src/models/product-collection.ts b/packages/medusa/src/models/product-collection.ts index e8a4a984c5..0c0a205f35 100644 --- a/packages/medusa/src/models/product-collection.ts +++ b/packages/medusa/src/models/product-collection.ts @@ -35,7 +35,7 @@ export class ProductCollection extends SoftDeletableEntity { /** * @schema ProductCollection * title: "Product Collection" - * description: "Product Collections represents a group of Products that are related." + * description: "A Product Collection allows grouping together products for promotional purposes. For example, an admin can create a Summer collection, add products to it, and showcase it on the storefront." * type: object * required: * - created_at @@ -60,8 +60,9 @@ export class ProductCollection extends SoftDeletableEntity { * type: string * example: summer-collection * products: - * description: The Products contained in the Product Collection. Available if the relation `products` is expanded. + * description: The details of the products that belong to this product collection. * type: array + * x-expandable: "products" * items: * $ref: "#/components/schemas/Product" * created_at: diff --git a/packages/medusa/src/models/product-option-value.ts b/packages/medusa/src/models/product-option-value.ts index 46d38ffdef..037aa01de8 100644 --- a/packages/medusa/src/models/product-option-value.ts +++ b/packages/medusa/src/models/product-option-value.ts @@ -48,7 +48,7 @@ export class ProductOptionValue extends SoftDeletableEntity { /** * @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." + * description: "An option value is one of the possible values of a Product Option. Product Variants specify a unique combination of product option values." * type: object * required: * - created_at @@ -65,23 +65,25 @@ export class ProductOptionValue extends SoftDeletableEntity { * type: string * example: optval_01F0YESHR7S6ECD03RF6W12DSJ * value: - * description: The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is \"Size\" this value could be `Small`, `Medium` or `Large`). + * description: The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is "Size" this value could be `Small`, `Medium` or `Large`). * type: string * example: large * option_id: - * description: The ID of the Product Option that the Product Option Value is defined for. + * description: The ID of the Product Option that the Product Option Value belongs to. * type: string * example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 * option: - * description: Available if the relation `option` is expanded. + * description: The details of the product option that the Product Option Value belongs to. + * x-expandable: "option" * nullable: true * $ref: "#/components/schemas/ProductOption" * variant_id: - * description: The ID of the Product Variant that the Product Option Value is defined for. + * description: The ID of the product variant that uses this product option value. * type: string * example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 * variant: - * description: Available if the relation `variant` is expanded. + * description: The details of the product variant that uses this product option value. + * x-expandable: "variant" * nullable: true * $ref: "#/components/schemas/ProductVariant" * created_at: diff --git a/packages/medusa/src/models/product-option.ts b/packages/medusa/src/models/product-option.ts index 9d3b021dec..bd509c0e50 100644 --- a/packages/medusa/src/models/product-option.ts +++ b/packages/medusa/src/models/product-option.ts @@ -42,7 +42,7 @@ export class ProductOption extends SoftDeletableEntity { /** * @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." + * description: A Product Option defines properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color". Admins are free to create any product options. * type: object * required: * - created_at @@ -62,16 +62,18 @@ export class ProductOption extends SoftDeletableEntity { * type: string * example: Size * values: - * description: The Product Option Values that are defined for the Product Option. Available if the relation `values` is expanded. + * description: The details of the values of the product option. * type: array + * x-expandable: "values" * items: * $ref: "#/components/schemas/ProductOptionValue" * product_id: - * description: The ID of the Product that the Product Option is defined for. + * description: The ID of the product that this product option belongs to. * type: string * example: prod_01G1G5V2MBA328390B5AXJ610F * product: - * description: A product object. Available if the relation `product` is expanded. + * description: The details of the product that this product option belongs to. + * x-expandable: "product" * nullable: true * $ref: "#/components/schemas/Product" * created_at: diff --git a/packages/medusa/src/models/product-tag.ts b/packages/medusa/src/models/product-tag.ts index f02dbb2299..7d6ea7f27b 100644 --- a/packages/medusa/src/models/product-tag.ts +++ b/packages/medusa/src/models/product-tag.ts @@ -21,7 +21,7 @@ export class ProductTag extends SoftDeletableEntity { /** * @schema ProductTag * title: "Product Tag" - * description: "Product Tags can be added to Products for easy filtering and grouping." + * description: "A Product Tag can be added to Products for easy filtering and grouping." * type: object * required: * - created_at diff --git a/packages/medusa/src/models/product-tax-rate.ts b/packages/medusa/src/models/product-tax-rate.ts index 3f63da4984..7c1ffa7ab3 100644 --- a/packages/medusa/src/models/product-tax-rate.ts +++ b/packages/medusa/src/models/product-tax-rate.ts @@ -41,7 +41,7 @@ export class ProductTaxRate { /** * @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" + * description: "This represents the association between a tax rate and a product to indicate that the product is taxed in a way different than the default." * type: object * required: * - created_at @@ -55,7 +55,8 @@ export class ProductTaxRate { * type: string * example: prod_01G1G5V2MBA328390B5AXJ610F * product: - * description: Available if the relation `product` is expanded. + * description: The details of the product. + * x-expandable: "product" * nullable: true * $ref: "#/components/schemas/Product" * rate_id: @@ -63,7 +64,8 @@ export class ProductTaxRate { * type: string * example: txr_01G8XDBAWKBHHJRKH0AV02KXBR * tax_rate: - * description: Available if the relation `tax_rate` is expanded. + * description: The details of the tax rate. + * x-expandable: "tax_rate" * nullable: true * $ref: "#/components/schemas/TaxRate" * created_at: diff --git a/packages/medusa/src/models/product-type-tax-rate.ts b/packages/medusa/src/models/product-type-tax-rate.ts index ebe6a4a081..d8ff590f1a 100644 --- a/packages/medusa/src/models/product-type-tax-rate.ts +++ b/packages/medusa/src/models/product-type-tax-rate.ts @@ -40,7 +40,7 @@ export class ProductTypeTaxRate { /** * @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" + * description: "This represents the association between a tax rate and a product type to indicate that the product type is taxed in a different way than the default." * type: object * required: * - created_at @@ -54,7 +54,8 @@ export class ProductTypeTaxRate { * type: string * example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A * product_type: - * description: Available if the relation `product_type` is expanded. + * description: The details of the product type. + * x-expandable: "product_type" * nullable: true * $ref: "#/components/schemas/ProductType" * rate_id: @@ -62,7 +63,8 @@ export class ProductTypeTaxRate { * type: string * example: txr_01G8XDBAWKBHHJRKH0AV02KXBR * tax_rate: - * description: Available if the relation `tax_rate` is expanded. + * description: The details of the tax rate. + * x-expandable: "tax_rate" * nullable: true * $ref: "#/components/schemas/TaxRate" * created_at: diff --git a/packages/medusa/src/models/product-type.ts b/packages/medusa/src/models/product-type.ts index 2803323791..d4fe28b40e 100644 --- a/packages/medusa/src/models/product-type.ts +++ b/packages/medusa/src/models/product-type.ts @@ -21,7 +21,7 @@ export class ProductType extends SoftDeletableEntity { /** * @schema ProductType * title: "Product Type" - * description: "Product Type can be added to Products for filtering and reporting purposes." + * description: "A Product Type can be added to Products for filtering and reporting purposes." * type: object * required: * - created_at diff --git a/packages/medusa/src/models/product-variant-inventory-item.ts b/packages/medusa/src/models/product-variant-inventory-item.ts index 006dc702a2..c9029f5334 100644 --- a/packages/medusa/src/models/product-variant-inventory-item.ts +++ b/packages/medusa/src/models/product-variant-inventory-item.ts @@ -36,7 +36,7 @@ export class ProductVariantInventoryItem extends SoftDeletableEntity { /** * @schema ProductVariantInventoryItem * title: "Product Variant Inventory Item" - * description: "Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant." + * description: "A Product Variant Inventory Item links variants with inventory items and denotes the required quantity of the variant." * type: object * required: * - created_at @@ -58,11 +58,12 @@ export class ProductVariantInventoryItem extends SoftDeletableEntity { * description: The id of the variant. * type: string * variant: - * description: A ProductVariant object. Available if the relation `variant` is expanded. + * description: The details of the product variant. + * x-expandable: "variant" * nullable: true * $ref: "#/components/schemas/ProductVariant" * required_quantity: - * description: The quantity of an inventory item required for one quantity of the variant. + * description: The quantity of an inventory item required for the variant. * type: integer * default: 1 * created_at: diff --git a/packages/medusa/src/models/product-variant.ts b/packages/medusa/src/models/product-variant.ts index e1e88c6a1c..a6641dd5f4 100644 --- a/packages/medusa/src/models/product-variant.ts +++ b/packages/medusa/src/models/product-variant.ts @@ -114,7 +114,7 @@ export class ProductVariant extends SoftDeletableEntity { /** * @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." + * description: "A Product Variant represents 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. A product must at least have one product variant." * type: object * required: * - allow_backorder @@ -149,16 +149,18 @@ export class ProductVariant extends SoftDeletableEntity { * type: string * example: Small * product_id: - * description: The ID of the Product that the Product Variant belongs to. + * description: The ID of the product that the product variant belongs to. * type: string * example: prod_01G1G5V2MBA328390B5AXJ610F * product: - * description: A product object. Available if the relation `product` is expanded. + * description: The details of the product that the product variant belongs to. + * x-expandable: "product" * nullable: true * $ref: "#/components/schemas/Product" * prices: - * 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. + * description: The details of the prices of the Product Variant, each represented as a Money Amount. Each Money Amount represents a price in a given currency or a specific Region. * type: array + * x-expandable: "prices" * items: * $ref: "#/components/schemas/MoneyAmount" * sku: @@ -239,13 +241,15 @@ export class ProductVariant extends SoftDeletableEntity { * type: number * example: null * options: - * description: The Product Option Values specified for the Product Variant. Available if the relation `options` is expanded. + * description: The details of the product options that this product variant defines values for. * type: array + * x-expandable: "options" * items: * $ref: "#/components/schemas/ProductOptionValue" * inventory_items: - * description: The Inventory Items related to the product variant. Available if the relation `inventory_items` is expanded. + * description: The details inventory items of the product variant. * type: array + * x-expandable: "inventory_items" * items: * $ref: "#/components/schemas/ProductVariantInventoryItem" * created_at: diff --git a/packages/medusa/src/models/product.ts b/packages/medusa/src/models/product.ts index c00d601e6c..b7a95b4128 100644 --- a/packages/medusa/src/models/product.ts +++ b/packages/medusa/src/models/product.ts @@ -224,7 +224,7 @@ export class Product extends SoftDeletableEntity { /** * @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." + * description: "A product is a saleable item that holds general information such as name or description. It must include at least one Product Variant, where each product variant defines different options to purchase the product with (for example, different sizes or colors). The prices and inventory of the product are defined on the variant level." * type: object * required: * - collection_id @@ -289,8 +289,9 @@ export class Product extends SoftDeletableEntity { * - rejected * default: draft * images: - * description: Images of the Product. Available if the relation `images` is expanded. + * description: The details of the product's images. * type: array + * x-expandable: "images" * items: * $ref: "#/components/schemas/Image" * thumbnail: @@ -299,26 +300,31 @@ export class Product extends SoftDeletableEntity { * type: string * format: uri * options: - * 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. + * description: The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options. * type: array + * x-expandable: "options" * items: * $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. + * description: The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options. * type: array + * x-expandable: "variants" * items: * $ref: "#/components/schemas/ProductVariant" * categories: - * description: The product's associated categories. Available if the relation `categories` are expanded. + * description: The details of the product categories that this product belongs to. * type: array + * x-expandable: "categories" + * x-featureFlag: "product_categories" * items: * $ref: "#/components/schemas/ProductCategory" * 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. + * description: The ID of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product. * type: string * example: sp_01G1G5V239ENSZ5MV4JAR737BM * profile: - * description: Available if the relation `profile` is expanded. + * description: The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product. + * x-expandable: "profile" * nullable: true * $ref: "#/components/schemas/ShippingProfile" * profiles: @@ -368,26 +374,29 @@ export class Product extends SoftDeletableEntity { * type: string * example: null * collection_id: - * description: The Product Collection that the Product belongs to + * description: The ID of the product collection that the product belongs to. * nullable: true * type: string * example: pcol_01F0YESBFAZ0DV6V831JXWH0BG * collection: - * description: A product collection object. Available if the relation `collection` is expanded. + * description: The details of the product collection that the product belongs to. + * x-expandable: "collection" * nullable: true * $ref: "#/components/schemas/ProductCollection" * type_id: - * description: The Product type that the Product belongs to + * description: The ID of the product type that the product belongs to. * nullable: true * type: string * example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A * type: - * description: Available if the relation `type` is expanded. + * description: The details of the product type that the product belongs to. + * x-expandable: "type" * nullable: true * $ref: "#/components/schemas/ProductType" * tags: - * description: The Product Tags assigned to the Product. Available if the relation `tags` is expanded. + * description: The details of the product tags used in this product. * type: array + * x-expandable: "type" * items: * $ref: "#/components/schemas/ProductTag" * discountable: @@ -400,8 +409,9 @@ export class Product extends SoftDeletableEntity { * type: string * example: null * sales_channels: - * description: The sales channels the product is associated with. Available if the relation `sales_channels` is expanded. + * description: The details of the sales channels this product is available in. * type: array + * x-expandable: "sales_channels" * items: * $ref: "#/components/schemas/SalesChannel" * created_at: diff --git a/packages/medusa/src/models/publishable-api-key-sales-channel.ts b/packages/medusa/src/models/publishable-api-key-sales-channel.ts index 3a30dfd78c..32ba90818f 100644 --- a/packages/medusa/src/models/publishable-api-key-sales-channel.ts +++ b/packages/medusa/src/models/publishable-api-key-sales-channel.ts @@ -11,8 +11,8 @@ export class PublishableApiKeySalesChannel { /** * @schema PublishableApiKeySalesChannel - * title: "Publishable API key sales channel" - * description: "Holds mapping between Publishable API keys and Sales Channels" + * title: "Publishable API Key Sales Channel" + * description: "This represents the association between the Publishable API keys and Sales Channels" * type: object * required: * - publishable_key_id diff --git a/packages/medusa/src/models/publishable-api-key.ts b/packages/medusa/src/models/publishable-api-key.ts index 3ce50269b7..5dc4a46e71 100644 --- a/packages/medusa/src/models/publishable-api-key.ts +++ b/packages/medusa/src/models/publishable-api-key.ts @@ -26,7 +26,7 @@ export class PublishableApiKey extends BaseEntity { /** * @schema PublishableApiKey * title: "Publishable API key" - * description: "Publishable API key defines scopes (i.e. resources) that are available within a request." + * description: "A Publishable API key defines scopes that resources are available in. Then, it can be used in request to infer the resources without having to directly pass them. For example, a publishable API key can be associated with one or more sales channels. Then, when the publishable API key is passed in the header of a request, it is inferred what sales channel is being used without having to pass the sales channel as a query or body parameter of the request. Publishable API keys can only be used with sales channels, at the moment." * type: object * required: * - created_at diff --git a/packages/medusa/src/models/refund.ts b/packages/medusa/src/models/refund.ts index 14bc9a2e1c..dc1c944f58 100644 --- a/packages/medusa/src/models/refund.ts +++ b/packages/medusa/src/models/refund.ts @@ -64,7 +64,7 @@ export class Refund extends BaseEntity { /** * @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." + * description: "A refund represents 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 an admin for an order." * type: object * required: * - amount @@ -83,21 +83,23 @@ export class Refund extends BaseEntity { * type: string * example: ref_01G1G5V27GYX4QXNARRQCW1N8T * order_id: - * description: The id of the Order that the Refund is related to. + * description: The ID of the order this refund was created for. * nullable: true * type: string * example: order_01G8TJSYT9M6AVS5N4EMNFS1EK * order: - * description: An order object. Available if the relation `order` is expanded. + * description: The details of the order this refund was created for. + * x-expandable: "order" * nullable: true * $ref: "#/components/schemas/Order" * payment_id: - * description: The payment's ID if available + * description: The payment's ID, if available. * nullable: true * type: string * example: pay_01G8ZCC5W42ZNY842124G7P5R9 * payment: - * description: Available if the relation `payment` is expanded. + * description: The details of the payment associated with the refund. + * x-expandable: "payment" * nullable: true * $ref: "#/components/schemas/Payment" * amount: diff --git a/packages/medusa/src/models/region.ts b/packages/medusa/src/models/region.ts index 9b3f0380bb..e53706e215 100644 --- a/packages/medusa/src/models/region.ts +++ b/packages/medusa/src/models/region.ts @@ -107,7 +107,7 @@ export class Region extends SoftDeletableEntity { /** * @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." + * description: "A region holds settings specific to a geographical location, including the currency, tax rates, and fulfillment and payment providers. A Region can consist of multiple countries to accomodate common shopping settings across countries." * type: object * required: * - automatic_taxes @@ -132,14 +132,15 @@ export class Region extends SoftDeletableEntity { * type: string * example: EU * currency_code: - * description: The 3 character currency code that the Region uses. + * description: The 3 character currency code used in the region. * type: string * example: usd * externalDocs: * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * currency: - * description: Available if the relation `currency` is expanded. + * description: The details of the currency used in the region. + * x-expandable: "currency" * nullable: true * $ref: "#/components/schemas/Currency" * tax_rate: @@ -147,8 +148,9 @@ export class Region extends SoftDeletableEntity { * type: number * example: 0 * tax_rates: - * description: The tax rates that are included in the Region. Available if the relation `tax_rates` is expanded. + * description: The details of the tax rates used in the region, aside from the default rate. * type: array + * x-expandable: "tax_rates" * items: * $ref: "#/components/schemas/TaxRate" * tax_code: @@ -165,8 +167,9 @@ export class Region extends SoftDeletableEntity { * type: boolean * default: true * countries: - * description: The countries that are included in the Region. Available if the relation `countries` is expanded. + * description: The details of the countries included in this region. * type: array + * x-expandable: "countries" * items: * $ref: "#/components/schemas/Country" * tax_provider_id: @@ -175,22 +178,26 @@ export class Region extends SoftDeletableEntity { * type: string * example: null * tax_provider: - * description: Available if the relation `tax_provider` is expanded. + * description: The details of the tax provider used in the region. + * x-expandable: "tax_provider" * nullable: true * $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. + * description: The details of the payment providers that can be used to process payments in the region. * type: array + * x-expandable: "payment_providers" * items: * $ref: "#/components/schemas/PaymentProvider" * fulfillment_providers: - * description: The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `fulfillment_providers` is expanded. + * description: The details of the fulfillment providers that can be used to fulfill items of orders and similar resources in the region. * type: array + * x-expandable: "fulfillment_providers" * items: * $ref: "#/components/schemas/FulfillmentProvider" * includes_tax: - * description: "[EXPERIMENTAL] Does the prices for the region include tax" + * description: "Whether the prices for the region include tax" * type: boolean + * x-featureFlag: "tax_inclusive_pricing" * default: false * created_at: * description: The date with timezone at which the resource was created. diff --git a/packages/medusa/src/models/return-item.ts b/packages/medusa/src/models/return-item.ts index b746c3f9fa..bc242d3de0 100644 --- a/packages/medusa/src/models/return-item.ts +++ b/packages/medusa/src/models/return-item.ts @@ -50,7 +50,7 @@ export class ReturnItem { /** * @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." + * description: "A return item represents a line item in an order that is to be returned. It includes details related to the return and the reason behind it." * type: object * required: * - is_requested @@ -64,23 +64,25 @@ export class ReturnItem { * - return_id * properties: * return_id: - * description: The id of the Return that the Return Item belongs to. + * description: The ID of the Return that the Return Item belongs to. * type: string * example: ret_01F0YET7XPCMF8RZ0Y151NZV2V * item_id: - * description: The id of the Line Item that the Return Item references. + * description: The ID of the Line Item that the Return Item references. * type: string * example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN * return_order: - * description: Available if the relation `return_order` is expanded. + * description: Details of the Return that the Return Item belongs to. + * x-expandable: "return_order" * nullable: true * $ref: "#/components/schemas/Return" * item: - * description: Available if the relation `item` is expanded. + * description: The details of the line item in the original order to be returned. + * x-expandable: "item" * nullable: true * $ref: "#/components/schemas/LineItem" * quantity: - * description: The quantity of the Line Item that is included in the Return. + * description: The quantity of the Line Item to be returned. * type: integer * example: 1 * is_requested: @@ -103,7 +105,8 @@ export class ReturnItem { * type: string * example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ * reason: - * description: Available if the relation `reason` is expanded. + * description: The details of the reason for returning the item. + * x-expandable: "reason" * nullable: true * $ref: "#/components/schemas/ReturnReason" * note: diff --git a/packages/medusa/src/models/return-reason.ts b/packages/medusa/src/models/return-reason.ts index f303ce4145..2adc92da68 100644 --- a/packages/medusa/src/models/return-reason.ts +++ b/packages/medusa/src/models/return-reason.ts @@ -50,7 +50,7 @@ export class ReturnReason extends SoftDeletableEntity { /** * @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." + * description: "A Return Reason is a value defined by an admin. It can be used on Return Items in order to indicate why a Line Item was returned." * type: object * required: * - created_at @@ -86,11 +86,13 @@ export class ReturnReason extends SoftDeletableEntity { * type: string * example: null * parent_return_reason: - * description: Available if the relation `parent_return_reason` is expanded. + * description: The details of the parent reason. + * x-expandable: "parent_return_reason" * nullable: true * $ref: "#/components/schemas/ReturnReason" * return_reason_children: - * description: Available if the relation `return_reason_children` is expanded. + * description: The details of the child reasons. + * x-expandable: "return_reason_children" * $ref: "#/components/schemas/ReturnReason" * created_at: * description: The date with timezone at which the resource was created. diff --git a/packages/medusa/src/models/return.ts b/packages/medusa/src/models/return.ts index 232835f038..91b4847ac9 100644 --- a/packages/medusa/src/models/return.ts +++ b/packages/medusa/src/models/return.ts @@ -100,7 +100,7 @@ export class Return extends BaseEntity { /** * @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." + * description: "A Return holds information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can also be used as part of a Swap or a Claim." * type: object * required: * - claim_order_id @@ -132,39 +132,44 @@ export class Return extends BaseEntity { * - canceled * default: requested * items: - * description: The Return Items that will be shipped back to the warehouse. Available if the relation `items` is expanded. + * description: The details of the items that the customer is returning. * type: array + * x-expandable: "items" * items: * $ref: "#/components/schemas/ReturnItem" * swap_id: - * description: The ID of the Swap that the Return is a part of. + * description: The ID of the swap that the return may belong to. * nullable: true * type: string * example: null * swap: - * description: A swap object. Available if the relation `swap` is expanded. + * description: The details of the swap that the return may belong to. + * x-expandable: "swap" * nullable: true * $ref: "#/components/schemas/Swap" * claim_order_id: - * description: The ID of the Claim that the Return is a part of. + * description: The ID of the claim that the return may belong to. * nullable: true * type: string * example: null * claim_order: - * description: A claim order object. Available if the relation `claim_order` is expanded. + * description: The details of the claim that the return may belong to. + * x-expandable: "claim_order" * nullable: true * $ref: "#/components/schemas/ClaimOrder" * order_id: - * description: The ID of the Order that the Return is made from. + * description: The ID of the order that the return was created for. * nullable: true * type: string * example: order_01G8TJSYT9M6AVS5N4EMNFS1EK * order: - * description: An order object. Available if the relation `order` is expanded. + * description: The details of the order that the return was created for. + * x-expandable: "order" * nullable: true * $ref: "#/components/schemas/Order" * shipping_method: - * 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. + * description: The details of the Shipping Method that will be used to send the Return back. Can be null if the Customer will handle the return shipment themselves. + * x-expandable: "shipping_method" * nullable: true * $ref: "#/components/schemas/ShippingMethod" * shipping_data: @@ -173,7 +178,7 @@ export class Return extends BaseEntity { * type: object * example: {} * location_id: - * description: The id of the stock location the return will be added back. + * description: The ID of the stock location the return will be added back. * nullable: true * type: string * example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK diff --git a/packages/medusa/src/models/sales-channel-location.ts b/packages/medusa/src/models/sales-channel-location.ts index 81f9ecb035..21579a6f56 100644 --- a/packages/medusa/src/models/sales-channel-location.ts +++ b/packages/medusa/src/models/sales-channel-location.ts @@ -28,7 +28,7 @@ export class SalesChannelLocation extends SoftDeletableEntity { /** * @schema SalesChannelLocation * title: "Sales Channel Stock Location" - * description: "Sales Channel Stock Location link sales channels with stock locations." + * description: "This represents the association between a sales channel and a stock locations." * type: object * required: * - created_at @@ -43,14 +43,15 @@ export class SalesChannelLocation extends SoftDeletableEntity { * type: string * example: scloc_01G8X9A7ESKAJXG2H0E6F1MW7A * sales_channel_id: - * description: "The id of the Sales Channel" + * description: "The ID of the Sales Channel" * type: string * example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A * location_id: - * description: "The id of the Location Stock." + * description: "The ID of the Location Stock." * type: string * sales_channel: - * description: The sales channel the location is associated with. Available if the relation `sales_channel` is expanded. + * description: The details of the sales channel the location is associated with. + * x-expandable: "sales_channel" * nullable: true * $ref: "#/components/schemas/SalesChannel" * created_at: diff --git a/packages/medusa/src/models/sales-channel.ts b/packages/medusa/src/models/sales-channel.ts index faa2c2c067..75202d33af 100644 --- a/packages/medusa/src/models/sales-channel.ts +++ b/packages/medusa/src/models/sales-channel.ts @@ -37,7 +37,7 @@ export class SalesChannel extends SoftDeletableEntity { /** * @schema SalesChannel * title: "Sales Channel" - * description: "A Sales Channel" + * description: "A Sales Channel is a method a business offers its products for purchase for the customers. For example, a Webshop can be a sales channel, and a mobile app can be another." * type: object * required: * - created_at @@ -66,8 +66,9 @@ export class SalesChannel extends SoftDeletableEntity { * type: boolean * default: false * locations: - * description: The Stock Locations related to the sales channel. Available if the relation `locations` is expanded. + * description: The details of the stock locations related to the sales channel. * type: array + * x-expandable: "locations" * items: * $ref: "#/components/schemas/SalesChannelLocation" * created_at: diff --git a/packages/medusa/src/models/shipping-method-tax-line.ts b/packages/medusa/src/models/shipping-method-tax-line.ts index dac24d4d09..5b234ce299 100644 --- a/packages/medusa/src/models/shipping-method-tax-line.ts +++ b/packages/medusa/src/models/shipping-method-tax-line.ts @@ -32,7 +32,7 @@ export class ShippingMethodTaxLine extends TaxLine { /** * @schema ShippingMethodTaxLine * title: "Shipping Method Tax Line" - * description: "Shipping Method Tax Line" + * description: "A Shipping Method Tax Line represents the taxes applied on a shipping method in a cart." * type: object * required: * - code @@ -66,7 +66,8 @@ export class ShippingMethodTaxLine extends TaxLine { * type: string * example: sm_01F0YET7DR2E7CYVSDHM593QG2 * shipping_method: - * description: Available if the relation `shipping_method` is expanded. + * description: The details of the associated shipping method. + * x-expandable: "shipping_method" * nullable: true * $ref: "#/components/schemas/ShippingMethod" * created_at: diff --git a/packages/medusa/src/models/shipping-method.ts b/packages/medusa/src/models/shipping-method.ts index cc2bffe403..910db350a0 100644 --- a/packages/medusa/src/models/shipping-method.ts +++ b/packages/medusa/src/models/shipping-method.ts @@ -107,7 +107,7 @@ export class ShippingMethod { /** * @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." + * description: "A Shipping Method represents a way in which an Order or Return can be shipped. Shipping Methods are created from a Shipping Option, but may contain additional details that can be necessary for the Fulfillment Provider to handle the shipment. If the shipping method is created for a return, it may be associated with a claim or a swap that the return is part of." * type: object * required: * - cart_id @@ -125,61 +125,68 @@ export class ShippingMethod { * type: string * example: sm_01F0YET7DR2E7CYVSDHM593QG2 * shipping_option_id: - * description: The id of the Shipping Option that the Shipping Method is built from. + * description: The ID of the Shipping Option that the Shipping Method is built from. * type: string * example: so_01G1G5V27GYX4QXNARRQCW1N8T * order_id: - * description: The id of the Order that the Shipping Method is used on. + * description: The ID of the order that the shipping method is used in. * nullable: true * type: string * example: order_01G8TJSYT9M6AVS5N4EMNFS1EK * order: - * description: An order object. Available if the relation `order` is expanded. + * description: The details of the order that the shipping method is used in. + * x-expandable: "order" * nullable: true * $ref: "#/components/schemas/Order" * claim_order_id: - * description: The id of the Claim that the Shipping Method is used on. + * description: The ID of the claim that the shipping method is used in. * nullable: true * type: string * example: null * claim_order: - * description: A claim order object. Available if the relation `claim_order` is expanded. + * description: The details of the claim that the shipping method is used in. + * x-expandable: "claim_order" * nullable: true * $ref: "#/components/schemas/ClaimOrder" * cart_id: - * description: The id of the Cart that the Shipping Method is used on. + * description: The ID of the cart that the shipping method is used in. * nullable: true * type: string * example: cart_01G8ZH853Y6TFXWPG5EYE81X63 * cart: - * description: A cart object. Available if the relation `cart` is expanded. + * description: The details of the cart that the shipping method is used in. + * x-expandable: "cart" * nullable: true * $ref: "#/components/schemas/Cart" * swap_id: - * description: The id of the Swap that the Shipping Method is used on. + * description: The ID of the swap that the shipping method is used in. * nullable: true * type: string * example: null * swap: - * description: A swap object. Available if the relation `swap` is expanded. + * description: The details of the swap that the shipping method is used in. + * x-expandable: "swap" * nullable: true * $ref: "#/components/schemas/Swap" * return_id: - * description: The id of the Return that the Shipping Method is used on. + * description: The ID of the return that the shipping method is used in. * nullable: true * type: string * example: null * return_order: - * description: A return object. Available if the relation `return_order` is expanded. + * description: The details of the return that the shipping method is used in. + * x-expandable: "return_order" * nullable: true * $ref: "#/components/schemas/Return" * shipping_option: - * description: Available if the relation `shipping_option` is expanded. + * description: The details of the shipping option the method was created from. + * x-expandable: "shipping_option" * nullable: true * $ref: "#/components/schemas/ShippingOption" * tax_lines: - * description: Available if the relation `tax_lines` is expanded. + * description: The details of the tax lines applied on the shipping method. * type: array + * x-expandable: "tax_lines" * items: * $ref: "#/components/schemas/ShippingMethodTaxLine" * price: @@ -191,8 +198,9 @@ export class ShippingMethod { * type: object * example: {} * includes_tax: - * description: "[EXPERIMENTAL] Indicates if the shipping method price include tax" + * description: "Whether the shipping method price include tax" * type: boolean + * x-featureFlag: "tax_inclusive_pricing" * default: false * subtotal: * description: The subtotal of the shipping diff --git a/packages/medusa/src/models/shipping-option-requirement.ts b/packages/medusa/src/models/shipping-option-requirement.ts index 4d490684a8..ec44f4bab8 100644 --- a/packages/medusa/src/models/shipping-option-requirement.ts +++ b/packages/medusa/src/models/shipping-option-requirement.ts @@ -49,7 +49,7 @@ export class ShippingOptionRequirement { /** * @schema ShippingOptionRequirement * title: "Shipping Option Requirement" - * description: "A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart." + * description: "A shipping option requirement defines conditions that a Cart must satisfy for the Shipping Option to be available for usage in the Cart." * type: object * required: * - amount @@ -63,11 +63,12 @@ export class ShippingOptionRequirement { * type: string * example: sor_01G1G5V29AB4CTNDRFSRWSRKWD * shipping_option_id: - * description: The id of the Shipping Option that the hipping option requirement belongs to + * description: The ID of the shipping option that the requirements belong to. * type: string * example: so_01G1G5V27GYX4QXNARRQCW1N8T * shipping_option: - * description: Available if the relation `shipping_option` is expanded. + * description: The details of the shipping option that the requirements belong to. + * x-expandable: "shipping_option" * nullable: true * $ref: "#/components/schemas/ShippingOption" * type: diff --git a/packages/medusa/src/models/shipping-option.ts b/packages/medusa/src/models/shipping-option.ts index 8934661d71..9b77cbb179 100644 --- a/packages/medusa/src/models/shipping-option.ts +++ b/packages/medusa/src/models/shipping-option.ts @@ -89,7 +89,7 @@ export class ShippingOption extends SoftDeletableEntity { /** * @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." + * description: "A Shipping Option represents 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." * type: object * required: * - admin_only @@ -116,27 +116,30 @@ export class ShippingOption extends SoftDeletableEntity { * type: string * example: PostFake Standard * region_id: - * description: The region's ID + * description: The ID of the region this shipping option can be used in. * type: string * example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G * region: - * description: A region object. Available if the relation `region` is expanded. + * description: The details of the region this shipping option can be used in. + * x-expandable: "region" * nullable: true * $ref: "#/components/schemas/Region" * profile_id: - * description: The ID of the Shipping Profile that the shipping option belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. + * description: The ID of the Shipping Profile that the shipping option belongs to. * type: string * example: sp_01G1G5V239ENSZ5MV4JAR737BM * profile: - * description: Available if the relation `profile` is expanded. + * description: The details of the shipping profile that the shipping option belongs to. + * x-expandable: "profile" * nullable: true * $ref: "#/components/schemas/ShippingProfile" * provider_id: - * description: The id of the Fulfillment Provider, that will be used to process Fulfillments from the Shipping Option. + * description: The ID of the fulfillment provider that will be used to later to process the shipping method created from this shipping option and its fulfillments. * type: string * example: manual * provider: - * description: Available if the relation `provider` is expanded. + * description: The details of the fulfillment provider that will be used to later to process the shipping method created from this shipping option and its fulfillments. + * x-expandable: "provider" * nullable: true * $ref: "#/components/schemas/FulfillmentProvider" * price_type: @@ -160,8 +163,9 @@ export class ShippingOption extends SoftDeletableEntity { * type: boolean * default: false * requirements: - * description: The requirements that must be satisfied for the Shipping Option to be available for a Cart. Available if the relation `requirements` is expanded. + * description: The details of the requirements that must be satisfied for the Shipping Option to be available for usage in a Cart. * type: array + * x-expandable: "requirements" * items: * $ref: "#/components/schemas/ShippingOptionRequirement" * data: @@ -169,8 +173,9 @@ export class ShippingOption extends SoftDeletableEntity { * type: object * example: {} * includes_tax: - * description: "[EXPERIMENTAL] Does the shipping option price include tax" + * description: "Whether the shipping option price include tax" * type: boolean + * x-featureFlag: "tax_inclusive_pricing" * default: false * created_at: * description: The date with timezone at which the resource was created. diff --git a/packages/medusa/src/models/shipping-profile.ts b/packages/medusa/src/models/shipping-profile.ts index ac89702618..bd6215aaae 100644 --- a/packages/medusa/src/models/shipping-profile.ts +++ b/packages/medusa/src/models/shipping-profile.ts @@ -55,7 +55,8 @@ export class ShippingProfile extends SoftDeletableEntity { /** * @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." + * description: "A Shipping Profile has a set of defined Shipping Options that can be used to fulfill a given set of Products. For example, gift cards are shipped differently than physical products, + * so a shipping profile with the type `gift_card` groups together the shipping options that can only be used for gift cards." * type: object * required: * - created_at @@ -83,13 +84,15 @@ export class ShippingProfile extends SoftDeletableEntity { * - custom * example: default * products: - * description: The Products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded. + * description: The details of the products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded. * type: array + * x-expandable: "products" * items: * $ref: "#/components/schemas/Product" * shipping_options: - * description: The Shipping Options that can be used to fulfill the Products in the Shipping Profile. Available if the relation `shipping_options` is expanded. + * description: The details of the shipping options that can be used to create shipping methods for the Products in the Shipping Profile. * type: array + * x-expandable: "shipping_options" * items: * $ref: "#/components/schemas/ShippingOption" * created_at: diff --git a/packages/medusa/src/models/shipping-tax-rate.ts b/packages/medusa/src/models/shipping-tax-rate.ts index bf3aa01579..826bb60d06 100644 --- a/packages/medusa/src/models/shipping-tax-rate.ts +++ b/packages/medusa/src/models/shipping-tax-rate.ts @@ -40,7 +40,7 @@ export class ShippingTaxRate { /** * @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" + * description: "This represents the tax rates applied on a shipping option." * type: object * required: * - created_at @@ -50,19 +50,21 @@ export class ShippingTaxRate { * - updated_at * properties: * shipping_option_id: - * description: The ID of the Shipping Option + * description: The ID of the shipping option. * type: string * example: so_01G1G5V27GYX4QXNARRQCW1N8T * shipping_option: - * description: Available if the relation `shipping_option` is expanded. + * description: The details of the shipping option. + * x-expandable: "shipping_option" * nullable: true * $ref: "#/components/schemas/ShippingOption" * rate_id: - * description: The ID of the Tax Rate + * description: The ID of the associated tax rate. * type: string * example: txr_01G8XDBAWKBHHJRKH0AV02KXBR * tax_rate: - * description: Available if the relation `tax_rate` is expanded. + * description: The details of the associated tax rate. + * x-expandable: "tax_rate" * nullable: true * $ref: "#/components/schemas/TaxRate" * created_at: diff --git a/packages/medusa/src/models/store.ts b/packages/medusa/src/models/store.ts index ed7de578d7..734afb62ec 100644 --- a/packages/medusa/src/models/store.ts +++ b/packages/medusa/src/models/store.ts @@ -78,7 +78,7 @@ export class Store extends BaseEntity { /** * @schema Store * title: "Store" - * description: "Holds settings for the Store, such as name, currencies, etc." + * description: "A store holds the main settings of the commerce shop. By default, only one store is created and used within the Medusa backend. It holds settings related to the name of the store, available currencies, and more." * type: object * required: * - created_at @@ -108,12 +108,14 @@ export class Store extends BaseEntity { * url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes * description: See a list of codes. * default_currency: - * description: Available if the relation `default_currency` is expanded. + * description: The details of the store's default currency. + * x-expandable: "default_currency" * nullable: true * $ref: "#/components/schemas/Currency" * currencies: - * description: The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. + * description: The details of the enabled currencies in the store. * type: array + * x-expandable: "currencies" * items: * $ref: "#/components/schemas/Currency" * swap_link_template: @@ -137,12 +139,13 @@ export class Store extends BaseEntity { * type: string * example: null * default_sales_channel_id: - * description: The sales channel ID the cart is associated with. + * description: The ID of the store's default sales channel. * nullable: true * type: string * example: null * default_sales_channel: - * description: A sales channel object. Available if the relation `default_sales_channel` is expanded. + * description: The details of the store's default sales channel. + * x-expandable: "default_sales_channel" * nullable: true * $ref: "#/components/schemas/SalesChannel" * created_at: diff --git a/packages/medusa/src/models/swap.ts b/packages/medusa/src/models/swap.ts index 7c34ca229d..7f40a0ff48 100644 --- a/packages/medusa/src/models/swap.ts +++ b/packages/medusa/src/models/swap.ts @@ -121,7 +121,7 @@ export class Swap extends SoftDeletableEntity { /** * @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." + * description: "A swap can be created when a Customer wishes to exchange Products that they have purchased with different Products. It consists of a Return of previously purchased Products and a Fulfillment of new Products. It also includes information on any additional payment or refund required based on the difference between the exchanged products." * type: object * required: * - allow_backorder @@ -171,33 +171,38 @@ export class Swap extends SoftDeletableEntity { * - requires_action * example: not_paid * order_id: - * description: The ID of the Order where the Line Items to be returned where purchased. + * description: The ID of the order that the swap belongs to. * type: string * example: order_01G8TJSYT9M6AVS5N4EMNFS1EK * order: - * description: An order object. Available if the relation `order` is expanded. + * description: The details of the order that the swap belongs to. + * x-expandable: "order" * nullable: true * $ref: "#/components/schemas/Order" * additional_items: - * description: The new Line Items to ship to the Customer. Available if the relation `additional_items` is expanded. + * description: The details of the new products to send to the customer, represented as line items. * type: array + * x-expandable: "additional_items" * items: * $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. + * description: The details of the return that belongs to the swap, which holds the details on the items being returned. + * x-expandable: "return_order" * nullable: true * $ref: "#/components/schemas/Return" * fulfillments: - * description: The Fulfillments used to send the new Line Items. Available if the relation `fulfillments` is expanded. + * description: The details of the fulfillments that are used to send the new items to the customer. + * x-expandable: "fulfillments" * type: array * items: * $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. + * description: The details of the additional payment authorized by the customer when `difference_due` is positive. + * x-expandable: "payment" * nullable: true * $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. + * description: The difference amount between the order’s original total and the new total imposed by the swap. If its value is negative, a refund must be issues to the customer. If it's positive, additional payment must be authorized by the customer. Otherwise, no payment processing is required. * nullable: true * type: integer * example: 0 @@ -207,21 +212,24 @@ export class Swap extends SoftDeletableEntity { * type: string * example: addr_01G8ZH853YPY9B94857DY91YGW * shipping_address: - * description: Available if the relation `shipping_address` is expanded. + * description: The details of the shipping address that the new items should be sent to. + * x-expandable: "shipping_address" * nullable: true * $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. + * description: The details of the shipping methods used to fulfill the additional items purchased. * type: array + * x-expandable: "shipping_methods" * items: * $ref: "#/components/schemas/ShippingMethod" * cart_id: - * description: The id of the Cart that the Customer will use to confirm the Swap. + * description: The ID of the cart that the customer uses to complete the swap. * nullable: true * type: string * example: cart_01G8ZH853Y6TFXWPG5EYE81X63 * cart: - * description: A cart object. Available if the relation `cart` is expanded. + * description: The details of the cart that the customer uses to complete the swap. + * x-expandable: "cart" * nullable: true * $ref: "#/components/schemas/Cart" * confirmed_at: diff --git a/packages/medusa/src/models/tax-line.ts b/packages/medusa/src/models/tax-line.ts index 3bdb268854..ab71753d2b 100644 --- a/packages/medusa/src/models/tax-line.ts +++ b/packages/medusa/src/models/tax-line.ts @@ -19,7 +19,7 @@ export class TaxLine extends BaseEntity { /** * @schema TaxLine * title: "Tax Line" - * description: "Line item that specifies an amount of tax to add to a line item." + * description: "A tax line represents the taxes amount applied to a line item." * type: object * required: * - code diff --git a/packages/medusa/src/models/tax-provider.ts b/packages/medusa/src/models/tax-provider.ts index 40b0612146..f29149bb7b 100644 --- a/packages/medusa/src/models/tax-provider.ts +++ b/packages/medusa/src/models/tax-provider.ts @@ -12,18 +12,19 @@ export class TaxProvider { /** * @schema TaxProvider * title: "Tax Provider" - * description: "The tax service used to calculate taxes" + * description: "A tax provider represents a tax service installed in the Medusa backend, either through a plugin or backend customizations. + * It holds the tax service's installation status." * type: object * required: * - id * - is_installed * properties: * id: - * description: The id of the tax provider as given by the plugin. + * description: The ID of the tax provider as given by the tax service. * 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 tax service is installed in the current version. If a tax service is no longer installed, the `is_installed` attribute is set to `false`. * type: boolean * default: true */ diff --git a/packages/medusa/src/models/tax-rate.ts b/packages/medusa/src/models/tax-rate.ts index 38dcea6848..5f4e0142b1 100644 --- a/packages/medusa/src/models/tax-rate.ts +++ b/packages/medusa/src/models/tax-rate.ts @@ -93,7 +93,7 @@ export class TaxRate extends BaseEntity { /** * @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" + * description: "A Tax Rate can be used to define a custom rate to charge on specified products, product types, and shipping options within a given region." * type: object * required: * - code @@ -124,26 +124,30 @@ export class TaxRate extends BaseEntity { * type: string * example: Tax Example * region_id: - * description: The id of the Region that the rate belongs to + * description: The ID of the region that the rate belongs to. * type: string * example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G * region: - * description: A region object. Available if the relation `region` is expanded. + * description: The details of the region that the rate belongs to. + * x-expandable: "region" * nullable: true * $ref: "#/components/schemas/Region" * products: - * description: The products that belong to this tax rate. Available if the relation `products` is expanded. + * description: The details of the products that belong to this tax rate. * type: array + * x-expandable: "products" * items: * $ref: "#/components/schemas/Product" * product_types: - * description: The product types that belong to this tax rate. Available if the relation `product_types` is expanded. + * description: The details of the product types that belong to this tax rate. * type: array + * x-expandable: "product_types" * items: * $ref: "#/components/schemas/ProductType" * shipping_options: + * description: The details of the shipping options that belong to this tax rate. * type: array - * description: The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded. + * x-expandable: "shipping_options" * items: * $ref: "#/components/schemas/ShippingOption" * product_count: diff --git a/packages/medusa/src/models/tracking-link.ts b/packages/medusa/src/models/tracking-link.ts index 7c38729291..861b8fd2ad 100644 --- a/packages/medusa/src/models/tracking-link.ts +++ b/packages/medusa/src/models/tracking-link.ts @@ -35,7 +35,7 @@ export class TrackingLink extends SoftDeletableEntity { /** * @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." + * description: "A 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. Typically, the tracking link is provided from the third-party service integrated through the used fulfillment provider." * type: object * required: * - created_at @@ -62,11 +62,12 @@ export class TrackingLink extends SoftDeletableEntity { * type: string * format: RH370168054CN * fulfillment_id: - * description: The id of the Fulfillment that the Tracking Link references. + * description: The ID of the fulfillment that the tracking link belongs to. * type: string * example: ful_01G8ZRTMQCA76TXNAT81KPJZRF * fulfillment: - * description: Available if the relation `fulfillment` is expanded. + * description: The details of the fulfillment that the tracking link belongs to. + * x-expandable: "fulfillment" * nullable: true * $ref: "#/components/schemas/Fulfillment" * idempotency_key: diff --git a/packages/medusa/src/models/user.ts b/packages/medusa/src/models/user.ts index df43765cb7..f5b6430376 100644 --- a/packages/medusa/src/models/user.ts +++ b/packages/medusa/src/models/user.ts @@ -48,7 +48,7 @@ export class User extends SoftDeletableEntity { /** * @schema User * title: "User" - * description: "Represents a User who can manage store settings." + * description: "A User is an administrator who can manage store settings and data." * type: object * required: * - api_token