From cd66cdd2bb528785040f93cd20ec3c5ebd6433f6 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Fri, 11 Apr 2025 16:41:39 +0300 Subject: [PATCH] docs: generate OAS manually for 2.7.0 (#12158) * original changes * changes * fixes for delete operations * generate oas --- .../workflows/generate-public-references.yml | 8 + .../generated/generated-admin-sidebar.mjs | 32 +- .../post.sh | 1 - .../JavaScript/admin_api-keys/get.js | 14 + .../JavaScript/admin_api-keys/post.js | 17 + .../JavaScript/admin_api-keys_{id}/delete.js | 14 + .../JavaScript/admin_api-keys_{id}/get.js | 14 + .../JavaScript/admin_api-keys_{id}/post.js | 16 + .../admin_api-keys_{id}_revoke/post.js | 14 + .../post.js | 17 + .../JavaScript/admin_campaigns/get.js | 14 + .../JavaScript/admin_campaigns/post.js | 16 + .../JavaScript/admin_campaigns_{id}/delete.js | 14 + .../JavaScript/admin_campaigns_{id}/get.js | 14 + .../JavaScript/admin_campaigns_{id}/post.js | 16 + .../admin_campaigns_{id}_promotions/post.js | 17 + .../JavaScript/admin_claims/get.js | 14 + .../JavaScript/admin_claims/post.js | 17 + .../JavaScript/admin_claims_{id}/get.js | 14 + .../admin_claims_{id}_cancel/post.js | 14 + .../admin_claims_{id}_claim-items/post.js | 21 + .../delete.js | 17 + .../post.js | 20 + .../admin_claims_{id}_inbound_items/post.js | 24 + .../delete.js | 17 + .../post.js | 20 + .../post.js | 20 + .../delete.js | 17 + .../post.js | 20 + .../admin_claims_{id}_outbound_items/post.js | 22 + .../delete.js | 17 + .../post.js | 20 + .../post.js | 20 + .../delete.js | 17 + .../post.js | 20 + .../admin_claims_{id}_request/delete.js | 16 + .../admin_claims_{id}_request/post.js | 17 + .../JavaScript/admin_collections/get.js | 14 + .../JavaScript/admin_collections/post.js | 16 + .../admin_collections_{id}/delete.js | 14 + .../JavaScript/admin_collections_{id}/get.js | 14 + .../JavaScript/admin_collections_{id}/post.js | 16 + .../admin_collections_{id}_products/post.js | 17 + .../JavaScript/admin_currencies/get.js | 14 + .../JavaScript/admin_currencies_{code}/get.js | 14 + .../JavaScript/admin_customer-groups/get.js | 14 + .../JavaScript/admin_customer-groups/post.js | 16 + .../admin_customer-groups_{id}/delete.js | 14 + .../admin_customer-groups_{id}/get.js | 14 + .../admin_customer-groups_{id}/post.js | 16 + .../post.js | 17 + .../JavaScript/admin_customers/get.js | 14 + .../JavaScript/admin_customers/post.js | 16 + .../JavaScript/admin_customers_{id}/delete.js | 14 + .../JavaScript/admin_customers_{id}/get.js | 14 + .../JavaScript/admin_customers_{id}/post.js | 16 + .../admin_customers_{id}_addresses/get.js | 14 + .../admin_customers_{id}_addresses/post.js | 19 + .../delete.js | 14 + .../get.js | 14 + .../post.js | 19 + .../post.js | 17 + .../JavaScript/admin_draft-orders/get.js | 14 + .../JavaScript/admin_draft-orders/post.js | 24 + .../JavaScript/admin_draft-orders_{id}/get.js | 14 + .../admin_draft-orders_{id}/post.js | 16 + .../post.js | 17 + .../admin_draft-orders_{id}_edit/delete.js | 14 + .../admin_draft-orders_{id}_edit/post.js | 14 + .../post.js | 14 + .../post.js | 21 + .../post.js | 16 + .../delete.js | 14 + .../post.js | 16 + .../delete.js | 13 + .../post.js | 16 + .../post.js | 14 + .../post.js | 16 + .../post.js | 16 + .../delete.js | 14 + .../post.js | 16 + .../JavaScript/admin_exchanges/get.js | 14 + .../JavaScript/admin_exchanges/post.js | 16 + .../JavaScript/admin_exchanges_{id}/get.js | 14 + .../admin_exchanges_{id}_cancel/post.js | 14 + .../post.js | 19 + .../delete.js | 17 + .../post.js | 20 + .../post.js | 16 + .../delete.js | 17 + .../post.js | 20 + .../post.js | 19 + .../delete.js | 17 + .../post.js | 20 + .../post.js | 16 + .../delete.js | 17 + .../post.js | 20 + .../admin_exchanges_{id}_request/delete.js | 14 + .../admin_exchanges_{id}_request/post.js | 14 + .../admin_fulfillment-providers/get.js | 14 + .../get.js | 14 + .../admin_fulfillment-sets_{id}/delete.js | 14 + .../post.js | 20 + .../delete.js | 17 + .../get.js | 17 + .../post.js | 20 + .../JavaScript/admin_fulfillments/post.js | 31 + .../admin_fulfillments_{id}_cancel/post.js | 14 + .../admin_fulfillments_{id}_shipment/post.js | 22 + .../JavaScript/admin_inventory-items/get.js | 14 + .../JavaScript/admin_inventory-items/post.js | 16 + .../post.js | 21 + .../admin_inventory-items_{id}/delete.js | 14 + .../admin_inventory-items_{id}/get.js | 14 + .../admin_inventory-items_{id}/post.js | 16 + .../get.js | 14 + .../post.js | 20 + .../delete.js | 17 + .../post.js | 20 + .../JavaScript/admin_invites/get.js | 14 + .../JavaScript/admin_invites/post.js | 16 + .../JavaScript/admin_invites_accept/post.js | 24 + .../JavaScript/admin_invites_{id}/delete.js | 14 + .../JavaScript/admin_invites_{id}/get.js | 14 + .../admin_invites_{id}_resend/post.js | 14 + .../JavaScript/admin_notifications/get.js | 14 + .../admin_notifications_{id}/get.js | 14 + .../JavaScript/admin_order-edits/post.js | 16 + .../admin_order-edits_{id}/delete.js | 14 + .../admin_order-edits_{id}_confirm/post.js | 14 + .../admin_order-edits_{id}_items/post.js | 21 + .../post.js | 20 + .../delete.js | 17 + .../post.js | 20 + .../admin_order-edits_{id}_request/post.js | 14 + .../JavaScript/admin_orders/get.js | 14 + .../JavaScript/admin_orders_{id}/get.js | 14 + .../JavaScript/admin_orders_{id}/post.js | 24 + .../admin_orders_{id}_cancel/post.js | 14 + .../admin_orders_{id}_changes/get.js | 14 + .../admin_orders_{id}_credit-lines/post.js | 21 + .../admin_orders_{id}_fulfillments/post.js | 21 + .../post.js | 20 + .../post.js | 17 + .../post.js | 25 + .../admin_orders_{id}_line-items/get.js | 14 + .../admin_orders_{id}_preview/get.js | 14 + .../admin_orders_{id}_transfer/post.js | 17 + .../admin_orders_{id}_transfer_cancel/post.js | 14 + .../admin_payment-collections/post.js | 16 + .../admin_payment-collections_{id}/delete.js | 14 + .../post.js | 16 + .../JavaScript/admin_payments/get.js | 14 + .../admin_payments_payment-providers/get.js | 14 + .../JavaScript/admin_payments_{id}/get.js | 14 + .../admin_payments_{id}_capture/post.js | 14 + .../admin_payments_{id}_refund/post.js | 14 + .../JavaScript/admin_plugins/get.js | 14 + .../JavaScript/admin_price-lists/get.js | 14 + .../JavaScript/admin_price-lists/post.js | 28 + .../admin_price-lists_{id}/delete.js | 14 + .../JavaScript/admin_price-lists_{id}/get.js | 14 + .../JavaScript/admin_price-lists_{id}/post.js | 16 + .../post.js | 29 + .../admin_price-lists_{id}_products/post.js | 16 + .../JavaScript/admin_price-preferences/get.js | 14 + .../admin_price-preferences/post.js | 18 + .../admin_price-preferences_{id}/delete.js | 14 + .../admin_price-preferences_{id}/get.js | 14 + .../admin_price-preferences_{id}/post.js | 16 + .../admin_product-categories/get.js | 14 + .../admin_product-categories/post.js | 16 + .../admin_product-categories_{id}/delete.js | 14 + .../admin_product-categories_{id}/get.js | 14 + .../admin_product-categories_{id}/post.js | 16 + .../post.js | 17 + .../JavaScript/admin_product-tags/get.js | 14 + .../JavaScript/admin_product-tags/post.js | 16 + .../admin_product-tags_{id}/delete.js | 14 + .../JavaScript/admin_product-tags_{id}/get.js | 14 + .../admin_product-tags_{id}/post.js | 16 + .../JavaScript/admin_product-types/get.js | 14 + .../JavaScript/admin_product-types/post.js | 16 + .../admin_product-types_{id}/delete.js | 14 + .../admin_product-types_{id}/get.js | 14 + .../admin_product-types_{id}/post.js | 16 + .../JavaScript/admin_product-variants/get.js | 14 + .../JavaScript/admin_products/get.js | 14 + .../JavaScript/admin_products/post.js | 30 + .../JavaScript/admin_products_batch/post.js | 38 + .../JavaScript/admin_products_export/post.js | 14 + .../JavaScript/admin_products_import/post.js | 16 + .../post.js | 14 + .../JavaScript/admin_products_{id}/delete.js | 14 + .../JavaScript/admin_products_{id}/get.js | 14 + .../JavaScript/admin_products_{id}/post.js | 16 + .../admin_products_{id}_options/get.js | 14 + .../admin_products_{id}_options/post.js | 20 + .../delete.js | 14 + .../get.js | 17 + .../post.js | 20 + .../admin_products_{id}_variants/get.js | 14 + .../admin_products_{id}_variants/post.js | 25 + .../post.js | 31 + .../post.js | 38 + .../delete.js | 14 + .../get.js | 17 + .../post.js | 20 + .../JavaScript/admin_promotions/get.js | 14 + .../JavaScript/admin_promotions/post.js | 20 + .../get.js | 14 + .../get.js | 14 + .../admin_promotions_{id}/delete.js | 14 + .../JavaScript/admin_promotions_{id}/get.js | 14 + .../JavaScript/admin_promotions_{id}/post.js | 16 + .../admin_promotions_{id}_{rule_type}/get.js | 14 + .../JavaScript/admin_refund-reasons/get.js | 14 + .../JavaScript/admin_regions/get.js | 14 + .../JavaScript/admin_regions/post.js | 17 + .../JavaScript/admin_regions_{id}/delete.js | 14 + .../JavaScript/admin_regions_{id}/get.js | 14 + .../JavaScript/admin_regions_{id}/post.js | 16 + .../JavaScript/admin_reservations/get.js | 14 + .../JavaScript/admin_reservations/post.js | 18 + .../admin_reservations_{id}/delete.js | 14 + .../JavaScript/admin_reservations_{id}/get.js | 14 + .../admin_reservations_{id}/post.js | 16 + .../JavaScript/admin_return-reasons/get.js | 14 + .../JavaScript/admin_return-reasons/post.js | 17 + .../admin_return-reasons_{id}/delete.js | 14 + .../admin_return-reasons_{id}/get.js | 14 + .../admin_return-reasons_{id}/post.js | 17 + .../JavaScript/admin_returns/get.js | 14 + .../JavaScript/admin_returns/post.js | 16 + .../JavaScript/admin_returns_{id}/get.js | 14 + .../JavaScript/admin_returns_{id}/post.js | 16 + .../admin_returns_{id}_cancel/post.js | 14 + .../admin_returns_{id}_dismiss-items/post.js | 18 + .../delete.js | 14 + .../post.js | 16 + .../admin_returns_{id}_receive-items/post.js | 18 + .../delete.js | 14 + .../post.js | 16 + .../admin_returns_{id}_receive/delete.js | 14 + .../admin_returns_{id}_receive/post.js | 16 + .../post.js | 16 + .../admin_returns_{id}_request-items/post.js | 17 + .../delete.js | 14 + .../post.js | 16 + .../admin_returns_{id}_request/delete.js | 14 + .../admin_returns_{id}_request/post.js | 16 + .../post.js | 16 + .../delete.js | 14 + .../post.js | 16 + .../JavaScript/admin_sales-channels/get.js | 14 + .../JavaScript/admin_sales-channels/post.js | 16 + .../admin_sales-channels_{id}/delete.js | 14 + .../admin_sales-channels_{id}/get.js | 14 + .../admin_sales-channels_{id}/post.js | 19 + .../post.js | 17 + .../JavaScript/admin_shipping-options/get.js | 14 + .../JavaScript/admin_shipping-options/post.js | 17 + .../admin_shipping-options_{id}/delete.js | 14 + .../admin_shipping-options_{id}/get.js | 14 + .../admin_shipping-options_{id}/post.js | 16 + .../post.js | 16 + .../JavaScript/admin_shipping-profiles/get.js | 14 + .../admin_shipping-profiles/post.js | 16 + .../admin_shipping-profiles_{id}/delete.js | 14 + .../admin_shipping-profiles_{id}/get.js | 14 + .../admin_shipping-profiles_{id}/post.js | 16 + .../JavaScript/admin_stock-locations/get.js | 14 + .../JavaScript/admin_stock-locations/post.js | 17 + .../admin_stock-locations_{id}/delete.js | 14 + .../admin_stock-locations_{id}/get.js | 14 + .../admin_stock-locations_{id}/post.js | 16 + .../post.js | 17 + .../post.js | 17 + .../post.js | 17 + .../JavaScript/admin_stores/get.js | 14 + .../JavaScript/admin_stores_{id}/get.js | 14 + .../JavaScript/admin_stores_{id}/post.js | 16 + .../JavaScript/admin_tax-rates/get.js | 14 + .../JavaScript/admin_tax-rates/post.js | 19 + .../JavaScript/admin_tax-rates_{id}/delete.js | 14 + .../JavaScript/admin_tax-rates_{id}/get.js | 14 + .../JavaScript/admin_tax-rates_{id}/post.js | 17 + .../JavaScript/admin_tax-regions/get.js | 14 + .../JavaScript/admin_tax-regions/post.js | 23 + .../admin_tax-regions_{id}/delete.js | 14 + .../JavaScript/admin_tax-regions_{id}/get.js | 14 + .../JavaScript/admin_uploads/post.js | 26 + .../JavaScript/admin_uploads_{id}/delete.js | 14 + .../JavaScript/admin_uploads_{id}/get.js | 14 + .../JavaScript/admin_users/get.js | 14 + .../JavaScript/admin_users_me/get.js | 14 + .../JavaScript/admin_users_{id}/delete.js | 14 + .../JavaScript/admin_users_{id}/get.js | 14 + .../JavaScript/admin_users_{id}/post.js | 17 + .../admin_workflows-executions/get.js | 14 + .../admin_workflows-executions_{id}/get.js | 14 + .../JavaScript/auth_session/delete.js | 14 + .../JavaScript/auth_token_refresh/post.js | 14 + .../auth_user_{auth_provider}/post.js | 29 + .../post.js | 31 + .../post.js | 24 + .../post.js | 20 + .../auth_user_{auth_provider}_update/post.js | 21 + .../post.sh | 2 + .../admin_draft-orders_{id}_edit/delete.sh | 2 + .../admin_draft-orders_{id}_edit/post.sh | 2 + .../post.sh | 2 + .../post.sh | 2 + .../post.sh | 6 + .../delete.sh | 2 + .../post.sh | 6 + .../delete.sh | 2 + .../post.sh | 8 + .../post.sh | 2 + .../post.sh | 6 + .../post.sh | 2 + .../delete.sh | 2 + .../post.sh | 6 + .../admin_orders_{id}_credit-lines/post.sh | 8 + .../code_samples/Shell/admin_plugins/get.sh | 2 + .../Shell/auth_user_{auth_provider}/post.sh | 6 - .../post.sh | 1 - .../post.ts | 31 + .../schemas/AdminAddDraftOrderItems.yaml | 44 + .../schemas/AdminAddDraftOrderPromotions.yaml | 13 + .../AdminAddDraftOrderShippingMethod.yaml | 27 + .../schemas/AdminCreateOrderCreditLines.yaml | 26 + .../components/schemas/AdminDraftOrder.yaml | 7 + .../schemas/AdminDraftOrderPreview.yaml | 655 ++ .../AdminDraftOrderPreviewResponse.yaml | 8 + .../admin/components/schemas/AdminOrder.yaml | 7 + .../components/schemas/AdminOrderPreview.yaml | 7 + .../admin/components/schemas/AdminPlugin.yaml | 10 + .../schemas/AdminPluginsListResponse.yaml | 11 + .../AdminRemoveDraftOrderPromotions.yaml | 13 + .../schemas/AdminUpdateDraftOrder.yaml | 8 + ...nUpdateDraftOrderActionShippingMethod.yaml | 27 + .../schemas/AdminUpdateDraftOrderItem.yaml | 22 + .../AdminUpdateDraftOrderShippingMethod.yaml | 18 + .../specs/admin/components/schemas/Order.yaml | 80 + .../components/schemas/OrderLineItem.yaml | 5 + .../schemas/StoreCartRemovePromotion.yaml | 13 + .../specs/admin/openapi.full.yaml | 7968 ++++++++++++++++- .../api-reference/specs/admin/openapi.yaml | 128 +- .../specs/admin/paths/admin_api-keys.yaml | 8 + .../admin/paths/admin_api-keys_{id}.yaml | 12 + .../paths/admin_api-keys_{id}_revoke.yaml | 4 + .../admin_api-keys_{id}_sales-channels.yaml | 4 + .../specs/admin/paths/admin_campaigns.yaml | 8 + .../admin/paths/admin_campaigns_{id}.yaml | 12 + .../admin_campaigns_{id}_promotions.yaml | 4 + .../specs/admin/paths/admin_claims.yaml | 8 + .../specs/admin/paths/admin_claims_{id}.yaml | 4 + .../admin/paths/admin_claims_{id}_cancel.yaml | 4 + .../paths/admin_claims_{id}_claim-items.yaml | 4 + ...n_claims_{id}_claim-items_{action_id}.yaml | 10 + .../admin_claims_{id}_inbound_items.yaml | 4 + ...claims_{id}_inbound_items_{action_id}.yaml | 10 + ...n_claims_{id}_inbound_shipping-method.yaml | 5 + ...}_inbound_shipping-method_{action_id}.yaml | 10 + .../admin_claims_{id}_outbound_items.yaml | 4 + ...laims_{id}_outbound_items_{action_id}.yaml | 10 + ..._claims_{id}_outbound_shipping-method.yaml | 5 + ..._outbound_shipping-method_{action_id}.yaml | 10 + .../paths/admin_claims_{id}_request.yaml | 8 + .../specs/admin/paths/admin_collections.yaml | 8 + .../admin/paths/admin_collections_{id}.yaml | 12 + .../admin_collections_{id}_products.yaml | 4 + .../specs/admin/paths/admin_currencies.yaml | 4 + .../admin/paths/admin_currencies_{code}.yaml | 4 + .../admin/paths/admin_customer-groups.yaml | 8 + .../paths/admin_customer-groups_{id}.yaml | 12 + .../admin_customer-groups_{id}_customers.yaml | 5 + .../specs/admin/paths/admin_customers.yaml | 8 + .../admin/paths/admin_customers_{id}.yaml | 12 + .../paths/admin_customers_{id}_addresses.yaml | 8 + ...customers_{id}_addresses_{address_id}.yaml | 15 + .../admin_customers_{id}_customer-groups.yaml | 5 + .../specs/admin/paths/admin_draft-orders.yaml | 8 + .../admin/paths/admin_draft-orders_{id}.yaml | 10 +- ...in_draft-orders_{id}_convert-to-order.yaml | 67 + .../paths/admin_draft-orders_{id}_edit.yaml | 91 + .../admin_draft-orders_{id}_edit_confirm.yaml | 47 + .../admin_draft-orders_{id}_edit_items.yaml | 49 + ...orders_{id}_edit_items_item_{item_id}.yaml | 57 + ...ft-orders_{id}_edit_items_{action_id}.yaml | 123 + ...min_draft-orders_{id}_edit_promotions.yaml | 109 + .../admin_draft-orders_{id}_edit_request.yaml | 47 + ...aft-orders_{id}_edit_shipping-methods.yaml | 51 + ...t_shipping-methods_method_{method_id}.yaml | 57 + ...id}_edit_shipping-methods_{action_id}.yaml | 126 + .../specs/admin/paths/admin_exchanges.yaml | 8 + .../admin/paths/admin_exchanges_{id}.yaml | 4 + .../paths/admin_exchanges_{id}_cancel.yaml | 4 + .../admin_exchanges_{id}_inbound_items.yaml | 4 + ...hanges_{id}_inbound_items_{action_id}.yaml | 10 + ...xchanges_{id}_inbound_shipping-method.yaml | 5 + ...}_inbound_shipping-method_{action_id}.yaml | 10 + .../admin_exchanges_{id}_outbound_items.yaml | 4 + ...anges_{id}_outbound_items_{action_id}.yaml | 10 + ...changes_{id}_outbound_shipping-method.yaml | 5 + ..._outbound_shipping-method_{action_id}.yaml | 10 + .../paths/admin_exchanges_{id}_request.yaml | 8 + .../paths/admin_fulfillment-providers.yaml | 4 + ...in_fulfillment-providers_{id}_options.yaml | 5 + .../paths/admin_fulfillment-sets_{id}.yaml | 4 + ...n_fulfillment-sets_{id}_service-zones.yaml | 5 + ...ent-sets_{id}_service-zones_{zone_id}.yaml | 15 + .../specs/admin/paths/admin_fulfillments.yaml | 4 + .../paths/admin_fulfillments_{id}_cancel.yaml | 4 + .../admin_fulfillments_{id}_shipment.yaml | 4 + .../admin/paths/admin_inventory-items.yaml | 8 + ...inventory-items_location-levels_batch.yaml | 5 + .../paths/admin_inventory-items_{id}.yaml | 12 + ..._inventory-items_{id}_location-levels.yaml | 5 + ...tory-items_{id}_location-levels_batch.yaml | 7 + ...ms_{id}_location-levels_{location_id}.yaml | 10 + .../specs/admin/paths/admin_invites.yaml | 8 + .../admin/paths/admin_invites_accept.yaml | 4 + .../specs/admin/paths/admin_invites_{id}.yaml | 8 + .../paths/admin_invites_{id}_resend.yaml | 4 + .../admin/paths/admin_notifications.yaml | 4 + .../admin/paths/admin_notifications_{id}.yaml | 4 + .../specs/admin/paths/admin_order-edits.yaml | 4 + .../admin/paths/admin_order-edits_{id}.yaml | 4 + .../paths/admin_order-edits_{id}_confirm.yaml | 4 + .../paths/admin_order-edits_{id}_items.yaml | 4 + ...order-edits_{id}_items_item_{item_id}.yaml | 5 + ...in_order-edits_{id}_items_{action_id}.yaml | 10 + .../paths/admin_order-edits_{id}_request.yaml | 4 + .../specs/admin/paths/admin_orders.yaml | 4 + .../specs/admin/paths/admin_orders_{id}.yaml | 8 + .../admin/paths/admin_orders_{id}_cancel.yaml | 4 + .../paths/admin_orders_{id}_changes.yaml | 4 + .../paths/admin_orders_{id}_credit-lines.yaml | 73 + .../paths/admin_orders_{id}_fulfillments.yaml | 4 + ..._fulfillments_{fulfillment_id}_cancel.yaml | 5 + ...ts_{fulfillment_id}_mark-as-delivered.yaml | 5 + ...lfillments_{fulfillment_id}_shipments.yaml | 5 + .../paths/admin_orders_{id}_line-items.yaml | 4 + .../paths/admin_orders_{id}_preview.yaml | 4 + .../paths/admin_orders_{id}_transfer.yaml | 4 + .../admin_orders_{id}_transfer_cancel.yaml | 4 + .../paths/admin_payment-collections.yaml | 4 + .../paths/admin_payment-collections_{id}.yaml | 4 + ...payment-collections_{id}_mark-as-paid.yaml | 5 + .../specs/admin/paths/admin_payments.yaml | 4 + .../admin_payments_payment-providers.yaml | 4 + .../admin/paths/admin_payments_{id}.yaml | 4 + .../paths/admin_payments_{id}_capture.yaml | 4 + .../paths/admin_payments_{id}_refund.yaml | 4 + .../specs/admin/paths/admin_plugins.yaml | 39 + .../specs/admin/paths/admin_price-lists.yaml | 8 + .../admin/paths/admin_price-lists_{id}.yaml | 12 + .../admin_price-lists_{id}_prices_batch.yaml | 4 + .../admin_price-lists_{id}_products.yaml | 4 + .../admin/paths/admin_price-preferences.yaml | 8 + .../paths/admin_price-preferences_{id}.yaml | 12 + .../admin/paths/admin_product-categories.yaml | 8 + .../paths/admin_product-categories_{id}.yaml | 12 + ...dmin_product-categories_{id}_products.yaml | 5 + .../specs/admin/paths/admin_product-tags.yaml | 8 + .../admin/paths/admin_product-tags_{id}.yaml | 12 + .../admin/paths/admin_product-types.yaml | 8 + .../admin/paths/admin_product-types_{id}.yaml | 12 + .../admin/paths/admin_product-variants.yaml | 4 + .../specs/admin/paths/admin_products.yaml | 8 + .../admin/paths/admin_products_batch.yaml | 4 + .../admin/paths/admin_products_export.yaml | 4 + .../admin/paths/admin_products_import.yaml | 4 + ...ducts_import_{transaction_id}_confirm.yaml | 7 + .../admin/paths/admin_products_{id}.yaml | 12 + .../paths/admin_products_{id}_options.yaml | 8 + ...min_products_{id}_options_{option_id}.yaml | 15 + .../paths/admin_products_{id}_variants.yaml | 8 + .../admin_products_{id}_variants_batch.yaml | 4 + ...s_{id}_variants_inventory-items_batch.yaml | 5 + ...n_products_{id}_variants_{variant_id}.yaml | 15 + .../specs/admin/paths/admin_promotions.yaml | 44 + ...ns_rule-attribute-options_{rule_type}.yaml | 5 + ...tions_{rule_type}_{rule_attribute_id}.yaml | 46 +- .../admin/paths/admin_promotions_{id}.yaml | 12 + .../admin_promotions_{id}_{rule_type}.yaml | 4 + .../admin/paths/admin_refund-reasons.yaml | 4 + .../specs/admin/paths/admin_regions.yaml | 8 + .../specs/admin/paths/admin_regions_{id}.yaml | 12 + .../specs/admin/paths/admin_reservations.yaml | 8 + .../admin/paths/admin_reservations_{id}.yaml | 12 + .../admin/paths/admin_return-reasons.yaml | 8 + .../paths/admin_return-reasons_{id}.yaml | 12 + .../specs/admin/paths/admin_returns.yaml | 8 + .../specs/admin/paths/admin_returns_{id}.yaml | 8 + .../paths/admin_returns_{id}_cancel.yaml | 4 + .../admin_returns_{id}_dismiss-items.yaml | 4 + ...eturns_{id}_dismiss-items_{action_id}.yaml | 10 + .../admin_returns_{id}_receive-items.yaml | 4 + ...eturns_{id}_receive-items_{action_id}.yaml | 10 + .../paths/admin_returns_{id}_receive.yaml | 8 + .../admin_returns_{id}_receive_confirm.yaml | 4 + .../admin_returns_{id}_request-items.yaml | 4 + ...eturns_{id}_request-items_{action_id}.yaml | 10 + .../paths/admin_returns_{id}_request.yaml | 8 + .../admin_returns_{id}_shipping-method.yaml | 4 + ...urns_{id}_shipping-method_{action_id}.yaml | 10 + .../admin/paths/admin_sales-channels.yaml | 8 + .../paths/admin_sales-channels_{id}.yaml | 12 + .../admin_sales-channels_{id}_products.yaml | 4 + .../admin/paths/admin_shipping-options.yaml | 8 + .../paths/admin_shipping-options_{id}.yaml | 12 + ...min_shipping-options_{id}_rules_batch.yaml | 5 + .../admin/paths/admin_shipping-profiles.yaml | 8 + .../paths/admin_shipping-profiles_{id}.yaml | 12 + .../admin/paths/admin_stock-locations.yaml | 8 + .../paths/admin_stock-locations_{id}.yaml | 12 + ...-locations_{id}_fulfillment-providers.yaml | 5 + ...stock-locations_{id}_fulfillment-sets.yaml | 5 + ...n_stock-locations_{id}_sales-channels.yaml | 5 + .../specs/admin/paths/admin_stores.yaml | 4 + .../specs/admin/paths/admin_stores_{id}.yaml | 8 + .../specs/admin/paths/admin_tax-rates.yaml | 8 + .../admin/paths/admin_tax-rates_{id}.yaml | 12 + .../specs/admin/paths/admin_tax-regions.yaml | 8 + .../admin/paths/admin_tax-regions_{id}.yaml | 8 + .../specs/admin/paths/admin_uploads.yaml | 4 + .../specs/admin/paths/admin_uploads_{id}.yaml | 8 + .../specs/admin/paths/admin_users.yaml | 4 + .../specs/admin/paths/admin_users_me.yaml | 4 + .../specs/admin/paths/admin_users_{id}.yaml | 12 + .../paths/admin_workflows-executions.yaml | 4 + .../admin_workflows-executions_{id}.yaml | 4 + .../specs/admin/paths/auth_session.yaml | 4 + .../specs/admin/paths/auth_token_refresh.yaml | 4 + .../paths/auth_user_{auth_provider}.yaml | 6 +- .../auth_user_{auth_provider}_callback.yaml | 8 +- .../auth_user_{auth_provider}_register.yaml | 4 + ...h_user_{auth_provider}_reset-password.yaml | 5 + .../auth_user_{auth_provider}_update.yaml | 4 + .../post.sh | 1 - .../auth_customer_{auth_provider}/post.js | 33 + .../post.js | 28 + .../post.js | 28 + .../post.js | 24 + .../post.js | 25 + .../JavaScript/auth_session/delete.js | 18 + .../JavaScript/auth_token_refresh/post.js | 18 + .../JavaScript/store_carts/post.js | 20 + .../JavaScript/store_carts_{id}/get.js | 18 + .../JavaScript/store_carts_{id}/post.js | 20 + .../store_carts_{id}_complete/post.js | 24 + .../store_carts_{id}_customer/post.js | 18 + .../store_carts_{id}_line-items/post.js | 21 + .../delete.js | 21 + .../post.js | 24 + .../store_carts_{id}_shipping-methods/post.js | 23 + .../JavaScript/store_collections/get.js | 18 + .../JavaScript/store_collections_{id}/get.js | 18 + .../JavaScript/store_customers/post.js | 31 + .../JavaScript/store_customers_me/get.js | 18 + .../JavaScript/store_customers_me/post.js | 20 + .../store_customers_me_addresses/get.js | 18 + .../store_customers_me_addresses/post.js | 20 + .../delete.js | 18 + .../get.js | 20 + .../post.js | 23 + .../JavaScript/store_orders/get.js | 18 + .../JavaScript/store_orders_{id}/get.js | 18 + .../store_orders_{id}_transfer_accept/post.js | 26 + .../store_orders_{id}_transfer_cancel/post.js | 24 + .../post.js | 26 + .../post.js | 27 + .../store_payment-collections/post.js | 26 + .../JavaScript/store_payment-providers/get.js | 20 + .../store_product-categories/get.js | 18 + .../store_product-categories_{id}/get.js | 18 + .../JavaScript/store_products/get.js | 18 + .../JavaScript/store_products_{id}/get.js | 18 + .../JavaScript/store_regions/get.js | 18 + .../JavaScript/store_regions_{id}/get.js | 18 + .../JavaScript/store_shipping-options/get.js | 20 + .../post.js | 20 + .../auth_customer_{auth_provider}/post.sh | 6 - .../post.sh | 1 - .../post.ts | 28 + .../schemas/AdminAddDraftOrderItems.yaml | 44 + .../schemas/AdminAddDraftOrderPromotions.yaml | 13 + .../AdminAddDraftOrderShippingMethod.yaml | 27 + .../schemas/AdminCreateOrderCreditLines.yaml | 26 + .../components/schemas/AdminDraftOrder.yaml | 7 + .../schemas/AdminDraftOrderPreview.yaml | 655 ++ .../AdminDraftOrderPreviewResponse.yaml | 8 + .../store/components/schemas/AdminOrder.yaml | 7 + .../components/schemas/AdminOrderPreview.yaml | 7 + .../store/components/schemas/AdminPlugin.yaml | 10 + .../schemas/AdminPluginsListResponse.yaml | 11 + .../AdminRemoveDraftOrderPromotions.yaml | 13 + .../schemas/AdminUpdateDraftOrder.yaml | 8 + ...nUpdateDraftOrderActionShippingMethod.yaml | 27 + .../schemas/AdminUpdateDraftOrderItem.yaml | 22 + .../AdminUpdateDraftOrderShippingMethod.yaml | 18 + .../specs/store/components/schemas/Order.yaml | 80 + .../components/schemas/OrderLineItem.yaml | 5 + .../schemas/StoreCartRemovePromotion.yaml | 13 + .../specs/store/openapi.full.yaml | 2071 ++++- .../api-reference/specs/store/openapi.yaml | 20 +- .../paths/auth_customer_{auth_provider}.yaml | 6 +- ...uth_customer_{auth_provider}_callback.yaml | 10 +- ...uth_customer_{auth_provider}_register.yaml | 5 + ...stomer_{auth_provider}_reset-password.yaml | 5 + .../auth_customer_{auth_provider}_update.yaml | 5 + .../specs/store/paths/auth_session.yaml | 4 + .../specs/store/paths/auth_token_refresh.yaml | 4 + .../specs/store/paths/store_carts.yaml | 4 + .../specs/store/paths/store_carts_{id}.yaml | 8 + .../paths/store_carts_{id}_complete.yaml | 4 + .../paths/store_carts_{id}_customer.yaml | 4 + .../paths/store_carts_{id}_line-items.yaml | 4 + ...store_carts_{id}_line-items_{line_id}.yaml | 10 + .../paths/store_carts_{id}_promotions.yaml | 5 + .../store_carts_{id}_shipping-methods.yaml | 4 + .../specs/store/paths/store_collections.yaml | 4 + .../store/paths/store_collections_{id}.yaml | 4 + .../specs/store/paths/store_customers.yaml | 4 + .../specs/store/paths/store_customers_me.yaml | 8 + .../paths/store_customers_me_addresses.yaml | 8 + ...e_customers_me_addresses_{address_id}.yaml | 15 + .../specs/store/paths/store_orders.yaml | 4 + .../specs/store/paths/store_orders_{id}.yaml | 4 + .../store_orders_{id}_transfer_accept.yaml | 4 + .../store_orders_{id}_transfer_cancel.yaml | 4 + .../store_orders_{id}_transfer_decline.yaml | 4 + .../store_orders_{id}_transfer_request.yaml | 4 + .../paths/store_payment-collections.yaml | 4 + .../store/paths/store_payment-providers.yaml | 4 + .../store/paths/store_product-categories.yaml | 4 + .../paths/store_product-categories_{id}.yaml | 4 + .../specs/store/paths/store_products.yaml | 4 + .../store/paths/store_products_{id}.yaml | 4 + .../specs/store/paths/store_regions.yaml | 4 + .../specs/store/paths/store_regions_{id}.yaml | 4 + .../store/paths/store_shipping-options.yaml | 4 + ...store_shipping-options_{id}_calculate.yaml | 5 + .../oas-output/base/admin.oas.base.yaml | 96 +- .../oas-output/base/store.oas.base.yaml | 20 +- .../admin/delete_admin_api-keys_[id].ts | 17 + .../admin/delete_admin_campaigns_[id].ts | 17 + ...min_claims_[id]_claim-items_[action_id].ts | 20 + ...n_claims_[id]_inbound_items_[action_id].ts | 20 + ...id]_inbound_shipping-method_[action_id].ts | 20 + ..._claims_[id]_outbound_items_[action_id].ts | 20 + ...d]_outbound_shipping-method_[action_id].ts | 20 + .../admin/delete_admin_claims_[id]_request.ts | 19 + .../admin/delete_admin_collections_[id].ts | 17 + .../delete_admin_customer-groups_[id].ts | 17 + .../admin/delete_admin_customers_[id].ts | 17 + ...n_customers_[id]_addresses_[address_id].ts | 17 + .../delete_admin_draft-orders_[id]_edit.ts | 62 + ...raft-orders_[id]_edit_items_[action_id].ts | 71 + ...admin_draft-orders_[id]_edit_promotions.ts | 70 + ..._[id]_edit_shipping-methods_[action_id].ts | 71 + ...xchanges_[id]_inbound_items_[action_id].ts | 20 + ...id]_inbound_shipping-method_[action_id].ts | 20 + ...changes_[id]_outbound_items_[action_id].ts | 20 + ...d]_outbound_shipping-method_[action_id].ts | 20 + .../delete_admin_exchanges_[id]_request.ts | 17 + .../delete_admin_fulfillment-sets_[id].ts | 17 + ...lment-sets_[id]_service-zones_[zone_id].ts | 20 + .../delete_admin_inventory-items_[id].ts | 17 + ...tems_[id]_location-levels_[location_id].ts | 20 + .../admin/delete_admin_invites_[id].ts | 17 + .../admin/delete_admin_order-edits_[id].ts | 17 + ...dmin_order-edits_[id]_items_[action_id].ts | 20 + .../delete_admin_payment-collections_[id].ts | 17 + .../admin/delete_admin_price-lists_[id].ts | 17 + .../delete_admin_price-preferences_[id].ts | 17 + .../delete_admin_product-categories_[id].ts | 17 + .../admin/delete_admin_product-tags_[id].ts | 17 + .../admin/delete_admin_product-types_[id].ts | 17 + .../admin/delete_admin_products_[id].ts | 17 + ...admin_products_[id]_options_[option_id].ts | 17 + ...min_products_[id]_variants_[variant_id].ts | 17 + .../admin/delete_admin_promotions_[id].ts | 17 + .../admin/delete_admin_regions_[id].ts | 17 + .../admin/delete_admin_reservations_[id].ts | 17 + .../admin/delete_admin_return-reasons_[id].ts | 17 + ..._returns_[id]_dismiss-items_[action_id].ts | 17 + ..._returns_[id]_receive-items_[action_id].ts | 17 + .../delete_admin_returns_[id]_receive.ts | 17 + ..._returns_[id]_request-items_[action_id].ts | 17 + .../delete_admin_returns_[id]_request.ts | 17 + ...eturns_[id]_shipping-method_[action_id].ts | 17 + .../admin/delete_admin_sales-channels_[id].ts | 17 + .../delete_admin_shipping-options_[id].ts | 17 + .../delete_admin_shipping-profiles_[id].ts | 17 + .../delete_admin_stock-locations_[id].ts | 17 + .../admin/delete_admin_tax-rates_[id].ts | 17 + .../admin/delete_admin_tax-regions_[id].ts | 17 + .../admin/delete_admin_uploads_[id].ts | 17 + .../admin/delete_admin_users_[id].ts | 17 + .../operations/admin/delete_auth_session.ts | 17 + .../operations/admin/get_admin_api-keys.ts | 17 + .../admin/get_admin_api-keys_[id].ts | 17 + .../operations/admin/get_admin_campaigns.ts | 17 + .../admin/get_admin_campaigns_[id].ts | 17 + .../operations/admin/get_admin_claims.ts | 17 + .../operations/admin/get_admin_claims_[id].ts | 17 + .../operations/admin/get_admin_collections.ts | 17 + .../admin/get_admin_collections_[id].ts | 17 + .../operations/admin/get_admin_currencies.ts | 17 + .../admin/get_admin_currencies_[code].ts | 17 + .../admin/get_admin_customer-groups.ts | 17 + .../admin/get_admin_customer-groups_[id].ts | 17 + .../operations/admin/get_admin_customers.ts | 17 + .../admin/get_admin_customers_[id].ts | 17 + .../get_admin_customers_[id]_addresses.ts | 17 + ...n_customers_[id]_addresses_[address_id].ts | 17 + .../admin/get_admin_draft-orders.ts | 17 + .../admin/get_admin_draft-orders_[id].ts | 17 + .../operations/admin/get_admin_exchanges.ts | 17 + .../admin/get_admin_exchanges_[id].ts | 17 + .../admin/get_admin_fulfillment-providers.ts | 17 + ...dmin_fulfillment-providers_[id]_options.ts | 17 + ...lment-sets_[id]_service-zones_[zone_id].ts | 20 + .../admin/get_admin_inventory-items.ts | 17 + .../admin/get_admin_inventory-items_[id].ts | 17 + ...in_inventory-items_[id]_location-levels.ts | 17 + .../operations/admin/get_admin_invites.ts | 17 + .../admin/get_admin_invites_[id].ts | 17 + .../admin/get_admin_notifications.ts | 17 + .../admin/get_admin_notifications_[id].ts | 17 + .../operations/admin/get_admin_orders.ts | 17 + .../operations/admin/get_admin_orders_[id].ts | 17 + .../admin/get_admin_orders_[id]_changes.ts | 17 + .../admin/get_admin_orders_[id]_line-items.ts | 17 + .../admin/get_admin_orders_[id]_preview.ts | 17 + .../operations/admin/get_admin_payments.ts | 17 + .../admin/get_admin_payments_[id].ts | 17 + .../get_admin_payments_payment-providers.ts | 17 + .../operations/admin/get_admin_plugins.ts | 57 + .../operations/admin/get_admin_price-lists.ts | 17 + .../admin/get_admin_price-lists_[id].ts | 17 + .../admin/get_admin_price-preferences.ts | 17 + .../admin/get_admin_price-preferences_[id].ts | 17 + .../admin/get_admin_product-categories.ts | 17 + .../get_admin_product-categories_[id].ts | 17 + .../admin/get_admin_product-tags.ts | 17 + .../admin/get_admin_product-tags_[id].ts | 17 + .../admin/get_admin_product-types.ts | 17 + .../admin/get_admin_product-types_[id].ts | 17 + .../admin/get_admin_product-variants.ts | 17 + .../operations/admin/get_admin_products.ts | 17 + .../admin/get_admin_products_[id].ts | 17 + .../admin/get_admin_products_[id]_options.ts | 17 + ...admin_products_[id]_options_[option_id].ts | 20 + .../admin/get_admin_products_[id]_variants.ts | 17 + ...min_products_[id]_variants_[variant_id].ts | 20 + .../operations/admin/get_admin_promotions.ts | 45 + .../admin/get_admin_promotions_[id].ts | 17 + .../get_admin_promotions_[id]_[rule_type].ts | 17 + ...ions_rule-attribute-options_[rule_type].ts | 17 + ...options_[rule_type]_[rule_attribute_id].ts | 56 +- .../admin/get_admin_refund-reasons.ts | 17 + .../operations/admin/get_admin_regions.ts | 17 + .../admin/get_admin_regions_[id].ts | 17 + .../admin/get_admin_reservations.ts | 17 + .../admin/get_admin_reservations_[id].ts | 17 + .../admin/get_admin_return-reasons.ts | 17 + .../admin/get_admin_return-reasons_[id].ts | 17 + .../operations/admin/get_admin_returns.ts | 17 + .../admin/get_admin_returns_[id].ts | 17 + .../admin/get_admin_sales-channels.ts | 17 + .../admin/get_admin_sales-channels_[id].ts | 17 + .../admin/get_admin_shipping-options.ts | 17 + .../admin/get_admin_shipping-options_[id].ts | 17 + .../admin/get_admin_shipping-profiles.ts | 17 + .../admin/get_admin_shipping-profiles_[id].ts | 17 + .../admin/get_admin_stock-locations.ts | 17 + .../admin/get_admin_stock-locations_[id].ts | 17 + .../operations/admin/get_admin_stores.ts | 17 + .../operations/admin/get_admin_stores_[id].ts | 17 + .../operations/admin/get_admin_tax-rates.ts | 17 + .../admin/get_admin_tax-rates_[id].ts | 17 + .../operations/admin/get_admin_tax-regions.ts | 17 + .../admin/get_admin_tax-regions_[id].ts | 17 + .../admin/get_admin_uploads_[id].ts | 17 + .../operations/admin/get_admin_users.ts | 17 + .../operations/admin/get_admin_users_[id].ts | 17 + .../operations/admin/get_admin_users_me.ts | 17 + .../admin/get_admin_workflows-executions.ts | 17 + .../get_admin_workflows-executions_[id].ts | 17 + .../operations/admin/post_admin_api-keys.ts | 20 + .../admin/post_admin_api-keys_[id].ts | 19 + .../admin/post_admin_api-keys_[id]_revoke.ts | 17 + ...post_admin_api-keys_[id]_sales-channels.ts | 20 + .../operations/admin/post_admin_campaigns.ts | 19 + .../admin/post_admin_campaigns_[id].ts | 19 + .../post_admin_campaigns_[id]_promotions.ts | 20 + .../operations/admin/post_admin_claims.ts | 20 + .../admin/post_admin_claims_[id]_cancel.ts | 17 + .../post_admin_claims_[id]_claim-items.ts | 24 + ...min_claims_[id]_claim-items_[action_id].ts | 23 + .../post_admin_claims_[id]_inbound_items.ts | 27 + ...n_claims_[id]_inbound_items_[action_id].ts | 23 + ...min_claims_[id]_inbound_shipping-method.ts | 23 + ...id]_inbound_shipping-method_[action_id].ts | 23 + .../post_admin_claims_[id]_outbound_items.ts | 25 + ..._claims_[id]_outbound_items_[action_id].ts | 23 + ...in_claims_[id]_outbound_shipping-method.ts | 23 + ...d]_outbound_shipping-method_[action_id].ts | 23 + .../admin/post_admin_claims_[id]_request.ts | 20 + .../admin/post_admin_collections.ts | 19 + .../admin/post_admin_collections_[id].ts | 19 + .../post_admin_collections_[id]_products.ts | 20 + .../admin/post_admin_customer-groups.ts | 19 + .../admin/post_admin_customer-groups_[id].ts | 19 + ...st_admin_customer-groups_[id]_customers.ts | 20 + .../operations/admin/post_admin_customers.ts | 19 + .../admin/post_admin_customers_[id].ts | 19 + .../post_admin_customers_[id]_addresses.ts | 22 + ...n_customers_[id]_addresses_[address_id].ts | 22 + ...st_admin_customers_[id]_customer-groups.ts | 20 + .../admin/post_admin_draft-orders.ts | 27 + .../admin/post_admin_draft-orders_[id].ts | 21 +- ...dmin_draft-orders_[id]_convert-to-order.ts | 79 + .../post_admin_draft-orders_[id]_edit.ts | 62 + ...st_admin_draft-orders_[id]_edit_confirm.ts | 62 + ...post_admin_draft-orders_[id]_edit_items.ts | 74 + ...raft-orders_[id]_edit_items_[action_id].ts | 82 + ...t-orders_[id]_edit_items_item_[item_id].ts | 79 + ...admin_draft-orders_[id]_edit_promotions.ts | 79 + ...st_admin_draft-orders_[id]_edit_request.ts | 62 + ...draft-orders_[id]_edit_shipping-methods.ts | 73 + ..._[id]_edit_shipping-methods_[action_id].ts | 82 + ...dit_shipping-methods_method_[method_id].ts | 75 + .../operations/admin/post_admin_exchanges.ts | 19 + .../admin/post_admin_exchanges_[id]_cancel.ts | 17 + ...post_admin_exchanges_[id]_inbound_items.ts | 22 + ...xchanges_[id]_inbound_items_[action_id].ts | 23 + ..._exchanges_[id]_inbound_shipping-method.ts | 19 + ...id]_inbound_shipping-method_[action_id].ts | 23 + ...ost_admin_exchanges_[id]_outbound_items.ts | 22 + ...changes_[id]_outbound_items_[action_id].ts | 23 + ...exchanges_[id]_outbound_shipping-method.ts | 19 + ...d]_outbound_shipping-method_[action_id].ts | 23 + .../post_admin_exchanges_[id]_request.ts | 17 + ...min_fulfillment-sets_[id]_service-zones.ts | 23 + ...lment-sets_[id]_service-zones_[zone_id].ts | 23 + .../admin/post_admin_fulfillments.ts | 34 + .../post_admin_fulfillments_[id]_cancel.ts | 17 + .../post_admin_fulfillments_[id]_shipment.ts | 25 + .../admin/post_admin_inventory-items.ts | 19 + .../admin/post_admin_inventory-items_[id].ts | 19 + ...tems_[id]_location-levels_[location_id].ts | 23 + ...entory-items_[id]_location-levels_batch.ts | 25 + ...n_inventory-items_location-levels_batch.ts | 24 + .../operations/admin/post_admin_invites.ts | 19 + .../admin/post_admin_invites_[id]_resend.ts | 17 + .../admin/post_admin_invites_accept.ts | 27 + .../admin/post_admin_order-edits.ts | 19 + .../post_admin_order-edits_[id]_confirm.ts | 17 + .../post_admin_order-edits_[id]_items.ts | 24 + ...dmin_order-edits_[id]_items_[action_id].ts | 23 + ...n_order-edits_[id]_items_item_[item_id].ts | 23 + .../post_admin_order-edits_[id]_request.ts | 17 + .../admin/post_admin_orders_[id].ts | 27 + .../admin/post_admin_orders_[id]_cancel.ts | 17 + .../post_admin_orders_[id]_credit-lines.ts | 98 + .../post_admin_orders_[id]_fulfillments.ts | 24 + ...d]_fulfillments_[fulfillment_id]_cancel.ts | 23 + ...ents_[fulfillment_id]_mark-as-delivered.ts | 20 + ...fulfillments_[fulfillment_id]_shipments.ts | 28 + .../admin/post_admin_orders_[id]_transfer.ts | 20 + .../post_admin_orders_[id]_transfer_cancel.ts | 17 + .../admin/post_admin_payment-collections.ts | 19 + ...n_payment-collections_[id]_mark-as-paid.ts | 19 + .../admin/post_admin_payments_[id]_capture.ts | 17 + .../admin/post_admin_payments_[id]_refund.ts | 17 + .../admin/post_admin_price-lists.ts | 31 + .../admin/post_admin_price-lists_[id].ts | 19 + ...ost_admin_price-lists_[id]_prices_batch.ts | 32 + .../post_admin_price-lists_[id]_products.ts | 19 + .../admin/post_admin_price-preferences.ts | 21 + .../post_admin_price-preferences_[id].ts | 19 + .../admin/post_admin_product-categories.ts | 19 + .../post_admin_product-categories_[id].ts | 19 + ..._admin_product-categories_[id]_products.ts | 20 + .../admin/post_admin_product-tags.ts | 19 + .../admin/post_admin_product-tags_[id].ts | 19 + .../admin/post_admin_product-types.ts | 19 + .../admin/post_admin_product-types_[id].ts | 19 + .../operations/admin/post_admin_products.ts | 33 + .../admin/post_admin_products_[id].ts | 19 + .../admin/post_admin_products_[id]_options.ts | 23 + ...admin_products_[id]_options_[option_id].ts | 23 + .../post_admin_products_[id]_variants.ts | 28 + ...min_products_[id]_variants_[variant_id].ts | 23 + ...post_admin_products_[id]_variants_batch.ts | 34 + ...cts_[id]_variants_inventory-items_batch.ts | 41 + .../admin/post_admin_products_batch.ts | 41 + .../admin/post_admin_products_export.ts | 17 + .../admin/post_admin_products_import.ts | 19 + ...roducts_import_[transaction_id]_confirm.ts | 19 + .../operations/admin/post_admin_promotions.ts | 23 + .../admin/post_admin_promotions_[id].ts | 19 + .../operations/admin/post_admin_regions.ts | 20 + .../admin/post_admin_regions_[id].ts | 19 + .../admin/post_admin_reservations.ts | 21 + .../admin/post_admin_reservations_[id].ts | 19 + .../admin/post_admin_return-reasons.ts | 20 + .../admin/post_admin_return-reasons_[id].ts | 20 + .../operations/admin/post_admin_returns.ts | 19 + .../admin/post_admin_returns_[id].ts | 19 + .../admin/post_admin_returns_[id]_cancel.ts | 17 + .../post_admin_returns_[id]_dismiss-items.ts | 21 + ..._returns_[id]_dismiss-items_[action_id].ts | 19 + .../post_admin_returns_[id]_receive-items.ts | 21 + ..._returns_[id]_receive-items_[action_id].ts | 19 + .../admin/post_admin_returns_[id]_receive.ts | 19 + ...post_admin_returns_[id]_receive_confirm.ts | 19 + .../post_admin_returns_[id]_request-items.ts | 20 + ..._returns_[id]_request-items_[action_id].ts | 19 + .../admin/post_admin_returns_[id]_request.ts | 19 + ...post_admin_returns_[id]_shipping-method.ts | 19 + ...eturns_[id]_shipping-method_[action_id].ts | 19 + .../admin/post_admin_sales-channels.ts | 19 + .../admin/post_admin_sales-channels_[id].ts | 22 + ...post_admin_sales-channels_[id]_products.ts | 20 + .../admin/post_admin_shipping-options.ts | 20 + .../admin/post_admin_shipping-options_[id].ts | 19 + ...admin_shipping-options_[id]_rules_batch.ts | 19 + .../admin/post_admin_shipping-profiles.ts | 19 + .../post_admin_shipping-profiles_[id].ts | 19 + .../admin/post_admin_stock-locations.ts | 20 + .../admin/post_admin_stock-locations_[id].ts | 19 + ...ck-locations_[id]_fulfillment-providers.ts | 20 + ...n_stock-locations_[id]_fulfillment-sets.ts | 20 + ...min_stock-locations_[id]_sales-channels.ts | 20 + .../admin/post_admin_stores_[id].ts | 19 + .../operations/admin/post_admin_tax-rates.ts | 22 + .../admin/post_admin_tax-rates_[id].ts | 20 + .../admin/post_admin_tax-regions.ts | 26 + .../operations/admin/post_admin_uploads.ts | 29 + .../operations/admin/post_admin_users_[id].ts | 20 + .../post_auth_[actor_type]_[auth_provider].ts | 41 +- ...h_[actor_type]_[auth_provider]_callback.ts | 70 +- ...h_[actor_type]_[auth_provider]_register.ts | 27 + ...or_type]_[auth_provider]_reset-password.ts | 23 + ...uth_[actor_type]_[auth_provider]_update.ts | 24 + .../admin/post_auth_token_refresh.ts | 17 + .../operations/auth/delete_auth_session.ts | 19 + .../get_auth_[actor_type]_[auth_provider].ts | 2 + ...h_[actor_type]_[auth_provider]_callback.ts | 29 + .../post_auth_[actor_type]_[auth_provider].ts | 34 + ...h_[actor_type]_[auth_provider]_callback.ts | 2 + ...h_[actor_type]_[auth_provider]_register.ts | 29 + ...or_type]_[auth_provider]_reset-password.ts | 25 + ...uth_[actor_type]_[auth_provider]_update.ts | 26 + .../operations/auth/post_auth_session.ts | 2 + .../auth/post_auth_token_refresh.ts | 19 + .../hooks/post_hooks_payment_[provider].ts | 2 + .../operations/store/delete_auth_session.ts | 21 + ...e_store_carts_[id]_line-items_[line_id].ts | 24 + .../delete_store_carts_[id]_promotions.ts | 5 + ...ore_customers_me_addresses_[address_id].ts | 21 + .../operations/store/get_store_carts_[id].ts | 21 + .../operations/store/get_store_collections.ts | 21 + .../store/get_store_collections_[id].ts | 21 + .../store/get_store_customers_me.ts | 21 + .../store/get_store_customers_me_addresses.ts | 21 + ...ore_customers_me_addresses_[address_id].ts | 23 + .../operations/store/get_store_orders.ts | 21 + .../operations/store/get_store_orders_[id].ts | 21 + .../store/get_store_payment-providers.ts | 23 + .../store/get_store_product-categories.ts | 21 + .../get_store_product-categories_[id].ts | 21 + .../operations/store/get_store_products.ts | 21 + .../store/get_store_products_[id].ts | 21 + .../operations/store/get_store_regions.ts | 21 + .../store/get_store_regions_[id].ts | 21 + .../store/get_store_shipping-options.ts | 23 + .../post_auth_[actor_type]_[auth_provider].ts | 45 +- ...h_[actor_type]_[auth_provider]_callback.ts | 64 +- ...h_[actor_type]_[auth_provider]_register.ts | 31 + ...or_type]_[auth_provider]_reset-password.ts | 27 + ...uth_[actor_type]_[auth_provider]_update.ts | 28 + .../store/post_auth_token_refresh.ts | 21 + .../operations/store/post_store_carts.ts | 23 + .../operations/store/post_store_carts_[id].ts | 23 + .../store/post_store_carts_[id]_complete.ts | 27 + .../store/post_store_carts_[id]_customer.ts | 21 + .../store/post_store_carts_[id]_line-items.ts | 24 + ...t_store_carts_[id]_line-items_[line_id].ts | 27 + .../post_store_carts_[id]_shipping-methods.ts | 26 + .../operations/store/post_store_customers.ts | 34 + .../store/post_store_customers_me.ts | 23 + .../post_store_customers_me_addresses.ts | 23 + ...ore_customers_me_addresses_[address_id].ts | 26 + .../post_store_orders_[id]_transfer_accept.ts | 29 + .../post_store_orders_[id]_transfer_cancel.ts | 27 + ...post_store_orders_[id]_transfer_decline.ts | 29 + ...post_store_orders_[id]_transfer_request.ts | 30 + .../store/post_store_payment-collections.ts | 29 + ...t_store_shipping-options_[id]_calculate.ts | 23 + .../schemas/AdminAddDraftOrderItems.ts | 49 + .../schemas/AdminAddDraftOrderPromotions.ts | 18 + .../AdminAddDraftOrderShippingMethod.ts | 30 + .../schemas/AdminCreateOrderCreditLines.ts | 31 + .../oas-output/schemas/AdminDraftOrder.ts | 7 + .../schemas/AdminDraftOrderPreview.ts | 634 ++ .../schemas/AdminDraftOrderPreviewResponse.ts | 13 + .../oas-output/schemas/AdminOrder.ts | 7 + .../oas-output/schemas/AdminOrderPreview.ts | 7 + .../oas-output/schemas/AdminPlugin.ts | 15 + .../schemas/AdminPluginsListResponse.ts | 16 + .../AdminRemoveDraftOrderPromotions.ts | 18 + .../schemas/AdminUpdateDraftOrder.ts | 8 + ...minUpdateDraftOrderActionShippingMethod.ts | 30 + .../schemas/AdminUpdateDraftOrderItem.ts | 27 + .../AdminUpdateDraftOrderShippingMethod.ts | 21 + .../generated/oas-output/schemas/Order.ts | 78 + .../oas-output/schemas/OrderLineItem.ts | 5 + .../schemas/StoreCartRemovePromotion.ts | 18 + .../route-examples-output/route-examples.json | 69 +- .../docs-generator/src/classes/kinds/oas.ts | 9 +- 1028 files changed, 29859 insertions(+), 286 deletions(-) delete mode 100644 www/apps/api-reference/specs/admin/code_samples/Bash/auth_user_{auth_provider}_callback/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}_revoke/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}_sales-channels/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}_promotions/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_cancel/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_request/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_request/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}_products/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_currencies/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_currencies_{code}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}_customers/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_customer-groups/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_convert-to-order/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_confirm/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_item_{item_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_promotions/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_promotions/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_request/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_cancel/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_request/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_request/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-providers/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-providers_{id}_options/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments_{id}_cancel/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments_{id}_shipment/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_location-levels_batch/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_batch/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_accept/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}_resend/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_notifications/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_notifications_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_confirm/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_item_{item_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_request/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_cancel/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_changes/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_credit-lines/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_mark-as-delivered/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_line-items/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_preview/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_transfer/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_transfer_cancel/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections_{id}_mark-as-paid/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_payment-providers/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}_capture/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}_refund/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_plugins/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_prices_batch/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_products/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}_products/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-variants/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_batch/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_export/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_import/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_import_{transaction_id}_confirm/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_batch/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_inventory-items_batch/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_rule-attribute-options_{rule_type}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}_{rule_type}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_cancel/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive_confirm/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method_{action_id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method_{action_id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}_products/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}_rules_batch/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_fulfillment-providers/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_fulfillment-sets/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_sales-channels/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_me/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_workflows-executions/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_workflows-executions_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_session/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_token_refresh/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_callback/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_register/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_reset-password/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_update/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_convert-to-order/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit/delete.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_confirm/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_item_{item_id}/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_{action_id}/delete.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_{action_id}/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_promotions/delete.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_promotions/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_request/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/delete.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_credit-lines/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_plugins/get.sh delete mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/auth_user_{auth_provider}/post.sh delete mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/auth_user_{auth_provider}_callback/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/TypeScript/auth_user_{auth_provider}_callback/post.ts create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderItems.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderPromotions.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderShippingMethod.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminCreateOrderCreditLines.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrderPreview.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrderPreviewResponse.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminPlugin.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminPluginsListResponse.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminRemoveDraftOrderPromotions.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderActionShippingMethod.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderItem.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderShippingMethod.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/StoreCartRemovePromotion.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_convert-to-order.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_confirm.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items_item_{item_id}.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items_{action_id}.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_promotions.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_request.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods_{action_id}.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_orders_{id}_credit-lines.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_plugins.yaml delete mode 100644 www/apps/api-reference/specs/store/code_samples/Bash/auth_customer_{auth_provider}_callback/post.sh create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_callback/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_register/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_reset-password/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_update/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/auth_session/delete.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/auth_token_refresh/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_complete/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_customer/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/delete.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_shipping-methods/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_collections/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_collections_{id}/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/delete.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_accept/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_cancel/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_decline/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_request/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_payment-collections/post.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_payment-providers/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_product-categories/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_product-categories_{id}/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_products/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_products_{id}/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_regions/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_regions_{id}/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_shipping-options/get.js create mode 100644 www/apps/api-reference/specs/store/code_samples/JavaScript/store_shipping-options_{id}_calculate/post.js delete mode 100644 www/apps/api-reference/specs/store/code_samples/Shell/auth_customer_{auth_provider}/post.sh delete mode 100644 www/apps/api-reference/specs/store/code_samples/Shell/auth_customer_{auth_provider}_callback/post.sh create mode 100644 www/apps/api-reference/specs/store/code_samples/TypeScript/auth_customer_{auth_provider}_callback/post.ts create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderItems.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderPromotions.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderShippingMethod.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminCreateOrderCreditLines.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminDraftOrderPreview.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminDraftOrderPreviewResponse.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminPlugin.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminPluginsListResponse.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminRemoveDraftOrderPromotions.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderActionShippingMethod.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderItem.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderShippingMethod.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/StoreCartRemovePromotion.yaml create mode 100644 www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit.ts create mode 100644 www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_items_[action_id].ts create mode 100644 www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_promotions.ts create mode 100644 www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_shipping-methods_[action_id].ts create mode 100644 www/utils/generated/oas-output/operations/admin/get_admin_plugins.ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_convert-to-order.ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit.ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_confirm.ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items.ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items_[action_id].ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items_item_[item_id].ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_promotions.ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_request.ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods.ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods_[action_id].ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods_method_[method_id].ts create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_credit-lines.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminAddDraftOrderItems.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminAddDraftOrderPromotions.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminAddDraftOrderShippingMethod.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminCreateOrderCreditLines.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminDraftOrderPreview.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminDraftOrderPreviewResponse.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminPlugin.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminPluginsListResponse.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminRemoveDraftOrderPromotions.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderActionShippingMethod.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderItem.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderShippingMethod.ts create mode 100644 www/utils/generated/oas-output/schemas/StoreCartRemovePromotion.ts diff --git a/.github/workflows/generate-public-references.yml b/.github/workflows/generate-public-references.yml index ecdac2d385..1be8208302 100644 --- a/.github/workflows/generate-public-references.yml +++ b/.github/workflows/generate-public-references.yml @@ -127,6 +127,14 @@ jobs: - name: Build Packages run: yarn build + - name: Install Docs dependencies + working-directory: www + run: yarn install + + - name: Build Docs packages + working-directory: www + run: yarn build:packages + - name: Install www/utils Dependencies run: yarn working-directory: www/utils diff --git a/www/apps/api-reference/generated/generated-admin-sidebar.mjs b/www/apps/api-reference/generated/generated-admin-sidebar.mjs index 71fdb7f9ea..ccc899c9f3 100644 --- a/www/apps/api-reference/generated/generated-admin-sidebar.mjs +++ b/www/apps/api-reference/generated/generated-admin-sidebar.mjs @@ -47,13 +47,6 @@ const generatedgeneratedAdminSidebarSidebar = { { "type": "separator" }, - { - "type": "category", - "title": "Auth", - "children": [], - "loaded": false, - "showLoadingIfEmpty": true - }, { "type": "category", "title": "Api Keys", @@ -72,6 +65,13 @@ const generatedgeneratedAdminSidebarSidebar = { "loaded": false, "showLoadingIfEmpty": true }, + { + "type": "category", + "title": "Auth", + "children": [], + "loaded": false, + "showLoadingIfEmpty": true + }, { "type": "category", "title": "Campaigns", @@ -385,6 +385,24 @@ const generatedgeneratedAdminSidebarSidebar = { "loaded": false, "showLoadingIfEmpty": true }, + { + "type": "category", + "title": "Plugins", + "children": [ + { + "type": "link", + "path": "plugins_plugin_schema", + "title": "Plugin Object", + "loaded": true, + "badge": { + "variant": "neutral", + "text": "Schema" + } + } + ], + "loaded": false, + "showLoadingIfEmpty": true + }, { "type": "category", "title": "Price Lists", diff --git a/www/apps/api-reference/specs/admin/code_samples/Bash/auth_user_{auth_provider}_callback/post.sh b/www/apps/api-reference/specs/admin/code_samples/Bash/auth_user_{auth_provider}_callback/post.sh deleted file mode 100644 index c4a07555a3..0000000000 --- a/www/apps/api-reference/specs/admin/code_samples/Bash/auth_user_{auth_provider}_callback/post.sh +++ /dev/null @@ -1 +0,0 @@ -curl -X POST '{backend_url}/auth/user/github/callback?code=123' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys/get.js new file mode 100644 index 0000000000..844d074c26 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.apiKey.list() +.then(({ api_keys, count, limit, offset }) => { + console.log(api_keys) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys/post.js new file mode 100644 index 0000000000..bfd66491cc --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.apiKey.create({ + title: "Development", + type: "publishable" +}) +.then(({ api_key }) => { + console.log(api_key) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/delete.js new file mode 100644 index 0000000000..ae1f2deda1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.apiKey.delete("apk_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/get.js new file mode 100644 index 0000000000..928a7eb6ca --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.apiKey.retrieve("apk_123") +.then(({ api_key }) => { + console.log(api_key) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/post.js new file mode 100644 index 0000000000..20458b27e9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.apiKey.update("apk_123", { + title: "Development" +}) +.then(({ api_key }) => { + console.log(api_key) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}_revoke/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}_revoke/post.js new file mode 100644 index 0000000000..3ce65c7932 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}_revoke/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.apiKey.revoke("apk_123") +.then(({ api_key }) => { + console.log(api_key) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}_sales-channels/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}_sales-channels/post.js new file mode 100644 index 0000000000..17e884ba99 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_api-keys_{id}_sales-channels/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.apiKey.batchSalesChannels("apk_123", { + add: ["sc_123"], + remove: ["sc_321"] +}) +.then(({ api_key }) => { + console.log(api_key) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns/get.js new file mode 100644 index 0000000000..558c8056b8 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.campaign.list() +.then(({ campaigns, count, limit, offset }) => { + console.log(campaigns) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns/post.js new file mode 100644 index 0000000000..da44f63572 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.campaign.create({ + name: "Summer Campaign" +}) +.then(({ campaign }) => { + console.log(campaign) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/delete.js new file mode 100644 index 0000000000..e32854ce1f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.campaign.delete("procamp_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/get.js new file mode 100644 index 0000000000..01cc0315fc --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.campaign.retrieve("procamp_123") +.then(({ campaign }) => { + console.log(campaign) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/post.js new file mode 100644 index 0000000000..98d494eee6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.campaign.update("procamp_123", { + name: "Summer Campaign" +}) +.then(({ campaign }) => { + console.log(campaign) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}_promotions/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}_promotions/post.js new file mode 100644 index 0000000000..99dc3f8510 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_campaigns_{id}_promotions/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.campaign.batchPromotions("procamp_123", { + add: ["prom_123", "prom_456"], + remove: ["prom_789"] +}) +.then(({ campaign }) => { + console.log(campaign) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims/get.js new file mode 100644 index 0000000000..2e2d1e50f9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.list() +.then(({ claims, count, limit, offset }) => { + console.log(claims) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims/post.js new file mode 100644 index 0000000000..644fb0c835 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.create({ + type: "refund", + order_id: "order_123", +}) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}/get.js new file mode 100644 index 0000000000..bde493cbcf --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.retrieve("claim_123") +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_cancel/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_cancel/post.js new file mode 100644 index 0000000000..d1524831cc --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_cancel/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.cancel("claim_123") +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items/post.js new file mode 100644 index 0000000000..7f9d0c1587 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items/post.js @@ -0,0 +1,21 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.addItems("claim_123", { + items: [ + { + id: "orli_123", + quantity: 1 + } + ] +}) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items_{action_id}/delete.js new file mode 100644 index 0000000000..68802a4197 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items_{action_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.removeItem( + "claim_123", + "ordchact_123", + ) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items_{action_id}/post.js new file mode 100644 index 0000000000..ff8fd0e345 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_claim-items_{action_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.updateItem( + "claim_123", + "ordchact_123", + { + quantity: 1 + } + ) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items/post.js new file mode 100644 index 0000000000..211154742c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items/post.js @@ -0,0 +1,24 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.addInboundItems( + "claim_123", + { + items: [ + { + id: "orli_123", + quantity: 1 + } + ] + }, + ) +.then(({ return: returnData }) => { + console.log(returnData) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items_{action_id}/delete.js new file mode 100644 index 0000000000..6ec75bc835 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items_{action_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.removeInboundItem( + "claim_123", + "ordchact_123", + ) +.then(({ return: returnData }) => { + console.log(returnData) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items_{action_id}/post.js new file mode 100644 index 0000000000..b92227728e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_items_{action_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.updateInboundItem( + "claim_123", + "ordchact_123", + { + quantity: 1 + }, + ) +.then(({ return: returnData }) => { + console.log(returnData) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method/post.js new file mode 100644 index 0000000000..1db8212902 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.addInboundShipping( + "claim_123", + { + shipping_option_id: "so_123", + custom_amount: 10 + }, + ) +.then(({ return: returnData }) => { + console.log(returnData) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method_{action_id}/delete.js new file mode 100644 index 0000000000..9cc97eeba7 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method_{action_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.deleteInboundShipping( + "claim_123", + "ordchact_123", + ) +.then(({ return: returnData }) => { + console.log(returnData) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method_{action_id}/post.js new file mode 100644 index 0000000000..b5286fbc74 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method_{action_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.updateInboundShipping( + "claim_123", + "ordchact_123", + { + custom_amount: 10 + }, + ) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items/post.js new file mode 100644 index 0000000000..286ad427a9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items/post.js @@ -0,0 +1,22 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.addOutboundItems( + "claim_123", + { + items: [{ + id: "orli_123", + quantity: 1 + }] + }, + ) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items_{action_id}/delete.js new file mode 100644 index 0000000000..2d0e49df95 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items_{action_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.removeOutboundItem( + "claim_123", + "ordchact_123", +) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items_{action_id}/post.js new file mode 100644 index 0000000000..a4abb00ff9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_items_{action_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.updateOutboundItem( + "claim_123", + "ordchact_123", + { + quantity: 1 + }, + ) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method/post.js new file mode 100644 index 0000000000..71c3c5fe85 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.addOutboundShipping( + "claim_123", + { + shipping_option_id: "so_123", + custom_amount: 10 + }, +) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method_{action_id}/delete.js new file mode 100644 index 0000000000..fa09f732d0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method_{action_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.deleteOutboundShipping( + "claim_123", + "ordchact_123", +) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method_{action_id}/post.js new file mode 100644 index 0000000000..a9f12e4246 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method_{action_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.updateOutboundShipping( + "claim_123", + "ordchact_123", + { + custom_amount: 10 + }, +) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_request/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_request/delete.js new file mode 100644 index 0000000000..28f63de7f9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_request/delete.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.cancelRequest( + "claim_123", +) +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_request/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_request/post.js new file mode 100644 index 0000000000..b403b37652 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_claims_{id}_request/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.claim.request( + "claim_123", + {}, +) +.then(({ claim }) => { + console.log(claim) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections/get.js new file mode 100644 index 0000000000..8ef26dd89c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCollection.list() +.then(({ collections, count, limit, offset }) => { + console.log(collections) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections/post.js new file mode 100644 index 0000000000..efef64084d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCollection.create({ + title: "Summer Collection" +}) +.then(({ collection }) => { + console.log(collection) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/delete.js new file mode 100644 index 0000000000..46fff5c64f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCollection.delete("pcol_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/get.js new file mode 100644 index 0000000000..612941f79a --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCollection.retrieve("pcol_123") +.then(({ collection }) => { + console.log(collection) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/post.js new file mode 100644 index 0000000000..25347c354e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCollection.update("pcol_123", { + title: "Summer Collection" +}) +.then(({ collection }) => { + console.log(collection) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}_products/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}_products/post.js new file mode 100644 index 0000000000..c2ec3f1987 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_collections_{id}_products/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCollection.updateProducts("pcol_123", { + add: ["prod_123"], + remove: ["prod_321"] +}) +.then(({ collection }) => { + console.log(collection) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_currencies/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_currencies/get.js new file mode 100644 index 0000000000..0b9860928e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_currencies/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.currency.list() +.then(({ currencies, count, limit, offset }) => { + console.log(currencies) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_currencies_{code}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_currencies_{code}/get.js new file mode 100644 index 0000000000..08e19d89c7 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_currencies_{code}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.currency.retrieve("usd") +.then(({ currency }) => { + console.log(currency) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups/get.js new file mode 100644 index 0000000000..36bd682498 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customerGroup.list() +.then(({ customer_groups, count, limit, offset }) => { + console.log(customer_groups) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups/post.js new file mode 100644 index 0000000000..118d0b7e21 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customerGroup.create({ + name: "VIP" +}) +.then(({ customer_group }) => { + console.log(customer_group) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/delete.js new file mode 100644 index 0000000000..22a0342df0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customerGroup.delete("cusgroup_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/get.js new file mode 100644 index 0000000000..59b2f6fbf6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customerGroup.retrieve("cusgroup_123") +.then(({ customer_group }) => { + console.log(customer_group) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/post.js new file mode 100644 index 0000000000..40d334fbb2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customerGroup.update("cusgroup_123", { + name: "VIP" +}) +.then(({ customer_group }) => { + console.log(customer_group) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}_customers/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}_customers/post.js new file mode 100644 index 0000000000..7124e7daba --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customer-groups_{id}_customers/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customerGroup.batchCustomers("cusgroup_123", { + add: ["cus_123"], + remove: ["cus_321"] +}) +.then(({ customer_group }) => { + console.log(customer_group) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers/get.js new file mode 100644 index 0000000000..98f6452cde --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customer.list() +.then(({ customers, count, limit, offset }) => { + console.log(customers) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers/post.js new file mode 100644 index 0000000000..bcf7cbff06 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customer.create({ + email: "customer@gmail.com" +}) +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/delete.js new file mode 100644 index 0000000000..9f19abfb7d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customer.delete("cus_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/get.js new file mode 100644 index 0000000000..05e90751a1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customer.retrieve("cus_123") +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/post.js new file mode 100644 index 0000000000..82396f85b3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customer.update("cus_123", { + first_name: "John" +}) +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses/get.js new file mode 100644 index 0000000000..2a0b93d891 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customer.listAddresses("cus_123") +.then(({ addresses }) => { + console.log(addresses) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses/post.js new file mode 100644 index 0000000000..c6e5193c8c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses/post.js @@ -0,0 +1,19 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customer.createAddress("cus_123", { + address_1: "123 Main St", + city: "Anytown", + country_code: "US", + postal_code: "12345" +}) +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/delete.js new file mode 100644 index 0000000000..cb95cc0f8f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customer.deleteAddress("cus_123", "cus_addr_123") +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/get.js new file mode 100644 index 0000000000..c604a9349f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customer.retrieveAddress("cus_123", "cus_addr_123") +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/post.js new file mode 100644 index 0000000000..05fcd47160 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/post.js @@ -0,0 +1,19 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customer.updateAddress("cus_123", "cus_addr_123", { + address_1: "123 Main St", + city: "Anytown", + country_code: "US", + postal_code: "12345" +}) +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_customer-groups/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_customer-groups/post.js new file mode 100644 index 0000000000..2fab3aa155 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_customers_{id}_customer-groups/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.customer.batchCustomerGroups("cus_123", { + add: ["cusgroup_123"], + remove: ["cusgroup_321"] +}) +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders/get.js new file mode 100644 index 0000000000..08a60e1846 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.list() +.then(({ draft_orders, count, limit, offset }) => { + console.log(draft_orders) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders/post.js new file mode 100644 index 0000000000..7a41d8a013 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders/post.js @@ -0,0 +1,24 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.create({ + email: "test@test.com", + items: [ + { + variant_id: "variant_123", + quantity: 1, + }, + ], + region_id: "region_123", + sales_channel_id: "sc_123", +}) +.then(({ draft_order }) => { + console.log(draft_order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}/get.js new file mode 100644 index 0000000000..782daa42b5 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.retrieve("order_123") +.then(({ draft_order }) => { + console.log(draft_order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}/post.js new file mode 100644 index 0000000000..cbd10c9744 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.update("order_123", { + email: "test@test.com", +}) +.then(({ draft_order }) => { + console.log(draft_order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_convert-to-order/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_convert-to-order/post.js new file mode 100644 index 0000000000..681f8498d7 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_convert-to-order/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +To convert a draft order to an order: + +```ts +sdk.admin.draftOrder.convertToOrder("order_123") +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit/delete.js new file mode 100644 index 0000000000..63f580c0ce --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.cancelEdit("order_123") +.then(({ id, object, deleted }) => { + console.log(id, object, deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit/post.js new file mode 100644 index 0000000000..2a91fd0f2e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.beginEdit("order_123") +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_confirm/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_confirm/post.js new file mode 100644 index 0000000000..86f0b47948 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_confirm/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.confirmEdit("order_123") +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items/post.js new file mode 100644 index 0000000000..5c76c84351 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items/post.js @@ -0,0 +1,21 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.addItems("order_123", { + items: [ + { + variant_id: "variant_123", + quantity: 1, + }, + ], +}) +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_item_{item_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_item_{item_id}/post.js new file mode 100644 index 0000000000..d67c61b071 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_item_{item_id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.updateItem("order_123", "item_123", { + quantity: 2, +}) +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_{action_id}/delete.js new file mode 100644 index 0000000000..16d6302a5f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_{action_id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.removeActionItem("order_123", "action_123") +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_{action_id}/post.js new file mode 100644 index 0000000000..bef6710e6c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_items_{action_id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.updateActionItem("order_123", "action_123", { + quantity: 2, +}) +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_promotions/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_promotions/delete.js new file mode 100644 index 0000000000..6d9021020e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_promotions/delete.js @@ -0,0 +1,13 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.removePromotions("order_123", { + promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"], +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_promotions/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_promotions/post.js new file mode 100644 index 0000000000..c5451059c5 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_promotions/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.addPromotions("order_123", { + promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"], +}) +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_request/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_request/post.js new file mode 100644 index 0000000000..6f19324017 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_request/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.requestEdit("order_123") +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods/post.js new file mode 100644 index 0000000000..a60b0d2769 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.addShippingMethod("order_123", { + shipping_option_id: "shipping_option_123", +}) +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}/post.js new file mode 100644 index 0000000000..2591c6a844 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.updateShippingMethod("order_123", "sm_123", { + shipping_option_id: "so_123", +}) +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/delete.js new file mode 100644 index 0000000000..4e7b4eaaf0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.removeShippingMethod("order_123", "action_123") +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/post.js new file mode 100644 index 0000000000..5adbdfb96f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.draftOrder.updateShippingMethod("order_123", "action_123", { + shipping_option_id: "shipping_option_123", +}) +.then(({ draft_order_preview }) => { + console.log(draft_order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges/get.js new file mode 100644 index 0000000000..a7854c9bb2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.list() +.then(({ exchanges, count, limit, offset }) => { + console.log(exchanges) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges/post.js new file mode 100644 index 0000000000..ddaaa3d2ed --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.create({ + order_id: "order_123" +}) +.then(({ exchange }) => { + console.log(exchange) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}/get.js new file mode 100644 index 0000000000..8eccd0938a --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.retrieve("exchange_123") +.then(({ exchange }) => { + console.log(exchange) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_cancel/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_cancel/post.js new file mode 100644 index 0000000000..a40569749c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_cancel/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.cancel("exchange_123") +.then(({ exchange }) => { + console.log(exchange) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items/post.js new file mode 100644 index 0000000000..84e3bf3a5d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items/post.js @@ -0,0 +1,19 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.addInboundItems("exchange_123", { + items: [{ + id: "orli_123", + quantity: 1 + }] +}) +.then(({ return: returnData }) => { + console.log(returnData) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items_{action_id}/delete.js new file mode 100644 index 0000000000..2d4f3e89f4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items_{action_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.removeInboundItem( + "exchange_123", + "ordchact_123", +) +.then(({ return: returnData }) => { + console.log(returnData) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items_{action_id}/post.js new file mode 100644 index 0000000000..8654e104d0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_items_{action_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.updateInboundItem( + "exchange_123", + "ordchact_123", + { + quantity: 1 + } +) +.then(({ return: returnData }) => { + console.log(returnData) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method/post.js new file mode 100644 index 0000000000..e3151f3215 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.addInboundShipping("exchange_123", { + shipping_option_id: "so_123" +}) +.then(({ return: returnData }) => { + console.log(returnData) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method_{action_id}/delete.js new file mode 100644 index 0000000000..7020197635 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method_{action_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.deleteInboundShipping( + "exchange_123", + "ordchact_123", +) +.then(({ return: returnData }) => { + console.log(returnData) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method_{action_id}/post.js new file mode 100644 index 0000000000..d36653155c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method_{action_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.updateInboundShipping( + "exchange_123", + "ordchact_123", + { + custom_amount: 10 + } +) +.then(({ return: returnData }) => { + console.log(returnData) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items/post.js new file mode 100644 index 0000000000..a672d783a3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items/post.js @@ -0,0 +1,19 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.addOutboundItems("exchange_123", { + items: [{ + id: "variant_123", + quantity: 1 + }] +}) +.then(({ exchange }) => { + console.log(exchange) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items_{action_id}/delete.js new file mode 100644 index 0000000000..586e360395 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items_{action_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.removeOutboundItem( + "exchange_123", + "ordchact_123", +) +.then(({ exchange }) => { + console.log(exchange) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items_{action_id}/post.js new file mode 100644 index 0000000000..a41e34756a --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_items_{action_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.updateOutboundItem( + "exchange_123", + "ordchact_123", + { + quantity: 1 + } +) +.then(({ exchange }) => { + console.log(exchange) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method/post.js new file mode 100644 index 0000000000..4835539c97 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.addOutboundShipping("exchange_123", { + shipping_option_id: "so_123" +}) +.then(({ exchange }) => { + console.log(exchange) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method_{action_id}/delete.js new file mode 100644 index 0000000000..e017a5244f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method_{action_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.deleteOutboundShipping( + "exchange_123", + "ordchact_123", +) +.then(({ exchange }) => { + console.log(exchange) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method_{action_id}/post.js new file mode 100644 index 0000000000..9cec06e9e1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method_{action_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.updateOutboundShipping( + "exchange_123", + "ordchact_123", + { + custom_amount: 10 + } +) +.then(({ exchange }) => { + console.log(exchange) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_request/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_request/delete.js new file mode 100644 index 0000000000..a8b7a5b77d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_request/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.cancel("exchange_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_request/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_request/post.js new file mode 100644 index 0000000000..fb440dde2d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_exchanges_{id}_request/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.exchange.request("exchange_123", {}) +.then(({ exchange }) => { + console.log(exchange) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-providers/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-providers/get.js new file mode 100644 index 0000000000..cb73d44190 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-providers/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.fulfillmentProvider.list() +.then(({ fulfillment_providers, count, limit, offset }) => { + console.log(fulfillment_providers) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-providers_{id}_options/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-providers_{id}_options/get.js new file mode 100644 index 0000000000..7d0fdaac41 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-providers_{id}_options/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.fulfillmentProvider.listFulfillmentOptions("fp_123") +.then(({ fulfillment_options }) => { + console.log(fulfillment_options) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}/delete.js new file mode 100644 index 0000000000..c1e77b7194 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.fulfillmentSet.delete("fset_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones/post.js new file mode 100644 index 0000000000..efaf8b0908 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.fulfillmentSet.createServiceZone("fset_123", { + name: "Europe Service Zone", + geo_zones: [{ + type: "country", + country_code: "us" + }] +}) +.then(({ fulfillment_set }) => { + console.log(fulfillment_set) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/delete.js new file mode 100644 index 0000000000..49eed4f917 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.fulfillmentSet.deleteServiceZone( + "fset_123", + "serzo_123", +) +.then(({ deleted, parent: fulfillmentSet }) => { + console.log(deleted, fulfillmentSet) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/get.js new file mode 100644 index 0000000000..53d82f0258 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/get.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.fulfillmentSet.retrieveServiceZone( + "fset_123", + "serzo_123" +) +.then(({ service_zone }) => { + console.log(service_zone) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/post.js new file mode 100644 index 0000000000..d06541414e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.fulfillmentSet.updateServiceZone( + "fset_123", + "serzo_123", + { + name: "Europe Service Zone", + } +) +.then(({ fulfillment_set }) => { + console.log(fulfillment_set) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments/post.js new file mode 100644 index 0000000000..5dc404ee79 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments/post.js @@ -0,0 +1,31 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.fulfillment.create({ + location_id: "sloc_123", + provider_id: "my_fulfillment", + delivery_address: { + country_code: "us" + }, + items: [ + { + title: "Shirt", + sku: "SHIRT", + quantity: 1, + barcode: "123" + } + ], + labels: [], + order: {}, + order_id: "order_123" +}) +.then(({ fulfillment }) => { + console.log(fulfillment) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments_{id}_cancel/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments_{id}_cancel/post.js new file mode 100644 index 0000000000..2662e5749a --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments_{id}_cancel/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.fulfillment.cancel("ful_123") +.then(({ fulfillment }) => { + console.log(fulfillment) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments_{id}_shipment/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments_{id}_shipment/post.js new file mode 100644 index 0000000000..14effb9f30 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_fulfillments_{id}_shipment/post.js @@ -0,0 +1,22 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.fulfillment.createShipment("ful_123", { + labels: [ + { + tracking_number: "123", + tracking_url: "example.com", + label_url: "example.com" + } + ] +}) +.then(({ fulfillment }) => { + console.log(fulfillment) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items/get.js new file mode 100644 index 0000000000..f8c824d5fc --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.inventoryItem.list() +.then(({ inventory_items, count, limit, offset }) => { + console.log(inventory_items) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items/post.js new file mode 100644 index 0000000000..d24a9a2285 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.inventoryItem.create({ + sku: "SHIRT" +}) +.then(({ inventory_item }) => { + console.log(inventory_item) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_location-levels_batch/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_location-levels_batch/post.js new file mode 100644 index 0000000000..58b871f354 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_location-levels_batch/post.js @@ -0,0 +1,21 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.inventoryItem.batchInventoryItemsLocationLevels({ + create: [{ + inventory_item_id: "iitem_123", + location_id: "sloc_123", + stocked_quantity: 10 + }], + delete: ["ilvl_123"] +}) +.then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/delete.js new file mode 100644 index 0000000000..76eb00c346 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.inventoryItem.delete("iitem_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/get.js new file mode 100644 index 0000000000..c442473a11 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.inventoryItem.retrieve("iitem_123") +.then(({ inventory_item }) => { + console.log(inventory_item) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/post.js new file mode 100644 index 0000000000..f45ed0d0cf --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.inventoryItem.update("iitem_123", { + sku: "SHIRT" +}) +.then(({ inventory_item }) => { + console.log(inventory_item) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/get.js new file mode 100644 index 0000000000..f2d6cb7036 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.inventoryItem.listLevels("iitem_123") +.then(({ inventory_levels, count, limit, offset }) => { + console.log(inventory_levels) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_batch/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_batch/post.js new file mode 100644 index 0000000000..2607be3de9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_batch/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.inventoryItem.batchInventoryItemLocationLevels("iitem_123", { + create: [{ + location_id: "sloc_123", + stocked_quantity: 10 + }], + delete: ["ilvl_123"] +}) +.then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/delete.js new file mode 100644 index 0000000000..a36fd29ddf --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.inventoryItem.deleteLevel( + "iitem_123", + "sloc_123", +) +.then(({ deleted, parent: inventoryItem }) => { + console.log(deleted, inventoryItem) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/post.js new file mode 100644 index 0000000000..002df58087 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.inventoryItem.updateLevel( + "iitem_123", + "sloc_123", + { + stocked_quantity: 10 + } +) +.then(({ inventory_item }) => { + console.log(inventory_item) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites/get.js new file mode 100644 index 0000000000..76d6ae1d12 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.invite.list() +.then(({ invites, count, limit, offset }) => { + console.log(invites) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites/post.js new file mode 100644 index 0000000000..e824b713aa --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.invite.create({ + email: "user@gmail.com", +}) +.then(({ invite }) => { + console.log(invite) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_accept/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_accept/post.js new file mode 100644 index 0000000000..5ea222d3e8 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_accept/post.js @@ -0,0 +1,24 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +await sdk.auth.register("user", "emailpass", { + email: "user@gmail.com", + password: "supersecret" +}) + +// all subsequent requests will use the token in the header +const { user } = await sdk.admin.invite.accept( + { + email: "user@gmail.com", + first_name: "John", + last_name: "Smith", + invite_token: "12345..." + }, +) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}/delete.js new file mode 100644 index 0000000000..6f876bf1d2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.invite.delete("invite_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}/get.js new file mode 100644 index 0000000000..a1ce195665 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.invite.retrieve("invite_123") +.then(({ invite }) => { + console.log(invite) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}_resend/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}_resend/post.js new file mode 100644 index 0000000000..58f49935cf --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_invites_{id}_resend/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.invite.resend("invite_123") +.then(({ invite }) => { + console.log(invite) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_notifications/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_notifications/get.js new file mode 100644 index 0000000000..7c2882f05d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_notifications/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.notification.list() +.then(({ notifications, count, limit, offset }) => { + console.log(notifications) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_notifications_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_notifications_{id}/get.js new file mode 100644 index 0000000000..bb7fd70add --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_notifications_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.notification.retrieve("notif_123") +.then(({ notification }) => { + console.log(notification) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits/post.js new file mode 100644 index 0000000000..6798001983 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.orderEdit.initiateRequest({ + order_id: "order_123" +}) +.then(({ order_change }) => { + console.log(order_change) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}/delete.js new file mode 100644 index 0000000000..310cd09478 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.orderEdit.cancelRequest("ordch_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_confirm/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_confirm/post.js new file mode 100644 index 0000000000..a6623b55b3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_confirm/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.orderEdit.confirm("ordch_123") +.then(({ order_preview }) => { + console.log(order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items/post.js new file mode 100644 index 0000000000..7dc3d865ff --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items/post.js @@ -0,0 +1,21 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.orderEdit.addItems("ordch_123", { + items: [ + { + variant_id: "variant_123", + quantity: 1 + } + ] +}) +.then(({ order_preview }) => { + console.log(order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_item_{item_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_item_{item_id}/post.js new file mode 100644 index 0000000000..1eeb57d3c0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_item_{item_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.orderEdit.updateOriginalItem( + "ordch_123", + "orli_123", + { + quantity: 1 + } +) +.then(({ order_preview }) => { + console.log(order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{action_id}/delete.js new file mode 100644 index 0000000000..e0749afb95 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{action_id}/delete.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.orderEdit.removeAddedItem( + "ordch_123", + "orli_123", +) +.then(({ order_preview }) => { + console.log(order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{action_id}/post.js new file mode 100644 index 0000000000..b15a3142e4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_items_{action_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.orderEdit.updateAddedItem( + "ordch_123", + "orli_123", + { + quantity: 1 + } +) +.then(({ order_preview }) => { + console.log(order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_request/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_request/post.js new file mode 100644 index 0000000000..9e5ff5ccbe --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_order-edits_{id}_request/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.orderEdit.request("ordch_123") +.then(({ order_preview }) => { + console.log(order_preview) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders/get.js new file mode 100644 index 0000000000..82f4023158 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.list() +.then(({ orders, count, limit, offset }) => { + console.log(orders) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}/get.js new file mode 100644 index 0000000000..01a3ea5347 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.retrieve("order_123") +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}/post.js new file mode 100644 index 0000000000..a8fe4e4d6b --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}/post.js @@ -0,0 +1,24 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.update( + "order_123", + { + email: "new_email@example.com", + shipping_address: { + first_name: "John", + last_name: "Doe", + address_1: "123 Main St", + } + } +) +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_cancel/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_cancel/post.js new file mode 100644 index 0000000000..6825b5715d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_cancel/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.cancel("order_123") +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_changes/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_changes/get.js new file mode 100644 index 0000000000..604745e4ee --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_changes/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.listChanges("order_123") +.then(({ order_changes }) => { + console.log(order_changes) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_credit-lines/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_credit-lines/post.js new file mode 100644 index 0000000000..e959dd4b8e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_credit-lines/post.js @@ -0,0 +1,21 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.createCreditLine( + "order_123", + { + amount: 100, + reference: "order", + reference_id: "order_123", + } +) +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments/post.js new file mode 100644 index 0000000000..bc98e3f500 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments/post.js @@ -0,0 +1,21 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.createFulfillment("order_123", { + items: [ + { + id: "orli_123", + quantity: 1 + } + ] +}) +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js new file mode 100644 index 0000000000..d238878d53 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.cancelFulfillment( + "order_123", + "ful_123", + { + no_notification: false + } +) +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_mark-as-delivered/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_mark-as-delivered/post.js new file mode 100644 index 0000000000..826d6f116f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_mark-as-delivered/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.markAsDelivered( + "order_123", + "ful_123", +) +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments/post.js new file mode 100644 index 0000000000..48f2be3aa9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments/post.js @@ -0,0 +1,25 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.createShipment( + "order_123", + "ful_123", + { + items: [ + { + id: "fulit_123", + quantity: 1 + } + ] + } +) +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_line-items/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_line-items/get.js new file mode 100644 index 0000000000..61cfb67808 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_line-items/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.listLineItems("order_123") +.then(({ order_items }) => { + console.log(order_items) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_preview/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_preview/get.js new file mode 100644 index 0000000000..63e9fb16a1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_preview/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.retrievePreview("order_123") +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_transfer/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_transfer/post.js new file mode 100644 index 0000000000..cd529b4cb6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_transfer/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.requestTransfer("order_123", { + customer_id: "cus_123", + internal_note: "Internal note", +}) +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_transfer_cancel/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_transfer_cancel/post.js new file mode 100644 index 0000000000..32e00477fa --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_transfer_cancel/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.order.cancelTransfer("order_123") +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections/post.js new file mode 100644 index 0000000000..bd5f9557a4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.paymentCollection.create({ + order_id: "order_123" +}) +.then(({ payment_collection }) => { + console.log(payment_collection) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections_{id}/delete.js new file mode 100644 index 0000000000..62c58b72f0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.paymentCollection.delete("paycol_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections_{id}_mark-as-paid/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections_{id}_mark-as-paid/post.js new file mode 100644 index 0000000000..b54a0b76a7 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payment-collections_{id}_mark-as-paid/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.paymentCollection.markAsPaid("paycol_123", { + order_id: "order_123" +}) +.then(({ payment_collection }) => { + console.log(payment_collection) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments/get.js new file mode 100644 index 0000000000..5fa5662a1f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.payment.list() +.then(({ payments, count, limit, offset }) => { + console.log(payments) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_payment-providers/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_payment-providers/get.js new file mode 100644 index 0000000000..901995c9c3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_payment-providers/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.payment.listPaymentProviders() +.then(({ payment_providers, count, limit, offset }) => { + console.log(payment_providers) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}/get.js new file mode 100644 index 0000000000..bb2106261c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.payment.retrieve("pay_123") +.then(({ payment }) => { + console.log(payment) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}_capture/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}_capture/post.js new file mode 100644 index 0000000000..f3b94cdc07 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}_capture/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.payment.capture("paycol_123", {}) +.then(({ payment }) => { + console.log(payment) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}_refund/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}_refund/post.js new file mode 100644 index 0000000000..fac9a2c48e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_payments_{id}_refund/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.payment.refund("paycol_123", {}) +.then(({ payment }) => { + console.log(payment) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_plugins/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_plugins/get.js new file mode 100644 index 0000000000..b112c03652 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_plugins/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.plugin.list() +.then(({ plugins }) => { + console.log(plugins) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists/get.js new file mode 100644 index 0000000000..6fbaf19831 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.priceList.list() +.then(({ price_lists, count, limit, offset }) => { + console.log(price_lists) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists/post.js new file mode 100644 index 0000000000..1f997e1eec --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists/post.js @@ -0,0 +1,28 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.priceList.create({ + title: "My Price List", + status: "active", + type: "sale", + prices: [ + { + variant_id: "variant_123", + amount: 10, + currency_code: "usd", + rules: { + region_id: "reg_123" + } + } + ] +}) +.then(({ price_list }) => { + console.log(price_list) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/delete.js new file mode 100644 index 0000000000..5217e0cac1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.priceList.delete("plist_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/get.js new file mode 100644 index 0000000000..88608a12db --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.priceList.retrieve("plist_123") +.then(({ price_list }) => { + console.log(price_list) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/post.js new file mode 100644 index 0000000000..157a60408d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.priceList.update("plist_123", { + title: "My Price List", +}) +.then(({ price_list }) => { + console.log(price_list) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_prices_batch/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_prices_batch/post.js new file mode 100644 index 0000000000..4ee18fd2b8 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_prices_batch/post.js @@ -0,0 +1,29 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.priceList.batchPrices("plist_123", { + create: [{ + variant_id: "variant_123", + currency_code: "usd", + amount: 10, + rules: { + region_id: "reg_123" + } + }], + update: [{ + id: "price_123", + variant_id: "variant_123", + amount: 20, + }], + delete: ["price_123"] +}) +.then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_products/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_products/post.js new file mode 100644 index 0000000000..0195f84ca1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-lists_{id}_products/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.priceList.linkProducts("plist_123", { + remove: ["prod_123"] +}) +.then(({ price_list }) => { + console.log(price_list) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences/get.js new file mode 100644 index 0000000000..23d5da731f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.pricePreference.list() +.then(({ price_preferences, count, limit, offset }) => { + console.log(price_preferences) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences/post.js new file mode 100644 index 0000000000..0acb570e52 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences/post.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.pricePreference.create({ + attribute: "region_id", + value: "region_123", + is_tax_inclusive: true +}) +.then(({ price_preference }) => { + console.log(price_preference) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/delete.js new file mode 100644 index 0000000000..a068df6e43 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.pricePreference.delete("prpref_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/get.js new file mode 100644 index 0000000000..1f87d3f1ac --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.pricePreference.retrieve("prpref_123") +.then(({ price_preference }) => { + console.log(price_preference) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/post.js new file mode 100644 index 0000000000..580f753c08 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_price-preferences_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.pricePreference.update("prpref_123", { + is_tax_inclusive: true +}) +.then(({ price_preference }) => { + console.log(price_preference) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories/get.js new file mode 100644 index 0000000000..1fa392f2c6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCategory.list() +.then(({ product_categories, count, limit, offset }) => { + console.log(product_categories) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories/post.js new file mode 100644 index 0000000000..8508387a63 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCategory.create({ + name: "Shirts" +}) +.then(({ product_category }) => { + console.log(product_category) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/delete.js new file mode 100644 index 0000000000..afcdb20c96 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCategory.delete("pcat_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/get.js new file mode 100644 index 0000000000..13beea5fff --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCategory.retrieve("pcat_123") +.then(({ product_category }) => { + console.log(product_category) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/post.js new file mode 100644 index 0000000000..d885e5a6b6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCategory.update("pcat_123", { + name: "Shirts" +}) +.then(({ product_category }) => { + console.log(product_category) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}_products/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}_products/post.js new file mode 100644 index 0000000000..1d0453ed27 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-categories_{id}_products/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productCategory.updateProducts("pcat_123", { + add: ["prod_123"], + remove: ["prod_321"] +}) +.then(({ product_category }) => { + console.log(product_category) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags/get.js new file mode 100644 index 0000000000..647261d30b --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productTag.list() +.then(({ product_tags, count, limit, offset }) => { + console.log(product_tags) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags/post.js new file mode 100644 index 0000000000..8e7e072372 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productTag.create({ + value: "shirt" +}) +.then(({ product_tag }) => { + console.log(product_tag) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/delete.js new file mode 100644 index 0000000000..7bb854a342 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productTag.delete("ptag_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/get.js new file mode 100644 index 0000000000..fce31952f0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productTag.retrieve("ptag_123") +.then(({ product_tag }) => { + console.log(product_tag) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/post.js new file mode 100644 index 0000000000..3506efb0b3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-tags_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productTag.update("ptag_123", { + value: "shirt" +}) +.then(({ product_tag }) => { + console.log(product_tag) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types/get.js new file mode 100644 index 0000000000..ab689c5902 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productType.list() +.then(({ product_types, count, limit, offset }) => { + console.log(product_types) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types/post.js new file mode 100644 index 0000000000..62fd0bcf08 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productType.create({ + value: "Clothes" +}) +.then(({ product_type }) => { + console.log(product_type) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/delete.js new file mode 100644 index 0000000000..75b169c69d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productType.delete("ptyp_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/get.js new file mode 100644 index 0000000000..f283e4973f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productType.retrieve("ptyp_123") +.then(({ product_type }) => { + console.log(product_type) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/post.js new file mode 100644 index 0000000000..b561fc7d2e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-types_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productType.update("ptyp_123", { + value: "Clothes" +}) +.then(({ product_type }) => { + console.log(product_type) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-variants/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-variants/get.js new file mode 100644 index 0000000000..19ac3a80d5 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_product-variants/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.productVariant.list() +.then(({ variants, count, limit, offset }) => { + console.log(variants) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products/get.js new file mode 100644 index 0000000000..0c3dcb7fd0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.list() +.then(({ products, count, limit, offset }) => { + console.log(products) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products/post.js new file mode 100644 index 0000000000..70e8ceeae1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products/post.js @@ -0,0 +1,30 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.create({ + title: "Shirt", + options: [{ + title: "Default", + values: ["Default Option"] + }], + variants: [ + { + title: "Default", + options: { + Default: "Default Option" + }, + prices: [] + } + ], + shipping_profile_id: "sp_123" +}) +.then(({ product }) => { + console.log(product) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_batch/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_batch/post.js new file mode 100644 index 0000000000..1e841a1d38 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_batch/post.js @@ -0,0 +1,38 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.batch({ + create: [ + { + title: "Shirt", + options: [{ + title: "Default", + values: ["Default Option"] + }], + variants: [ + { + title: "Default", + options: { + Default: "Default Option" + }, + prices: [] + } + ] + } + ], + update: [{ + id: "prod_123", + title: "Pants" + }], + delete: ["prod_321"] +}) +.then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_export/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_export/post.js new file mode 100644 index 0000000000..aa8d64ca3b --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_export/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.export({}) +.then(({ transaction_id }) => { + console.log(transaction_id) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_import/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_import/post.js new file mode 100644 index 0000000000..96452f7ceb --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_import/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.import({ + file // uploaded File instance +}) +.then(({ transaction_id }) => { + console.log(transaction_id) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_import_{transaction_id}_confirm/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_import_{transaction_id}_confirm/post.js new file mode 100644 index 0000000000..a6f3118760 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_import_{transaction_id}_confirm/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.confirmImport("transaction_123") +.then(() => { + console.log("Import confirmed") +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/delete.js new file mode 100644 index 0000000000..ca1c5824e3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.delete("prod_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/get.js new file mode 100644 index 0000000000..8240f9c3d6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.retrieve("prod_123") +.then(({ product }) => { + console.log(product) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/post.js new file mode 100644 index 0000000000..7d078ccba2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.update("prod_123", { + title: "Shirt", +}) +.then(({ product }) => { + console.log(product) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options/get.js new file mode 100644 index 0000000000..d587354712 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.listOptions("prod_123") +.then(({ product_options, count, limit, offset }) => { + console.log(product_options) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options/post.js new file mode 100644 index 0000000000..4d470b36d8 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.createOption( + "prod_123", + { + title: "Color", + values: ["Green", "Blue"] + } +) +.then(({ product }) => { + console.log(product) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/delete.js new file mode 100644 index 0000000000..9e1ec2aad6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.deleteOption("prod_123", "prodopt_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/get.js new file mode 100644 index 0000000000..364f2bd9a0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/get.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.retrieveOption( + "prod_123", + "prodopt_123" +) +.then(({ product_option }) => { + console.log(product_option) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/post.js new file mode 100644 index 0000000000..297d141eb1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_options_{option_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.updateOption( + "prod_123", + "prodopt_123", + { + title: "Color" + } +) +.then(({ product }) => { + console.log(product) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants/get.js new file mode 100644 index 0000000000..62d0758e38 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.listVariants("prod_123") +.then(({ variants, count, limit, offset }) => { + console.log(variants) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants/post.js new file mode 100644 index 0000000000..f2adf16109 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants/post.js @@ -0,0 +1,25 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.createVariant("prod_123", { + title: "Blue Shirt", + options: { + Color: "Blue" + }, + prices: [ + { + amount: 10, + currency_code: "usd" + } + ] +}) +.then(({ product }) => { + console.log(product) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_batch/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_batch/post.js new file mode 100644 index 0000000000..d6b1c69f65 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_batch/post.js @@ -0,0 +1,31 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.batchVariants("prod_123", { + create: [ + { + title: "Blue Shirt", + options: { + Color: "Blue" + }, + prices: [] + } + ], + update: [ + { + id: "variant_123", + title: "Pants" + } + ], + delete: ["variant_123"] +}) +.then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_inventory-items_batch/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_inventory-items_batch/post.js new file mode 100644 index 0000000000..aba2bfa878 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_inventory-items_batch/post.js @@ -0,0 +1,38 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.batchVariantInventoryItems( + "prod_123", + { + create: [ + { + inventory_item_id: "iitem_123", + variant_id: "variant_123", + required_quantity: 10 + } + ], + update: [ + { + inventory_item_id: "iitem_1234", + variant_id: "variant_1234", + required_quantity: 20 + } + ], + delete: [ + { + inventory_item_id: "iitem_321", + variant_id: "variant_321" + } + ] + } +) +.then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/delete.js new file mode 100644 index 0000000000..90166a0c37 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.deleteVariant("prod_123", "variant_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/get.js new file mode 100644 index 0000000000..e73b04a4d4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/get.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.retrieveVariant( + "prod_123", + "variant_123" +) +.then(({ variant }) => { + console.log(variant) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/post.js new file mode 100644 index 0000000000..8672481c6f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.product.updateVariant( + "prod_123", + "variant_123", + { + title: "Blue Shirt", + } +) +.then(({ product }) => { + console.log(product) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/get.js new file mode 100644 index 0000000000..927dd6e075 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.promotion.list() +.then(({ promotions, count, limit, offset }) => { + console.log(promotions) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/post.js new file mode 100644 index 0000000000..d930063c5b --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.promotion.create({ + name: "My Promotion", + description: "This is a test promotion", + code: "PROMO123", + starts_at: "2021-01-01", + ends_at: "2021-01-01", +}) +.then(({ promotion }) => { + console.log(promotion) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_rule-attribute-options_{rule_type}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_rule-attribute-options_{rule_type}/get.js new file mode 100644 index 0000000000..1fe9acb944 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_rule-attribute-options_{rule_type}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.promotion.listRuleAttributes("rules", "standard") +.then(({ attributes }) => { + console.log(attributes) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}/get.js new file mode 100644 index 0000000000..79b1920622 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.promotion.listRuleValues("rules", "attr_123") +.then(({ values }) => { + console.log(values) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/delete.js new file mode 100644 index 0000000000..8f04b8d30c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.promotion.delete("promo_123") +.then(({ promotion }) => { + console.log(promotion) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/get.js new file mode 100644 index 0000000000..f18035141a --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.promotion.retrieve("promo_123") +.then(({ promotion }) => { + console.log(promotion) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/post.js new file mode 100644 index 0000000000..d3a82e1cc5 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.promotion.update("promo_123", { + code: "PROMO123", +}) +.then(({ promotion }) => { + console.log(promotion) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}_{rule_type}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}_{rule_type}/get.js new file mode 100644 index 0000000000..b726d7fa05 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions_{id}_{rule_type}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.promotion.listRules("promo_123", "rules") +.then(({ rules }) => { + console.log(rules) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons/get.js new file mode 100644 index 0000000000..86660c77fb --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.refundReason.list() +.then(({ refund_reasons, count, limit, offset }) => { + console.log(refund_reasons) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions/get.js new file mode 100644 index 0000000000..be831f14ea --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.region.list() +.then(({ regions, count, limit, offset }) => { + console.log(regions) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions/post.js new file mode 100644 index 0000000000..49bf93aebd --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.region.create({ + name: "United States", + currency_code: "usd", +}) +.then(({ region }) => { + console.log(region) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/delete.js new file mode 100644 index 0000000000..bbdfd81839 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.region.delete("region_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/get.js new file mode 100644 index 0000000000..d96a681328 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.region.retrieve("region_123") +.then(({ region }) => { + console.log(region) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/post.js new file mode 100644 index 0000000000..6752508842 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_regions_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.region.update("region_123", { + name: "United States", +}) +.then(({ region }) => { + console.log(region) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations/get.js new file mode 100644 index 0000000000..58f83dfb4d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.reservation.list() +.then(({ reservations, count, limit, offset }) => { + console.log(reservations) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations/post.js new file mode 100644 index 0000000000..1f02cb79e2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations/post.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.reservation.create({ + inventory_item_id: "iitem_123", + location_id: "sloc_123", + quantity: 10, +}) +.then(({ reservation }) => { + console.log(reservation) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/delete.js new file mode 100644 index 0000000000..89cc6ddde5 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.reservation.delete("res_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/get.js new file mode 100644 index 0000000000..8c43f7019f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.reservation.retrieve("res_123") +.then(({ reservation }) => { + console.log(reservation) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/post.js new file mode 100644 index 0000000000..ea979d74dd --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_reservations_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.reservation.update("res_123", { + quantity: 20, +}) +.then(({ reservation }) => { + console.log(reservation) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons/get.js new file mode 100644 index 0000000000..9334b86d4e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.returnReason.list() +.then(({ return_reasons, count, limit, offset }) => { + console.log(return_reasons) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons/post.js new file mode 100644 index 0000000000..1cabb884dd --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.returnReason.create({ + value: "refund", + label: "Refund", +}) +.then(({ return_reason }) => { + console.log(return_reason) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/delete.js new file mode 100644 index 0000000000..331bae3239 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.returnReason.delete("ret_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/get.js new file mode 100644 index 0000000000..a577552de2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.returnReason.retrieve("ret_123") +.then(({ return_reason }) => { + console.log(return_reason) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/post.js new file mode 100644 index 0000000000..80dcf95b4f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_return-reasons_{id}/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.returnReason.update("ret_123", { + value: "refund", + label: "Refund", +}) +.then(({ return_reason }) => { + console.log(return_reason) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns/get.js new file mode 100644 index 0000000000..17d7d1c605 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.list() +.then(({ returns, count, limit, offset }) => { + console.log(returns) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns/post.js new file mode 100644 index 0000000000..d5bf5878c7 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.initiateRequest({ + order_id: "order_123", +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}/get.js new file mode 100644 index 0000000000..601de77165 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.retrieve("return_123") +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}/post.js new file mode 100644 index 0000000000..e962237eee --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.updateRequest("return_123", { + location_id: "sloc_123", +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_cancel/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_cancel/post.js new file mode 100644 index 0000000000..960623a225 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_cancel/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.cancel("return_123") +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items/post.js new file mode 100644 index 0000000000..55f067a550 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items/post.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.dismissItems("return_123", { + items: [ + { id: "orli_123", quantity: 1 }, + ], +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items_{action_id}/delete.js new file mode 100644 index 0000000000..d3f525b451 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items_{action_id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.removeDismissItem("return_123", "orchach_123") +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items_{action_id}/post.js new file mode 100644 index 0000000000..b802536b8c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_dismiss-items_{action_id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.updateDismissItem("return_123", "orchach_123", { + quantity: 2, +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items/post.js new file mode 100644 index 0000000000..f146ee26d9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items/post.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.receiveItems("return_123", { + items: [ + { id: "item_123", quantity: 1 }, + ], +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items_{action_id}/delete.js new file mode 100644 index 0000000000..90567df408 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items_{action_id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.removeReceiveItem("return_123", "orchach_123") +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items_{action_id}/post.js new file mode 100644 index 0000000000..cdea1dcd7e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive-items_{action_id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.updateReceiveItem("return_123", "orchach_123", { + quantity: 2, +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive/delete.js new file mode 100644 index 0000000000..d303ede7e5 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.cancelReceive("return_123") +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive/post.js new file mode 100644 index 0000000000..da0429529e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.initiateReceive("return_123", { + internal_note: "Return received by the customer", +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive_confirm/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive_confirm/post.js new file mode 100644 index 0000000000..5b76dd6553 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_receive_confirm/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.confirmReceive("return_123", { + no_notification: true, +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items/post.js new file mode 100644 index 0000000000..6465fa7873 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.addReturnItem("return_123", { + id: "orlitem_123", + quantity: 1, +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items_{action_id}/delete.js new file mode 100644 index 0000000000..114be61d8f --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items_{action_id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.removeReturnItem("return_123", "orchach_123") +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items_{action_id}/post.js new file mode 100644 index 0000000000..2dfea6d9fe --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request-items_{action_id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.updateReturnItem("return_123", "orchach_123", { + quantity: 2, +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request/delete.js new file mode 100644 index 0000000000..3efa77037c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.cancelRequest("return_123") +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request/post.js new file mode 100644 index 0000000000..c0c1795eb0 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_request/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.confirmRequest("return_123", { + no_notification: true, +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method/post.js new file mode 100644 index 0000000000..45c19fda12 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.addReturnShipping("return_123", { + shipping_option_id: "so_123", +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method_{action_id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method_{action_id}/delete.js new file mode 100644 index 0000000000..3c8c2cc048 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method_{action_id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.deleteReturnShipping("return_123", "orchach_123") +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method_{action_id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method_{action_id}/post.js new file mode 100644 index 0000000000..900afcb032 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_returns_{id}_shipping-method_{action_id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.return.updateReturnShipping("return_123", "orchach_123", { + custom_amount: 100, +}) +.then(({ return }) => { + console.log(return) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels/get.js new file mode 100644 index 0000000000..d458da1505 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.salesChannel.list() +.then(({ sales_channels, count, limit, offset }) => { + console.log(sales_channels) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels/post.js new file mode 100644 index 0000000000..76b85fea3d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.salesChannel.create({ + name: "Storefront", +}) +.then(({ salesChannel }) => { + console.log(salesChannel) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/delete.js new file mode 100644 index 0000000000..09c75a135c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.salesChannel.delete("sc_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/get.js new file mode 100644 index 0000000000..ee5080ca99 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.salesChannel.retrieve("sc_123") +.then(({ sales_channel }) => { + console.log(sales_channel) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/post.js new file mode 100644 index 0000000000..ada3a2433e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}/post.js @@ -0,0 +1,19 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.salesChannel.update( + "sc_123", + { + name: "Storefront", + } +) +.then(({ salesChannel }) => { + console.log(salesChannel) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}_products/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}_products/post.js new file mode 100644 index 0000000000..365bb304be --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_sales-channels_{id}_products/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.salesChannel.batchProducts("sc_123", { + add: ["prod_123", "prod_456"], + remove: ["prod_789"] +}) +.then(({ sales_channel }) => { + console.log(sales_channel) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options/get.js new file mode 100644 index 0000000000..cca328b6c5 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.shippingOption.list() +.then(({ shipping_options, count, limit, offset }) => { + console.log(shipping_options) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options/post.js new file mode 100644 index 0000000000..9fbadcae11 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.shippingOption.create({ + name: "Standard Shipping", + profile_id: "shp_123", +}) +.then(({ shipping_option }) => { + console.log(shipping_option) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/delete.js new file mode 100644 index 0000000000..99cc868509 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.shippingOption.delete("so_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/get.js new file mode 100644 index 0000000000..d750675b29 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.shippingOption.retrieve("so_123") +.then(({ shipping_option }) => { + console.log(shipping_option) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/post.js new file mode 100644 index 0000000000..9ffae45803 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.shippingOption.update("so_123", { + name: "Standard Shipping", +}) +.then(({ shipping_option }) => { + console.log(shipping_option) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}_rules_batch/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}_rules_batch/post.js new file mode 100644 index 0000000000..a1370c73b2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-options_{id}_rules_batch/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.shippingOption.updateRules("so_123", { + create: [{ attribute: "enabled_in_store", operator: "eq", value: "true" }], +}) +.then(({ shipping_option }) => { + console.log(shipping_option) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles/get.js new file mode 100644 index 0000000000..11b9cb1147 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.shippingProfile.list() +.then(({ shipping_profiles, count, limit, offset }) => { + console.log(shipping_profiles) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles/post.js new file mode 100644 index 0000000000..0744157275 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.shippingProfile.create({ + name: "Default Shipping Profile", +}) +.then(({ shipping_profile }) => { + console.log(shipping_profile) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/delete.js new file mode 100644 index 0000000000..cb5d6d9e18 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.shippingProfile.delete("sp_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/get.js new file mode 100644 index 0000000000..85ec2a69ff --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.shippingProfile.retrieve("sp_123") +.then(({ shipping_profile }) => { + console.log(shipping_profile) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/post.js new file mode 100644 index 0000000000..363d6ccade --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-profiles_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.shippingProfile.update("sp_123", { + name: "Updated Shipping Profile", +}) +.then(({ shipping_profile }) => { + console.log(shipping_profile) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations/get.js new file mode 100644 index 0000000000..885227510c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.stockLocation.list() +.then(({ stock_locations, count, limit, offset }) => { + console.log(stock_locations) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations/post.js new file mode 100644 index 0000000000..233dde90a3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.stockLocation.create({ + name: "Main Warehouse", + address_id: "addr_123", +}) +.then(({ stock_location }) => { + console.log(stock_location) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/delete.js new file mode 100644 index 0000000000..28f3d5d351 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.stockLocation.delete("sloc_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/get.js new file mode 100644 index 0000000000..1d947a48bf --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.stockLocation.retrieve("sloc_123") +.then(({ stock_location }) => { + console.log(stock_location) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/post.js new file mode 100644 index 0000000000..53fb87d7a5 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.stockLocation.update("sloc_123", { + name: "European Warehouse", +}) +.then(({ stock_location }) => { + console.log(stock_location) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_fulfillment-providers/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_fulfillment-providers/post.js new file mode 100644 index 0000000000..631596c2fd --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_fulfillment-providers/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.stockLocation.updateFulfillmentProviders("sloc_123", { + add: ["fp_manual_manual"], + remove: ["fp_shipstation_shipstation"], +}) +.then(({ stock_location }) => { + console.log(stock_location) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_fulfillment-sets/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_fulfillment-sets/post.js new file mode 100644 index 0000000000..1d40cd3fa2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_fulfillment-sets/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.stockLocation.createFulfillmentSet("sloc_123", { + name: "Shipping", + type: "shipping", +}) +.then(({ stock_location }) => { + console.log(stock_location) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_sales-channels/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_sales-channels/post.js new file mode 100644 index 0000000000..feeb8b618c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stock-locations_{id}_sales-channels/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.stockLocation.updateSalesChannels("sloc_123", { + add: ["sc_123"], + remove: ["sc_456"], +}) +.then(({ stock_location }) => { + console.log(stock_location) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores/get.js new file mode 100644 index 0000000000..71e104999e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.store.list() +.then(({ stores, count, limit, offset }) => { + console.log(stores) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores_{id}/get.js new file mode 100644 index 0000000000..75b5997384 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.store.retrieve("store_123") +.then(({ store }) => { + console.log(store) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores_{id}/post.js new file mode 100644 index 0000000000..5435ca72d3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_stores_{id}/post.js @@ -0,0 +1,16 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.store.update("store_123", { + name: "My Store", +}) +.then(({ store }) => { + console.log(store) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates/get.js new file mode 100644 index 0000000000..0dff44ae37 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.taxRate.list() +.then(({ tax_rates, count, limit, offset }) => { + console.log(tax_rates) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates/post.js new file mode 100644 index 0000000000..11e2c15504 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates/post.js @@ -0,0 +1,19 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.taxRate.create({ + name: "VAT", + tax_region_id: "txreg_123", + code: "VAT", + rate: 2, // 2% +}) +.then(({ tax_rate }) => { + console.log(tax_rate) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/delete.js new file mode 100644 index 0000000000..43bc78cb17 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.taxRate.delete("txrat_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/get.js new file mode 100644 index 0000000000..5b905230a7 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.taxRate.retrieve("txrat_123") +.then(({ tax_rate }) => { + console.log(tax_rate) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/post.js new file mode 100644 index 0000000000..a2be144c23 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-rates_{id}/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.taxRate.update("txrat_123", { + name: "VAT", + code: "VAT", +}) +.then(({ tax_rate }) => { + console.log(tax_rate) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions/get.js new file mode 100644 index 0000000000..b471cbdc7b --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.taxRegion.list() +.then(({ tax_regions, count, limit, offset }) => { + console.log(tax_regions) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions/post.js new file mode 100644 index 0000000000..1ff27001a9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions/post.js @@ -0,0 +1,23 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.taxRegion.create({ + country_code: "us", + province_code: "ca", + default_tax_rate: { + code: "VAT", + name: "VAT", + rate: 20, // 20% + is_combinable: true, + }, +}) +.then(({ tax_region }) => { + console.log(tax_region) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions_{id}/delete.js new file mode 100644 index 0000000000..19aaf7541d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.taxRegion.delete("txreg_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions_{id}/get.js new file mode 100644 index 0000000000..8aafb6dff4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_tax-regions_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.taxRegion.retrieve("txreg_123") +.then(({ tax_region }) => { + console.log(tax_region) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads/post.js new file mode 100644 index 0000000000..93b9431e40 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads/post.js @@ -0,0 +1,26 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.upload.create( + { + files: [ + // file uploaded as a base64 string + { + name: "test.txt", + content: "test", // Should be the base64 content of the file + }, + // file uploaded as a File object + new File(["test"], "test.txt", { type: "text/plain" }) + ], + } +) +.then(({ files }) => { + console.log(files) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads_{id}/delete.js new file mode 100644 index 0000000000..9581225578 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.upload.delete("test.txt") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads_{id}/get.js new file mode 100644 index 0000000000..eb4c029cb1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_uploads_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.upload.retrieve("test.txt") +.then(({ file }) => { + console.log(file) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users/get.js new file mode 100644 index 0000000000..0067ff6125 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.user.list() +.then(({ users, count, limit, offset }) => { + console.log(users) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_me/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_me/get.js new file mode 100644 index 0000000000..c10a034c39 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_me/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.user.me() +.then(({ user }) => { + console.log(user) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/delete.js new file mode 100644 index 0000000000..79f3a8522a --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.user.delete("user_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/get.js new file mode 100644 index 0000000000..141089059e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.user.retrieve("user_123") +.then(({ user }) => { + console.log(user) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/post.js new file mode 100644 index 0000000000..c683100b7b --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_users_{id}/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.user.update("user_123", { + first_name: "John", + last_name: "Doe", +}) +.then(({ user }) => { + console.log(user) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_workflows-executions/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_workflows-executions/get.js new file mode 100644 index 0000000000..89bcf29cc6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_workflows-executions/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.workflowExecution.list() +.then(({ workflow_executions, count, limit, offset }) => { + console.log(workflow_executions) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_workflows-executions_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_workflows-executions_{id}/get.js new file mode 100644 index 0000000000..691570884b --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_workflows-executions_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.workflowExecution.retrieve("wrk_123") +.then(({ workflow_execution }) => { + console.log(workflow_execution) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_session/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_session/delete.js new file mode 100644 index 0000000000..8eff465e53 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_session/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +await sdk.auth.logout() + +// user is now logged out +// you can't send any requests that require authentication \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_token_refresh/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_token_refresh/post.js new file mode 100644 index 0000000000..2879061771 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_token_refresh/post.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +const token = await sdk.auth.refresh() + +// all subsequent requests will use the token in the header +const { user } = await sdk.admin.user.me() \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}/post.js new file mode 100644 index 0000000000..dcdaee3189 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}/post.js @@ -0,0 +1,29 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +const result = await sdk.auth.login( + "user", + "emailpass", + { + email: "user@gmail.com", + password: "supersecret" + } +) + +if (typeof result !== "string") { + alert("Authentication requires additional steps") + // replace with the redirect logic of your application + window.location.href = result.location + return +} + +// user is now authenticated +// all subsequent requests will use the token in the header +const { user } = await sdk.admin.user.me() \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_callback/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_callback/post.js new file mode 100644 index 0000000000..c216efc565 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_callback/post.js @@ -0,0 +1,31 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +await sdk.auth.callback( + "user", + "google", + { + code: "123", + state: "456" + } +) + +// all subsequent requests will use the token in the header +sdk.admin.invite.accept( + { + email: "user@gmail.com", + first_name: "John", + last_name: "Smith", + invite_token: "12345..." + }, +) +.then(({ user }) => { + console.log(user) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_register/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_register/post.js new file mode 100644 index 0000000000..590ff439cd --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_register/post.js @@ -0,0 +1,24 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +const token = await sdk.auth.register("user", "emailpass", { + email: "user@gmail.com", + password: "supersecret" +}) + +// all subsequent requests will use the token in the header +const { user } = await sdk.admin.invite.accept( + { + email: "user@gmail.com", + first_name: "John", + last_name: "Smith", + invite_token: "12345..." + }, +) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_reset-password/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_reset-password/post.js new file mode 100644 index 0000000000..52972ab446 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_reset-password/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.auth.resetPassword( + "user", + "emailpass", + { + identifier: "user@gmail.com" + } +) +.then(() => { + // user receives token +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_update/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_update/post.js new file mode 100644 index 0000000000..0f55ed3208 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/auth_user_{auth_provider}_update/post.js @@ -0,0 +1,21 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.auth.updateProvider( + "user", + "emailpass", + { + password: "supersecret" + }, + token +) +.then(() => { + // password updated +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_convert-to-order/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_convert-to-order/post.sh new file mode 100644 index 0000000000..9dd1056bc4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_convert-to-order/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/admin/draft-orders/{id}/convert-to-order' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit/delete.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit/delete.sh new file mode 100644 index 0000000000..5c3ebcbd94 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit/delete.sh @@ -0,0 +1,2 @@ +curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit/post.sh new file mode 100644 index 0000000000..0d7a5c7584 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/admin/draft-orders/{id}/edit' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_confirm/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_confirm/post.sh new file mode 100644 index 0000000000..85c48b1478 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_confirm/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/confirm' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items/post.sh new file mode 100644 index 0000000000..d7b2859bc2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/items' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_item_{item_id}/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_item_{item_id}/post.sh new file mode 100644 index 0000000000..85776c66a7 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_item_{item_id}/post.sh @@ -0,0 +1,6 @@ +curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/items/item/{item_id}' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "quantity": 0 +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_{action_id}/delete.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_{action_id}/delete.sh new file mode 100644 index 0000000000..fc2e22326b --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_{action_id}/delete.sh @@ -0,0 +1,2 @@ +curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit/items/{action_id}' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_{action_id}/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_{action_id}/post.sh new file mode 100644 index 0000000000..163a8b97d6 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_items_{action_id}/post.sh @@ -0,0 +1,6 @@ +curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/items/{action_id}' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "quantity": 39 +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_promotions/delete.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_promotions/delete.sh new file mode 100644 index 0000000000..373b212a87 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_promotions/delete.sh @@ -0,0 +1,2 @@ +curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit/promotions' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_promotions/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_promotions/post.sh new file mode 100644 index 0000000000..729451594d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_promotions/post.sh @@ -0,0 +1,8 @@ +curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/promotions' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "promo_codes": [ + "{value}" + ] +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_request/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_request/post.sh new file mode 100644 index 0000000000..541d819d0c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_request/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/request' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods/post.sh new file mode 100644 index 0000000000..901f5cd3a2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods/post.sh @@ -0,0 +1,6 @@ +curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "shipping_option_id": "{value}" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}/post.sh new file mode 100644 index 0000000000..a33986482c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods/method/{method_id}' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/delete.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/delete.sh new file mode 100644 index 0000000000..7dc2cc1a6e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/delete.sh @@ -0,0 +1,2 @@ +curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods/{action_id}' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/post.sh new file mode 100644 index 0000000000..8a266d20ef --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/post.sh @@ -0,0 +1,6 @@ +curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods/{action_id}' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "shipping_option_id": "{value}" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_credit-lines/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_credit-lines/post.sh new file mode 100644 index 0000000000..91be304c3e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_credit-lines/post.sh @@ -0,0 +1,8 @@ +curl -X POST '{backend_url}/admin/orders/{id}/credit-lines' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "amount": 32, + "reference": "{value}", + "reference_id": "{value}" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_plugins/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_plugins/get.sh new file mode 100644 index 0000000000..c89f34177e --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_plugins/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/plugins' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/auth_user_{auth_provider}/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/auth_user_{auth_provider}/post.sh deleted file mode 100644 index 684dcc3cba..0000000000 --- a/www/apps/api-reference/specs/admin/code_samples/Shell/auth_user_{auth_provider}/post.sh +++ /dev/null @@ -1,6 +0,0 @@ -curl -X POST '{backend_url}/auth/user/emailpass' \ --H 'Content-Type: application/json' \ ---data-raw '{ - "email": "admin@medusa-test.com", - "password": "supersecret" -}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/auth_user_{auth_provider}_callback/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/auth_user_{auth_provider}_callback/post.sh deleted file mode 100644 index eacb071a60..0000000000 --- a/www/apps/api-reference/specs/admin/code_samples/Shell/auth_user_{auth_provider}_callback/post.sh +++ /dev/null @@ -1 +0,0 @@ -curl -X POST '{backend_url}/auth/user/google/callback?code=123' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/TypeScript/auth_user_{auth_provider}_callback/post.ts b/www/apps/api-reference/specs/admin/code_samples/TypeScript/auth_user_{auth_provider}_callback/post.ts new file mode 100644 index 0000000000..09f7452589 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/TypeScript/auth_user_{auth_provider}_callback/post.ts @@ -0,0 +1,31 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +const authToken = await sdk.auth.callback( + "user", + "google", + { + code: "123", + state: "456" + } +) + +// all subsequent requests will use the token in the header +sdk.admin.invite.accept( + { + email: "user@gmail.com", + first_name: "John", + last_name: "Smith", + invite_token: "12345..." + }, +) +.then(({ user }) => { + console.log(user) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderItems.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderItems.yaml new file mode 100644 index 0000000000..fc172864f4 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderItems.yaml @@ -0,0 +1,44 @@ +type: object +description: The details of the items to add to a draft order. +x-schemaName: AdminAddDraftOrderItems +properties: + items: + type: array + description: The items to add to the draft order. + items: + type: object + description: The item's details + required: + - quantity + properties: + quantity: + type: number + title: quantity + description: The item's quantity. + variant_id: + type: string + title: variant_id + description: The ID of the variant to add to the draft order. + title: + type: string + title: title + description: The item's title. + unit_price: + type: number + title: unit_price + description: The item's unit price. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the item. + allow_backorder: + type: boolean + title: allow_backorder + description: Whether the item can be purchased if it's out of stock. + metadata: + type: object + description: The item's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderPromotions.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderPromotions.yaml new file mode 100644 index 0000000000..8b73ae81ca --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderPromotions.yaml @@ -0,0 +1,13 @@ +type: object +description: The details of the promotions to add to a draft order. +x-schemaName: AdminAddDraftOrderPromotions +required: + - promo_codes +properties: + promo_codes: + type: array + description: The list promotion codes to add to the draft order. + items: + type: string + title: promo_codes + description: A promotion's code. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderShippingMethod.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderShippingMethod.yaml new file mode 100644 index 0000000000..443413665e --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminAddDraftOrderShippingMethod.yaml @@ -0,0 +1,27 @@ +type: object +description: The details of the shipping method to add to a draft order. +x-schemaName: AdminAddDraftOrderShippingMethod +required: + - shipping_option_id +properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the shipping option that this method is created from. + custom_amount: + type: number + title: custom_amount + description: >- + A custom amount to be charged for this shipping method. If not provided, + the shipping option's amount will be used. + description: + type: string + title: description + description: The shipping method's description. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateOrderCreditLines.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateOrderCreditLines.yaml new file mode 100644 index 0000000000..a5d094df4d --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateOrderCreditLines.yaml @@ -0,0 +1,26 @@ +type: object +description: The details of a credit line to add to an order. +x-schemaName: AdminCreateOrderCreditLines +required: + - amount + - reference + - reference_id +properties: + amount: + type: number + title: amount + description: The amount of the credit line. + example: 100 + reference: + type: string + title: reference + description: The name of the table that the credit line is referencing. + example: order + reference_id: + type: string + title: reference_id + description: The ID of a record in the table that the credit line is referencing. + example: order_123 + metadata: + type: object + description: The credit line's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrder.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrder.yaml index 0db0d9d34e..7b02e34a88 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrder.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrder.yaml @@ -247,3 +247,10 @@ properties: type: number title: original_shipping_tax_total description: The tax total of the draft order's shipping excluding promotions. + region: + $ref: ./AdminRegion.yaml + credit_lines: + type: array + description: The draft order's credit lines. + items: + $ref: ./OrderCreditLine.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrderPreview.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrderPreview.yaml new file mode 100644 index 0000000000..76ed108602 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrderPreview.yaml @@ -0,0 +1,655 @@ +type: object +description: The draft order preview's details. +x-schemaName: AdminDraftOrderPreview +required: + - return_requested_total + - order_change + - status + - currency_code + - id + - version + - region_id + - customer_id + - sales_channel_id + - email + - payment_collections + - payment_status + - fulfillment_status + - summary + - created_at + - updated_at + - original_item_total + - original_item_subtotal + - original_item_tax_total + - item_total + - item_subtotal + - item_tax_total + - original_total + - original_subtotal + - original_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - gift_card_total + - gift_card_tax_total + - shipping_total + - shipping_subtotal + - shipping_tax_total + - original_shipping_total + - original_shipping_subtotal + - original_shipping_tax_total +properties: + return_requested_total: + type: number + title: return_requested_total + description: The total of the requested return. + order_change: + $ref: ./AdminOrderChange.yaml + items: + type: array + description: The order's items. + items: + allOf: + - type: object + description: An order's item. + x-schemaName: BaseOrderLineItem + required: + - id + - title + - subtitle + - thumbnail + - variant_id + - product_id + - product_title + - product_description + - product_subtitle + - product_type + - product_collection + - product_handle + - variant_sku + - variant_barcode + - variant_title + - variant_option_values + - requires_shipping + - is_discountable + - is_tax_inclusive + - unit_price + - quantity + - detail + - created_at + - updated_at + - metadata + - original_total + - original_subtotal + - original_tax_total + - item_total + - item_subtotal + - item_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - refundable_total + - refundable_total_per_unit + properties: + id: + type: string + title: id + description: The item's ID. + title: + type: string + title: title + description: The item's title. + subtitle: + type: string + title: subtitle + description: The item's subtitle. + thumbnail: + type: string + title: thumbnail + description: The URL of the item's thumbnail. + variant: + $ref: ./BaseProductVariant.yaml + variant_id: + type: string + title: variant_id + description: The ID of the associated variant. + product: + $ref: ./AdminProduct.yaml + product_id: + type: string + title: product_id + description: The ID of the associated product. + product_title: + type: string + title: product_title + description: The title of the item's product. + product_description: + type: string + title: product_description + description: The description of the item's product. + product_subtitle: + type: string + title: product_subtitle + description: The subtitle of the item's product. + product_type: + type: string + title: product_type + description: The ID of type of the item's product. + product_collection: + type: string + title: product_collection + description: The ID of collection of the item's product. + product_handle: + type: string + title: product_handle + description: The handle of the item's product. + variant_sku: + type: string + title: variant_sku + description: The SKU of the item's variant. + variant_barcode: + type: string + title: variant_barcode + description: The barcode of the item's variant. + variant_title: + type: string + title: variant_title + description: The title of the item's variant. + variant_option_values: + type: object + description: >- + The option values of the item's variant as key-value pairs. The + key is the title of an option, and the value is the option's + value. + requires_shipping: + type: boolean + title: requires_shipping + description: Whether the item requires shipping. + is_discountable: + type: boolean + title: is_discountable + description: Whether the item is discountable. + is_tax_inclusive: + type: boolean + title: is_tax_inclusive + description: Whether the item's price includes taxes. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + unit_price: + type: number + title: unit_price + description: The item's unit price. + quantity: + type: number + title: quantity + description: The item's quantity. + tax_lines: + type: array + description: The item's tax lines. + items: + $ref: ./BaseOrderLineItemTaxLine.yaml + adjustments: + type: array + description: The item's adjustments. + items: + $ref: ./BaseOrderLineItemAdjustment.yaml + detail: + $ref: ./BaseOrderItemDetail.yaml + created_at: + type: string + format: date-time + title: created_at + description: The date the item was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the item was updated. + metadata: + type: object + description: The item's metadata, can hold custom key-value pairs. + original_total: + type: number + title: original_total + description: The item's total including taxes, excluding promotions. + original_subtotal: + type: number + title: original_subtotal + description: The item's total excluding taxes, including promotions. + original_tax_total: + type: number + title: original_tax_total + description: The tax total of the item excluding promotions. + item_total: + type: number + title: item_total + description: >- + The item's total for a single unit including taxes and + promotions. + item_subtotal: + type: number + title: item_subtotal + description: >- + The item's total for a single unit excluding taxes, including + promotions. + item_tax_total: + type: number + title: item_tax_total + description: >- + The tax total for a single unit of the item including + promotions. + total: + type: number + title: total + description: The item's total including taxes and promotions. + subtotal: + type: number + title: subtotal + description: The item's total excluding taxes, including promotions. + tax_total: + type: number + title: tax_total + description: The tax total of the item including promotions. + discount_total: + type: number + title: discount_total + description: The total of the item's discount / promotion. + discount_tax_total: + type: number + title: discount_tax_total + description: The tax total of the item's discount / promotion + refundable_total: + type: number + title: refundable_total + description: The total refundable amount of the item's total. + refundable_total_per_unit: + type: number + title: refundable_total_per_unit + description: >- + The total refundable amount of the item's total for a single + unit. + - type: object + description: An order's item. + properties: + actions: + type: array + description: The actions applied on an item. + items: + type: object + description: The action's details. + x-schemaName: BaseOrderChangeAction + shipping_methods: + type: array + description: The order's shipping methods. + items: + allOf: + - type: object + description: The shipping method's details. + x-schemaName: BaseOrderShippingMethod + required: + - id + - order_id + - name + - amount + - is_tax_inclusive + - shipping_option_id + - data + - metadata + - original_total + - original_subtotal + - original_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - created_at + - updated_at + properties: + id: + type: string + title: id + description: The shipping method's ID. + order_id: + type: string + title: order_id + description: The ID of the order this shipping method belongs to. + name: + type: string + title: name + description: The shipping method's name. + description: + type: string + title: description + description: The shipping method's description. + amount: + type: number + title: amount + description: The shipping method's amount. + is_tax_inclusive: + type: boolean + title: is_tax_inclusive + description: Whether the shipping method's amount is tax inclusive. + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the shipping option this method was created from. + data: + type: object + description: >- + The data relevant for the fulfillment provider to process this + shipment. + externalDocs: + url: >- + https://docs.medusajs.com/v2/resources/commerce-modules/order/concepts#data-property + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. + tax_lines: + type: array + description: The shipping method's tax lines. + items: + $ref: ./BaseOrderShippingMethodTaxLine.yaml + adjustments: + type: array + description: The shipping method's adjustments. + items: + $ref: ./BaseOrderShippingMethodAdjustment.yaml + original_total: + oneOf: + - type: string + title: original_total + description: >- + The shipping method's total including taxes, excluding + promotions. + - type: number + title: original_total + description: >- + The shipping method's total including taxes, excluding + promotions. + original_subtotal: + oneOf: + - type: string + title: original_subtotal + description: >- + The shipping method's total excluding taxes, including + promotions. + - type: number + title: original_subtotal + description: >- + The shipping method's total excluding taxes, including + promotions. + original_tax_total: + oneOf: + - type: string + title: original_tax_total + description: The tax total of the shipping method excluding promotions. + - type: number + title: original_tax_total + description: The tax total of the shipping method excluding promotions. + total: + oneOf: + - type: string + title: total + description: The shipping method's total including taxes and promotions. + - type: number + title: total + description: The shipping method's total including taxes and promotions. + subtotal: + oneOf: + - type: string + title: subtotal + description: >- + The shipping method's total excluding taxes, including + promotions. + - type: number + title: subtotal + description: >- + The shipping method's total excluding taxes, including + promotions. + tax_total: + oneOf: + - type: string + title: tax_total + description: The tax total of the shipping method including promotions. + - type: number + title: tax_total + description: The tax total of the shipping method including promotions. + discount_total: + oneOf: + - type: string + title: discount_total + description: The total of the shipping method's promotion. + - type: number + title: discount_total + description: The total of the shipping method's promotion. + discount_tax_total: + oneOf: + - type: string + title: discount_tax_total + description: The tax total of the shipping method's promotion. + - type: number + title: discount_tax_total + description: The shipping method's discount tax total. + created_at: + type: string + format: date-time + title: created_at + description: The date the shipping method was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the shipping method was updated. + - type: object + description: The shipping method's details. + properties: + actions: + type: array + description: The actions applied on the shipping method. + items: + type: object + description: The action's details. + x-schemaName: BaseOrderChangeAction + currency_code: + type: string + title: currency_code + description: The order's currency code. + version: + type: number + title: version + description: The order's version when this preview is applied. + id: + type: string + title: id + description: The order's ID. + region_id: + type: string + title: region_id + description: The ID of the order's associated region. + customer_id: + type: string + title: customer_id + description: The ID of the customer that placed the order. + sales_channel_id: + type: string + title: sales_channel_id + description: The ID of the sales channel that the order was placed in. + email: + type: string + title: email + description: The email of the customer that placed the order. + format: email + display_id: + type: number + title: display_id + description: The order's display ID. + shipping_address: + $ref: ./AdminOrderAddress.yaml + billing_address: + $ref: ./AdminOrderAddress.yaml + payment_collections: + type: array + description: The order's payment collections. + items: + $ref: ./AdminPaymentCollection.yaml + payment_status: + type: string + description: The order's payment status. + enum: + - canceled + - not_paid + - awaiting + - authorized + - partially_authorized + - captured + - partially_captured + - partially_refunded + - refunded + - requires_action + fulfillments: + type: array + description: The order's fulfillments. + items: + $ref: ./AdminOrderFulfillment.yaml + fulfillment_status: + type: string + description: The order's fulfillment status. + enum: + - canceled + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_delivered + - delivered + transactions: + type: array + description: The order's transactions. + items: + $ref: ./BaseOrderTransaction.yaml + summary: + $ref: ./BaseOrderSummary.yaml + metadata: + type: object + description: The order's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the order was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the order was updated. + original_item_total: + type: number + title: original_item_total + description: The total of the order's items including taxes, excluding promotions. + original_item_subtotal: + type: number + title: original_item_subtotal + description: The total of the order's items excluding taxes, including promotions. + original_item_tax_total: + type: number + title: original_item_tax_total + description: The tax total of the order's items excluding promotions. + item_total: + type: number + title: item_total + description: The total of the order's items including taxes and promotions. + item_subtotal: + type: number + title: item_subtotal + description: The total of the order's items excluding taxes, including promotions. + item_tax_total: + type: number + title: item_tax_total + description: The tax total of the order's items including promotions. + original_total: + type: number + title: original_total + description: The order's total excluding promotions, including taxes. + original_subtotal: + type: number + title: original_subtotal + description: The order's total excluding taxes, including promotions. + original_tax_total: + type: number + title: original_tax_total + description: The order's tax total, excluding promotions. + total: + type: number + title: total + description: The order's total including taxes and promotions. + subtotal: + type: number + title: subtotal + description: The order's total excluding taxes, including promotions. + tax_total: + type: number + title: tax_total + description: The order's tax total including promotions. + discount_total: + type: number + title: discount_total + description: The order's discount or promotions total. + discount_tax_total: + type: number + title: discount_tax_total + description: The tax total of order's discount or promotion. + gift_card_total: + type: number + title: gift_card_total + description: The order's gift card total. + gift_card_tax_total: + type: number + title: gift_card_tax_total + description: The tax total of the order's gift card. + shipping_total: + type: number + title: shipping_total + description: The order's shipping total including taxes and promotions. + shipping_subtotal: + type: number + title: shipping_subtotal + description: The order's shipping total excluding taxes, including promotions. + shipping_tax_total: + type: number + title: shipping_tax_total + description: The tax total of the order's shipping. + original_shipping_total: + type: number + title: original_shipping_total + description: The order's shipping total including taxes, excluding promotions. + original_shipping_subtotal: + type: number + title: original_shipping_subtotal + description: The order's shipping total excluding taxes, including promotions. + original_shipping_tax_total: + type: number + title: original_shipping_tax_total + description: The tax total of the order's shipping excluding promotions. + customer: + $ref: ./AdminCustomer.yaml + sales_channel: + $ref: ./AdminSalesChannel.yaml + status: + type: string + title: status + description: The order's status. + region: + $ref: ./AdminRegion.yaml + credit_lines: + type: array + description: The order preview's credit lines. + items: + $ref: ./OrderCreditLine.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrderPreviewResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrderPreviewResponse.yaml new file mode 100644 index 0000000000..96792be348 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrderPreviewResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The details of the preview on the draft order. +x-schemaName: AdminDraftOrderPreviewResponse +required: + - draft_order_preview +properties: + draft_order_preview: + $ref: ./AdminDraftOrderPreview.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminOrder.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminOrder.yaml index f09a9d120e..ff5651f98a 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminOrder.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminOrder.yaml @@ -240,3 +240,10 @@ properties: type: string title: status description: The order's status. + region: + $ref: ./AdminRegion.yaml + credit_lines: + type: array + description: The order's credit lines. + items: + $ref: ./OrderCreditLine.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminOrderPreview.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminOrderPreview.yaml index 7a9ae25344..be48d39907 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminOrderPreview.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminOrderPreview.yaml @@ -648,3 +648,10 @@ properties: type: string title: status description: The order's status. + region: + $ref: ./AdminRegion.yaml + credit_lines: + type: array + description: The order preview's credit lines. + items: + $ref: ./OrderCreditLine.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminPlugin.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminPlugin.yaml new file mode 100644 index 0000000000..e08f3e29dc --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminPlugin.yaml @@ -0,0 +1,10 @@ +type: object +description: The plugin's details. +x-schemaName: AdminPlugin +required: + - name +properties: + name: + type: string + title: name + description: The plugin's name. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminPluginsListResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminPluginsListResponse.yaml new file mode 100644 index 0000000000..6d08ef7b16 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminPluginsListResponse.yaml @@ -0,0 +1,11 @@ +type: object +description: The list of plugins. +x-schemaName: AdminPluginsListResponse +required: + - plugins +properties: + plugins: + type: array + description: The list of plugins. + items: + $ref: ./AdminPlugin.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminRemoveDraftOrderPromotions.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminRemoveDraftOrderPromotions.yaml new file mode 100644 index 0000000000..770f208bbc --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminRemoveDraftOrderPromotions.yaml @@ -0,0 +1,13 @@ +type: object +description: The promotion codes to remove from the draft order. +x-schemaName: AdminRemoveDraftOrderPromotions +required: + - promo_codes +properties: + promo_codes: + type: array + description: The promotion codes to remove from the draft order. + items: + type: string + title: promo_codes + description: A promotion code to remove from the draft order. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrder.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrder.yaml index e324201489..b8a6ad7759 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrder.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrder.yaml @@ -106,3 +106,11 @@ properties: metadata: type: object description: The draft order's metadata, can hold custom key-value pairs. + customer_id: + type: string + title: customer_id + description: The ID of the customer associated with the draft order. + sales_channel_id: + type: string + title: sales_channel_id + description: The ID of the sales channel associated with the draft order. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderActionShippingMethod.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderActionShippingMethod.yaml new file mode 100644 index 0000000000..8b2d7422db --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderActionShippingMethod.yaml @@ -0,0 +1,27 @@ +type: object +description: The updates to make on a changed shipping method. +x-schemaName: AdminUpdateDraftOrderActionShippingMethod +required: + - shipping_option_id +properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the associated shipping option. + custom_amount: + type: number + title: custom_amount + description: >- + The custom amount of the shipping method. If not provided, the shipping + option's amount will be used. + description: + type: string + title: description + description: The shipping method's description. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderItem.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderItem.yaml new file mode 100644 index 0000000000..230c4f6f57 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderItem.yaml @@ -0,0 +1,22 @@ +type: object +description: The updates to make on a draft order's item. +x-schemaName: AdminUpdateDraftOrderItem +required: + - quantity +properties: + quantity: + type: number + title: quantity + description: The item's quantity. + unit_price: + type: number + title: unit_price + description: The item's unit price. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the item. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderShippingMethod.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderShippingMethod.yaml new file mode 100644 index 0000000000..e1656ddc82 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdateDraftOrderShippingMethod.yaml @@ -0,0 +1,18 @@ +type: object +description: The updates to make on a draft order's shipping method. +x-schemaName: AdminUpdateDraftOrderShippingMethod +properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the associated shipping option. + custom_amount: + type: number + title: custom_amount + description: >- + The custom amount of the shipping method. If not provided, the shipping + option's amount will be used. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. diff --git a/www/apps/api-reference/specs/admin/components/schemas/Order.yaml b/www/apps/api-reference/specs/admin/components/schemas/Order.yaml index fbb4d9bc32..5be6266d54 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/Order.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/Order.yaml @@ -97,6 +97,82 @@ properties: summary: type: object description: The order's summary. + properties: + pending_difference: + type: number + title: pending_difference + description: The remaining amount to be paid or refunded. + current_order_total: + type: number + title: current_order_total + description: The order's current total. + original_order_total: + type: number + title: original_order_total + description: The order's total before any changes. + transaction_total: + type: number + title: transaction_total + description: >- + The total of the transactions (payments and refunds) made on the + order. + paid_total: + type: number + title: paid_total + description: The total paid amount. + refunded_total: + type: number + title: refunded_total + description: The total refunded amount. + credit_line_total: + type: number + title: credit_line_total + description: The total credit line amount. + accounting_total: + type: number + title: accounting_total + description: The total amount for accounting purposes. + raw_pending_difference: + type: object + description: The summary's raw pending difference. + raw_current_order_total: + type: object + description: The summary's raw current order total. + raw_original_order_total: + type: object + description: The summary's raw original order total. + raw_transaction_total: + type: object + description: The summary's raw transaction total. + raw_paid_total: + type: object + description: The summary's raw paid total. + raw_refunded_total: + type: object + description: The summary's raw refunded total. + raw_credit_line_total: + type: object + description: The summary's raw credit line total. + raw_accounting_total: + type: object + description: The summary's raw accounting total. + required: + - pending_difference + - current_order_total + - original_order_total + - transaction_total + - paid_total + - refunded_total + - credit_line_total + - accounting_total + - raw_pending_difference + - raw_current_order_total + - raw_original_order_total + - raw_transaction_total + - raw_paid_total + - raw_refunded_total + - raw_credit_line_total + - raw_accounting_total metadata: type: object description: The order's metadata, can hold custom key-value pairs. @@ -218,3 +294,7 @@ properties: order. items: $ref: ./OrderCreditLine.yaml + is_draft_order: + type: boolean + title: is_draft_order + description: Whether the order is a draft order. diff --git a/www/apps/api-reference/specs/admin/components/schemas/OrderLineItem.yaml b/www/apps/api-reference/specs/admin/components/schemas/OrderLineItem.yaml index 1c7d686760..1a0cf29b96 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/OrderLineItem.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/OrderLineItem.yaml @@ -6,6 +6,7 @@ required: - title - requires_shipping - is_discountable + - is_giftcard - is_tax_inclusive - unit_price - quantity @@ -198,3 +199,7 @@ properties: type: string title: product_type_id description: The ID of the associated product's type. + is_giftcard: + type: boolean + title: is_giftcard + description: Whether the item is a gift card. diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreCartRemovePromotion.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreCartRemovePromotion.yaml new file mode 100644 index 0000000000..b49b78ff44 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreCartRemovePromotion.yaml @@ -0,0 +1,13 @@ +type: object +description: The promotion code to remove from the cart. +x-schemaName: StoreCartRemovePromotion +required: + - promo_codes +properties: + promo_codes: + type: array + description: The promotion code to remove from the cart. + items: + type: string + title: promo_codes + description: A promotion code to remove from the cart. diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index 77cdb73bc3..4864fe859b 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -9,9 +9,6 @@ servers: - url: http://localhost:9000 - url: https://api.medusajs.com tags: - - name: Auth - description: | - Auth API routes allow you to manage an admin user's authentication. - name: Api Keys description: | API keys can be used for authentication or resource-scoping. @@ -21,9 +18,12 @@ tags: These API routes allow admin users to manage both publishable and secret API keys. externalDocs: description: Learn more about the API Key Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/api-key + url: https://docs.medusajs.com/resources/commerce-modules/api-key x-associatedSchema: $ref: '#/components/schemas/AdminApiKey' + - name: Auth + description: | + Auth API routes allow you to manage an admin user's authentication. - name: Campaigns description: | A campaign is a group of promotions that have the same conditions, such as start and end dates. @@ -31,7 +31,7 @@ tags: These API routes allow admin users to manage campaigns, their conditions, and promotions that belong to them. externalDocs: description: Learn more about campaigns. - url: https://docs.medusajs.com/v2/resources/commerce-modules/promotion/campaign + url: https://docs.medusajs.com/resources/commerce-modules/promotion/campaign x-associatedSchema: $ref: '#/components/schemas/AdminCampaign' - name: Claims @@ -43,7 +43,7 @@ tags: $ref: '#/components/schemas/AdminClaim' externalDocs: description: Learn more about order claims. - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/claim + url: https://docs.medusajs.com/resources/commerce-modules/order/claim - name: Collections description: | A product collection organizes products into a collection for marketing purposes. For example, a summer collection. @@ -58,7 +58,7 @@ tags: Currencies are defined by the Currency Module. Currency API Routes allow admins to list and update currencies. externalDocs: description: Learn more about the Currency Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/currency + url: https://docs.medusajs.com/resources/commerce-modules/currency x-associatedSchema: $ref: '#/components/schemas/AdminCurrency' - name: Customer Groups @@ -70,7 +70,7 @@ tags: These API routes allow admin users to manage groups and the customers in them. externalDocs: description: Learn more about the Customer Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/customer + url: https://docs.medusajs.com/resources/commerce-modules/customer x-associatedSchema: $ref: '#/components/schemas/AdminCustomerGroup' - name: Customers @@ -80,7 +80,7 @@ tags: These API routes allow admin users to manage customers in their store. externalDocs: description: Learn more about the Customer Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/customer + url: https://docs.medusajs.com/resources/commerce-modules/customer x-associatedSchema: $ref: '#/components/schemas/AdminCustomer' - name: Draft Orders @@ -90,7 +90,7 @@ tags: These API routes allow admin users to create and manage draft orders. externalDocs: description: Learn more about the Order Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/order + url: https://docs.medusajs.com/resources/commerce-modules/order x-associatedSchema: $ref: '#/components/schemas/AdminDraftOrder' - name: Exchanges @@ -100,7 +100,7 @@ tags: These API routes allow admin users t create and manage exchanges. externalDocs: description: Learn more about the order exchanges. - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/exchange + url: https://docs.medusajs.com/resources/commerce-modules/order/exchange x-associatedSchema: $ref: '#/components/schemas/AdminExchange' - name: Fulfillment Providers @@ -110,7 +110,7 @@ tags: Fulfillment providers are installed as module providers. externalDocs: description: Learn more about the fulfillment providers and how to create them. - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/fulfillment-provider + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/fulfillment-provider x-associatedSchema: $ref: '#/components/schemas/AdminFulfillmentProvider' - name: Fulfillment Sets @@ -122,7 +122,7 @@ tags: These API routes allow admin users to manage fulfillment sets. externalDocs: description: Learn more about fulfillment sets. - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/concepts + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/concepts x-associatedSchema: $ref: '#/components/schemas/AdminFulfillmentSet' - name: Fulfillments @@ -132,7 +132,7 @@ tags: These API routes allow admin users to manage fulfillments. externalDocs: description: Learn more about fulfillments. - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/item-fulfillment + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/item-fulfillment x-associatedSchema: $ref: '#/components/schemas/AdminFulfillment' - name: Inventory Items @@ -142,7 +142,7 @@ tags: These API routes allow admin users to manage inventory items. externalDocs: description: Learn more about inventory items. - url: https://docs.medusajs.com/v2/resources/commerce-modules/inventory/concepts + url: https://docs.medusajs.com/resources/commerce-modules/inventory/concepts x-associatedSchema: $ref: '#/components/schemas/AdminInventoryItem' - name: Invites @@ -152,7 +152,7 @@ tags: These API routes allow admin users to manage invites. externalDocs: description: Learn more about the User Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/user + url: https://docs.medusajs.com/resources/commerce-modules/user x-associatedSchema: $ref: '#/components/schemas/AdminInvite' - name: Notifications @@ -173,7 +173,7 @@ tags: These API routes allow admin users to make edits to an order and manage those edits. externalDocs: description: Learn more about the Order Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/order + url: https://docs.medusajs.com/resources/commerce-modules/order - name: Orders description: | An order is a purchase made by a customer through a storefront. @@ -183,7 +183,7 @@ tags: These API routes allow admin users to view and manage orders. externalDocs: description: Learn more about the orders - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/concepts + url: https://docs.medusajs.com/resources/commerce-modules/order/concepts x-associatedSchema: $ref: '#/components/schemas/AdminOrder' - name: Payment Collections @@ -197,7 +197,7 @@ tags: These API routes allow admin users to manage payment collections. externalDocs: description: Learn more about payment collections. - url: https://docs.medusajs.com/v2/resources/commerce-modules/payment/payment-collection + url: https://docs.medusajs.com/resources/commerce-modules/payment/payment-collection x-associatedSchema: $ref: '#/components/schemas/AdminPaymentCollection' - name: Payments @@ -209,9 +209,19 @@ tags: These API routes allow admin users to manage payments. externalDocs: description: Learn more about payments. - url: https://docs.medusajs.com/v2/resources/commerce-modules/payment/payment + url: https://docs.medusajs.com/resources/commerce-modules/payment/payment x-associatedSchema: $ref: '#/components/schemas/AdminPayment' + - name: Plugins + description: | + A plugin is a package of reusable Medusa customizations that you can install in any Medusa application. + Plugins can be used to add new functionality, such as wishlists, or integrate third-party services, such as payment providers. + These API routes allow admin users to retrieve plugins installed in their Medusa application. + externalDocs: + description: Learn more about plugins. + url: https://docs.medusajs.com/learn/fundamentals/plugins + x-associatedSchema: + $ref: '#/components/schemas/AdminPlugin' - name: Price Lists description: | A price list is a group of prices applied if the specified conditions and rules are satisfied. @@ -221,7 +231,7 @@ tags: These API routes allow admin users to manage price lists. externalDocs: description: Learn more about price lists. - url: https://docs.medusajs.com/v2/resources/commerce-modules/pricing/concepts#price-list + url: https://docs.medusajs.com/resources/commerce-modules/pricing/concepts#price-list x-associatedSchema: $ref: '#/components/schemas/AdminPriceList' - name: Price Preferences @@ -231,7 +241,7 @@ tags: These API routes allow admin users to manage whether a region or currency is tax inclusive. externalDocs: description: Learn more about tax-inclusiveness and the role of a price preference. - url: https://docs.medusajs.com/v2/resources/commerce-modules/pricing/tax-inclusive-pricing + url: https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing x-associatedSchema: $ref: '#/components/schemas/AdminPricePreference' - name: Product Categories @@ -243,7 +253,7 @@ tags: These API routes allow admin users to manage categories and the products in them. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: '#/components/schemas/AdminProductCategory' - name: Product Tags @@ -255,7 +265,7 @@ tags: These API routes allow admin users to manage product tags. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: '#/components/schemas/AdminProductTag' - name: Product Types @@ -267,7 +277,7 @@ tags: These API routes allow admin users to manage product types. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: '#/components/schemas/AdminProductType' - name: Product Variants @@ -279,7 +289,7 @@ tags: These API routes allow admin users to manage product variants. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: '#/components/schemas/AdminProductVariant' - name: Products @@ -293,7 +303,7 @@ tags: These API routes allow admin users to manage products. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: '#/components/schemas/AdminProduct' - name: Promotions @@ -309,7 +319,7 @@ tags: These API routes allow admin users to manage promotions. externalDocs: description: Learn more about promotions. - url: https://docs.medusajs.com/v2/resources/commerce-modules/promotion/concepts + url: https://docs.medusajs.com/resources/commerce-modules/promotion/concepts x-associatedSchema: $ref: '#/components/schemas/AdminPromotion' - name: Refund Reasons @@ -326,7 +336,7 @@ tags: These API routes allow admin users to manage regions, their providers, and more. externalDocs: description: Learn more about the Region Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/region + url: https://docs.medusajs.com/resources/commerce-modules/region x-associatedSchema: $ref: '#/components/schemas/AdminRegion' - name: Reservations @@ -338,7 +348,7 @@ tags: These API routes allow admin users to manage reservations. externalDocs: description: Learn more about reservations and other inventory concepts. - url: https://docs.medusajs.com/v2/resources/commerce-modules/inventory/concepts + url: https://docs.medusajs.com/resources/commerce-modules/inventory/concepts x-associatedSchema: $ref: '#/components/schemas/AdminReservation' - name: Return Reasons @@ -357,7 +367,7 @@ tags: These API routes allow admin users to manage returns. externalDocs: description: Learn more about order returns. - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/return + url: https://docs.medusajs.com/resources/commerce-modules/order/return x-associatedSchema: $ref: '#/components/schemas/AdminReturn' - name: Sales Channels @@ -367,7 +377,7 @@ tags: These API routes allow admins to manage sales channels and the products available in them. externalDocs: description: Learn more about the Sales Channel Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/sales-channel + url: https://docs.medusajs.com/resources/commerce-modules/sales-channel x-associatedSchema: $ref: '#/components/schemas/AdminSalesChannel' - name: Shipping Options @@ -381,7 +391,7 @@ tags: These API routes allow admins to manage shipping options. externalDocs: description: Learn more about shipping options. - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option x-associatedSchema: $ref: '#/components/schemas/AdminShippingOption' - name: Shipping Profiles @@ -391,7 +401,7 @@ tags: These API routes allow admin users to manage shipping profiles. externalDocs: description: Learn more about shipping profiles and other fulfillment concepts. - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/concepts#shipping-profile + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/concepts#shipping-profile x-associatedSchema: $ref: '#/components/schemas/AdminShippingProfile' - name: Stock Locations @@ -405,7 +415,7 @@ tags: These API routes allow admin users to manage stock locations and their linked data. externalDocs: description: Learn more about stock locations. - url: https://docs.medusajs.com/v2/resources/commerce-modules/stock-location/concepts + url: https://docs.medusajs.com/resources/commerce-modules/stock-location/concepts x-associatedSchema: $ref: '#/components/schemas/AdminStockLocation' - name: Stores @@ -417,7 +427,7 @@ tags: These API routes allow admin users to manage their store. externalDocs: description: Learn more about the Store Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/store + url: https://docs.medusajs.com/resources/commerce-modules/store x-associatedSchema: $ref: '#/components/schemas/AdminStore' - name: Tax Rates @@ -429,7 +439,7 @@ tags: These API routes allow admin users to manage tax rates and their rules. externalDocs: description: Learn more about tax rates and rules. - url: https://docs.medusajs.com/v2/resources/commerce-modules/tax/tax-rates-and-rules + url: https://docs.medusajs.com/resources/commerce-modules/tax/tax-rates-and-rules x-associatedSchema: $ref: '#/components/schemas/AdminTaxRate' - name: Tax Regions @@ -441,7 +451,7 @@ tags: These API routes allow admin users to manage tax regions. externalDocs: description: Learn more about tax regions. - url: https://docs.medusajs.com/v2/resources/commerce-modules/tax/tax-region + url: https://docs.medusajs.com/resources/commerce-modules/tax/tax-region x-associatedSchema: $ref: '#/components/schemas/AdminTaxRegion' - name: Uploads @@ -451,7 +461,7 @@ tags: You can upload public files, such as product images, or private files, such as CSV files used to import products. externalDocs: description: Check out available file module providers. - url: https://docs.medusajs.com/v2/resources/architectural-modules/file + url: https://docs.medusajs.com/resources/architectural-modules/file - name: Users description: | A user is an admin user that can authenticate and perform functionalities as an admin user. @@ -461,7 +471,7 @@ tags: These API routes allow admin users to manage their team. externalDocs: description: Learn more about the User Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/user + url: https://docs.medusajs.com/resources/commerce-modules/user x-associatedSchema: $ref: '#/components/schemas/AdminUser' - name: Workflows Executions @@ -471,7 +481,7 @@ tags: Depending on the workflow engine you use, executions may only be retained for a short while, or only until the Medusa application is restarted. externalDocs: description: Check out available Workflow Engine Modules - url: https://docs.medusajs.com/v2/resources/architectural-modules/workflow-engine + url: https://docs.medusajs.com/resources/architectural-modules/workflow-engine paths: /admin/api-keys: get: @@ -1528,6 +1538,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.apiKey.list() + .then(({ api_keys, count, limit, offset }) => { + console.log(api_keys) + }) - lang: Shell label: cURL source: |- @@ -1600,6 +1627,26 @@ paths: schema: $ref: '#/components/schemas/AdminCreateApiKey' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.apiKey.create({ + title: "Development", + type: "publishable" + }) + .then(({ api_key }) => { + console.log(api_key) + }) - lang: Shell label: cURL source: |- @@ -1660,6 +1707,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.apiKey.retrieve("apk_123") + .then(({ api_key }) => { + console.log(api_key) + }) - lang: Shell label: cURL source: |- @@ -1718,6 +1782,25 @@ paths: schema: $ref: '#/components/schemas/AdminUpdateApiKey' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.apiKey.update("apk_123", { + title: "Development" + }) + .then(({ api_key }) => { + console.log(api_key) + }) - lang: Shell label: cURL source: |- @@ -1767,6 +1850,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.apiKey.delete("apk_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -1847,6 +1947,23 @@ paths: schema: $ref: '#/components/schemas/AdminRevokeApiKey' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.apiKey.revoke("apk_123") + .then(({ api_key }) => { + console.log(api_key) + }) - lang: Shell label: cURL source: |- @@ -1924,6 +2041,26 @@ paths: title: remove description: A sales channel's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.apiKey.batchSalesChannels("apk_123", { + add: ["sc_123"], + remove: ["sc_321"] + }) + .then(({ api_key }) => { + console.log(api_key) + }) - lang: Shell label: cURL source: |- @@ -2001,6 +2138,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.campaign.list() + .then(({ campaigns, count, limit, offset }) => { + console.log(campaigns) + }) - lang: Shell label: cURL source: |- @@ -2158,6 +2312,25 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The campaign's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.campaign.create({ + name: "Summer Campaign" + }) + .then(({ campaign }) => { + console.log(campaign) + }) - lang: Shell label: cURL source: |- @@ -2221,6 +2394,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.campaign.retrieve("procamp_123") + .then(({ campaign }) => { + console.log(campaign) + }) - lang: Shell label: cURL source: |- @@ -2338,6 +2528,25 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The campaign's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.campaign.update("procamp_123", { + name: "Summer Campaign" + }) + .then(({ campaign }) => { + console.log(campaign) + }) - lang: Shell label: cURL source: |- @@ -2389,6 +2598,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.campaign.delete("procamp_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -2485,6 +2711,26 @@ paths: title: remove description: A promotion's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.campaign.batchPromotions("procamp_123", { + add: ["prom_123", "prom_456"], + remove: ["prom_789"] + }) + .then(({ campaign }) => { + console.log(campaign) + }) - lang: Shell label: cURL source: |- @@ -3325,6 +3571,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.list() + .then(({ claims, count, limit, offset }) => { + console.log(claims) + }) - lang: Shell label: cURL source: |- @@ -3377,6 +3640,26 @@ paths: schema: $ref: '#/components/schemas/AdminPostOrderClaimsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.create({ + type: "refund", + order_id: "order_123", + }) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -3438,6 +3721,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.retrieve("claim_123") + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -3487,6 +3787,23 @@ paths: schema: $ref: '#/components/schemas/AdminPostCancelClaimReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.cancel("claim_123") + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -3548,6 +3865,30 @@ paths: schema: $ref: '#/components/schemas/AdminPostClaimItemsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.addItems("claim_123", { + items: [ + { + id: "orli_123", + quantity: 1 + } + ] + }) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -3617,6 +3958,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostClaimsItemsActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.updateItem( + "claim_123", + "ordchact_123", + { + quantity: 1 + } + ) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -3681,6 +4045,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.removeItem( + "claim_123", + "ordchact_123", + ) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -3733,6 +4117,33 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsRequestItemsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.addInboundItems( + "claim_123", + { + items: [ + { + id: "orli_123", + quantity: 1 + } + ] + }, + ) + .then(({ return: returnData }) => { + console.log(returnData) + }) - lang: Shell label: cURL source: |- @@ -3793,6 +4204,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsRequestItemsActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.updateInboundItem( + "claim_123", + "ordchact_123", + { + quantity: 1 + }, + ) + .then(({ return: returnData }) => { + console.log(returnData) + }) - lang: Shell label: cURL source: |- @@ -3847,6 +4281,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.removeInboundItem( + "claim_123", + "ordchact_123", + ) + .then(({ return: returnData }) => { + console.log(returnData) + }) - lang: Shell label: cURL source: 'curl -X DELETE ''{backend_url}/admin/claims/{id}/inbound/items/{action_id}'' \ -H ''Authorization: Bearer {access_token}''' @@ -3897,6 +4351,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsShippingReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.addInboundShipping( + "claim_123", + { + shipping_option_id: "so_123", + custom_amount: 10 + }, + ) + .then(({ return: returnData }) => { + console.log(returnData) + }) - lang: Shell label: cURL source: |- @@ -3971,6 +4448,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostClaimsShippingActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.updateInboundShipping( + "claim_123", + "ordchact_123", + { + custom_amount: 10 + }, + ) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -4025,6 +4525,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.deleteInboundShipping( + "claim_123", + "ordchact_123", + ) + .then(({ return: returnData }) => { + console.log(returnData) + }) - lang: Shell label: cURL source: 'curl -X DELETE ''{backend_url}/admin/claims/{id}/inbound/shipping-method/{action_id}'' \ -H ''Authorization: Bearer {access_token}''' @@ -4085,6 +4605,31 @@ paths: schema: $ref: '#/components/schemas/AdminPostClaimsAddItemsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.addOutboundItems( + "claim_123", + { + items: [{ + id: "orli_123", + quantity: 1 + }] + }, + ) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -4155,6 +4700,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostClaimsItemsActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.updateOutboundItem( + "claim_123", + "ordchact_123", + { + quantity: 1 + }, + ) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -4219,6 +4787,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.removeOutboundItem( + "claim_123", + "ordchact_123", + ) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: 'curl -X DELETE ''{backend_url}/admin/claims/{id}/outbound/items/{action_id}'' \ -H ''Authorization: Bearer {access_token}''' @@ -4279,6 +4867,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostClaimsShippingReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.addOutboundShipping( + "claim_123", + { + shipping_option_id: "so_123", + custom_amount: 10 + }, + ) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -4353,6 +4964,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostClaimsShippingActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.updateOutboundShipping( + "claim_123", + "ordchact_123", + { + custom_amount: 10 + }, + ) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -4417,6 +5051,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.deleteOutboundShipping( + "claim_123", + "ordchact_123", + ) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: 'curl -X DELETE ''{backend_url}/admin/claims/{id}/outbound/shipping-method/{action_id}'' \ -H ''Authorization: Bearer {access_token}''' @@ -4471,6 +5125,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.request( + "claim_123", + {}, + ) + .then(({ claim }) => { + console.log(claim) + }) - lang: Shell label: cURL source: |- @@ -4515,6 +5189,25 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.claim.cancelRequest( + "claim_123", + ) + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -5355,6 +6048,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCollection.list() + .then(({ collections, count, limit, offset }) => { + console.log(collections) + }) - lang: Shell label: cURL source: |- @@ -5407,6 +6117,25 @@ paths: schema: $ref: '#/components/schemas/AdminCreateCollection' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCollection.create({ + title: "Summer Collection" + }) + .then(({ collection }) => { + console.log(collection) + }) - lang: Shell label: cURL source: |- @@ -5467,6 +6196,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCollection.retrieve("pcol_123") + .then(({ collection }) => { + console.log(collection) + }) - lang: Shell label: cURL source: |- @@ -5525,6 +6271,25 @@ paths: schema: $ref: '#/components/schemas/AdminUpdateCollection' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCollection.update("pcol_123", { + title: "Summer Collection" + }) + .then(({ collection }) => { + console.log(collection) + }) - lang: Shell label: cURL source: |- @@ -5573,6 +6338,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCollection.delete("pcol_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -5650,6 +6432,26 @@ paths: title: remove description: A product's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCollection.updateProducts("pcol_123", { + add: ["prod_123"], + remove: ["prod_321"] + }) + .then(({ collection }) => { + console.log(collection) + }) - lang: Shell label: cURL source: |- @@ -5769,6 +6571,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.currency.list() + .then(({ currencies, count, limit, offset }) => { + console.log(currencies) + }) - lang: Shell label: cURL source: |- @@ -5823,6 +6642,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.currency.retrieve("usd") + .then(({ currency }) => { + console.log(currency) + }) - lang: Shell label: cURL source: |- @@ -6677,6 +7513,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customerGroup.list() + .then(({ customer_groups, count, limit, offset }) => { + console.log(customer_groups) + }) - lang: Shell label: cURL source: |- @@ -6758,6 +7611,25 @@ paths: schema: $ref: '#/components/schemas/AdminCreateCustomerGroup' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customerGroup.create({ + name: "VIP" + }) + .then(({ customer_group }) => { + console.log(customer_group) + }) - lang: Shell label: cURL source: |- @@ -6818,6 +7690,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customerGroup.retrieve("cusgroup_123") + .then(({ customer_group }) => { + console.log(customer_group) + }) - lang: Shell label: cURL source: |- @@ -6876,6 +7765,25 @@ paths: schema: $ref: '#/components/schemas/AdminUpdateCustomerGroup' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customerGroup.update("cusgroup_123", { + name: "VIP" + }) + .then(({ customer_group }) => { + console.log(customer_group) + }) - lang: Shell label: cURL source: |- @@ -6926,6 +7834,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customerGroup.delete("cusgroup_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -7021,6 +7946,26 @@ paths: title: remove description: A customer's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customerGroup.batchCustomers("cusgroup_123", { + add: ["cus_123"], + remove: ["cus_321"] + }) + .then(({ customer_group }) => { + console.log(customer_group) + }) - lang: Shell label: cURL source: |- @@ -10382,6 +11327,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customer.list() + .then(({ customers, count, limit, offset }) => { + console.log(customers) + }) - lang: Shell label: cURL source: |- @@ -10501,6 +11463,25 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The customer's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customer.create({ + email: "customer@gmail.com" + }) + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -10565,6 +11546,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customer.retrieve("cus_123") + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -10664,6 +11662,25 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The customer's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customer.update("cus_123", { + first_name: "John" + }) + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -10717,6 +11734,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customer.delete("cus_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -10916,6 +11950,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customer.listAddresses("cus_123") + .then(({ addresses }) => { + console.log(addresses) + }) - lang: Shell label: cURL source: |- @@ -11082,6 +12133,28 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The address's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customer.createAddress("cus_123", { + address_1: "123 Main St", + city: "Anytown", + country_code: "US", + postal_code: "12345" + }) + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -11158,6 +12231,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customer.retrieveAddress("cus_123", "cus_addr_123") + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -11301,6 +12391,28 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The address's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customer.updateAddress("cus_123", "cus_addr_123", { + address_1: "123 Main St", + city: "Anytown", + country_code: "US", + postal_code: "12345" + }) + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -11376,6 +12488,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customer.deleteAddress("cus_123", "cus_addr_123") + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: 'curl -X DELETE ''{backend_url}/admin/customers/{id}/addresses/{address_id}'' \ -H ''Authorization: Bearer {access_token}''' @@ -11479,6 +12608,26 @@ paths: title: remove description: The ID of the group to remove the customer from. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.customer.batchCustomerGroups("cus_123", { + add: ["cusgroup_123"], + remove: ["cusgroup_321"] + }) + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -12932,6 +14081,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.list() + .then(({ draft_orders, count, limit, offset }) => { + console.log(draft_orders) + }) - lang: Shell label: cURL source: |- @@ -13272,6 +14438,33 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The draft order's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.create({ + email: "test@test.com", + items: [ + { + variant_id: "variant_123", + quantity: 1, + }, + ], + region_id: "region_123", + sales_channel_id: "sc_123", + }) + .then(({ draft_order }) => { + console.log(draft_order) + }) - lang: Shell label: cURL source: |- @@ -13347,6 +14540,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.retrieve("order_123") + .then(({ draft_order }) => { + console.log(draft_order) + }) - lang: Shell label: cURL source: |- @@ -13409,6 +14619,25 @@ paths: schema: $ref: '#/components/schemas/AdminUpdateDraftOrder' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.update("order_123", { + email: "test@test.com", + }) + .then(({ draft_order }) => { + console.log(draft_order) + }) - lang: Shell label: cURL source: |- @@ -13435,7 +14664,1040 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - x-workflow: updateOrderWorkflow + x-workflow: updateDraftOrderWorkflow + /admin/draft-orders/{id}/convert-to-order: + post: + operationId: PostDraftOrdersIdConvertToOrder + summary: Convert a Draft Order to an Order + x-sidebar-summary: Convert to Order + description: Convert a draft order to an order. This will finalize the draft order and create a new order with the same details. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: |- + Comma-separated fields that should be included in the returned data. + if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + To convert a draft order to an order: + + ```ts + sdk.admin.draftOrder.convertToOrder("order_123") + .then(({ order }) => { + console.log(order) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/draft-orders/{id}/convert-to-order' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: convertDraftOrderWorkflow + /admin/draft-orders/{id}/edit: + post: + operationId: PostDraftOrdersIdEdit + summary: Create a Draft Order Edit + x-sidebar-summary: Create Edit + description: Create an edit on a draft order. This will allow you to make changes to the draft order's items, shipping methods, or promotions before confirming them later. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.beginEdit("order_123") + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/draft-orders/{id}/edit' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: beginDraftOrderEditWorkflow + delete: + operationId: DeleteDraftOrdersIdEdit + summary: Cancel Edit on Draft Order + x-sidebar-summary: Cancel Edit + description: Cancel an unconfirmed edit on a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.cancelEdit("order_123") + .then(({ id, object, deleted }) => { + console.log(id, object, deleted) + }) + - lang: Shell + label: cURL + source: |- + curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: cancelDraftOrderEditWorkflow + /admin/draft-orders/{id}/edit/confirm: + post: + operationId: PostDraftOrdersIdEditConfirm + summary: Confirm an Edit on a Draft Order + x-sidebar-summary: Confirm Edit + description: Confirm an edit on a draft order. This will apply the changes made to the draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.confirmEdit("order_123") + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/confirm' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: confirmDraftOrderEditWorkflow + /admin/draft-orders/{id}/edit/items: + post: + operationId: PostDraftOrdersIdEditItems + summary: Add Item to Draft Order + x-sidebar-summary: Add Item + description: Add an Item to a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAddDraftOrderItems' + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.addItems("order_123", { + items: [ + { + variant_id: "variant_123", + quantity: 1, + }, + ], + }) + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/items' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: addDraftOrderItemsWorkflow + /admin/draft-orders/{id}/edit/items/item/{item_id}: + post: + operationId: PostDraftOrdersIdEditItemsItemItem_id + summary: Update Item in Draft Order + x-sidebar-summary: Update Item + description: Update an item in a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: item_id + in: path + description: The item's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdateDraftOrderItem' + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.updateItem("order_123", "item_123", { + quantity: 2, + }) + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/items/item/{item_id}' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "quantity": 0 + }' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: updateDraftOrderItemWorkflow + /admin/draft-orders/{id}/edit/items/{action_id}: + post: + operationId: PostDraftOrdersIdEditItemsAction_id + summary: Update Item Changes in Draft Order + x-sidebar-summary: Update Item Changes + description: | + Update changes made on an item (addition or update) in the draft order by the ID of the item's `ITEM_ADD` or `ITEM_UPDATE` action. + + Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: action_id + in: path + description: The ID of the item's `ITEM_ADD` or `ITEM_UPDATE` action. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdateDraftOrderItem' + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.updateActionItem("order_123", "action_123", { + quantity: 2, + }) + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/items/{action_id}' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "quantity": 39 + }' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: updateDraftOrderActionItemWorkflow + delete: + operationId: DeleteDraftOrdersIdEditItemsAction_id + summary: Remove Item from Draft Order + x-sidebar-summary: Remove Item + description: | + Remove an order item from a draft order by the ID of the item's `ITEM_REMOVE` action. + + Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: action_id + in: path + description: The ID of the order item's `ITEM_REMOVE` action. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.removeActionItem("order_123", "action_123") + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit/items/{action_id}' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: removeDraftOrderActionItemWorkflow + /admin/draft-orders/{id}/edit/promotions: + post: + operationId: PostDraftOrdersIdEditPromotions + summary: Add Promotions to Draft Order + x-sidebar-summary: Add Promotions + description: Add promotions to a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAddDraftOrderPromotions' + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.addPromotions("order_123", { + promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"], + }) + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/promotions' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "promo_codes": [ + "{value}" + ] + }' + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrderPreviewResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: addDraftOrderPromotionWorkflow + delete: + operationId: DeleteDraftOrdersIdEditPromotions + summary: Remove Promotions from Draft Order + x-sidebar-summary: Remove Promotions + description: Remove specified promotions from a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.removePromotions("order_123", { + promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"], + }) + - lang: Shell + label: cURL + source: |- + curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit/promotions' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrderPreviewResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: removeDraftOrderPromotionsWorkflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRemoveDraftOrderPromotions' + /admin/draft-orders/{id}/edit/request: + post: + operationId: PostDraftOrdersIdEditRequest + summary: Request Edit on Draft Order + x-sidebar-summary: Request Edit + description: Change the status of a draft order's edit to be requested. Later, the edit can be confirmed or canceled. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.requestEdit("order_123") + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/request' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: requestDraftOrderEditWorkflow + /admin/draft-orders/{id}/edit/shipping-methods: + post: + operationId: PostDraftOrdersIdEditShippingMethods + summary: Add Shipping Method to Draft Order + x-sidebar-summary: Add Shipping Method + description: Add a shipping method to a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAddDraftOrderShippingMethod' + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.addShippingMethod("order_123", { + shipping_option_id: "shipping_option_123", + }) + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "shipping_option_id": "{value}" + }' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: addDraftOrderShippingMethodsWorkflow + /admin/draft-orders/{id}/edit/shipping-methods/method/{method_id}: + post: + operationId: PostDraftOrdersIdEditShippingMethodsMethodMethod_id + summary: Update Shipping Method in Draft Order + x-sidebar-summary: Update Shipping Method + description: Update a shipping method in a draft order + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: method_id + in: path + description: The ID of the shipping method. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdateDraftOrderShippingMethod' + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.updateShippingMethod("order_123", "sm_123", { + shipping_option_id: "so_123", + }) + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods/method/{method_id}' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: updateDraftOrderShippingMethodWorkflow + /admin/draft-orders/{id}/edit/shipping-methods/{action_id}: + post: + operationId: PostDraftOrdersIdEditShippingMethodsAction_id + summary: Update Shipping Method Changes in Draft Order + x-sidebar-summary: Update Shipping Method Changes + description: | + Update changes made on a shipping method (addition or update) in a draft order using the `ID` of the method's `SHIPPING_ADD` or `SHIPPING_UPDATE` action. + + Every shipping method has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: action_id + in: path + description: The ID of the shipping method's `SHIPPING_ADD` or `SHIPPING_UPDATE` action. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdateDraftOrderActionShippingMethod' + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.updateShippingMethod("order_123", "action_123", { + shipping_option_id: "shipping_option_123", + }) + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods/{action_id}' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "shipping_option_id": "{value}" + }' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: updateDraftOrderActionShippingMethodWorkflow + delete: + operationId: DeleteDraftOrdersIdEditShippingMethodsAction_id + summary: Remove Shipping Method from Draft Order + x-sidebar-summary: Remove Shipping Method + description: | + Remove the shipping method in a draft order using the `ID` of the method's `SHIPPING_ADD` action. + + Every shipping method has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: action_id + in: path + description: The ID of the shipping method's `SHIPPING_ADD` action. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.draftOrder.removeShippingMethod("order_123", "action_123") + .then(({ draft_order_preview }) => { + console.log(draft_order_preview) + }) + - lang: Shell + label: cURL + source: |- + curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods/{action_id}' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: removeDraftOrderActionShippingMethodWorkflow /admin/exchanges: get: operationId: GetExchanges @@ -14221,6 +16483,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.list() + .then(({ exchanges, count, limit, offset }) => { + console.log(exchanges) + }) - lang: Shell label: cURL source: |- @@ -14302,6 +16581,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostOrderExchangesReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.create({ + order_id: "order_123" + }) + .then(({ exchange }) => { + console.log(exchange) + }) - lang: Shell label: cURL source: |- @@ -14362,6 +16660,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.retrieve("exchange_123") + .then(({ exchange }) => { + console.log(exchange) + }) - lang: Shell label: cURL source: |- @@ -14411,6 +16726,23 @@ paths: schema: $ref: '#/components/schemas/AdminPostCancelExchangeReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.cancel("exchange_123") + .then(({ exchange }) => { + console.log(exchange) + }) - lang: Shell label: cURL source: |- @@ -14462,6 +16794,28 @@ paths: schema: $ref: '#/components/schemas/AdminPostExchangesReturnRequestItemsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.addInboundItems("exchange_123", { + items: [{ + id: "orli_123", + quantity: 1 + }] + }) + .then(({ return: returnData }) => { + console.log(returnData) + }) - lang: Shell label: cURL source: |- @@ -14522,6 +16876,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostExchangesRequestItemsReturnActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.updateInboundItem( + "exchange_123", + "ordchact_123", + { + quantity: 1 + } + ) + .then(({ return: returnData }) => { + console.log(returnData) + }) - lang: Shell label: cURL source: |- @@ -14576,6 +16953,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.removeInboundItem( + "exchange_123", + "ordchact_123", + ) + .then(({ return: returnData }) => { + console.log(returnData) + }) - lang: Shell label: cURL source: 'curl -X DELETE ''{backend_url}/admin/exchanges/{id}/inbound/items/{action_id}'' \ -H ''Authorization: Bearer {access_token}''' @@ -14625,6 +17022,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsShippingReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.addInboundShipping("exchange_123", { + shipping_option_id: "so_123" + }) + .then(({ return: returnData }) => { + console.log(returnData) + }) - lang: Shell label: cURL source: |- @@ -14699,6 +17115,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostExchangesShippingActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.updateInboundShipping( + "exchange_123", + "ordchact_123", + { + custom_amount: 10 + } + ) + .then(({ return: returnData }) => { + console.log(returnData) + }) - lang: Shell label: cURL source: |- @@ -14753,6 +17192,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.deleteInboundShipping( + "exchange_123", + "ordchact_123", + ) + .then(({ return: returnData }) => { + console.log(returnData) + }) - lang: Shell label: cURL source: 'curl -X DELETE ''{backend_url}/admin/exchanges/{id}/inbound/shipping-method/{action_id}'' \ -H ''Authorization: Bearer {access_token}''' @@ -14811,6 +17270,28 @@ paths: schema: $ref: '#/components/schemas/AdminPostExchangesAddItemsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.addOutboundItems("exchange_123", { + items: [{ + id: "variant_123", + quantity: 1 + }] + }) + .then(({ exchange }) => { + console.log(exchange) + }) - lang: Shell label: cURL source: |- @@ -14881,6 +17362,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostExchangesItemsActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.updateOutboundItem( + "exchange_123", + "ordchact_123", + { + quantity: 1 + } + ) + .then(({ exchange }) => { + console.log(exchange) + }) - lang: Shell label: cURL source: |- @@ -14945,6 +17449,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.removeOutboundItem( + "exchange_123", + "ordchact_123", + ) + .then(({ exchange }) => { + console.log(exchange) + }) - lang: Shell label: cURL source: 'curl -X DELETE ''{backend_url}/admin/exchanges/{id}/outbound/items/{action_id}'' \ -H ''Authorization: Bearer {access_token}''' @@ -15004,6 +17528,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostExchangesShippingReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.addOutboundShipping("exchange_123", { + shipping_option_id: "so_123" + }) + .then(({ exchange }) => { + console.log(exchange) + }) - lang: Shell label: cURL source: |- @@ -15078,6 +17621,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostExchangesShippingActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.updateOutboundShipping( + "exchange_123", + "ordchact_123", + { + custom_amount: 10 + } + ) + .then(({ exchange }) => { + console.log(exchange) + }) - lang: Shell label: cURL source: |- @@ -15142,6 +17708,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.deleteOutboundShipping( + "exchange_123", + "ordchact_123", + ) + .then(({ exchange }) => { + console.log(exchange) + }) - lang: Shell label: cURL source: 'curl -X DELETE ''{backend_url}/admin/exchanges/{id}/outbound/shipping-method/{action_id}''\ -H ''Authorization: Bearer {access_token}''' @@ -15195,6 +17781,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.request("exchange_123", {}) + .then(({ exchange }) => { + console.log(exchange) + }) - lang: Shell label: cURL source: |- @@ -15239,6 +17842,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.exchange.cancel("exchange_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -15360,6 +17980,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.fulfillmentProvider.list() + .then(({ fulfillment_providers, count, limit, offset }) => { + console.log(fulfillment_providers) + }) - lang: Shell label: cURL source: |- @@ -15404,6 +18041,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.fulfillmentProvider.listFulfillmentOptions("fp_123") + .then(({ fulfillment_options }) => { + console.log(fulfillment_options) + }) - lang: Shell label: cURL source: |- @@ -15448,6 +18102,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.fulfillmentSet.delete("fset_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -15627,6 +18298,29 @@ paths: type: object description: The geo zone's postal expression or ZIP code. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.fulfillmentSet.createServiceZone("fset_123", { + name: "Europe Service Zone", + geo_zones: [{ + type: "country", + country_code: "us" + }] + }) + .then(({ fulfillment_set }) => { + console.log(fulfillment_set) + }) - lang: Shell label: cURL source: |- @@ -15693,6 +18387,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.fulfillmentSet.retrieveServiceZone( + "fset_123", + "serzo_123" + ) + .then(({ service_zone }) => { + console.log(service_zone) + }) - lang: Shell label: cURL source: |- @@ -15890,6 +18604,29 @@ paths: title: id description: The ID of an existing geo zone. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.fulfillmentSet.updateServiceZone( + "fset_123", + "serzo_123", + { + name: "Europe Service Zone", + } + ) + .then(({ fulfillment_set }) => { + console.log(fulfillment_set) + }) - lang: Shell label: cURL source: |- @@ -15945,6 +18682,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.fulfillmentSet.deleteServiceZone( + "fset_123", + "serzo_123", + ) + .then(({ deleted, parent: fulfillmentSet }) => { + console.log(deleted, fulfillmentSet) + }) - lang: Shell label: cURL source: 'curl -X DELETE ''{backend_url}/admin/fulfillment-sets/{id}/service-zones/{zone_id}'' \ -H ''Authorization: Bearer {access_token}''' @@ -15997,6 +18754,40 @@ paths: schema: $ref: '#/components/schemas/AdminCreateFulfillment' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.fulfillment.create({ + location_id: "sloc_123", + provider_id: "my_fulfillment", + delivery_address: { + country_code: "us" + }, + items: [ + { + title: "Shirt", + sku: "SHIRT", + quantity: 1, + barcode: "123" + } + ], + labels: [], + order: {}, + order_id: "order_123" + }) + .then(({ fulfillment }) => { + console.log(fulfillment) + }) - lang: Shell label: cURL source: |- @@ -16099,6 +18890,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.fulfillment.cancel("ful_123") + .then(({ fulfillment }) => { + console.log(fulfillment) + }) - lang: Shell label: cURL source: |- @@ -16160,6 +18968,31 @@ paths: schema: $ref: '#/components/schemas/AdminCreateShipment' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.fulfillment.createShipment("ful_123", { + labels: [ + { + tracking_number: "123", + tracking_url: "example.com", + label_url: "example.com" + } + ] + }) + .then(({ fulfillment }) => { + console.log(fulfillment) + }) - lang: Shell label: cURL source: |- @@ -16582,6 +19415,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.inventoryItem.list() + .then(({ inventory_items, count, limit, offset }) => { + console.log(inventory_items) + }) - lang: Shell label: cURL source: |- @@ -16663,6 +19513,25 @@ paths: schema: $ref: '#/components/schemas/AdminCreateInventoryItem' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.inventoryItem.create({ + sku: "SHIRT" + }) + .then(({ inventory_item }) => { + console.log(inventory_item) + }) - lang: Shell label: cURL source: |- @@ -16722,6 +19591,30 @@ paths: schema: $ref: '#/components/schemas/AdminBatchInventoryItemsLocationLevels' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.inventoryItem.batchInventoryItemsLocationLevels({ + create: [{ + inventory_item_id: "iitem_123", + location_id: "sloc_123", + stocked_quantity: 10 + }], + delete: ["ilvl_123"] + }) + .then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) + }) - lang: Shell label: cURL source: |- @@ -16799,6 +19692,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.inventoryItem.retrieve("iitem_123") + .then(({ inventory_item }) => { + console.log(inventory_item) + }) - lang: Shell label: cURL source: |- @@ -16914,6 +19824,25 @@ paths: type: object description: The inventory item's metadata. Can be custom data in key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.inventoryItem.update("iitem_123", { + sku: "SHIRT" + }) + .then(({ inventory_item }) => { + console.log(inventory_item) + }) - lang: Shell label: cURL source: |- @@ -16974,6 +19903,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.inventoryItem.delete("iitem_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -17094,6 +20040,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.inventoryItem.listLevels("iitem_123") + .then(({ inventory_levels, count, limit, offset }) => { + console.log(inventory_levels) + }) - lang: Shell label: cURL source: |- @@ -17253,6 +20216,29 @@ paths: schema: $ref: '#/components/schemas/AdminBatchInventoryItemLocationsLevel' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.inventoryItem.batchInventoryItemLocationLevels("iitem_123", { + create: [{ + location_id: "sloc_123", + stocked_quantity: 10 + }], + delete: ["ilvl_123"] + }) + .then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) + }) - lang: Shell label: cURL source: |- @@ -17261,6 +20247,8 @@ paths: tags: - Inventory Items responses: + '200': + description: OK '400': $ref: '#/components/responses/400_error' '401': @@ -17324,6 +20312,29 @@ paths: title: incoming_quantity description: The inventory level's incoming quantity. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.inventoryItem.updateLevel( + "iitem_123", + "sloc_123", + { + stocked_quantity: 10 + } + ) + .then(({ inventory_item }) => { + console.log(inventory_item) + }) - lang: Shell label: cURL source: |- @@ -17388,6 +20399,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.inventoryItem.deleteLevel( + "iitem_123", + "sloc_123", + ) + .then(({ deleted, parent: inventoryItem }) => { + console.log(deleted, inventoryItem) + }) - lang: Shell label: cURL source: 'curl -X DELETE ''{backend_url}/admin/inventory-items/{id}/location-levels/{location_id}'' \ -H ''Authorization: Bearer {access_token}''' @@ -17897,6 +20928,23 @@ paths: type: object title: $or x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.invite.list() + .then(({ invites, count, limit, offset }) => { + console.log(invites) + }) - lang: Shell label: cURL source: curl '{backend_url}/admin/invites' @@ -17988,6 +21036,25 @@ paths: type: object description: The invite's metadata. Can be custom data in key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.invite.create({ + email: "user@gmail.com", + }) + .then(({ invite }) => { + console.log(invite) + }) - lang: Shell label: cURL source: |- @@ -18051,6 +21118,33 @@ paths: title: last_name description: The user's last name. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + await sdk.auth.register("user", "emailpass", { + email: "user@gmail.com", + password: "supersecret" + }) + + // all subsequent requests will use the token in the header + const { user } = await sdk.admin.invite.accept( + { + email: "user@gmail.com", + first_name: "John", + last_name: "Smith", + invite_token: "12345..." + }, + ) - lang: Shell label: cURL source: |- @@ -18126,6 +21220,23 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.invite.retrieve("invite_123") + .then(({ invite }) => { + console.log(invite) + }) - lang: Shell label: cURL source: curl '{backend_url}/admin/invites/{id}' @@ -18167,6 +21278,23 @@ paths: schema: type: string x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.invite.delete("invite_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: curl -X DELETE '{backend_url}/admin/invites/{id}' @@ -18239,6 +21367,23 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.invite.resend("invite_123") + .then(({ invite }) => { + console.log(invite) + }) - lang: Shell label: cURL source: curl -X POST '{backend_url}/admin/invites/{id}/resend' @@ -18374,6 +21519,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.notification.list() + .then(({ notifications, count, limit, offset }) => { + console.log(notifications) + }) - lang: Shell label: cURL source: |- @@ -18428,6 +21590,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.notification.retrieve("notif_123") + .then(({ notification }) => { + console.log(notification) + }) - lang: Shell label: cURL source: |- @@ -18470,6 +21649,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostOrderEditsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.orderEdit.initiateRequest({ + order_id: "order_123" + }) + .then(({ order_change }) => { + console.log(order_change) + }) - lang: Shell label: cURL source: |- @@ -18520,6 +21718,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.orderEdit.cancelRequest("ordch_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -18584,6 +21799,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.orderEdit.confirm("ordch_123") + .then(({ order_preview }) => { + console.log(order_preview) + }) - lang: Shell label: cURL source: |- @@ -18635,6 +21867,30 @@ paths: schema: $ref: '#/components/schemas/AdminPostOrderEditsAddItemsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.orderEdit.addItems("ordch_123", { + items: [ + { + variant_id: "variant_123", + quantity: 1 + } + ] + }) + .then(({ order_preview }) => { + console.log(order_preview) + }) - lang: Shell label: cURL source: |- @@ -18692,6 +21948,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostOrderEditsUpdateItemQuantityReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.orderEdit.updateOriginalItem( + "ordch_123", + "orli_123", + { + quantity: 1 + } + ) + .then(({ order_preview }) => { + console.log(order_preview) + }) - lang: Shell label: cURL source: |- @@ -18756,6 +22035,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostOrderEditsItemsActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.orderEdit.updateAddedItem( + "ordch_123", + "orli_123", + { + quantity: 1 + } + ) + .then(({ order_preview }) => { + console.log(order_preview) + }) - lang: Shell label: cURL source: |- @@ -18810,6 +22112,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.orderEdit.removeAddedItem( + "ordch_123", + "orli_123", + ) + .then(({ order_preview }) => { + console.log(order_preview) + }) - lang: Shell label: cURL source: |- @@ -18855,6 +22177,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.orderEdit.request("ordch_123") + .then(({ order_preview }) => { + console.log(order_preview) + }) - lang: Shell label: cURL source: |- @@ -19659,6 +22998,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.list() + .then(({ orders, count, limit, offset }) => { + console.log(orders) + }) - lang: Shell label: cURL source: |- @@ -19791,6 +23147,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.retrieve("order_123") + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -19853,6 +23226,33 @@ paths: schema: $ref: '#/components/schemas/AdminUpdateOrder' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.update( + "order_123", + { + email: "new_email@example.com", + shipping_address: { + first_name: "John", + last_name: "Doe", + address_1: "123 Main St", + } + } + ) + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -19975,6 +23375,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.cancel("order_123") + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -20038,6 +23455,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.listChanges("order_123") + .then(({ order_changes }) => { + console.log(order_changes) + }) - lang: Shell label: cURL source: |- @@ -20133,6 +23567,100 @@ paths: '500': $ref: '#/components/responses/500_error' x-workflow: completeOrderWorkflow + /admin/orders/{id}/credit-lines: + post: + operationId: PostOrdersIdCreditLines + summary: Create Credit Line for Order + x-sidebar-summary: Create Credit Line + description: Create a credit line for an order. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: |- + Comma-separated fields that should be included in the returned data. + if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCreateOrderCreditLines' + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.createCreditLine( + "order_123", + { + amount: 100, + reference: "order", + reference_id: "order_123", + } + ) + .then(({ order }) => { + console.log(order) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/orders/{id}/credit-lines' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "amount": 32, + "reference": "{value}", + "reference_id": "{value}" + }' + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: createOrderCreditLinesWorkflow /admin/orders/{id}/fulfillments: post: operationId: PostOrdersIdFulfillments @@ -20210,6 +23738,30 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The fulfillment's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.createFulfillment("order_123", { + items: [ + { + id: "orli_123", + quantity: 1 + } + ] + }) + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -20301,6 +23853,29 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The cancelation details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.cancelFulfillment( + "order_123", + "ful_123", + { + no_notification: false + } + ) + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -20364,6 +23939,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.markAsDelivered( + "order_123", + "ful_123", + ) + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -20492,6 +24087,34 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The shipment's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.createShipment( + "order_123", + "ful_123", + { + items: [ + { + id: "fulit_123", + quantity: 1 + } + ] + } + ) + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -20646,6 +24269,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.listLineItems("order_123") + .then(({ order_items }) => { + console.log(order_items) + }) - lang: Shell label: cURL source: |- @@ -20699,6 +24339,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.retrievePreview("order_123") + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -20762,6 +24419,26 @@ paths: schema: $ref: '#/components/schemas/AdminTransferOrder' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.requestTransfer("order_123", { + customer_id: "cus_123", + internal_note: "Internal note", + }) + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -20825,6 +24502,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.order.cancelTransfer("order_123") + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -20892,6 +24586,25 @@ paths: title: amount description: The amount to be paid. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.paymentCollection.create({ + order_id: "order_123" + }) + .then(({ payment_collection }) => { + console.log(payment_collection) + }) - lang: Shell label: cURL source: |- @@ -20941,6 +24654,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.paymentCollection.delete("paycol_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -21010,6 +24740,25 @@ paths: title: order_id description: The ID of the order associated with the payment collection. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.paymentCollection.markAsPaid("paycol_123", { + order_id: "order_123" + }) + .then(({ payment_collection }) => { + console.log(payment_collection) + }) - lang: Shell label: cURL source: |- @@ -21502,6 +25251,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.payment.list() + .then(({ payments, count, limit, offset }) => { + console.log(payments) + }) - lang: Shell label: cURL source: |- @@ -21647,6 +25413,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.payment.listPaymentProviders() + .then(({ payment_providers, count, limit, offset }) => { + console.log(payment_providers) + }) - lang: Shell label: cURL source: |- @@ -21730,6 +25513,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.payment.retrieve("pay_123") + .then(({ payment }) => { + console.log(payment) + }) - lang: Shell label: cURL source: |- @@ -21795,6 +25595,23 @@ paths: title: amount description: The amount to capture. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.payment.capture("paycol_123", {}) + .then(({ payment }) => { + console.log(payment) + }) - lang: Shell label: cURL source: |- @@ -21869,6 +25686,23 @@ paths: title: note description: A note to attach to the refund. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.payment.refund("paycol_123", {}) + .then(({ payment }) => { + console.log(payment) + }) - lang: Shell label: cURL source: |- @@ -21896,6 +25730,60 @@ paths: '500': $ref: '#/components/responses/500_error' x-workflow: refundPaymentWorkflow + /admin/plugins: + get: + operationId: GetPlugins + summary: List Plugins + description: Retrieve the list of plugins installed in the Medusa application. + x-authenticated: true + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.plugin.list() + .then(({ plugins }) => { + console.log(plugins) + }) + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/plugins' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Plugins + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPluginsListResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /admin/price-lists: get: operationId: GetPriceLists @@ -22250,6 +26138,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.priceList.list() + .then(({ price_lists, count, limit, offset }) => { + console.log(price_lists) + }) - lang: Shell label: cURL source: |- @@ -22302,6 +26207,37 @@ paths: schema: $ref: '#/components/schemas/AdminCreatePriceList' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.priceList.create({ + title: "My Price List", + status: "active", + type: "sale", + prices: [ + { + variant_id: "variant_123", + amount: 10, + currency_code: "usd", + rules: { + region_id: "reg_123" + } + } + ] + }) + .then(({ price_list }) => { + console.log(price_list) + }) - lang: Shell label: cURL source: |- @@ -22364,6 +26300,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.priceList.retrieve("plist_123") + .then(({ price_list }) => { + console.log(price_list) + }) - lang: Shell label: cURL source: |- @@ -22422,6 +26375,25 @@ paths: schema: $ref: '#/components/schemas/AdminUpdatePriceList' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.priceList.update("plist_123", { + title: "My Price List", + }) + .then(({ price_list }) => { + console.log(price_list) + }) - lang: Shell label: cURL source: |- @@ -22472,6 +26444,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.priceList.delete("plist_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -22607,6 +26596,38 @@ paths: title: delete description: A price's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.priceList.batchPrices("plist_123", { + create: [{ + variant_id: "variant_123", + currency_code: "usd", + amount: 10, + rules: { + region_id: "reg_123" + } + }], + update: [{ + id: "price_123", + variant_id: "variant_123", + amount: 20, + }], + delete: ["price_123"] + }) + .then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) + }) - lang: Shell label: cURL source: |- @@ -22667,6 +26688,25 @@ paths: schema: $ref: '#/components/schemas/AdminLinkPriceListProducts' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.priceList.linkProducts("plist_123", { + remove: ["prod_123"] + }) + .then(({ price_list }) => { + console.log(price_list) + }) - lang: Shell label: cURL source: |- @@ -22814,6 +26854,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.pricePreference.list() + .then(({ price_preferences, count, limit, offset }) => { + console.log(price_preferences) + }) - lang: Shell label: cURL source: |- @@ -22866,6 +26923,27 @@ paths: schema: $ref: '#/components/schemas/AdminCreatePricePreference' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.pricePreference.create({ + attribute: "region_id", + value: "region_123", + is_tax_inclusive: true + }) + .then(({ price_preference }) => { + console.log(price_preference) + }) - lang: Shell label: cURL source: |- @@ -22921,6 +26999,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.pricePreference.retrieve("prpref_123") + .then(({ price_preference }) => { + console.log(price_preference) + }) - lang: Shell label: cURL source: |- @@ -22979,6 +27074,25 @@ paths: schema: $ref: '#/components/schemas/AdminUpdatePricePreference' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.pricePreference.update("prpref_123", { + is_tax_inclusive: true + }) + .then(({ price_preference }) => { + console.log(price_preference) + }) - lang: Shell label: cURL source: |- @@ -23023,6 +27137,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.pricePreference.delete("prpref_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -23585,6 +27716,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCategory.list() + .then(({ product_categories, count, limit, offset }) => { + console.log(product_categories) + }) - lang: Shell label: cURL source: |- @@ -23637,6 +27785,25 @@ paths: schema: $ref: '#/components/schemas/AdminCreateProductCategory' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCategory.create({ + name: "Shirts" + }) + .then(({ product_category }) => { + console.log(product_category) + }) - lang: Shell label: cURL source: |- @@ -23714,6 +27881,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCategory.retrieve("pcat_123") + .then(({ product_category }) => { + console.log(product_category) + }) - lang: Shell label: cURL source: |- @@ -23805,6 +27989,25 @@ paths: title: rank description: The product category's rank among other categories. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCategory.update("pcat_123", { + name: "Shirts" + }) + .then(({ product_category }) => { + console.log(product_category) + }) - lang: Shell label: cURL source: |- @@ -23854,6 +28057,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCategory.delete("pcat_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -23931,6 +28151,26 @@ paths: title: remove description: A product ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productCategory.updateProducts("pcat_123", { + add: ["prod_123"], + remove: ["prod_321"] + }) + .then(({ product_category }) => { + console.log(product_category) + }) - lang: Shell label: cURL source: |- @@ -24419,6 +28659,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productTag.list() + .then(({ product_tags, count, limit, offset }) => { + console.log(product_tags) + }) - lang: Shell label: cURL source: |- @@ -24471,6 +28728,25 @@ paths: schema: $ref: '#/components/schemas/AdminCreateProductTag' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productTag.create({ + value: "shirt" + }) + .then(({ product_tag }) => { + console.log(product_tag) + }) - lang: Shell label: cURL source: |- @@ -24531,6 +28807,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productTag.retrieve("ptag_123") + .then(({ product_tag }) => { + console.log(product_tag) + }) - lang: Shell label: cURL source: |- @@ -24598,6 +28891,25 @@ paths: type: object description: The product tag's metadata. Can hold custom key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productTag.update("ptag_123", { + value: "shirt" + }) + .then(({ product_tag }) => { + console.log(product_tag) + }) - lang: Shell label: cURL source: |- @@ -24646,6 +28958,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productTag.delete("ptag_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -25134,6 +29463,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productType.list() + .then(({ product_types, count, limit, offset }) => { + console.log(product_types) + }) - lang: Shell label: cURL source: |- @@ -25186,6 +29532,25 @@ paths: schema: $ref: '#/components/schemas/AdminCreateProductType' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productType.create({ + value: "Clothes" + }) + .then(({ product_type }) => { + console.log(product_type) + }) - lang: Shell label: cURL source: |- @@ -25246,6 +29611,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productType.retrieve("ptyp_123") + .then(({ product_type }) => { + console.log(product_type) + }) - lang: Shell label: cURL source: |- @@ -25313,6 +29695,25 @@ paths: type: object description: The product type's metadata. Can hold custom key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productType.update("ptyp_123", { + value: "Clothes" + }) + .then(({ product_type }) => { + console.log(product_type) + }) - lang: Shell label: cURL source: |- @@ -25361,6 +29762,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productType.delete("ptyp_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -25853,6 +30271,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.productVariant.list() + .then(({ variants, count, limit, offset }) => { + console.log(variants) + }) - lang: Shell label: cURL source: |- @@ -26897,6 +31332,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.list() + .then(({ products, count, limit, offset }) => { + console.log(products) + }) - lang: Shell label: cURL source: |- @@ -26986,6 +31438,39 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The product's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.create({ + title: "Shirt", + options: [{ + title: "Default", + values: ["Default Option"] + }], + variants: [ + { + title: "Default", + options: { + Default: "Default Option" + }, + prices: [] + } + ], + shipping_profile_id: "sp_123" + }) + .then(({ product }) => { + console.log(product) + }) - lang: Shell label: cURL source: |- @@ -27050,6 +31535,47 @@ paths: schema: $ref: '#/components/schemas/AdminBatchProductRequest' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.batch({ + create: [ + { + title: "Shirt", + options: [{ + title: "Default", + values: ["Default Option"] + }], + variants: [ + { + title: "Default", + options: { + Default: "Default Option" + }, + prices: [] + } + ] + } + ], + update: [{ + id: "prod_123", + title: "Pants" + }], + delete: ["prod_321"] + }) + .then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) + }) - lang: Shell label: cURL source: |- @@ -27108,6 +31634,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.export({}) + .then(({ transaction_id }) => { + console.log(transaction_id) + }) - lang: Shell label: cURL source: |- @@ -27151,6 +31694,25 @@ paths: schema: $ref: '#/components/schemas/AdminImportProductRequest' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.import({ + file // uploaded File instance + }) + .then(({ transaction_id }) => { + console.log(transaction_id) + }) - lang: Shell label: cURL source: |- @@ -27196,6 +31758,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.confirmImport("transaction_123") + .then(() => { + console.log("Import confirmed") + }) - lang: Shell label: cURL source: |- @@ -27204,6 +31783,8 @@ paths: tags: - Products responses: + '202': + description: OK '400': $ref: '#/components/responses/400_error' '401': @@ -27244,6 +31825,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.retrieve("prod_123") + .then(({ product }) => { + console.log(product) + }) - lang: Shell label: cURL source: |- @@ -27310,6 +31908,25 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The properties to update in a product. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.update("prod_123", { + title: "Shirt", + }) + .then(({ product }) => { + console.log(product) + }) - lang: Shell label: cURL source: |- @@ -27354,6 +31971,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.delete("prod_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -27494,6 +32128,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.listOptions("prod_123") + .then(({ product_options, count, limit, offset }) => { + console.log(product_options) + }) - lang: Shell label: cURL source: |- @@ -27590,6 +32241,29 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The product option's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.createOption( + "prod_123", + { + title: "Color", + values: ["Green", "Blue"] + } + ) + .then(({ product }) => { + console.log(product) + }) - lang: Shell label: cURL source: |- @@ -27659,6 +32333,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.retrieveOption( + "prod_123", + "prodopt_123" + ) + .then(({ product_option }) => { + console.log(product_option) + }) - lang: Shell label: cURL source: |- @@ -27732,6 +32426,29 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The properties to update in the product option. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.updateOption( + "prod_123", + "prodopt_123", + { + title: "Color" + } + ) + .then(({ product }) => { + console.log(product) + }) - lang: Shell label: cURL source: |- @@ -27796,6 +32513,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.deleteOption("prod_123", "prodopt_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -28295,6 +33029,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.listVariants("prod_123") + .then(({ variants, count, limit, offset }) => { + console.log(variants) + }) - lang: Shell label: cURL source: |- @@ -28391,6 +33142,34 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The product variant's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.createVariant("prod_123", { + title: "Blue Shirt", + options: { + Color: "Blue" + }, + prices: [ + { + amount: 10, + currency_code: "usd" + } + ] + }) + .then(({ product }) => { + console.log(product) + }) - lang: Shell label: cURL source: |- @@ -28457,6 +33236,40 @@ paths: schema: $ref: '#/components/schemas/AdminBatchProductVariantRequest' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.batchVariants("prod_123", { + create: [ + { + title: "Blue Shirt", + options: { + Color: "Blue" + }, + prices: [] + } + ], + update: [ + { + id: "variant_123", + title: "Pants" + } + ], + delete: ["variant_123"] + }) + .then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) + }) - lang: Shell label: cURL source: |- @@ -28574,6 +33387,47 @@ paths: title: variant_id description: The ID of the variant. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.batchVariantInventoryItems( + "prod_123", + { + create: [ + { + inventory_item_id: "iitem_123", + variant_id: "variant_123", + required_quantity: 10 + } + ], + update: [ + { + inventory_item_id: "iitem_1234", + variant_id: "variant_1234", + required_quantity: 20 + } + ], + delete: [ + { + inventory_item_id: "iitem_321", + variant_id: "variant_321" + } + ] + } + ) + .then(({ created, updated, deleted }) => { + console.log(created, updated, deleted) + }) - lang: Shell label: cURL source: |- @@ -28636,6 +33490,26 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.retrieveVariant( + "prod_123", + "variant_123" + ) + .then(({ variant }) => { + console.log(variant) + }) - lang: Shell label: cURL source: |- @@ -28709,6 +33583,29 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The properties to update in the variant. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.updateVariant( + "prod_123", + "variant_123", + { + title: "Blue Shirt", + } + ) + .then(({ product }) => { + console.log(product) + }) - lang: Shell label: cURL source: |- @@ -28770,6 +33667,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.product.deleteVariant("prod_123", "variant_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -29488,11 +34402,56 @@ paths: items: type: object title: $or + - name: currency_code + in: query + required: false + schema: + oneOf: + - type: string + title: currency_code + description: Filter by a currency code. The promotions are filtered based on their application method's currency code. + - type: array + description: Filter by currency codes. The promotions are filtered based on their application method's currency code. + items: + type: string + title: currency_code + description: A currency code. + - name: application_method_type + in: query + required: false + schema: + oneOf: + - type: string + title: application_method_type + description: Filter by an application method type. The promotions are filtered based on their application method's type. + - type: array + description: Filter by application method types. The promotions are filtered based on their application method's type. + items: + type: string + title: application_method_type + description: An application method type. security: - api_token: [] - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.promotion.list() + .then(({ promotions, count, limit, offset }) => { + console.log(promotions) + }) - lang: Shell label: cURL source: |- @@ -29856,6 +34815,29 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The promotion's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.promotion.create({ + name: "My Promotion", + description: "This is a test promotion", + code: "PROMO123", + starts_at: "2021-01-01", + ends_at: "2021-01-01", + }) + .then(({ promotion }) => { + console.log(promotion) + }) - lang: Shell label: cURL source: |- @@ -29954,6 +34936,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.promotion.listRuleAttributes("rules", "standard") + .then(({ attributes }) => { + console.log(attributes) + }) - lang: Shell label: cURL source: |- @@ -30070,6 +35069,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.promotion.listRuleValues("rules", "attr_123") + .then(({ values }) => { + console.log(values) + }) - lang: Shell label: cURL source: |- @@ -30083,16 +35099,37 @@ paths: content: application/json: schema: - type: object - description: The list of rule values. - required: - - values - properties: - values: - type: array + allOf: + - type: object + description: The pagination fields. + required: + - limit + - offset + - count + properties: + limit: + type: number + title: limit + description: The maximum number of items returned. + offset: + type: number + title: offset + description: The number of items skipped before retrieving the returned items. + count: + type: number + title: count + description: The total number of items. + - type: object description: The list of rule values. - items: - $ref: '#/components/schemas/AdminRuleValueOption' + required: + - values + properties: + values: + type: array + description: The list of rule values. + items: + $ref: '#/components/schemas/AdminRuleValueOption' + description: The paginated list of rule values. '400': $ref: '#/components/responses/400_error' '401': @@ -30133,6 +35170,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.promotion.retrieve("promo_123") + .then(({ promotion }) => { + console.log(promotion) + }) - lang: Shell label: cURL source: |- @@ -30281,6 +35335,25 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The properties to update in a promotion. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.promotion.update("promo_123", { + code: "PROMO123", + }) + .then(({ promotion }) => { + console.log(promotion) + }) - lang: Shell label: cURL source: |- @@ -30329,6 +35402,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.promotion.delete("promo_123") + .then(({ promotion }) => { + console.log(promotion) + }) - lang: Shell label: cURL source: |- @@ -30778,6 +35868,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.promotion.listRules("promo_123", "rules") + .then(({ rules }) => { + console.log(rules) + }) - lang: Shell label: cURL source: |- @@ -30905,6 +36012,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.refundReason.list() + .then(({ refund_reasons, count, limit, offset }) => { + console.log(refund_reasons) + }) - lang: Shell label: cURL source: |- @@ -31683,6 +36807,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.region.list() + .then(({ regions, count, limit, offset }) => { + console.log(regions) + }) - lang: Shell label: cURL source: |- @@ -31764,6 +36905,26 @@ paths: schema: $ref: '#/components/schemas/AdminCreateRegion' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.region.create({ + name: "United States", + currency_code: "usd", + }) + .then(({ region }) => { + console.log(region) + }) - lang: Shell label: cURL source: |- @@ -31825,6 +36986,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.region.retrieve("region_123") + .then(({ region }) => { + console.log(region) + }) - lang: Shell label: cURL source: |- @@ -31918,6 +37096,25 @@ paths: title: is_tax_inclusive description: Whether the prices in the region are tax inclusive. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.region.update("region_123", { + name: "United States", + }) + .then(({ region }) => { + console.log(region) + }) - lang: Shell label: cURL source: |- @@ -31966,6 +37163,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.region.delete("region_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -32528,6 +37742,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.reservation.list() + .then(({ reservations, count, limit, offset }) => { + console.log(reservations) + }) - lang: Shell label: cURL source: |- @@ -32609,6 +37840,27 @@ paths: schema: $ref: '#/components/schemas/AdminCreateReservation' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.reservation.create({ + inventory_item_id: "iitem_123", + location_id: "sloc_123", + quantity: 10, + }) + .then(({ reservation }) => { + console.log(reservation) + }) - lang: Shell label: cURL source: |- @@ -32673,6 +37925,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.reservation.retrieve("res_123") + .then(({ reservation }) => { + console.log(reservation) + }) - lang: Shell label: cURL source: |- @@ -32748,6 +38017,25 @@ paths: type: object description: The reservation's metadata. Can hold custom key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.reservation.update("res_123", { + quantity: 20, + }) + .then(({ reservation }) => { + console.log(reservation) + }) - lang: Shell label: cURL source: |- @@ -32797,6 +38085,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.reservation.delete("res_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -33348,6 +38653,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.returnReason.list() + .then(({ return_reasons, count, limit, offset }) => { + console.log(return_reasons) + }) - lang: Shell label: cURL source: |- @@ -33400,6 +38722,26 @@ paths: schema: $ref: '#/components/schemas/AdminCreateReturnReason' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.returnReason.create({ + value: "refund", + label: "Refund", + }) + .then(({ return_reason }) => { + console.log(return_reason) + }) - lang: Shell label: cURL source: |- @@ -33460,6 +38802,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.returnReason.retrieve("ret_123") + .then(({ return_reason }) => { + console.log(return_reason) + }) - lang: Shell label: cURL source: |- @@ -33518,6 +38877,26 @@ paths: schema: $ref: '#/components/schemas/AdminUpdateReturnReason' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.returnReason.update("ret_123", { + value: "refund", + label: "Refund", + }) + .then(({ return_reason }) => { + console.log(return_reason) + }) - lang: Shell label: cURL source: |- @@ -33562,6 +38941,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.returnReason.delete("ret_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -34197,6 +39593,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.list() + .then(({ returns, count, limit, offset }) => { + console.log(returns) + }) - lang: Shell label: cURL source: |- @@ -34278,6 +39691,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.initiateRequest({ + order_id: "order_123", + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -34351,6 +39783,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.retrieve("return_123") + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -34409,6 +39858,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsReturnReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.updateRequest("return_123", { + location_id: "sloc_123", + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -34458,6 +39926,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.cancel("return_123") + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -34524,6 +40009,27 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsReceiveItemsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.dismissItems("return_123", { + items: [ + { id: "orli_123", quantity: 1 }, + ], + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -34594,6 +40100,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsDismissItemsActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.updateDismissItem("return_123", "orchach_123", { + quantity: 2, + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -34658,6 +40183,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.removeDismissItem("return_123", "orchach_123") + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -34718,6 +40260,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostReceiveReturnsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.initiateReceive("return_123", { + internal_note: "Return received by the customer", + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -34775,6 +40336,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.cancelReceive("return_123") + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -34855,6 +40433,27 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsReceiveItemsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.receiveItems("return_123", { + items: [ + { id: "item_123", quantity: 1 }, + ], + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -34925,6 +40524,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsReceiveItemsActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.updateReceiveItem("return_123", "orchach_123", { + quantity: 2, + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -34989,6 +40607,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.removeReceiveItem("return_123", "orchach_123") + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -35050,6 +40685,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsConfirmRequestReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.confirmReceive("return_123", { + no_notification: true, + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -35111,6 +40765,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsConfirmRequestReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.confirmRequest("return_123", { + no_notification: true, + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -35155,6 +40828,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.cancelRequest("return_123") + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -35235,6 +40925,26 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsRequestItemsReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.addReturnItem("return_123", { + id: "orlitem_123", + quantity: 1, + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -35305,6 +41015,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsRequestItemsActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.updateReturnItem("return_123", "orchach_123", { + quantity: 2, + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -35369,6 +41098,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.removeReturnItem("return_123", "orchach_123") + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -35430,6 +41176,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsShippingReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.addReturnShipping("return_123", { + shipping_option_id: "so_123", + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -35504,6 +41269,25 @@ paths: schema: $ref: '#/components/schemas/AdminPostReturnsShippingActionReqSchema' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.updateReturnShipping("return_123", "orchach_123", { + custom_amount: 100, + }) + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -35568,6 +41352,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.return.deleteReturnShipping("return_123", "orchach_123") + .then(({ return }) => { + console.log(return) + }) - lang: Shell label: cURL source: |- @@ -36100,6 +41901,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.salesChannel.list() + .then(({ sales_channels, count, limit, offset }) => { + console.log(sales_channels) + }) - lang: Shell label: cURL source: |- @@ -36181,6 +41999,25 @@ paths: schema: $ref: '#/components/schemas/AdminCreateSalesChannel' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.salesChannel.create({ + name: "Storefront", + }) + .then(({ salesChannel }) => { + console.log(salesChannel) + }) - lang: Shell label: cURL source: |- @@ -36242,6 +42079,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.salesChannel.retrieve("sc_123") + .then(({ sales_channel }) => { + console.log(sales_channel) + }) - lang: Shell label: cURL source: |- @@ -36300,6 +42154,28 @@ paths: schema: $ref: '#/components/schemas/AdminUpdateSalesChannel' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.salesChannel.update( + "sc_123", + { + name: "Storefront", + } + ) + .then(({ salesChannel }) => { + console.log(salesChannel) + }) - lang: Shell label: cURL source: |- @@ -36349,6 +42225,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.salesChannel.delete("sc_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -36426,6 +42319,26 @@ paths: title: remove description: A product's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.salesChannel.batchProducts("sc_123", { + add: ["prod_123", "prod_456"], + remove: ["prod_789"] + }) + .then(({ sales_channel }) => { + console.log(sales_channel) + }) - lang: Shell label: cURL source: |- @@ -36968,6 +42881,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.shippingOption.list() + .then(({ shipping_options, count, limit, offset }) => { + console.log(shipping_options) + }) - lang: Shell label: cURL source: |- @@ -37049,6 +42979,26 @@ paths: schema: $ref: '#/components/schemas/AdminCreateShippingOption' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.shippingOption.create({ + name: "Standard Shipping", + profile_id: "shp_123", + }) + .then(({ shipping_option }) => { + console.log(shipping_option) + }) - lang: Shell label: cURL source: |- @@ -37121,6 +43071,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.shippingOption.retrieve("so_123") + .then(({ shipping_option }) => { + console.log(shipping_option) + }) - lang: Shell label: cURL source: |- @@ -37344,6 +43311,25 @@ paths: description: A value of the attribute that enables this rule. example: cusgroup_123 x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.shippingOption.update("so_123", { + name: "Standard Shipping", + }) + .then(({ shipping_option }) => { + console.log(shipping_option) + }) - lang: Shell label: cURL source: |- @@ -37388,6 +43374,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.shippingOption.delete("so_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -37468,6 +43471,25 @@ paths: title: delete description: A rule's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.shippingOption.updateRules("so_123", { + create: [{ attribute: "enabled_in_store", operator: "eq", value: "true" }], + }) + .then(({ shipping_option }) => { + console.log(shipping_option) + }) - lang: Shell label: cURL source: |- @@ -37998,6 +44020,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.shippingProfile.list() + .then(({ shipping_profiles, count, limit, offset }) => { + console.log(shipping_profiles) + }) - lang: Shell label: cURL source: |- @@ -38079,6 +44118,25 @@ paths: schema: $ref: '#/components/schemas/AdminCreateShippingProfile' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.shippingProfile.create({ + name: "Default Shipping Profile", + }) + .then(({ shipping_profile }) => { + console.log(shipping_profile) + }) - lang: Shell label: cURL source: |- @@ -38140,6 +44198,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.shippingProfile.retrieve("sp_123") + .then(({ shipping_profile }) => { + console.log(shipping_profile) + }) - lang: Shell label: cURL source: |- @@ -38211,6 +44286,25 @@ paths: type: object description: The shipping profile's metadata. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.shippingProfile.update("sp_123", { + name: "Updated Shipping Profile", + }) + .then(({ shipping_profile }) => { + console.log(shipping_profile) + }) - lang: Shell label: cURL source: |- @@ -38259,6 +44353,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.shippingProfile.delete("sp_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -38775,6 +44886,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.stockLocation.list() + .then(({ stock_locations, count, limit, offset }) => { + console.log(stock_locations) + }) - lang: Shell label: cURL source: |- @@ -38827,6 +44955,26 @@ paths: schema: $ref: '#/components/schemas/AdminCreateStockLocation' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.stockLocation.create({ + name: "Main Warehouse", + address_id: "addr_123", + }) + .then(({ stock_location }) => { + console.log(stock_location) + }) - lang: Shell label: cURL source: |- @@ -38888,6 +45036,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.stockLocation.retrieve("sloc_123") + .then(({ stock_location }) => { + console.log(stock_location) + }) - lang: Shell label: cURL source: |- @@ -38946,6 +45111,25 @@ paths: schema: $ref: '#/components/schemas/AdminUpdateStockLocation' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.stockLocation.update("sloc_123", { + name: "European Warehouse", + }) + .then(({ stock_location }) => { + console.log(stock_location) + }) - lang: Shell label: cURL source: |- @@ -38995,6 +45179,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.stockLocation.delete("sloc_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -39072,6 +45273,26 @@ paths: title: remove description: A fulfillment provider's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.stockLocation.updateFulfillmentProviders("sloc_123", { + add: ["fp_manual_manual"], + remove: ["fp_shipstation_shipstation"], + }) + .then(({ stock_location }) => { + console.log(stock_location) + }) - lang: Shell label: cURL source: |- @@ -39146,6 +45367,26 @@ paths: title: type description: The fulfillment set's type. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.stockLocation.createFulfillmentSet("sloc_123", { + name: "Shipping", + type: "shipping", + }) + .then(({ stock_location }) => { + console.log(stock_location) + }) - lang: Shell label: cURL source: |- @@ -39228,6 +45469,26 @@ paths: title: remove description: A sales channel's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.stockLocation.updateSalesChannels("sloc_123", { + add: ["sc_123"], + remove: ["sc_456"], + }) + .then(({ stock_location }) => { + console.log(stock_location) + }) - lang: Shell label: cURL source: |- @@ -39359,6 +45620,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.store.list() + .then(({ stores, count, limit, offset }) => { + console.log(stores) + }) - lang: Shell label: cURL source: |- @@ -39413,6 +45691,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.store.retrieve("store_123") + .then(({ store }) => { + console.log(store) + }) - lang: Shell label: cURL source: |- @@ -39471,6 +45766,25 @@ paths: schema: $ref: '#/components/schemas/AdminUpdateStore' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.store.update("store_123", { + name: "My Store", + }) + .then(({ store }) => { + console.log(store) + }) - lang: Shell label: cURL source: |- @@ -40039,6 +46353,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.taxRate.list() + .then(({ tax_rates, count, limit, offset }) => { + console.log(tax_rates) + }) - lang: Shell label: cURL source: |- @@ -40120,6 +46451,28 @@ paths: schema: $ref: '#/components/schemas/AdminCreateTaxRate' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.taxRate.create({ + name: "VAT", + tax_region_id: "txreg_123", + code: "VAT", + rate: 2, // 2% + }) + .then(({ tax_rate }) => { + console.log(tax_rate) + }) - lang: Shell label: cURL source: |- @@ -40181,6 +46534,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.taxRate.retrieve("txrat_123") + .then(({ tax_rate }) => { + console.log(tax_rate) + }) - lang: Shell label: cURL source: |- @@ -40239,6 +46609,26 @@ paths: schema: $ref: '#/components/schemas/AdminUpdateTaxRate' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.taxRate.update("txrat_123", { + name: "VAT", + code: "VAT", + }) + .then(({ tax_rate }) => { + console.log(tax_rate) + }) - lang: Shell label: cURL source: |- @@ -40287,6 +46677,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.taxRate.delete("txrat_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -41453,6 +47860,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.taxRegion.list() + .then(({ tax_regions, count, limit, offset }) => { + console.log(tax_regions) + }) - lang: Shell label: cURL source: |- @@ -41534,6 +47958,32 @@ paths: schema: $ref: '#/components/schemas/AdminCreateTaxRegion' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.taxRegion.create({ + country_code: "us", + province_code: "ca", + default_tax_rate: { + code: "VAT", + name: "VAT", + rate: 20, // 20% + is_combinable: true, + }, + }) + .then(({ tax_region }) => { + console.log(tax_region) + }) - lang: Shell label: cURL source: |- @@ -41596,6 +48046,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.taxRegion.retrieve("txreg_123") + .then(({ tax_region }) => { + console.log(tax_region) + }) - lang: Shell label: cURL source: |- @@ -41701,6 +48168,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.taxRegion.delete("txreg_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -41784,6 +48268,35 @@ paths: title: FileList description: The files to upload. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.upload.create( + { + files: [ + // file uploaded as a base64 string + { + name: "test.txt", + content: "test", // Should be the base64 content of the file + }, + // file uploaded as a File object + new File(["test"], "test.txt", { type: "text/plain" }) + ], + } + ) + .then(({ files }) => { + console.log(files) + }) - lang: Shell label: cURL source: |- @@ -41839,6 +48352,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.upload.retrieve("test.txt") + .then(({ file }) => { + console.log(file) + }) - lang: Shell label: cURL source: |- @@ -41882,6 +48412,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.upload.delete("test.txt") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -42378,6 +48925,23 @@ paths: title: $exists description: Filter by whether a value for this parameter exists (not `null`). x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.user.list() + .then(({ users, count, limit, offset }) => { + console.log(users) + }) - lang: Shell label: cURL source: curl '{backend_url}/admin/users' @@ -42423,6 +48987,23 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.user.me() + .then(({ user }) => { + console.log(user) + }) - lang: Shell label: cURL source: curl '{backend_url}/admin/users/me' @@ -42474,6 +49055,23 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.user.retrieve("user_123") + .then(({ user }) => { + console.log(user) + }) - lang: Shell label: cURL source: curl '{backend_url}/admin/users/{id}' @@ -42529,6 +49127,26 @@ paths: schema: $ref: '#/components/schemas/AdminUpdateUser' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.user.update("user_123", { + first_name: "John", + last_name: "Doe", + }) + .then(({ user }) => { + console.log(user) + }) - lang: Shell label: cURL source: |- @@ -42577,6 +49195,23 @@ paths: schema: type: string x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.user.delete("user_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: curl -X DELETE '{backend_url}/admin/users/{id}' @@ -42683,6 +49318,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.workflowExecution.list() + .then(({ workflow_executions, count, limit, offset }) => { + console.log(workflow_executions) + }) - lang: Shell label: cURL source: |- @@ -42766,6 +49418,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.workflowExecution.retrieve("wrk_123") + .then(({ workflow_execution }) => { + console.log(workflow_execution) + }) - lang: Shell label: cURL source: |- @@ -43214,6 +49883,23 @@ paths: description: Deletes the cookie session ID previously set for authentication. x-authenticated: true x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + await sdk.auth.logout() + + // user is now logged out + // you can't send any requests that require authentication - lang: Shell label: cURL source: |- @@ -43258,6 +49944,23 @@ paths: description: Learn about third-party authentication flow. x-authenticated: true x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + const token = await sdk.auth.refresh() + + // all subsequent requests will use the token in the header + const { user } = await sdk.admin.user.me() - lang: Shell label: cURL source: |- @@ -43315,15 +50018,38 @@ paths: For example, for email-pass authentication, pass `email` and `password` properties. For the Google and GitHub authentication providers, you can pass `callback_url` to indicate the URL in the frontend that the user should be redirected to after completing their authentication. This will override the provider's `callbackUrl` configurations in `medusa-config.ts`. x-codeSamples: - - lang: Shell - label: EmailPass Provider + - lang: JavaScript + label: JS SDK source: |- - curl -X POST '{backend_url}/auth/user/emailpass' \ - -H 'Content-Type: application/json' \ - --data-raw '{ - "email": "admin@medusa-test.com", - "password": "supersecret" - }' + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + const result = await sdk.auth.login( + "user", + "emailpass", + { + email: "user@gmail.com", + password: "supersecret" + } + ) + + if (typeof result !== "string") { + alert("Authentication requires additional steps") + // replace with the redirect logic of your application + window.location.href = result.location + return + } + + // user is now authenticated + // all subsequent requests will use the token in the header + const { user } = await sdk.admin.user.me() - lang: Bash label: Google Provider source: curl -X POST '{backend_url}/auth/user/google' @@ -43371,12 +50097,74 @@ paths: type: string example: google x-codeSamples: - - lang: Shell + - lang: JavaScript label: Google Provider - source: curl -X POST '{backend_url}/auth/user/google/callback?code=123' - - lang: Bash + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + await sdk.auth.callback( + "user", + "google", + { + code: "123", + state: "456" + } + ) + + // all subsequent requests will use the token in the header + sdk.admin.invite.accept( + { + email: "user@gmail.com", + first_name: "John", + last_name: "Smith", + invite_token: "12345..." + }, + ) + .then(({ user }) => { + console.log(user) + }) + - lang: TypeScript label: GitHub Provider - source: curl -X POST '{backend_url}/auth/user/github/callback?code=123' + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + const authToken = await sdk.auth.callback( + "user", + "google", + { + code: "123", + state: "456" + } + ) + + // all subsequent requests will use the token in the header + sdk.admin.invite.accept( + { + email: "user@gmail.com", + first_name: "John", + last_name: "Smith", + invite_token: "12345..." + }, + ) + .then(({ user }) => { + console.log(user) + }) tags: - Auth responses: @@ -43426,6 +50214,33 @@ paths: email: admin@medusa-test.com password: supersecret x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + const token = await sdk.auth.register("user", "emailpass", { + email: "user@gmail.com", + password: "supersecret" + }) + + // all subsequent requests will use the token in the header + const { user } = await sdk.admin.invite.accept( + { + email: "user@gmail.com", + first_name: "John", + last_name: "Smith", + invite_token: "12345..." + }, + ) - lang: Shell label: cURL source: |- @@ -43489,6 +50304,29 @@ paths: description: The user's identifier for the selected auth provider. For example, for the `emailpass` auth provider, the value is the user's email. example: admin@medusa-test.com x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.auth.resetPassword( + "user", + "emailpass", + { + identifier: "user@gmail.com" + } + ) + .then(() => { + // user receives token + }) - lang: Shell label: cURL source: |- @@ -43544,6 +50382,30 @@ paths: email: admin@medusa-test.com password: supersecret x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.auth.updateProvider( + "user", + "emailpass", + { + password: "supersecret" + }, + token + ) + .then(() => { + // password updated + }) - lang: Shell label: cURL source: |- @@ -43587,6 +50449,91 @@ paths: $ref: '#/components/responses/500_error' components: schemas: + AdminAddDraftOrderItems: + type: object + description: The details of the items to add to a draft order. + x-schemaName: AdminAddDraftOrderItems + properties: + items: + type: array + description: The items to add to the draft order. + items: + type: object + description: The item's details + required: + - quantity + properties: + quantity: + type: number + title: quantity + description: The item's quantity. + variant_id: + type: string + title: variant_id + description: The ID of the variant to add to the draft order. + title: + type: string + title: title + description: The item's title. + unit_price: + type: number + title: unit_price + description: The item's unit price. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the item. + allow_backorder: + type: boolean + title: allow_backorder + description: Whether the item can be purchased if it's out of stock. + metadata: + type: object + description: The item's metadata, can hold custom key-value pairs. + AdminAddDraftOrderPromotions: + type: object + description: The details of the promotions to add to a draft order. + x-schemaName: AdminAddDraftOrderPromotions + required: + - promo_codes + properties: + promo_codes: + type: array + description: The list promotion codes to add to the draft order. + items: + type: string + title: promo_codes + description: A promotion's code. + AdminAddDraftOrderShippingMethod: + type: object + description: The details of the shipping method to add to a draft order. + x-schemaName: AdminAddDraftOrderShippingMethod + required: + - shipping_option_id + properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the shipping option that this method is created from. + custom_amount: + type: number + title: custom_amount + description: A custom amount to be charged for this shipping method. If not provided, the shipping option's amount will be used. + description: + type: string + title: description + description: The shipping method's description. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. AdminApiKey: type: object description: The API key's details. @@ -44976,6 +51923,33 @@ components: metadata: type: object description: The inventory item's metadata, used to store custom key-value pairs. + AdminCreateOrderCreditLines: + type: object + description: The details of a credit line to add to an order. + x-schemaName: AdminCreateOrderCreditLines + required: + - amount + - reference + - reference_id + properties: + amount: + type: number + title: amount + description: The amount of the credit line. + example: 100 + reference: + type: string + title: reference + description: The name of the table that the credit line is referencing. + example: order + reference_id: + type: string + title: reference_id + description: The ID of a record in the table that the credit line is referencing. + example: order_123 + metadata: + type: object + description: The credit line's metadata, can hold custom key-value pairs. AdminCreatePriceList: type: object description: The price list's details. @@ -47179,6 +54153,13 @@ components: type: number title: original_shipping_tax_total description: The tax total of the draft order's shipping excluding promotions. + region: + $ref: '#/components/schemas/AdminRegion' + credit_lines: + type: array + description: The draft order's credit lines. + items: + $ref: '#/components/schemas/OrderCreditLine' AdminDraftOrderListResponse: type: object description: The list of draft orders with pagination fields. @@ -47206,6 +54187,645 @@ components: description: The list of draft orders. items: $ref: '#/components/schemas/AdminDraftOrder' + AdminDraftOrderPreview: + type: object + description: The draft order preview's details. + x-schemaName: AdminDraftOrderPreview + required: + - return_requested_total + - order_change + - status + - currency_code + - id + - version + - region_id + - customer_id + - sales_channel_id + - email + - payment_collections + - payment_status + - fulfillment_status + - summary + - created_at + - updated_at + - original_item_total + - original_item_subtotal + - original_item_tax_total + - item_total + - item_subtotal + - item_tax_total + - original_total + - original_subtotal + - original_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - gift_card_total + - gift_card_tax_total + - shipping_total + - shipping_subtotal + - shipping_tax_total + - original_shipping_total + - original_shipping_subtotal + - original_shipping_tax_total + properties: + return_requested_total: + type: number + title: return_requested_total + description: The total of the requested return. + order_change: + $ref: '#/components/schemas/AdminOrderChange' + items: + type: array + description: The order's items. + items: + allOf: + - type: object + description: An order's item. + x-schemaName: BaseOrderLineItem + required: + - id + - title + - subtitle + - thumbnail + - variant_id + - product_id + - product_title + - product_description + - product_subtitle + - product_type + - product_collection + - product_handle + - variant_sku + - variant_barcode + - variant_title + - variant_option_values + - requires_shipping + - is_discountable + - is_tax_inclusive + - unit_price + - quantity + - detail + - created_at + - updated_at + - metadata + - original_total + - original_subtotal + - original_tax_total + - item_total + - item_subtotal + - item_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - refundable_total + - refundable_total_per_unit + properties: + id: + type: string + title: id + description: The item's ID. + title: + type: string + title: title + description: The item's title. + subtitle: + type: string + title: subtitle + description: The item's subtitle. + thumbnail: + type: string + title: thumbnail + description: The URL of the item's thumbnail. + variant: + $ref: '#/components/schemas/BaseProductVariant' + variant_id: + type: string + title: variant_id + description: The ID of the associated variant. + product: + $ref: '#/components/schemas/AdminProduct' + product_id: + type: string + title: product_id + description: The ID of the associated product. + product_title: + type: string + title: product_title + description: The title of the item's product. + product_description: + type: string + title: product_description + description: The description of the item's product. + product_subtitle: + type: string + title: product_subtitle + description: The subtitle of the item's product. + product_type: + type: string + title: product_type + description: The ID of type of the item's product. + product_collection: + type: string + title: product_collection + description: The ID of collection of the item's product. + product_handle: + type: string + title: product_handle + description: The handle of the item's product. + variant_sku: + type: string + title: variant_sku + description: The SKU of the item's variant. + variant_barcode: + type: string + title: variant_barcode + description: The barcode of the item's variant. + variant_title: + type: string + title: variant_title + description: The title of the item's variant. + variant_option_values: + type: object + description: The option values of the item's variant as key-value pairs. The key is the title of an option, and the value is the option's value. + requires_shipping: + type: boolean + title: requires_shipping + description: Whether the item requires shipping. + is_discountable: + type: boolean + title: is_discountable + description: Whether the item is discountable. + is_tax_inclusive: + type: boolean + title: is_tax_inclusive + description: Whether the item's price includes taxes. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + unit_price: + type: number + title: unit_price + description: The item's unit price. + quantity: + type: number + title: quantity + description: The item's quantity. + tax_lines: + type: array + description: The item's tax lines. + items: + $ref: '#/components/schemas/BaseOrderLineItemTaxLine' + adjustments: + type: array + description: The item's adjustments. + items: + $ref: '#/components/schemas/BaseOrderLineItemAdjustment' + detail: + $ref: '#/components/schemas/BaseOrderItemDetail' + created_at: + type: string + format: date-time + title: created_at + description: The date the item was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the item was updated. + metadata: + type: object + description: The item's metadata, can hold custom key-value pairs. + original_total: + type: number + title: original_total + description: The item's total including taxes, excluding promotions. + original_subtotal: + type: number + title: original_subtotal + description: The item's total excluding taxes, including promotions. + original_tax_total: + type: number + title: original_tax_total + description: The tax total of the item excluding promotions. + item_total: + type: number + title: item_total + description: The item's total for a single unit including taxes and promotions. + item_subtotal: + type: number + title: item_subtotal + description: The item's total for a single unit excluding taxes, including promotions. + item_tax_total: + type: number + title: item_tax_total + description: The tax total for a single unit of the item including promotions. + total: + type: number + title: total + description: The item's total including taxes and promotions. + subtotal: + type: number + title: subtotal + description: The item's total excluding taxes, including promotions. + tax_total: + type: number + title: tax_total + description: The tax total of the item including promotions. + discount_total: + type: number + title: discount_total + description: The total of the item's discount / promotion. + discount_tax_total: + type: number + title: discount_tax_total + description: The tax total of the item's discount / promotion + refundable_total: + type: number + title: refundable_total + description: The total refundable amount of the item's total. + refundable_total_per_unit: + type: number + title: refundable_total_per_unit + description: The total refundable amount of the item's total for a single unit. + - type: object + description: An order's item. + properties: + actions: + type: array + description: The actions applied on an item. + items: + type: object + description: The action's details. + x-schemaName: BaseOrderChangeAction + shipping_methods: + type: array + description: The order's shipping methods. + items: + allOf: + - type: object + description: The shipping method's details. + x-schemaName: BaseOrderShippingMethod + required: + - id + - order_id + - name + - amount + - is_tax_inclusive + - shipping_option_id + - data + - metadata + - original_total + - original_subtotal + - original_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - created_at + - updated_at + properties: + id: + type: string + title: id + description: The shipping method's ID. + order_id: + type: string + title: order_id + description: The ID of the order this shipping method belongs to. + name: + type: string + title: name + description: The shipping method's name. + description: + type: string + title: description + description: The shipping method's description. + amount: + type: number + title: amount + description: The shipping method's amount. + is_tax_inclusive: + type: boolean + title: is_tax_inclusive + description: Whether the shipping method's amount is tax inclusive. + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the shipping option this method was created from. + data: + type: object + description: The data relevant for the fulfillment provider to process this shipment. + externalDocs: + url: https://docs.medusajs.com/v2/resources/commerce-modules/order/concepts#data-property + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. + tax_lines: + type: array + description: The shipping method's tax lines. + items: + $ref: '#/components/schemas/BaseOrderShippingMethodTaxLine' + adjustments: + type: array + description: The shipping method's adjustments. + items: + $ref: '#/components/schemas/BaseOrderShippingMethodAdjustment' + original_total: + oneOf: + - type: string + title: original_total + description: The shipping method's total including taxes, excluding promotions. + - type: number + title: original_total + description: The shipping method's total including taxes, excluding promotions. + original_subtotal: + oneOf: + - type: string + title: original_subtotal + description: The shipping method's total excluding taxes, including promotions. + - type: number + title: original_subtotal + description: The shipping method's total excluding taxes, including promotions. + original_tax_total: + oneOf: + - type: string + title: original_tax_total + description: The tax total of the shipping method excluding promotions. + - type: number + title: original_tax_total + description: The tax total of the shipping method excluding promotions. + total: + oneOf: + - type: string + title: total + description: The shipping method's total including taxes and promotions. + - type: number + title: total + description: The shipping method's total including taxes and promotions. + subtotal: + oneOf: + - type: string + title: subtotal + description: The shipping method's total excluding taxes, including promotions. + - type: number + title: subtotal + description: The shipping method's total excluding taxes, including promotions. + tax_total: + oneOf: + - type: string + title: tax_total + description: The tax total of the shipping method including promotions. + - type: number + title: tax_total + description: The tax total of the shipping method including promotions. + discount_total: + oneOf: + - type: string + title: discount_total + description: The total of the shipping method's promotion. + - type: number + title: discount_total + description: The total of the shipping method's promotion. + discount_tax_total: + oneOf: + - type: string + title: discount_tax_total + description: The tax total of the shipping method's promotion. + - type: number + title: discount_tax_total + description: The shipping method's discount tax total. + created_at: + type: string + format: date-time + title: created_at + description: The date the shipping method was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the shipping method was updated. + - type: object + description: The shipping method's details. + properties: + actions: + type: array + description: The actions applied on the shipping method. + items: + type: object + description: The action's details. + x-schemaName: BaseOrderChangeAction + currency_code: + type: string + title: currency_code + description: The order's currency code. + version: + type: number + title: version + description: The order's version when this preview is applied. + id: + type: string + title: id + description: The order's ID. + region_id: + type: string + title: region_id + description: The ID of the order's associated region. + customer_id: + type: string + title: customer_id + description: The ID of the customer that placed the order. + sales_channel_id: + type: string + title: sales_channel_id + description: The ID of the sales channel that the order was placed in. + email: + type: string + title: email + description: The email of the customer that placed the order. + format: email + display_id: + type: number + title: display_id + description: The order's display ID. + shipping_address: + $ref: '#/components/schemas/AdminOrderAddress' + billing_address: + $ref: '#/components/schemas/AdminOrderAddress' + payment_collections: + type: array + description: The order's payment collections. + items: + $ref: '#/components/schemas/AdminPaymentCollection' + payment_status: + type: string + description: The order's payment status. + enum: + - canceled + - not_paid + - awaiting + - authorized + - partially_authorized + - captured + - partially_captured + - partially_refunded + - refunded + - requires_action + fulfillments: + type: array + description: The order's fulfillments. + items: + $ref: '#/components/schemas/AdminOrderFulfillment' + fulfillment_status: + type: string + description: The order's fulfillment status. + enum: + - canceled + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_delivered + - delivered + transactions: + type: array + description: The order's transactions. + items: + $ref: '#/components/schemas/BaseOrderTransaction' + summary: + $ref: '#/components/schemas/BaseOrderSummary' + metadata: + type: object + description: The order's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the order was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the order was updated. + original_item_total: + type: number + title: original_item_total + description: The total of the order's items including taxes, excluding promotions. + original_item_subtotal: + type: number + title: original_item_subtotal + description: The total of the order's items excluding taxes, including promotions. + original_item_tax_total: + type: number + title: original_item_tax_total + description: The tax total of the order's items excluding promotions. + item_total: + type: number + title: item_total + description: The total of the order's items including taxes and promotions. + item_subtotal: + type: number + title: item_subtotal + description: The total of the order's items excluding taxes, including promotions. + item_tax_total: + type: number + title: item_tax_total + description: The tax total of the order's items including promotions. + original_total: + type: number + title: original_total + description: The order's total excluding promotions, including taxes. + original_subtotal: + type: number + title: original_subtotal + description: The order's total excluding taxes, including promotions. + original_tax_total: + type: number + title: original_tax_total + description: The order's tax total, excluding promotions. + total: + type: number + title: total + description: The order's total including taxes and promotions. + subtotal: + type: number + title: subtotal + description: The order's total excluding taxes, including promotions. + tax_total: + type: number + title: tax_total + description: The order's tax total including promotions. + discount_total: + type: number + title: discount_total + description: The order's discount or promotions total. + discount_tax_total: + type: number + title: discount_tax_total + description: The tax total of order's discount or promotion. + gift_card_total: + type: number + title: gift_card_total + description: The order's gift card total. + gift_card_tax_total: + type: number + title: gift_card_tax_total + description: The tax total of the order's gift card. + shipping_total: + type: number + title: shipping_total + description: The order's shipping total including taxes and promotions. + shipping_subtotal: + type: number + title: shipping_subtotal + description: The order's shipping total excluding taxes, including promotions. + shipping_tax_total: + type: number + title: shipping_tax_total + description: The tax total of the order's shipping. + original_shipping_total: + type: number + title: original_shipping_total + description: The order's shipping total including taxes, excluding promotions. + original_shipping_subtotal: + type: number + title: original_shipping_subtotal + description: The order's shipping total excluding taxes, including promotions. + original_shipping_tax_total: + type: number + title: original_shipping_tax_total + description: The tax total of the order's shipping excluding promotions. + customer: + $ref: '#/components/schemas/AdminCustomer' + sales_channel: + $ref: '#/components/schemas/AdminSalesChannel' + status: + type: string + title: status + description: The order's status. + region: + $ref: '#/components/schemas/AdminRegion' + credit_lines: + type: array + description: The order preview's credit lines. + items: + $ref: '#/components/schemas/OrderCreditLine' + AdminDraftOrderPreviewResponse: + type: object + description: The details of the preview on the draft order. + x-schemaName: AdminDraftOrderPreviewResponse + required: + - draft_order_preview + properties: + draft_order_preview: + $ref: '#/components/schemas/AdminDraftOrderPreview' AdminDraftOrderResponse: type: object description: The draft order's details. @@ -48570,6 +56190,13 @@ components: type: string title: status description: The order's status. + region: + $ref: '#/components/schemas/AdminRegion' + credit_lines: + type: array + description: The order's credit lines. + items: + $ref: '#/components/schemas/OrderCreditLine' AdminOrderAddress: type: object description: An order address. @@ -49877,6 +57504,13 @@ components: type: string title: status description: The order's status. + region: + $ref: '#/components/schemas/AdminRegion' + credit_lines: + type: array + description: The order preview's credit lines. + items: + $ref: '#/components/schemas/OrderCreditLine' AdminOrderPreviewResponse: type: object description: The preview of an order. @@ -50268,6 +57902,29 @@ components: - provider_id - data - status + AdminPlugin: + type: object + description: The plugin's details. + x-schemaName: AdminPlugin + required: + - name + properties: + name: + type: string + title: name + description: The plugin's name. + AdminPluginsListResponse: + type: object + description: The list of plugins. + x-schemaName: AdminPluginsListResponse + required: + - plugins + properties: + plugins: + type: array + description: The list of plugins. + items: + $ref: '#/components/schemas/AdminPlugin' AdminPostCancelClaimReqSchema: type: object description: The details of canceling a claim. @@ -52748,6 +60405,20 @@ components: properties: region: $ref: '#/components/schemas/AdminRegion' + AdminRemoveDraftOrderPromotions: + type: object + description: The promotion codes to remove from the draft order. + x-schemaName: AdminRemoveDraftOrderPromotions + required: + - promo_codes + properties: + promo_codes: + type: array + description: The promotion codes to remove from the draft order. + items: + type: string + title: promo_codes + description: A promotion code to remove from the draft order. AdminReservation: type: object description: The reservation's details. @@ -54417,6 +62088,80 @@ components: metadata: type: object description: The draft order's metadata, can hold custom key-value pairs. + customer_id: + type: string + title: customer_id + description: The ID of the customer associated with the draft order. + sales_channel_id: + type: string + title: sales_channel_id + description: The ID of the sales channel associated with the draft order. + AdminUpdateDraftOrderActionShippingMethod: + type: object + description: The updates to make on a changed shipping method. + x-schemaName: AdminUpdateDraftOrderActionShippingMethod + required: + - shipping_option_id + properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the associated shipping option. + custom_amount: + type: number + title: custom_amount + description: The custom amount of the shipping method. If not provided, the shipping option's amount will be used. + description: + type: string + title: description + description: The shipping method's description. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. + AdminUpdateDraftOrderItem: + type: object + description: The updates to make on a draft order's item. + x-schemaName: AdminUpdateDraftOrderItem + required: + - quantity + properties: + quantity: + type: number + title: quantity + description: The item's quantity. + unit_price: + type: number + title: unit_price + description: The item's unit price. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the item. + AdminUpdateDraftOrderShippingMethod: + type: object + description: The updates to make on a draft order's shipping method. + x-schemaName: AdminUpdateDraftOrderShippingMethod + properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the associated shipping option. + custom_amount: + type: number + title: custom_amount + description: The custom amount of the shipping method. If not provided, the shipping option's amount will be used. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. AdminUpdateOrder: type: object description: The details to update in the order. @@ -59431,6 +67176,80 @@ components: summary: type: object description: The order's summary. + properties: + pending_difference: + type: number + title: pending_difference + description: The remaining amount to be paid or refunded. + current_order_total: + type: number + title: current_order_total + description: The order's current total. + original_order_total: + type: number + title: original_order_total + description: The order's total before any changes. + transaction_total: + type: number + title: transaction_total + description: The total of the transactions (payments and refunds) made on the order. + paid_total: + type: number + title: paid_total + description: The total paid amount. + refunded_total: + type: number + title: refunded_total + description: The total refunded amount. + credit_line_total: + type: number + title: credit_line_total + description: The total credit line amount. + accounting_total: + type: number + title: accounting_total + description: The total amount for accounting purposes. + raw_pending_difference: + type: object + description: The summary's raw pending difference. + raw_current_order_total: + type: object + description: The summary's raw current order total. + raw_original_order_total: + type: object + description: The summary's raw original order total. + raw_transaction_total: + type: object + description: The summary's raw transaction total. + raw_paid_total: + type: object + description: The summary's raw paid total. + raw_refunded_total: + type: object + description: The summary's raw refunded total. + raw_credit_line_total: + type: object + description: The summary's raw credit line total. + raw_accounting_total: + type: object + description: The summary's raw accounting total. + required: + - pending_difference + - current_order_total + - original_order_total + - transaction_total + - paid_total + - refunded_total + - credit_line_total + - accounting_total + - raw_pending_difference + - raw_current_order_total + - raw_original_order_total + - raw_transaction_total + - raw_paid_total + - raw_refunded_total + - raw_credit_line_total + - raw_accounting_total metadata: type: object description: The order's metadata, can hold custom key-value pairs. @@ -59550,6 +67369,10 @@ components: description: The order's credit lines, useful to add additional payment amounts for an order. items: $ref: '#/components/schemas/OrderCreditLine' + is_draft_order: + type: boolean + title: is_draft_order + description: Whether the order is a draft order. OrderAddress: type: object description: The address's details. @@ -60215,6 +68038,7 @@ components: - title - requires_shipping - is_discountable + - is_giftcard - is_tax_inclusive - unit_price - quantity @@ -60405,6 +68229,10 @@ components: type: string title: product_type_id description: The ID of the associated product's type. + is_giftcard: + type: boolean + title: is_giftcard + description: Whether the item is a gift card. OrderLineItemAdjustment: type: object description: The line item adjustment's details. @@ -61843,6 +69671,20 @@ components: type: string title: currency_code description: The application method's currency code. + StoreCartRemovePromotion: + type: object + description: The promotion code to remove from the cart. + x-schemaName: StoreCartRemovePromotion + required: + - promo_codes + properties: + promo_codes: + type: array + description: The promotion code to remove from the cart. + items: + type: string + title: promo_codes + description: A promotion code to remove from the cart. StoreCartResponse: type: object description: The cart's details. diff --git a/www/apps/api-reference/specs/admin/openapi.yaml b/www/apps/api-reference/specs/admin/openapi.yaml index 5ee1c8689a..cb0a0060d5 100644 --- a/www/apps/api-reference/specs/admin/openapi.yaml +++ b/www/apps/api-reference/specs/admin/openapi.yaml @@ -9,9 +9,6 @@ servers: - url: http://localhost:9000 - url: https://api.medusajs.com tags: - - name: Auth - description: | - Auth API routes allow you to manage an admin user's authentication. - name: Api Keys description: > API keys can be used for authentication or resource-scoping. @@ -26,9 +23,12 @@ tags: API keys. externalDocs: description: Learn more about the API Key Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/api-key + url: https://docs.medusajs.com/resources/commerce-modules/api-key x-associatedSchema: $ref: ./components/schemas/AdminApiKey.yaml + - name: Auth + description: | + Auth API routes allow you to manage an admin user's authentication. - name: Campaigns description: > A campaign is a group of promotions that have the same conditions, such as @@ -39,8 +39,7 @@ tags: and promotions that belong to them. externalDocs: description: Learn more about campaigns. - url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/promotion/campaign + url: https://docs.medusajs.com/resources/commerce-modules/promotion/campaign x-associatedSchema: $ref: ./components/schemas/AdminCampaign.yaml - name: Claims @@ -55,7 +54,7 @@ tags: $ref: ./components/schemas/AdminClaim.yaml externalDocs: description: Learn more about order claims. - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/claim + url: https://docs.medusajs.com/resources/commerce-modules/order/claim - name: Collections description: > A product collection organizes products into a collection for marketing @@ -76,7 +75,7 @@ tags: admins to list and update currencies. externalDocs: description: Learn more about the Currency Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/currency + url: https://docs.medusajs.com/resources/commerce-modules/currency x-associatedSchema: $ref: ./components/schemas/AdminCurrency.yaml - name: Customer Groups @@ -93,7 +92,7 @@ tags: them. externalDocs: description: Learn more about the Customer Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/customer + url: https://docs.medusajs.com/resources/commerce-modules/customer x-associatedSchema: $ref: ./components/schemas/AdminCustomerGroup.yaml - name: Customers @@ -105,7 +104,7 @@ tags: These API routes allow admin users to manage customers in their store. externalDocs: description: Learn more about the Customer Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/customer + url: https://docs.medusajs.com/resources/commerce-modules/customer x-associatedSchema: $ref: ./components/schemas/AdminCustomer.yaml - name: Draft Orders @@ -118,7 +117,7 @@ tags: These API routes allow admin users to create and manage draft orders. externalDocs: description: Learn more about the Order Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/order + url: https://docs.medusajs.com/resources/commerce-modules/order x-associatedSchema: $ref: ./components/schemas/AdminDraftOrder.yaml - name: Exchanges @@ -130,7 +129,7 @@ tags: These API routes allow admin users t create and manage exchanges. externalDocs: description: Learn more about the order exchanges. - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/exchange + url: https://docs.medusajs.com/resources/commerce-modules/order/exchange x-associatedSchema: $ref: ./components/schemas/AdminExchange.yaml - name: Fulfillment Providers @@ -143,7 +142,7 @@ tags: externalDocs: description: Learn more about the fulfillment providers and how to create them. url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/fulfillment-provider + https://docs.medusajs.com/resources/commerce-modules/fulfillment/fulfillment-provider x-associatedSchema: $ref: ./components/schemas/AdminFulfillmentProvider.yaml - name: Fulfillment Sets @@ -160,7 +159,7 @@ tags: externalDocs: description: Learn more about fulfillment sets. url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/concepts + https://docs.medusajs.com/resources/commerce-modules/fulfillment/concepts x-associatedSchema: $ref: ./components/schemas/AdminFulfillmentSet.yaml - name: Fulfillments @@ -173,7 +172,7 @@ tags: externalDocs: description: Learn more about fulfillments. url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/item-fulfillment + https://docs.medusajs.com/resources/commerce-modules/fulfillment/item-fulfillment x-associatedSchema: $ref: ./components/schemas/AdminFulfillment.yaml - name: Inventory Items @@ -183,8 +182,7 @@ tags: These API routes allow admin users to manage inventory items. externalDocs: description: Learn more about inventory items. - url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/inventory/concepts + url: https://docs.medusajs.com/resources/commerce-modules/inventory/concepts x-associatedSchema: $ref: ./components/schemas/AdminInventoryItem.yaml - name: Invites @@ -196,7 +194,7 @@ tags: These API routes allow admin users to manage invites. externalDocs: description: Learn more about the User Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/user + url: https://docs.medusajs.com/resources/commerce-modules/user x-associatedSchema: $ref: ./components/schemas/AdminInvite.yaml - name: Notifications @@ -225,7 +223,7 @@ tags: those edits. externalDocs: description: Learn more about the Order Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/order + url: https://docs.medusajs.com/resources/commerce-modules/order - name: Orders description: | An order is a purchase made by a customer through a storefront. @@ -235,7 +233,7 @@ tags: These API routes allow admin users to view and manage orders. externalDocs: description: Learn more about the orders - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/concepts + url: https://docs.medusajs.com/resources/commerce-modules/order/concepts x-associatedSchema: $ref: ./components/schemas/AdminOrder.yaml - name: Payment Collections @@ -255,7 +253,7 @@ tags: externalDocs: description: Learn more about payment collections. url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/payment/payment-collection + https://docs.medusajs.com/resources/commerce-modules/payment/payment-collection x-associatedSchema: $ref: ./components/schemas/AdminPaymentCollection.yaml - name: Payments @@ -271,9 +269,24 @@ tags: These API routes allow admin users to manage payments. externalDocs: description: Learn more about payments. - url: https://docs.medusajs.com/v2/resources/commerce-modules/payment/payment + url: https://docs.medusajs.com/resources/commerce-modules/payment/payment x-associatedSchema: $ref: ./components/schemas/AdminPayment.yaml + - name: Plugins + description: > + A plugin is a package of reusable Medusa customizations that you can + install in any Medusa application. + + Plugins can be used to add new functionality, such as wishlists, or + integrate third-party services, such as payment providers. + + These API routes allow admin users to retrieve plugins installed in their + Medusa application. + externalDocs: + description: Learn more about plugins. + url: https://docs.medusajs.com/learn/fundamentals/plugins + x-associatedSchema: + $ref: ./components/schemas/AdminPlugin.yaml - name: Price Lists description: > A price list is a group of prices applied if the specified conditions and @@ -288,7 +301,7 @@ tags: externalDocs: description: Learn more about price lists. url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/pricing/concepts#price-list + https://docs.medusajs.com/resources/commerce-modules/pricing/concepts#price-list x-associatedSchema: $ref: ./components/schemas/AdminPriceList.yaml - name: Price Preferences @@ -302,7 +315,7 @@ tags: externalDocs: description: Learn more about tax-inclusiveness and the role of a price preference. url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/pricing/tax-inclusive-pricing + https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing x-associatedSchema: $ref: ./components/schemas/AdminPricePreference.yaml - name: Product Categories @@ -318,7 +331,7 @@ tags: in them. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: ./components/schemas/AdminProductCategory.yaml - name: Product Tags @@ -333,7 +346,7 @@ tags: These API routes allow admin users to manage product tags. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: ./components/schemas/AdminProductTag.yaml - name: Product Types @@ -345,7 +358,7 @@ tags: These API routes allow admin users to manage product types. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: ./components/schemas/AdminProductType.yaml - name: Product Variants @@ -361,7 +374,7 @@ tags: These API routes allow admin users to manage product variants. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: ./components/schemas/AdminProductVariant.yaml - name: Products @@ -380,7 +393,7 @@ tags: These API routes allow admin users to manage products. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: ./components/schemas/AdminProduct.yaml - name: Promotions @@ -404,8 +417,7 @@ tags: These API routes allow admin users to manage promotions. externalDocs: description: Learn more about promotions. - url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/promotion/concepts + url: https://docs.medusajs.com/resources/commerce-modules/promotion/concepts x-associatedSchema: $ref: ./components/schemas/AdminPromotion.yaml - name: Refund Reasons @@ -427,7 +439,7 @@ tags: more. externalDocs: description: Learn more about the Region Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/region + url: https://docs.medusajs.com/resources/commerce-modules/region x-associatedSchema: $ref: ./components/schemas/AdminRegion.yaml - name: Reservations @@ -443,8 +455,7 @@ tags: These API routes allow admin users to manage reservations. externalDocs: description: Learn more about reservations and other inventory concepts. - url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/inventory/concepts + url: https://docs.medusajs.com/resources/commerce-modules/inventory/concepts x-associatedSchema: $ref: ./components/schemas/AdminReservation.yaml - name: Return Reasons @@ -469,7 +480,7 @@ tags: These API routes allow admin users to manage returns. externalDocs: description: Learn more about order returns. - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/return + url: https://docs.medusajs.com/resources/commerce-modules/order/return x-associatedSchema: $ref: ./components/schemas/AdminReturn.yaml - name: Sales Channels @@ -482,7 +493,7 @@ tags: available in them. externalDocs: description: Learn more about the Sales Channel Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/sales-channel + url: https://docs.medusajs.com/resources/commerce-modules/sales-channel x-associatedSchema: $ref: ./components/schemas/AdminSalesChannel.yaml - name: Shipping Options @@ -502,7 +513,7 @@ tags: externalDocs: description: Learn more about shipping options. url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option + https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option x-associatedSchema: $ref: ./components/schemas/AdminShippingOption.yaml - name: Shipping Profiles @@ -516,7 +527,7 @@ tags: externalDocs: description: Learn more about shipping profiles and other fulfillment concepts. url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/concepts#shipping-profile + https://docs.medusajs.com/resources/commerce-modules/fulfillment/concepts#shipping-profile x-associatedSchema: $ref: ./components/schemas/AdminShippingProfile.yaml - name: Stock Locations @@ -537,7 +548,7 @@ tags: externalDocs: description: Learn more about stock locations. url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/stock-location/concepts + https://docs.medusajs.com/resources/commerce-modules/stock-location/concepts x-associatedSchema: $ref: ./components/schemas/AdminStockLocation.yaml - name: Stores @@ -554,7 +565,7 @@ tags: These API routes allow admin users to manage their store. externalDocs: description: Learn more about the Store Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/store + url: https://docs.medusajs.com/resources/commerce-modules/store x-associatedSchema: $ref: ./components/schemas/AdminStore.yaml - name: Tax Rates @@ -571,7 +582,7 @@ tags: externalDocs: description: Learn more about tax rates and rules. url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/tax/tax-rates-and-rules + https://docs.medusajs.com/resources/commerce-modules/tax/tax-rates-and-rules x-associatedSchema: $ref: ./components/schemas/AdminTaxRate.yaml - name: Tax Regions @@ -586,7 +597,7 @@ tags: These API routes allow admin users to manage tax regions. externalDocs: description: Learn more about tax regions. - url: https://docs.medusajs.com/v2/resources/commerce-modules/tax/tax-region + url: https://docs.medusajs.com/resources/commerce-modules/tax/tax-region x-associatedSchema: $ref: ./components/schemas/AdminTaxRegion.yaml - name: Uploads @@ -599,7 +610,7 @@ tags: such as CSV files used to import products. externalDocs: description: Check out available file module providers. - url: https://docs.medusajs.com/v2/resources/architectural-modules/file + url: https://docs.medusajs.com/resources/architectural-modules/file - name: Users description: > A user is an admin user that can authenticate and perform functionalities @@ -613,7 +624,7 @@ tags: These API routes allow admin users to manage their team. externalDocs: description: Learn more about the User Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/user + url: https://docs.medusajs.com/resources/commerce-modules/user x-associatedSchema: $ref: ./components/schemas/AdminUser.yaml - name: Workflows Executions @@ -627,7 +638,7 @@ tags: externalDocs: description: Check out available Workflow Engine Modules url: >- - https://docs.medusajs.com/v2/resources/architectural-modules/workflow-engine + https://docs.medusajs.com/resources/architectural-modules/workflow-engine paths: /admin/api-keys: $ref: paths/admin_api-keys.yaml @@ -701,6 +712,29 @@ paths: $ref: paths/admin_draft-orders.yaml /admin/draft-orders/{id}: $ref: paths/admin_draft-orders_{id}.yaml + /admin/draft-orders/{id}/convert-to-order: + $ref: paths/admin_draft-orders_{id}_convert-to-order.yaml + /admin/draft-orders/{id}/edit: + $ref: paths/admin_draft-orders_{id}_edit.yaml + /admin/draft-orders/{id}/edit/confirm: + $ref: paths/admin_draft-orders_{id}_edit_confirm.yaml + /admin/draft-orders/{id}/edit/items: + $ref: paths/admin_draft-orders_{id}_edit_items.yaml + /admin/draft-orders/{id}/edit/items/item/{item_id}: + $ref: paths/admin_draft-orders_{id}_edit_items_item_{item_id}.yaml + /admin/draft-orders/{id}/edit/items/{action_id}: + $ref: paths/admin_draft-orders_{id}_edit_items_{action_id}.yaml + /admin/draft-orders/{id}/edit/promotions: + $ref: paths/admin_draft-orders_{id}_edit_promotions.yaml + /admin/draft-orders/{id}/edit/request: + $ref: paths/admin_draft-orders_{id}_edit_request.yaml + /admin/draft-orders/{id}/edit/shipping-methods: + $ref: paths/admin_draft-orders_{id}_edit_shipping-methods.yaml + /admin/draft-orders/{id}/edit/shipping-methods/method/{method_id}: + $ref: >- + paths/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}.yaml + /admin/draft-orders/{id}/edit/shipping-methods/{action_id}: + $ref: paths/admin_draft-orders_{id}_edit_shipping-methods_{action_id}.yaml /admin/exchanges: $ref: paths/admin_exchanges.yaml /admin/exchanges/{id}: @@ -795,6 +829,8 @@ paths: $ref: paths/admin_orders_{id}_changes.yaml /admin/orders/{id}/complete: $ref: paths/admin_orders_{id}_complete.yaml + /admin/orders/{id}/credit-lines: + $ref: paths/admin_orders_{id}_credit-lines.yaml /admin/orders/{id}/fulfillments: $ref: paths/admin_orders_{id}_fulfillments.yaml /admin/orders/{id}/fulfillments/{fulfillment_id}/cancel: @@ -828,6 +864,8 @@ paths: $ref: paths/admin_payments_{id}_capture.yaml /admin/payments/{id}/refund: $ref: paths/admin_payments_{id}_refund.yaml + /admin/plugins: + $ref: paths/admin_plugins.yaml /admin/price-lists: $ref: paths/admin_price-lists.yaml /admin/price-lists/{id}: diff --git a/www/apps/api-reference/specs/admin/paths/admin_api-keys.yaml b/www/apps/api-reference/specs/admin/paths/admin_api-keys.yaml index 66384165e8..858dcc21f2 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_api-keys.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_api-keys.yaml @@ -1227,6 +1227,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_api-keys/get.js - lang: Shell label: cURL source: @@ -1303,6 +1307,10 @@ post: schema: $ref: ../components/schemas/AdminCreateApiKey.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_api-keys/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}.yaml index 86ad80a615..2c294f1620 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_api-keys_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminUpdateApiKey.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_api-keys_{id}/post.js - lang: Shell label: cURL source: @@ -144,6 +152,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_api-keys_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}_revoke.yaml b/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}_revoke.yaml index 62390dcd82..148a774f99 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}_revoke.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}_revoke.yaml @@ -41,6 +41,10 @@ post: schema: $ref: ../components/schemas/AdminRevokeApiKey.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_api-keys_{id}_revoke/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}_sales-channels.yaml b/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}_sales-channels.yaml index ba865399e5..6080353618 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}_sales-channels.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_api-keys_{id}_sales-channels.yaml @@ -57,6 +57,10 @@ post: title: remove description: A sales channel's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_api-keys_{id}_sales-channels/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_campaigns.yaml b/www/apps/api-reference/specs/admin/paths/admin_campaigns.yaml index 2b0f47fab2..00236b47c8 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_campaigns.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_campaigns.yaml @@ -62,6 +62,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_campaigns/get.js - lang: Shell label: cURL source: @@ -237,6 +241,10 @@ post: `additional_data` parameter. description: The campaign's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_campaigns/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_campaigns_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_campaigns_{id}.yaml index 4650841fac..0162ce0f95 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_campaigns_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_campaigns_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_campaigns_{id}/get.js - lang: Shell label: cURL source: @@ -162,6 +166,10 @@ post: `additional_data` parameter. description: The campaign's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_campaigns_{id}/post.js - lang: Shell label: cURL source: @@ -207,6 +215,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_campaigns_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_campaigns_{id}_promotions.yaml b/www/apps/api-reference/specs/admin/paths/admin_campaigns_{id}_promotions.yaml index 00463258a3..3106892ec8 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_campaigns_{id}_promotions.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_campaigns_{id}_promotions.yaml @@ -57,6 +57,10 @@ post: title: remove description: A promotion's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_campaigns_{id}_promotions/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims.yaml index 9e10d8e292..cf06f4fae2 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims.yaml @@ -989,6 +989,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_claims/get.js - lang: Shell label: cURL source: @@ -1050,6 +1054,10 @@ post: schema: $ref: ../components/schemas/AdminPostOrderClaimsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_claims/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}.yaml index 346e6d2b60..50e93c3db4 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_claims_{id}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_cancel.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_cancel.yaml index 4b8256711e..756d001d2f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_cancel.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_cancel.yaml @@ -20,6 +20,10 @@ post: schema: $ref: ../components/schemas/AdminPostCancelClaimReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_claims_{id}_cancel/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_claim-items.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_claim-items.yaml index c459dab766..bd09408dda 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_claim-items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_claim-items.yaml @@ -41,6 +41,10 @@ post: schema: $ref: ../components/schemas/AdminPostClaimItemsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_claims_{id}_claim-items/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_claim-items_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_claim-items_{action_id}.yaml index d2fdaca5eb..e1a8c149e0 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_claim-items_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_claim-items_{action_id}.yaml @@ -51,6 +51,11 @@ post: schema: $ref: ../components/schemas/AdminPostClaimsItemsActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_claim-items_{action_id}/post.js - lang: Shell label: cURL source: @@ -127,6 +132,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_claim-items_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_items.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_items.yaml index 36d437e111..40db0c72ab 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_items.yaml @@ -23,6 +23,10 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsRequestItemsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_claims_{id}_inbound_items/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_items_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_items_{action_id}.yaml index 839882089e..9026fcbb53 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_items_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_items_{action_id}.yaml @@ -35,6 +35,11 @@ post: $ref: >- ../components/schemas/AdminPostReturnsRequestItemsActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_inbound_items_{action_id}/post.js - lang: Shell label: cURL source: @@ -93,6 +98,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_inbound_items_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_shipping-method.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_shipping-method.yaml index f644a770ea..6327a13ffb 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_shipping-method.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_shipping-method.yaml @@ -23,6 +23,11 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsShippingReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_shipping-method_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_shipping-method_{action_id}.yaml index 1f00289c71..b4d7e3f82a 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_shipping-method_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_inbound_shipping-method_{action_id}.yaml @@ -52,6 +52,11 @@ post: schema: $ref: ../components/schemas/AdminPostClaimsShippingActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method_{action_id}/post.js - lang: Shell label: cURL source: @@ -110,6 +115,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_inbound_shipping-method_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_items.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_items.yaml index fb75b34968..e384123a4b 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_items.yaml @@ -41,6 +41,10 @@ post: schema: $ref: ../components/schemas/AdminPostClaimsAddItemsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_claims_{id}_outbound_items/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_items_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_items_{action_id}.yaml index 0b42eeaf6f..5b63f8eb3c 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_items_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_items_{action_id}.yaml @@ -52,6 +52,11 @@ post: schema: $ref: ../components/schemas/AdminPostClaimsItemsActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_outbound_items_{action_id}/post.js - lang: Shell label: cURL source: @@ -128,6 +133,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_outbound_items_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_shipping-method.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_shipping-method.yaml index c991c9dde9..4fcc75f067 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_shipping-method.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_shipping-method.yaml @@ -41,6 +41,11 @@ post: schema: $ref: ../components/schemas/AdminPostClaimsShippingReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_shipping-method_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_shipping-method_{action_id}.yaml index 162470080c..c893599a43 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_shipping-method_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_outbound_shipping-method_{action_id}.yaml @@ -52,6 +52,11 @@ post: schema: $ref: ../components/schemas/AdminPostClaimsShippingActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method_{action_id}/post.js - lang: Shell label: cURL source: @@ -128,6 +133,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_claims_{id}_outbound_shipping-method_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_request.yaml b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_request.yaml index 146313ac84..19258779d0 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_request.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_claims_{id}_request.yaml @@ -34,6 +34,10 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_claims_{id}_request/post.js - lang: Shell label: cURL source: @@ -77,6 +81,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_claims_{id}_request/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_collections.yaml b/www/apps/api-reference/specs/admin/paths/admin_collections.yaml index cfd1208445..8896bc5e10 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_collections.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_collections.yaml @@ -947,6 +947,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_collections/get.js - lang: Shell label: cURL source: @@ -1006,6 +1010,10 @@ post: schema: $ref: ../components/schemas/AdminCreateCollection.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_collections/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_collections_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_collections_{id}.yaml index b9175e8b78..7668f30966 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_collections_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_collections_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_collections_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminUpdateCollection.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_collections_{id}/post.js - lang: Shell label: cURL source: @@ -143,6 +151,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_collections_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_collections_{id}_products.yaml b/www/apps/api-reference/specs/admin/paths/admin_collections_{id}_products.yaml index cbc0e59334..9233e2e7b2 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_collections_{id}_products.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_collections_{id}_products.yaml @@ -57,6 +57,10 @@ post: title: remove description: A product's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_collections_{id}_products/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_currencies.yaml b/www/apps/api-reference/specs/admin/paths/admin_currencies.yaml index 33b8c0c102..b31482e672 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_currencies.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_currencies.yaml @@ -112,6 +112,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_currencies/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_currencies_{code}.yaml b/www/apps/api-reference/specs/admin/paths/admin_currencies_{code}.yaml index 50737b4f4e..6c47a4b45d 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_currencies_{code}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_currencies_{code}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_currencies_{code}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_customer-groups.yaml b/www/apps/api-reference/specs/admin/paths/admin_customer-groups.yaml index 6986da8aa1..3068c72ad2 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_customer-groups.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_customer-groups.yaml @@ -966,6 +966,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customer-groups/get.js - lang: Shell label: cURL source: @@ -1056,6 +1060,10 @@ post: schema: $ref: ../components/schemas/AdminCreateCustomerGroup.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customer-groups/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_customer-groups_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_customer-groups_{id}.yaml index 8e9df8e2e8..0a1d8c510e 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_customer-groups_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_customer-groups_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customer-groups_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminUpdateCustomerGroup.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customer-groups_{id}/post.js - lang: Shell label: cURL source: @@ -144,6 +152,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customer-groups_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_customer-groups_{id}_customers.yaml b/www/apps/api-reference/specs/admin/paths/admin_customer-groups_{id}_customers.yaml index 159bba6143..60842a8289 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_customer-groups_{id}_customers.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_customer-groups_{id}_customers.yaml @@ -55,6 +55,11 @@ post: title: remove description: A customer's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_customer-groups_{id}_customers/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_customers.yaml b/www/apps/api-reference/specs/admin/paths/admin_customers.yaml index 50f04aa9ee..7bc60df2c9 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_customers.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_customers.yaml @@ -4158,6 +4158,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customers/get.js - lang: Shell label: cURL source: @@ -4291,6 +4295,10 @@ post: `additional_data` parameter. description: The customer's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customers/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_customers_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}.yaml index c686997d37..6575fab12a 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_customers_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}.yaml @@ -37,6 +37,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customers_{id}/get.js - lang: Shell label: cURL source: @@ -148,6 +152,10 @@ post: `additional_data` parameter. description: The customer's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customers_{id}/post.js - lang: Shell label: cURL source: @@ -191,6 +199,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customers_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_addresses.yaml b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_addresses.yaml index d64c964009..3aa9071d6b 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_addresses.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_addresses.yaml @@ -176,6 +176,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customers_{id}_addresses/get.js - lang: Shell label: cURL source: @@ -360,6 +364,10 @@ post: `additional_data` parameter. description: The address's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_customers_{id}_addresses/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_addresses_{address_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_addresses_{address_id}.yaml index 22572340ed..ae47db1943 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_addresses_{address_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_addresses_{address_id}.yaml @@ -43,6 +43,11 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/get.js - lang: Shell label: cURL source: @@ -203,6 +208,11 @@ post: `additional_data` parameter. description: The address's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/post.js - lang: Shell label: cURL source: @@ -273,6 +283,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_customers_{id}_addresses_{address_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml index bb53c89718..3c9c136962 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml @@ -61,6 +61,11 @@ post: title: remove description: The ID of the group to remove the customer from. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_customers_{id}_customer-groups/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml index 6dc8b7d2fe..00c29f2eba 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml @@ -1750,6 +1750,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_draft-orders/get.js - lang: Shell label: cURL source: @@ -2107,6 +2111,10 @@ post: `additional_data` parameter. description: The draft order's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_draft-orders/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}.yaml index 9db46ee801..bace04df51 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}.yaml @@ -37,6 +37,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_draft-orders_{id}/get.js - lang: Shell label: cURL source: @@ -105,6 +109,10 @@ post: schema: $ref: ../components/schemas/AdminUpdateDraftOrder.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_draft-orders_{id}/post.js - lang: Shell label: cURL source: @@ -130,4 +138,4 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - x-workflow: updateOrderWorkflow + x-workflow: updateDraftOrderWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_convert-to-order.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_convert-to-order.yaml new file mode 100644 index 0000000000..57dc429120 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_convert-to-order.yaml @@ -0,0 +1,67 @@ +post: + operationId: PostDraftOrdersIdConvertToOrder + summary: Convert a Draft Order to an Order + x-sidebar-summary: Convert to Order + description: >- + Convert a draft order to an order. This will finalize the draft order and + create a new order with the same details. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. + + if a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. + + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_convert-to-order/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_draft-orders_{id}_convert-to-order/post.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: convertDraftOrderWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit.yaml new file mode 100644 index 0000000000..9424133b29 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit.yaml @@ -0,0 +1,91 @@ +post: + operationId: PostDraftOrdersIdEdit + summary: Create a Draft Order Edit + x-sidebar-summary: Create Edit + description: >- + Create an edit on a draft order. This will allow you to make changes to the + draft order's items, shipping methods, or promotions before confirming them + later. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_draft-orders_{id}_edit/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_draft-orders_{id}_edit/post.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: beginDraftOrderEditWorkflow +delete: + operationId: DeleteDraftOrdersIdEdit + summary: Cancel Edit on Draft Order + x-sidebar-summary: Cancel Edit + description: Cancel an unconfirmed edit on a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_draft-orders_{id}_edit/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_draft-orders_{id}_edit/delete.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: cancelDraftOrderEditWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_confirm.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_confirm.yaml new file mode 100644 index 0000000000..a7be2308e2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_confirm.yaml @@ -0,0 +1,47 @@ +post: + operationId: PostDraftOrdersIdEditConfirm + summary: Confirm an Edit on a Draft Order + x-sidebar-summary: Confirm Edit + description: >- + Confirm an edit on a draft order. This will apply the changes made to the + draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_edit_confirm/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_draft-orders_{id}_edit_confirm/post.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: confirmDraftOrderEditWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items.yaml new file mode 100644 index 0000000000..53bedcd001 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items.yaml @@ -0,0 +1,49 @@ +post: + operationId: PostDraftOrdersIdEditItems + summary: Add Item to Draft Order + x-sidebar-summary: Add Item + description: Add an Item to a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminAddDraftOrderItems.yaml + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_draft-orders_{id}_edit_items/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_draft-orders_{id}_edit_items/post.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: addDraftOrderItemsWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items_item_{item_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items_item_{item_id}.yaml new file mode 100644 index 0000000000..9888c49e64 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items_item_{item_id}.yaml @@ -0,0 +1,57 @@ +post: + operationId: PostDraftOrdersIdEditItemsItemItem_id + summary: Update Item in Draft Order + x-sidebar-summary: Update Item + description: Update an item in a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: item_id + in: path + description: The item's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminUpdateDraftOrderItem.yaml + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_edit_items_item_{item_id}/post.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_draft-orders_{id}_edit_items_item_{item_id}/post.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: updateDraftOrderItemWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items_{action_id}.yaml new file mode 100644 index 0000000000..71e1fcbc94 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_items_{action_id}.yaml @@ -0,0 +1,123 @@ +post: + operationId: PostDraftOrdersIdEditItemsAction_id + summary: Update Item Changes in Draft Order + x-sidebar-summary: Update Item Changes + description: > + Update changes made on an item (addition or update) in the draft order by + the ID of the item's `ITEM_ADD` or `ITEM_UPDATE` action. + + + Every item has an `actions` property, whose value is an array of actions. + You can check the action's name using its `action` property, and use the + value of the `id` property. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: action_id + in: path + description: The ID of the item's `ITEM_ADD` or `ITEM_UPDATE` action. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminUpdateDraftOrderItem.yaml + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_edit_items_{action_id}/post.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_draft-orders_{id}_edit_items_{action_id}/post.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: updateDraftOrderActionItemWorkflow +delete: + operationId: DeleteDraftOrdersIdEditItemsAction_id + summary: Remove Item from Draft Order + x-sidebar-summary: Remove Item + description: > + Remove an order item from a draft order by the ID of the item's + `ITEM_REMOVE` action. + + + Every item has an `actions` property, whose value is an array of actions. + You can check the action's name using its `action` property, and use the + value of the `id` property. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: action_id + in: path + description: The ID of the order item's `ITEM_REMOVE` action. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_edit_items_{action_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_draft-orders_{id}_edit_items_{action_id}/delete.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: removeDraftOrderActionItemWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_promotions.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_promotions.yaml new file mode 100644 index 0000000000..6e290c7b79 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_promotions.yaml @@ -0,0 +1,109 @@ +post: + operationId: PostDraftOrdersIdEditPromotions + summary: Add Promotions to Draft Order + x-sidebar-summary: Add Promotions + description: Add promotions to a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminAddDraftOrderPromotions.yaml + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_edit_promotions/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_draft-orders_{id}_edit_promotions/post.sh + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminDraftOrderPreviewResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: addDraftOrderPromotionWorkflow +delete: + operationId: DeleteDraftOrdersIdEditPromotions + summary: Remove Promotions from Draft Order + x-sidebar-summary: Remove Promotions + description: Remove specified promotions from a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_edit_promotions/delete.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_draft-orders_{id}_edit_promotions/delete.sh + tags: + - Draft Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminDraftOrderPreviewResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: removeDraftOrderPromotionsWorkflow + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminRemoveDraftOrderPromotions.yaml diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_request.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_request.yaml new file mode 100644 index 0000000000..72077df5b5 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_request.yaml @@ -0,0 +1,47 @@ +post: + operationId: PostDraftOrdersIdEditRequest + summary: Request Edit on Draft Order + x-sidebar-summary: Request Edit + description: >- + Change the status of a draft order's edit to be requested. Later, the edit + can be confirmed or canceled. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_edit_request/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_draft-orders_{id}_edit_request/post.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: requestDraftOrderEditWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods.yaml new file mode 100644 index 0000000000..320df11676 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods.yaml @@ -0,0 +1,51 @@ +post: + operationId: PostDraftOrdersIdEditShippingMethods + summary: Add Shipping Method to Draft Order + x-sidebar-summary: Add Shipping Method + description: Add a shipping method to a draft order. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminAddDraftOrderShippingMethod.yaml + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods/post.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods/post.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: addDraftOrderShippingMethodsWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}.yaml new file mode 100644 index 0000000000..08199411d9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}.yaml @@ -0,0 +1,57 @@ +post: + operationId: PostDraftOrdersIdEditShippingMethodsMethodMethod_id + summary: Update Shipping Method in Draft Order + x-sidebar-summary: Update Shipping Method + description: Update a shipping method in a draft order + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: method_id + in: path + description: The ID of the shipping method. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminUpdateDraftOrderShippingMethod.yaml + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}/post.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_method_{method_id}/post.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: updateDraftOrderShippingMethodWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods_{action_id}.yaml new file mode 100644 index 0000000000..46b6582dc3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders_{id}_edit_shipping-methods_{action_id}.yaml @@ -0,0 +1,126 @@ +post: + operationId: PostDraftOrdersIdEditShippingMethodsAction_id + summary: Update Shipping Method Changes in Draft Order + x-sidebar-summary: Update Shipping Method Changes + description: > + Update changes made on a shipping method (addition or update) in a draft + order using the `ID` of the method's `SHIPPING_ADD` or `SHIPPING_UPDATE` + action. + + + Every shipping method has an `actions` property, whose value is an array of + actions. You can check the action's name using its `action` property, and + use the value of the `id` property. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: action_id + in: path + description: >- + The ID of the shipping method's `SHIPPING_ADD` or `SHIPPING_UPDATE` + action. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminUpdateDraftOrderActionShippingMethod.yaml + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/post.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/post.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: updateDraftOrderActionShippingMethodWorkflow +delete: + operationId: DeleteDraftOrdersIdEditShippingMethodsAction_id + summary: Remove Shipping Method from Draft Order + x-sidebar-summary: Remove Shipping Method + description: > + Remove the shipping method in a draft order using the `ID` of the method's + `SHIPPING_ADD` action. + + + Every shipping method has an `actions` property, whose value is an array of + actions. You can check the action's name using its `action` property, and + use the value of the `id` property. + x-authenticated: true + parameters: + - name: id + in: path + description: The draft order's ID. + required: true + schema: + type: string + - name: action_id + in: path + description: The ID of the shipping method's `SHIPPING_ADD` action. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/admin_draft-orders_{id}_edit_shipping-methods_{action_id}/delete.sh + tags: + - Draft Orders + responses: + '200': + description: OK + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: removeDraftOrderActionShippingMethodWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges.yaml index d88ad4fbde..cae9a9af0c 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges.yaml @@ -911,6 +911,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_exchanges/get.js - lang: Shell label: cURL source: @@ -1003,6 +1007,10 @@ post: schema: $ref: ../components/schemas/AdminPostOrderExchangesReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_exchanges/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}.yaml index 7c03af30fb..62add2e3ca 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_exchanges_{id}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_cancel.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_cancel.yaml index d50c124617..4748f94287 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_cancel.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_cancel.yaml @@ -20,6 +20,10 @@ post: schema: $ref: ../components/schemas/AdminPostCancelExchangeReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_exchanges_{id}_cancel/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_items.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_items.yaml index c3c030cd2c..488006534b 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_items.yaml @@ -24,6 +24,10 @@ post: $ref: >- ../components/schemas/AdminPostExchangesReturnRequestItemsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_exchanges_{id}_inbound_items/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_items_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_items_{action_id}.yaml index 02cc9541b4..f9bade489f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_items_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_items_{action_id}.yaml @@ -35,6 +35,11 @@ post: $ref: >- ../components/schemas/AdminPostExchangesRequestItemsReturnActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_exchanges_{id}_inbound_items_{action_id}/post.js - lang: Shell label: cURL source: @@ -93,6 +98,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_exchanges_{id}_inbound_items_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_shipping-method.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_shipping-method.yaml index d4fdc470dd..0f64e24af8 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_shipping-method.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_shipping-method.yaml @@ -23,6 +23,11 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsShippingReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_shipping-method_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_shipping-method_{action_id}.yaml index 2ce1a484bf..710a25d538 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_shipping-method_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_inbound_shipping-method_{action_id}.yaml @@ -52,6 +52,11 @@ post: schema: $ref: ../components/schemas/AdminPostExchangesShippingActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method_{action_id}/post.js - lang: Shell label: cURL source: @@ -110,6 +115,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_exchanges_{id}_inbound_shipping-method_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_items.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_items.yaml index 875adf14a9..9f2db09a05 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_items.yaml @@ -40,6 +40,10 @@ post: schema: $ref: ../components/schemas/AdminPostExchangesAddItemsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_exchanges_{id}_outbound_items/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_items_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_items_{action_id}.yaml index f739fb19dc..af8fca5751 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_items_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_items_{action_id}.yaml @@ -52,6 +52,11 @@ post: schema: $ref: ../components/schemas/AdminPostExchangesItemsActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_exchanges_{id}_outbound_items_{action_id}/post.js - lang: Shell label: cURL source: @@ -128,6 +133,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_exchanges_{id}_outbound_items_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_shipping-method.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_shipping-method.yaml index 93eaa2fda2..9a75c2004f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_shipping-method.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_shipping-method.yaml @@ -41,6 +41,11 @@ post: schema: $ref: ../components/schemas/AdminPostExchangesShippingReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_shipping-method_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_shipping-method_{action_id}.yaml index c04b888f19..7420700601 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_shipping-method_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_outbound_shipping-method_{action_id}.yaml @@ -52,6 +52,11 @@ post: schema: $ref: ../components/schemas/AdminPostExchangesShippingActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method_{action_id}/post.js - lang: Shell label: cURL source: @@ -128,6 +133,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_exchanges_{id}_outbound_shipping-method_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_request.yaml b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_request.yaml index ad3f25c30e..f6ae002cdc 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_request.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_exchanges_{id}_request.yaml @@ -33,6 +33,10 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_exchanges_{id}_request/post.js - lang: Shell label: cURL source: @@ -76,6 +80,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_exchanges_{id}_request/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-providers.yaml b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-providers.yaml index d0a273e9f0..d874f46e28 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-providers.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-providers.yaml @@ -107,6 +107,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_fulfillment-providers/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-providers_{id}_options.yaml b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-providers_{id}_options.yaml index 32ce5b4b15..680d19192a 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-providers_{id}_options.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-providers_{id}_options.yaml @@ -17,6 +17,11 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_fulfillment-providers_{id}_options/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}.yaml index 212c231cab..5a8bc41dbd 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}.yaml @@ -15,6 +15,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_fulfillment-sets_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones.yaml b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones.yaml index 09eb248a9a..15de3c5edd 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones.yaml @@ -157,6 +157,11 @@ post: type: object description: The geo zone's postal expression or ZIP code. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones_{zone_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones_{zone_id}.yaml index ad35287b5f..d3327b598b 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones_{zone_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_fulfillment-sets_{id}_service-zones_{zone_id}.yaml @@ -40,6 +40,11 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/get.js - lang: Shell label: cURL source: @@ -245,6 +250,11 @@ post: title: id description: The ID of an existing geo zone. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/post.js - lang: Shell label: cURL source: @@ -296,6 +306,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_fulfillment-sets_{id}_service-zones_{zone_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_fulfillments.yaml b/www/apps/api-reference/specs/admin/paths/admin_fulfillments.yaml index 2f21d28cff..b4d1050229 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_fulfillments.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_fulfillments.yaml @@ -32,6 +32,10 @@ post: schema: $ref: ../components/schemas/AdminCreateFulfillment.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_fulfillments/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_fulfillments_{id}_cancel.yaml b/www/apps/api-reference/specs/admin/paths/admin_fulfillments_{id}_cancel.yaml index 21f4c984ee..25353014a6 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_fulfillments_{id}_cancel.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_fulfillments_{id}_cancel.yaml @@ -38,6 +38,10 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_fulfillments_{id}_cancel/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_fulfillments_{id}_shipment.yaml b/www/apps/api-reference/specs/admin/paths/admin_fulfillments_{id}_shipment.yaml index cadea3bc61..afeeff2fe1 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_fulfillments_{id}_shipment.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_fulfillments_{id}_shipment.yaml @@ -41,6 +41,10 @@ post: schema: $ref: ../components/schemas/AdminCreateShipment.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_fulfillments_{id}_shipment/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_inventory-items.yaml b/www/apps/api-reference/specs/admin/paths/admin_inventory-items.yaml index 38ad66561d..a959abec01 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_inventory-items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_inventory-items.yaml @@ -435,6 +435,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_inventory-items/get.js - lang: Shell label: cURL source: @@ -525,6 +529,10 @@ post: schema: $ref: ../components/schemas/AdminCreateInventoryItem.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_inventory-items/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_location-levels_batch.yaml b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_location-levels_batch.yaml index d49d51cb22..57deda3888 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_location-levels_batch.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_location-levels_batch.yaml @@ -13,6 +13,11 @@ post: schema: $ref: ../components/schemas/AdminBatchInventoryItemsLocationLevels.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_inventory-items_location-levels_batch/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}.yaml index da0f1fdb39..e43c8b9736 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_inventory-items_{id}/get.js - lang: Shell label: cURL source: @@ -162,6 +166,10 @@ post: The inventory item's metadata. Can be custom data in key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_inventory-items_{id}/post.js - lang: Shell label: cURL source: @@ -205,6 +213,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_inventory-items_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml index c35d324e01..49c099b73b 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml @@ -91,6 +91,11 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_inventory-items_{id}_location-levels/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_batch.yaml b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_batch.yaml index dbc0e3d2fe..f786691469 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_batch.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_batch.yaml @@ -21,6 +21,11 @@ post: schema: $ref: ../components/schemas/AdminBatchInventoryItemLocationsLevel.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_inventory-items_{id}_location-levels_batch/post.js - lang: Shell label: cURL source: @@ -29,6 +34,8 @@ post: tags: - Inventory Items responses: + '200': + description: OK '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml index 45aae2bc29..79ec142b25 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml @@ -57,6 +57,11 @@ post: title: incoming_quantity description: The inventory level's incoming quantity. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/post.js - lang: Shell label: cURL source: @@ -131,6 +136,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_inventory-items_{id}_location-levels_{location_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_invites.yaml b/www/apps/api-reference/specs/admin/paths/admin_invites.yaml index 1365bb7ef5..c994e0eac2 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_invites.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_invites.yaml @@ -535,6 +535,10 @@ get: type: object title: $or x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_invites/get.js - lang: Shell label: cURL source: @@ -635,6 +639,10 @@ post: type: object description: The invite's metadata. Can be custom data in key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_invites/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_invites_accept.yaml b/www/apps/api-reference/specs/admin/paths/admin_invites_accept.yaml index 61278e9669..43d0cc68c9 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_invites_accept.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_invites_accept.yaml @@ -30,6 +30,10 @@ post: title: last_name description: The user's last name. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_invites_accept/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_invites_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_invites_{id}.yaml index 933f808c6b..3d65f1b136 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_invites_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_invites_{id}.yaml @@ -31,6 +31,10 @@ get: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_invites_{id}/get.js - lang: Shell label: cURL source: @@ -73,6 +77,10 @@ delete: schema: type: string x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_invites_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_invites_{id}_resend.yaml b/www/apps/api-reference/specs/admin/paths/admin_invites_{id}_resend.yaml index 4d4e5cc876..7a235dd074 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_invites_{id}_resend.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_invites_{id}_resend.yaml @@ -29,6 +29,10 @@ post: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_invites_{id}_resend/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_notifications.yaml b/www/apps/api-reference/specs/admin/paths/admin_notifications.yaml index 26281c69ad..306d2b12da 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_notifications.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_notifications.yaml @@ -122,6 +122,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_notifications/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_notifications_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_notifications_{id}.yaml index 85628227f5..ac2932f775 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_notifications_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_notifications_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_notifications_{id}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_order-edits.yaml b/www/apps/api-reference/specs/admin/paths/admin_order-edits.yaml index b112a354fc..af5b22041f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_order-edits.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_order-edits.yaml @@ -13,6 +13,10 @@ post: schema: $ref: ../components/schemas/AdminPostOrderEditsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_order-edits/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}.yaml index 0a2d11193c..e9953f152d 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}.yaml @@ -15,6 +15,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_order-edits_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_confirm.yaml b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_confirm.yaml index e398ce56e4..100f2ed2ad 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_confirm.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_confirm.yaml @@ -15,6 +15,10 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_order-edits_{id}_confirm/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items.yaml b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items.yaml index fd0e9bcba7..861bacd635 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items.yaml @@ -21,6 +21,10 @@ post: schema: $ref: ../components/schemas/AdminPostOrderEditsAddItemsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_order-edits_{id}_items/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items_item_{item_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items_item_{item_id}.yaml index babbf7dd53..5575b81233 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items_item_{item_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items_item_{item_id}.yaml @@ -28,6 +28,11 @@ post: $ref: >- ../components/schemas/AdminPostOrderEditsUpdateItemQuantityReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_order-edits_{id}_items_item_{item_id}/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items_{action_id}.yaml index 107a1adf23..e4ad568609 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_items_{action_id}.yaml @@ -34,6 +34,11 @@ post: schema: $ref: ../components/schemas/AdminPostOrderEditsItemsActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_order-edits_{id}_items_{action_id}/post.js - lang: Shell label: cURL source: @@ -91,6 +96,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_order-edits_{id}_items_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_request.yaml b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_request.yaml index 8e95961ea6..853d4bb4fc 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_request.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_order-edits_{id}_request.yaml @@ -15,6 +15,10 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_order-edits_{id}_request/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders.yaml index 2750c8df9a..91414d675c 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders.yaml @@ -706,6 +706,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}.yaml index d14dc0f95d..898bb04d61 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}.yaml @@ -83,6 +83,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}/get.js - lang: Shell label: cURL source: @@ -151,6 +155,10 @@ post: schema: $ref: ../components/schemas/AdminUpdateOrder.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_cancel.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_cancel.yaml index f67171c4f4..f01e2f832f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_cancel.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_cancel.yaml @@ -41,6 +41,10 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}_cancel/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_changes.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_changes.yaml index 83af4bddde..2b65c68c86 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_changes.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_changes.yaml @@ -42,6 +42,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}_changes/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_credit-lines.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_credit-lines.yaml new file mode 100644 index 0000000000..37ec73561f --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_credit-lines.yaml @@ -0,0 +1,73 @@ +post: + operationId: PostOrdersIdCreditLines + summary: Create Credit Line for Order + x-sidebar-summary: Create Credit Line + description: Create a credit line for an order. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. + + if a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. + + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminCreateOrderCreditLines.yaml + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}_credit-lines/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_orders_{id}_credit-lines/post.sh + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminOrderResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: createOrderCreditLinesWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments.yaml index 5f72f092b4..5bf5e6b42d 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments.yaml @@ -92,6 +92,10 @@ post: `additional_data` parameter. description: The fulfillment's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}_fulfillments/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml index be337068fc..1fecf1a830 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -65,6 +65,11 @@ post: `additional_data` parameter. description: The cancelation details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_mark-as-delivered.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_mark-as-delivered.yaml index d6151b97c4..9892af5d50 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_mark-as-delivered.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_mark-as-delivered.yaml @@ -40,6 +40,11 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_mark-as-delivered/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments.yaml index 6c21e1c2ef..7dd85a1fb5 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments.yaml @@ -111,6 +111,11 @@ post: `additional_data` parameter. description: The shipment's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_line-items.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_line-items.yaml index 80372cbcfe..8d252a054e 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_line-items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_line-items.yaml @@ -128,6 +128,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}_line-items/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_preview.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_preview.yaml index e533c340ce..87a335fe19 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_preview.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_preview.yaml @@ -15,6 +15,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}_preview/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer.yaml index 7851f0d847..486dc23e14 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer.yaml @@ -45,6 +45,10 @@ post: schema: $ref: ../components/schemas/AdminTransferOrder.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}_transfer/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer_cancel.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer_cancel.yaml index 88c6ecc027..29ca12da78 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer_cancel.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer_cancel.yaml @@ -36,6 +36,10 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}_transfer_cancel/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_payment-collections.yaml b/www/apps/api-reference/specs/admin/paths/admin_payment-collections.yaml index a7e5acd535..78e36f9055 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payment-collections.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payment-collections.yaml @@ -45,6 +45,10 @@ post: title: amount description: The amount to be paid. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_payment-collections/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}.yaml index 35f2fecee9..196e3c8db8 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}.yaml @@ -15,6 +15,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_payment-collections_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}_mark-as-paid.yaml b/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}_mark-as-paid.yaml index 44f572f0b2..3dfd8cee23 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}_mark-as-paid.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payment-collections_{id}_mark-as-paid.yaml @@ -49,6 +49,11 @@ post: title: order_id description: The ID of the order associated with the payment collection. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_payment-collections_{id}_mark-as-paid/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_payments.yaml b/www/apps/api-reference/specs/admin/paths/admin_payments.yaml index 796fcf9fd4..f3a5b046d2 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payments.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payments.yaml @@ -541,6 +541,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_payments/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_payments_payment-providers.yaml b/www/apps/api-reference/specs/admin/paths/admin_payments_payment-providers.yaml index c2e9e68680..692d2a329f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payments_payment-providers.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payments_payment-providers.yaml @@ -107,6 +107,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_payments_payment-providers/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_payments_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_payments_{id}.yaml index 122a7c3232..8c5e9854ed 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payments_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payments_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_payments_{id}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_capture.yaml b/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_capture.yaml index 7424603aaf..c5fd4a2ceb 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_capture.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_capture.yaml @@ -46,6 +46,10 @@ post: title: amount description: The amount to capture. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_payments_{id}_capture/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_refund.yaml b/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_refund.yaml index 203d5e0c12..fbb21b158e 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_refund.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_payments_{id}_refund.yaml @@ -54,6 +54,10 @@ post: title: note description: A note to attach to the refund. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_payments_{id}_refund/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_plugins.yaml b/www/apps/api-reference/specs/admin/paths/admin_plugins.yaml new file mode 100644 index 0000000000..fff02d5af5 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_plugins.yaml @@ -0,0 +1,39 @@ +get: + operationId: GetPlugins + summary: List Plugins + description: Retrieve the list of plugins installed in the Medusa application. + x-authenticated: true + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_plugins/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_plugins/get.sh + tags: + - Plugins + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminPluginsListResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/www/apps/api-reference/specs/admin/paths/admin_price-lists.yaml b/www/apps/api-reference/specs/admin/paths/admin_price-lists.yaml index 717ec6d072..e18eab36f2 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_price-lists.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_price-lists.yaml @@ -414,6 +414,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-lists/get.js - lang: Shell label: cURL source: @@ -473,6 +477,10 @@ post: schema: $ref: ../components/schemas/AdminCreatePriceList.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-lists/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}.yaml index 5431d989a5..c777861017 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-lists_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminUpdatePriceList.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-lists_{id}/post.js - lang: Shell label: cURL source: @@ -143,6 +151,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-lists_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_prices_batch.yaml b/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_prices_batch.yaml index 8291f9266d..063c58f8d4 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_prices_batch.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_prices_batch.yaml @@ -115,6 +115,10 @@ post: title: delete description: A price's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-lists_{id}_prices_batch/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_products.yaml b/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_products.yaml index 92b6d0876b..b59a856ab9 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_products.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_price-lists_{id}_products.yaml @@ -38,6 +38,10 @@ post: schema: $ref: ../components/schemas/AdminLinkPriceListProducts.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-lists_{id}_products/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_price-preferences.yaml b/www/apps/api-reference/specs/admin/paths/admin_price-preferences.yaml index 4b3f37dcb4..46039b7844 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_price-preferences.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_price-preferences.yaml @@ -141,6 +141,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-preferences/get.js - lang: Shell label: cURL source: @@ -200,6 +204,10 @@ post: schema: $ref: ../components/schemas/AdminCreatePricePreference.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-preferences/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_price-preferences_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_price-preferences_{id}.yaml index fcc9aa640b..4294aef139 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_price-preferences_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_price-preferences_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-preferences_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminUpdatePricePreference.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-preferences_{id}/post.js - lang: Shell label: cURL source: @@ -143,6 +151,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_price-preferences_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-categories.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-categories.yaml index 786f1642bf..ee22858434 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-categories.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-categories.yaml @@ -642,6 +642,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-categories/get.js - lang: Shell label: cURL source: @@ -703,6 +707,10 @@ post: schema: $ref: ../components/schemas/AdminCreateProductCategory.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-categories/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml index a7c21529a0..a04b54bacd 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml @@ -77,6 +77,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-categories_{id}/get.js - lang: Shell label: cURL source: @@ -181,6 +185,10 @@ post: title: rank description: The product category's rank among other categories. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-categories_{id}/post.js - lang: Shell label: cURL source: @@ -224,6 +232,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-categories_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}_products.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}_products.yaml index 03d9ecd0bf..44db81e032 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}_products.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}_products.yaml @@ -57,6 +57,11 @@ post: title: remove description: A product ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_product-categories_{id}_products/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-tags.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-tags.yaml index 6c9c318571..be3c1e5a93 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-tags.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-tags.yaml @@ -537,6 +537,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-tags/get.js - lang: Shell label: cURL source: @@ -596,6 +600,10 @@ post: schema: $ref: ../components/schemas/AdminCreateProductTag.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-tags/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-tags_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-tags_{id}.yaml index 7ff072a091..5dc0a4e1d1 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-tags_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-tags_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-tags_{id}/get.js - lang: Shell label: cURL source: @@ -109,6 +113,10 @@ post: type: object description: The product tag's metadata. Can hold custom key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-tags_{id}/post.js - lang: Shell label: cURL source: @@ -152,6 +160,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-tags_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-types.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-types.yaml index 474a0093b7..a6edcace6a 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-types.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-types.yaml @@ -537,6 +537,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-types/get.js - lang: Shell label: cURL source: @@ -596,6 +600,10 @@ post: schema: $ref: ../components/schemas/AdminCreateProductType.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-types/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-types_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-types_{id}.yaml index 04e36a912e..fb82434eb9 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-types_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-types_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-types_{id}/get.js - lang: Shell label: cURL source: @@ -109,6 +113,10 @@ post: type: object description: The product type's metadata. Can hold custom key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-types_{id}/post.js - lang: Shell label: cURL source: @@ -152,6 +160,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-types_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-variants.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-variants.yaml index e8617ec73f..f8adb70015 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-variants.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-variants.yaml @@ -545,6 +545,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_product-variants/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_products.yaml b/www/apps/api-reference/specs/admin/paths/admin_products.yaml index 34ee3feee4..37af38eb2d 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products.yaml @@ -1188,6 +1188,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products/get.js - lang: Shell label: cURL source: @@ -1289,6 +1293,10 @@ post: `additional_data` parameter. description: The product's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_batch.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_batch.yaml index c53cbb9771..f846a37f18 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_batch.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_batch.yaml @@ -32,6 +32,10 @@ post: schema: $ref: ../components/schemas/AdminBatchProductRequest.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products_batch/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_export.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_export.yaml index 73c83b8fd2..a3d146bb00 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_export.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_export.yaml @@ -37,6 +37,10 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products_export/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_import.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_import.yaml index 719f91f872..1558793039 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_import.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_import.yaml @@ -16,6 +16,10 @@ post: schema: $ref: ../components/schemas/AdminImportProductRequest.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products_import/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_import_{transaction_id}_confirm.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_import_{transaction_id}_confirm.yaml index d45e77c4e3..3801815cc1 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_import_{transaction_id}_confirm.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_import_{transaction_id}_confirm.yaml @@ -17,6 +17,11 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_products_import_{transaction_id}_confirm/post.js - lang: Shell label: cURL source: @@ -25,6 +30,8 @@ post: tags: - Products responses: + '202': + description: OK '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_{id}.yaml index b52ef25637..8f0ec2aa2d 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products_{id}/get.js - lang: Shell label: cURL source: @@ -111,6 +115,10 @@ post: `additional_data` parameter. description: The properties to update in a product. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products_{id}/post.js - lang: Shell label: cURL source: @@ -154,6 +162,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_options.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_options.yaml index 5cc494b487..4e2aa36bbc 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_options.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_options.yaml @@ -133,6 +133,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products_{id}_options/get.js - lang: Shell label: cURL source: @@ -239,6 +243,10 @@ post: `additional_data` parameter. description: The product option's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products_{id}_options/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_options_{option_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_options_{option_id}.yaml index 9947bc4521..81c5e0f3a0 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_options_{option_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_options_{option_id}.yaml @@ -40,6 +40,11 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_products_{id}_options_{option_id}/get.js - lang: Shell label: cURL source: @@ -123,6 +128,11 @@ post: `additional_data` parameter. description: The properties to update in the product option. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_products_{id}_options_{option_id}/post.js - lang: Shell label: cURL source: @@ -194,6 +204,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_products_{id}_options_{option_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants.yaml index 675daf0ab9..12a43e3707 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants.yaml @@ -552,6 +552,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products_{id}_variants/get.js - lang: Shell label: cURL source: @@ -658,6 +662,10 @@ post: `additional_data` parameter. description: The product variant's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products_{id}_variants/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_batch.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_batch.yaml index e83a1f83a3..079f05e13d 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_batch.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_batch.yaml @@ -39,6 +39,10 @@ post: schema: $ref: ../components/schemas/AdminBatchProductVariantRequest.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_products_{id}_variants_batch/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_inventory-items_batch.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_inventory-items_batch.yaml index 508314a614..d24542af8f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_inventory-items_batch.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_inventory-items_batch.yaml @@ -116,6 +116,11 @@ post: title: variant_id description: The ID of the variant. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_products_{id}_variants_inventory-items_batch/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_{variant_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_{variant_id}.yaml index ad7e6a31c5..fb75cc1c24 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_{variant_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_products_{id}_variants_{variant_id}.yaml @@ -40,6 +40,11 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/get.js - lang: Shell label: cURL source: @@ -123,6 +128,11 @@ post: `additional_data` parameter. description: The properties to update in the variant. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/post.js - lang: Shell label: cURL source: @@ -192,6 +202,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_products_{id}_variants_{variant_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_promotions.yaml b/www/apps/api-reference/specs/admin/paths/admin_promotions.yaml index b800968128..cc5c3a17a6 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_promotions.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_promotions.yaml @@ -555,11 +555,51 @@ get: items: type: object title: $or + - name: currency_code + in: query + required: false + schema: + oneOf: + - type: string + title: currency_code + description: >- + Filter by a currency code. The promotions are filtered based on + their application method's currency code. + - type: array + description: >- + Filter by currency codes. The promotions are filtered based on + their application method's currency code. + items: + type: string + title: currency_code + description: A currency code. + - name: application_method_type + in: query + required: false + schema: + oneOf: + - type: string + title: application_method_type + description: >- + Filter by an application method type. The promotions are filtered + based on their application method's type. + - type: array + description: >- + Filter by application method types. The promotions are filtered + based on their application method's type. + items: + type: string + title: application_method_type + description: An application method type. security: - api_token: [] - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_promotions/get.js - lang: Shell label: cURL source: @@ -983,6 +1023,10 @@ post: `additional_data` parameter. description: The promotion's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_promotions/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-attribute-options_{rule_type}.yaml b/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-attribute-options_{rule_type}.yaml index c240da2171..135b6e8756 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-attribute-options_{rule_type}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-attribute-options_{rule_type}.yaml @@ -58,6 +58,11 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_promotions_rule-attribute-options_{rule_type}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}.yaml index e715dd2981..30ae7314a6 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}.yaml @@ -87,6 +87,11 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}/get.js - lang: Shell label: cURL source: @@ -100,16 +105,39 @@ get: content: application/json: schema: - type: object - description: The list of rule values. - required: - - values - properties: - values: - type: array + allOf: + - type: object + description: The pagination fields. + required: + - limit + - offset + - count + properties: + limit: + type: number + title: limit + description: The maximum number of items returned. + offset: + type: number + title: offset + description: >- + The number of items skipped before retrieving the returned + items. + count: + type: number + title: count + description: The total number of items. + - type: object description: The list of rule values. - items: - $ref: ../components/schemas/AdminRuleValueOption.yaml + required: + - values + properties: + values: + type: array + description: The list of rule values. + items: + $ref: ../components/schemas/AdminRuleValueOption.yaml + description: The paginated list of rule values. '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/www/apps/api-reference/specs/admin/paths/admin_promotions_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_promotions_{id}.yaml index bcb1ae5d7b..acd5c5ce3a 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_promotions_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_promotions_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_promotions_{id}/get.js - lang: Shell label: cURL source: @@ -213,6 +217,10 @@ post: `additional_data` parameter. description: The properties to update in a promotion. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_promotions_{id}/post.js - lang: Shell label: cURL source: @@ -256,6 +264,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_promotions_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_promotions_{id}_{rule_type}.yaml b/www/apps/api-reference/specs/admin/paths/admin_promotions_{id}_{rule_type}.yaml index f423ecb2af..50fa3f96e8 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_promotions_{id}_{rule_type}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_promotions_{id}_{rule_type}.yaml @@ -54,6 +54,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_promotions_{id}_{rule_type}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_refund-reasons.yaml b/www/apps/api-reference/specs/admin/paths/admin_refund-reasons.yaml index be2fe97f71..8c5a905562 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_refund-reasons.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_refund-reasons.yaml @@ -112,6 +112,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_refund-reasons/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_regions.yaml b/www/apps/api-reference/specs/admin/paths/admin_regions.yaml index b26d028d09..ea43e27e07 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_regions.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_regions.yaml @@ -551,6 +551,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_regions/get.js - lang: Shell label: cURL source: @@ -641,6 +645,10 @@ post: schema: $ref: ../components/schemas/AdminCreateRegion.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_regions/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_regions_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_regions_{id}.yaml index d4c5ea365d..b28b3547e1 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_regions_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_regions_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_regions_{id}/get.js - lang: Shell label: cURL source: @@ -137,6 +141,10 @@ post: title: is_tax_inclusive description: Whether the prices in the region are tax inclusive. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_regions_{id}/post.js - lang: Shell label: cURL source: @@ -180,6 +188,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_regions_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_reservations.yaml b/www/apps/api-reference/specs/admin/paths/admin_reservations.yaml index ae573bbe24..05a696f5cf 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_reservations.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_reservations.yaml @@ -611,6 +611,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_reservations/get.js - lang: Shell label: cURL source: @@ -701,6 +705,10 @@ post: schema: $ref: ../components/schemas/AdminCreateReservation.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_reservations/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_reservations_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_reservations_{id}.yaml index 8d38c4d827..2c80486978 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_reservations_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_reservations_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_reservations_{id}/get.js - lang: Shell label: cURL source: @@ -117,6 +121,10 @@ post: type: object description: The reservation's metadata. Can hold custom key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_reservations_{id}/post.js - lang: Shell label: cURL source: @@ -160,6 +168,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_reservations_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_return-reasons.yaml b/www/apps/api-reference/specs/admin/paths/admin_return-reasons.yaml index 3024301806..410a3bf059 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_return-reasons.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_return-reasons.yaml @@ -595,6 +595,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_return-reasons/get.js - lang: Shell label: cURL source: @@ -654,6 +658,10 @@ post: schema: $ref: ../components/schemas/AdminCreateReturnReason.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_return-reasons/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_return-reasons_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_return-reasons_{id}.yaml index 54d1ad8286..103286d181 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_return-reasons_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_return-reasons_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_return-reasons_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminUpdateReturnReason.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_return-reasons_{id}/post.js - lang: Shell label: cURL source: @@ -143,6 +151,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_return-reasons_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns.yaml index a7ba5184fb..73a3b48d99 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns.yaml @@ -704,6 +704,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns/get.js - lang: Shell label: cURL source: @@ -794,6 +798,10 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}.yaml index dec04a57a5..eed237a60f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsReturnReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_cancel.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_cancel.yaml index 8902f29c16..151963d939 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_cancel.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_cancel.yaml @@ -15,6 +15,10 @@ post: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}_cancel/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_dismiss-items.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_dismiss-items.yaml index b9d16ab226..e76c80e0b1 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_dismiss-items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_dismiss-items.yaml @@ -41,6 +41,10 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsReceiveItemsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}_dismiss-items/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_dismiss-items_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_dismiss-items_{action_id}.yaml index 76d04367fc..0dacc5eb59 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_dismiss-items_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_dismiss-items_{action_id}.yaml @@ -53,6 +53,11 @@ post: $ref: >- ../components/schemas/AdminPostReturnsDismissItemsActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_returns_{id}_dismiss-items_{action_id}/post.js - lang: Shell label: cURL source: @@ -129,6 +134,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_returns_{id}_dismiss-items_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive-items.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive-items.yaml index 9bd33b5e12..e5ca29f568 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive-items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive-items.yaml @@ -41,6 +41,10 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsReceiveItemsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}_receive-items/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive-items_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive-items_{action_id}.yaml index 950901edeb..226581d9a4 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive-items_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive-items_{action_id}.yaml @@ -53,6 +53,11 @@ post: $ref: >- ../components/schemas/AdminPostReturnsReceiveItemsActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_returns_{id}_receive-items_{action_id}/post.js - lang: Shell label: cURL source: @@ -129,6 +134,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_returns_{id}_receive-items_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive.yaml index e2d885f1dd..b733f001c9 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive.yaml @@ -40,6 +40,10 @@ post: schema: $ref: ../components/schemas/AdminPostReceiveReturnsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}_receive/post.js - lang: Shell label: cURL source: @@ -85,6 +89,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}_receive/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive_confirm.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive_confirm.yaml index 96e621b46f..623e075aad 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive_confirm.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_receive_confirm.yaml @@ -40,6 +40,10 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsConfirmRequestReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}_receive_confirm/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request-items.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request-items.yaml index 6725a4704f..ac28ceef85 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request-items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request-items.yaml @@ -41,6 +41,10 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsRequestItemsReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}_request-items/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request-items_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request-items_{action_id}.yaml index 39ae26960d..c839550cf2 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request-items_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request-items_{action_id}.yaml @@ -53,6 +53,11 @@ post: $ref: >- ../components/schemas/AdminPostReturnsRequestItemsActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_returns_{id}_request-items_{action_id}/post.js - lang: Shell label: cURL source: @@ -129,6 +134,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_returns_{id}_request-items_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request.yaml index e9c4ad693c..48ee733ce4 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_request.yaml @@ -41,6 +41,10 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsConfirmRequestReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}_request/post.js - lang: Shell label: cURL source: @@ -84,6 +88,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}_request/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_shipping-method.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_shipping-method.yaml index f3bd97db24..48ffd8ef5f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_shipping-method.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_shipping-method.yaml @@ -41,6 +41,10 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsShippingReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_returns_{id}_shipping-method/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_shipping-method_{action_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_shipping-method_{action_id}.yaml index 8916a6e3ba..8de8919078 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_shipping-method_{action_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns_{id}_shipping-method_{action_id}.yaml @@ -52,6 +52,11 @@ post: schema: $ref: ../components/schemas/AdminPostReturnsShippingActionReqSchema.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_returns_{id}_shipping-method_{action_id}/post.js - lang: Shell label: cURL source: @@ -128,6 +133,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_returns_{id}_shipping-method_{action_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_sales-channels.yaml b/www/apps/api-reference/specs/admin/paths/admin_sales-channels.yaml index 4ef279f97e..d7ca5e8207 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_sales-channels.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_sales-channels.yaml @@ -589,6 +589,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_sales-channels/get.js - lang: Shell label: cURL source: @@ -679,6 +683,10 @@ post: schema: $ref: ../components/schemas/AdminCreateSalesChannel.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_sales-channels/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_sales-channels_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_sales-channels_{id}.yaml index 8ecd255a99..d2166bc64b 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_sales-channels_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_sales-channels_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_sales-channels_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminUpdateSalesChannel.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_sales-channels_{id}/post.js - lang: Shell label: cURL source: @@ -143,6 +151,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_sales-channels_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_sales-channels_{id}_products.yaml b/www/apps/api-reference/specs/admin/paths/admin_sales-channels_{id}_products.yaml index 7ab66212df..e647b88061 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_sales-channels_{id}_products.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_sales-channels_{id}_products.yaml @@ -55,6 +55,10 @@ post: title: remove description: A product's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_sales-channels_{id}_products/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_shipping-options.yaml b/www/apps/api-reference/specs/admin/paths/admin_shipping-options.yaml index 3c82fe115b..5a73766e6a 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_shipping-options.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_shipping-options.yaml @@ -607,6 +607,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-options/get.js - lang: Shell label: cURL source: @@ -697,6 +701,10 @@ post: schema: $ref: ../components/schemas/AdminCreateShippingOption.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-options/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}.yaml index 3efc340cc4..f10ca2908f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}.yaml @@ -37,6 +37,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-options_{id}/get.js - lang: Shell label: cURL source: @@ -281,6 +285,10 @@ post: description: A value of the attribute that enables this rule. example: cusgroup_123 x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-options_{id}/post.js - lang: Shell label: cURL source: @@ -324,6 +332,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-options_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}_rules_batch.yaml b/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}_rules_batch.yaml index a6c51c8006..b70d04f955 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}_rules_batch.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_shipping-options_{id}_rules_batch.yaml @@ -58,6 +58,11 @@ post: title: delete description: A rule's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_shipping-options_{id}_rules_batch/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles.yaml b/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles.yaml index c111ff647e..e83c4e29de 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles.yaml @@ -540,6 +540,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-profiles/get.js - lang: Shell label: cURL source: @@ -630,6 +634,10 @@ post: schema: $ref: ../components/schemas/AdminCreateShippingProfile.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-profiles/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles_{id}.yaml index 8774da5e46..6ea25d8364 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_shipping-profiles_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-profiles_{id}/get.js - lang: Shell label: cURL source: @@ -113,6 +117,10 @@ post: type: object description: The shipping profile's metadata. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-profiles_{id}/post.js - lang: Shell label: cURL source: @@ -156,6 +164,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-profiles_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_stock-locations.yaml b/www/apps/api-reference/specs/admin/paths/admin_stock-locations.yaml index 5a1af4cc41..de2a053acd 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_stock-locations.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_stock-locations.yaml @@ -567,6 +567,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_stock-locations/get.js - lang: Shell label: cURL source: @@ -626,6 +630,10 @@ post: schema: $ref: ../components/schemas/AdminCreateStockLocation.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_stock-locations/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}.yaml index 7a7263ba5e..f4ed982ae8 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_stock-locations_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminUpdateStockLocation.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_stock-locations_{id}/post.js - lang: Shell label: cURL source: @@ -143,6 +151,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_stock-locations_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-providers.yaml b/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-providers.yaml index 240249dff4..92f83ce19d 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-providers.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-providers.yaml @@ -57,6 +57,11 @@ post: title: remove description: A fulfillment provider's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_stock-locations_{id}_fulfillment-providers/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-sets.yaml b/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-sets.yaml index 7e174c7c93..11999a6529 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-sets.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_fulfillment-sets.yaml @@ -52,6 +52,11 @@ post: title: type description: The fulfillment set's type. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_stock-locations_{id}_fulfillment-sets/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_sales-channels.yaml b/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_sales-channels.yaml index 68a8bee956..45f87a389b 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_sales-channels.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_stock-locations_{id}_sales-channels.yaml @@ -55,6 +55,11 @@ post: title: remove description: A sales channel's ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/admin_stock-locations_{id}_sales-channels/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_stores.yaml b/www/apps/api-reference/specs/admin/paths/admin_stores.yaml index 0c4d024bf4..c51f0ef327 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_stores.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_stores.yaml @@ -120,6 +120,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_stores/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_stores_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_stores_{id}.yaml index 3fb4c9aa09..32041d6a7a 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_stores_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_stores_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_stores_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminUpdateStore.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_stores_{id}/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_tax-rates.yaml b/www/apps/api-reference/specs/admin/paths/admin_tax-rates.yaml index 43f58552d3..8ef0a91929 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_tax-rates.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_tax-rates.yaml @@ -633,6 +633,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_tax-rates/get.js - lang: Shell label: cURL source: @@ -723,6 +727,10 @@ post: schema: $ref: ../components/schemas/AdminCreateTaxRate.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_tax-rates/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_tax-rates_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_tax-rates_{id}.yaml index 358ce6d59b..9ddb8a8a91 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_tax-rates_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_tax-rates_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_tax-rates_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminUpdateTaxRate.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_tax-rates_{id}/post.js - lang: Shell label: cURL source: @@ -143,6 +151,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_tax-rates_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_tax-regions.yaml b/www/apps/api-reference/specs/admin/paths/admin_tax-regions.yaml index 96f0ef5825..4e630b97b1 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_tax-regions.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_tax-regions.yaml @@ -1256,6 +1256,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_tax-regions/get.js - lang: Shell label: cURL source: @@ -1346,6 +1350,10 @@ post: schema: $ref: ../components/schemas/AdminCreateTaxRegion.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_tax-regions/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_tax-regions_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_tax-regions_{id}.yaml index 98e10dcbb1..1886827f71 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_tax-regions_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_tax-regions_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_tax-regions_{id}/get.js - lang: Shell label: cURL source: @@ -145,6 +149,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_tax-regions_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_uploads.yaml b/www/apps/api-reference/specs/admin/paths/admin_uploads.yaml index 287992e323..2bed219b7f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_uploads.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_uploads.yaml @@ -54,6 +54,10 @@ post: title: FileList description: The files to upload. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_uploads/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_uploads_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_uploads_{id}.yaml index 1f4dc3827c..312407d9e7 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_uploads_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_uploads_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_uploads_{id}/get.js - lang: Shell label: cURL source: @@ -77,6 +81,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_uploads_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_users.yaml b/www/apps/api-reference/specs/admin/paths/admin_users.yaml index 72ca4a2742..eeb6efcef9 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_users.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_users.yaml @@ -522,6 +522,10 @@ get: title: $exists description: Filter by whether a value for this parameter exists (not `null`). x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_users/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_users_me.yaml b/www/apps/api-reference/specs/admin/paths/admin_users_me.yaml index 6246d4f2e3..03447ca548 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_users_me.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_users_me.yaml @@ -23,6 +23,10 @@ get: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_users_me/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_users_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_users_{id}.yaml index 490eba4d36..f1b65f96e1 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_users_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_users_{id}.yaml @@ -31,6 +31,10 @@ get: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_users_{id}/get.js - lang: Shell label: cURL source: @@ -95,6 +99,10 @@ post: schema: $ref: ../components/schemas/AdminUpdateUser.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_users_{id}/post.js - lang: Shell label: cURL source: @@ -137,6 +145,10 @@ delete: schema: type: string x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_users_{id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_workflows-executions.yaml b/www/apps/api-reference/specs/admin/paths/admin_workflows-executions.yaml index e74e6a2c10..02414cf2e9 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_workflows-executions.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_workflows-executions.yaml @@ -91,6 +91,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_workflows-executions/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_workflows-executions_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_workflows-executions_{id}.yaml index ac98902ff2..0bb614ebc6 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_workflows-executions_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_workflows-executions_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_workflows-executions_{id}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/auth_session.yaml b/www/apps/api-reference/specs/admin/paths/auth_session.yaml index 29f77a9c93..13058281cd 100644 --- a/www/apps/api-reference/specs/admin/paths/auth_session.yaml +++ b/www/apps/api-reference/specs/admin/paths/auth_session.yaml @@ -38,6 +38,10 @@ delete: description: Deletes the cookie session ID previously set for authentication. x-authenticated: true x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/auth_session/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/auth_token_refresh.yaml b/www/apps/api-reference/specs/admin/paths/auth_token_refresh.yaml index 69af124458..559bb72f80 100644 --- a/www/apps/api-reference/specs/admin/paths/auth_token_refresh.yaml +++ b/www/apps/api-reference/specs/admin/paths/auth_token_refresh.yaml @@ -11,6 +11,10 @@ post: description: Learn about third-party authentication flow. x-authenticated: true x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/auth_token_refresh/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}.yaml b/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}.yaml index 253196dd75..7f6cfebb8e 100644 --- a/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}.yaml +++ b/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}.yaml @@ -40,10 +40,10 @@ post: will override the provider's `callbackUrl` configurations in `medusa-config.ts`. x-codeSamples: - - lang: Shell - label: EmailPass Provider + - lang: JavaScript + label: JS SDK source: - $ref: ../code_samples/Shell/auth_user_{auth_provider}/post.sh + $ref: ../code_samples/JavaScript/auth_user_{auth_provider}/post.js - lang: Bash label: Google Provider source: diff --git a/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_callback.yaml b/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_callback.yaml index 9ab9bc3db5..7ecc9ba9c9 100644 --- a/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_callback.yaml +++ b/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_callback.yaml @@ -29,14 +29,14 @@ post: type: string example: google x-codeSamples: - - lang: Shell + - lang: JavaScript label: Google Provider source: - $ref: ../code_samples/Shell/auth_user_{auth_provider}_callback/post.sh - - lang: Bash + $ref: ../code_samples/JavaScript/auth_user_{auth_provider}_callback/post.js + - lang: TypeScript label: GitHub Provider source: - $ref: ../code_samples/Bash/auth_user_{auth_provider}_callback/post.sh + $ref: ../code_samples/TypeScript/auth_user_{auth_provider}_callback/post.ts tags: - Auth responses: diff --git a/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_register.yaml b/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_register.yaml index 00c216f0cd..5cb41a2b50 100644 --- a/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_register.yaml +++ b/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_register.yaml @@ -31,6 +31,10 @@ post: email: admin@medusa-test.com password: supersecret x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/auth_user_{auth_provider}_register/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_reset-password.yaml b/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_reset-password.yaml index d9bb5469b3..6a01dec6e7 100644 --- a/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_reset-password.yaml +++ b/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_reset-password.yaml @@ -44,6 +44,11 @@ post: for the `emailpass` auth provider, the value is the user's email. example: admin@medusa-test.com x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/auth_user_{auth_provider}_reset-password/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_update.yaml b/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_update.yaml index b679112dd5..8bb6d39753 100644 --- a/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_update.yaml +++ b/www/apps/api-reference/specs/admin/paths/auth_user_{auth_provider}_update.yaml @@ -33,6 +33,10 @@ post: email: admin@medusa-test.com password: supersecret x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/auth_user_{auth_provider}_update/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/code_samples/Bash/auth_customer_{auth_provider}_callback/post.sh b/www/apps/api-reference/specs/store/code_samples/Bash/auth_customer_{auth_provider}_callback/post.sh deleted file mode 100644 index 8d755aa683..0000000000 --- a/www/apps/api-reference/specs/store/code_samples/Bash/auth_customer_{auth_provider}_callback/post.sh +++ /dev/null @@ -1 +0,0 @@ -curl -X POST '{backend_url}/auth/customer/github/callback?code=123' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}/post.js new file mode 100644 index 0000000000..5127dd4706 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}/post.js @@ -0,0 +1,33 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +const result = await sdk.auth.login( + "customer", + "emailpass", + { + email: "customer@gmail.com", + password: "supersecret" + } +) + +if (typeof result !== "string") { + alert("Authentication requires additional steps") + // replace with the redirect logic of your application + window.location.href = result.location + return +} + +// customer is now authenticated +// all subsequent requests will use the token in the header +const { customer } = await sdk.store.customer.retrieve() \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_callback/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_callback/post.js new file mode 100644 index 0000000000..abf065875a --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_callback/post.js @@ -0,0 +1,28 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +await sdk.auth.callback( + "customer", + "google", + { + code: "123", + state: "456" + } +) + +// all subsequent requests will use the token in the header +const { customer } = await sdk.store.customer.create({ + email: "customer@gmail.com", + password: "supersecret" +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_register/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_register/post.js new file mode 100644 index 0000000000..2c221fdfde --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_register/post.js @@ -0,0 +1,28 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +await sdk.auth.register( + "customer", + "emailpass", + { + email: "customer@gmail.com", + password: "supersecret" + } +) + +// all subsequent requests will use the token in the header +const { customer } = await sdk.store.customer.create({ + email: "customer@gmail.com", + password: "supersecret" +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_reset-password/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_reset-password/post.js new file mode 100644 index 0000000000..ff5f68eb3a --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_reset-password/post.js @@ -0,0 +1,24 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.auth.resetPassword( + "customer", + "emailpass", + { + identifier: "customer@gmail.com" + } +) +.then(() => { + // user receives token +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_update/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_update/post.js new file mode 100644 index 0000000000..8d0b638408 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_customer_{auth_provider}_update/post.js @@ -0,0 +1,25 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.auth.updateProvider( + "customer", + "emailpass", + { + password: "supersecret" + }, + token +) +.then(() => { + // password updated +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_session/delete.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_session/delete.js new file mode 100644 index 0000000000..46fa961ab3 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_session/delete.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +await sdk.auth.logout() + +// customer is now logged out +// you can't send any requests that require authentication \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_token_refresh/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_token_refresh/post.js new file mode 100644 index 0000000000..c3bf18829e --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/auth_token_refresh/post.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +const token = await sdk.auth.refresh() + +// all subsequent requests will use the token in the header +const { customer } = await sdk.store.customer.retrieve() \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts/post.js new file mode 100644 index 0000000000..77f9ac714d --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.cart.create({ + region_id: "reg_123" +}) +.then(({ cart }) => { + console.log(cart) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}/get.js new file mode 100644 index 0000000000..9115b0b0e0 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.cart.retrieve("cart_123") +.then(({ cart }) => { + console.log(cart) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}/post.js new file mode 100644 index 0000000000..67c489b962 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.cart.update("cart_123", { + region_id: "reg_123" +}) +.then(({ cart }) => { + console.log(cart) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_complete/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_complete/post.js new file mode 100644 index 0000000000..f88582f26c --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_complete/post.js @@ -0,0 +1,24 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.cart.complete("cart_123") +.then((data) => { + if(data.type === "cart") { + // an error occurred + console.log(data.error, data.cart) + } else { + // order placed successfully + console.log(data.order) + } +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_customer/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_customer/post.js new file mode 100644 index 0000000000..015b9db41f --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_customer/post.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.cart.transferCart("cart_123") +.then(({ cart }) => { + console.log(cart) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items/post.js new file mode 100644 index 0000000000..a78389aa65 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items/post.js @@ -0,0 +1,21 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.cart.createLineItem("cart_123", { + variant_id: "variant_123", + quantity: 1 +}) +.then(({ cart }) => { + console.log(cart) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/delete.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/delete.js new file mode 100644 index 0000000000..ab86e45a69 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/delete.js @@ -0,0 +1,21 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.cart.deleteLineItem( + "cart_123", + "li_123" +) +.then(({ deleted, parent: cart }) => { + console.log(deleted, cart) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/post.js new file mode 100644 index 0000000000..4179cdbdd1 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/post.js @@ -0,0 +1,24 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.cart.updateLineItem( + "cart_123", + "li_123", + { + quantity: 1 + } +) +.then(({ cart }) => { + console.log(cart) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_shipping-methods/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_shipping-methods/post.js new file mode 100644 index 0000000000..1fb9c629d4 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_carts_{id}_shipping-methods/post.js @@ -0,0 +1,23 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.cart.addShippingMethod("cart_123", { + option_id: "so_123", + data: { + // custom data for fulfillment provider. + } +}) +.then(({ cart }) => { + console.log(cart) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_collections/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_collections/get.js new file mode 100644 index 0000000000..af8267c457 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_collections/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.collection.list() +.then(({ collections, count, limit, offset }) => { + console.log(collections) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_collections_{id}/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_collections_{id}/get.js new file mode 100644 index 0000000000..f2403dfb0c --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_collections_{id}/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.collection.retrieve("pcol_123") +.then(({ collection }) => { + console.log(collection) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers/post.js new file mode 100644 index 0000000000..65640e013a --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers/post.js @@ -0,0 +1,31 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +const token = await sdk.auth.register("customer", "emailpass", { + "email": "customer@gmail.com", + "password": "supersecret" +}) + +sdk.store.customer.create( + { + "email": "customer@gmail.com" + }, + {}, + { + Authorization: `Bearer ${token}` + } +) +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me/get.js new file mode 100644 index 0000000000..c12fe04ddf --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.customer.retrieve() +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me/post.js new file mode 100644 index 0000000000..4a3e589111 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.customer.update({ + first_name: "John" +}) +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses/get.js new file mode 100644 index 0000000000..afc6bc5403 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.customer.listAddress() +.then(({ addresses, count, offset, limit }) => { + console.log(addresses) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses/post.js new file mode 100644 index 0000000000..b6d407d6fa --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.customer.createAddress({ + country_code: "us" +}) +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/delete.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/delete.js new file mode 100644 index 0000000000..a6351f9d62 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/delete.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.customer.deleteAddress("caddr_123") +.then(({ deleted, parent: customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/get.js new file mode 100644 index 0000000000..d7a9f6ee8c --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/get.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.customer.retrieveAddress( + "caddr_123" +) +.then(({ address }) => { + console.log(address) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/post.js new file mode 100644 index 0000000000..a30dfcde4c --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_customers_me_addresses_{address_id}/post.js @@ -0,0 +1,23 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.customer.updateAddress( + "caddr_123", + { + country_code: "us" + } +) +.then(({ customer }) => { + console.log(customer) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders/get.js new file mode 100644 index 0000000000..e1b3170039 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.order.list() +.then(({ orders, count, offset, limit }) => { + console.log(orders) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}/get.js new file mode 100644 index 0000000000..639af2ff4f --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.order.retrieve("order_123") +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_accept/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_accept/post.js new file mode 100644 index 0000000000..3a9d2d23ff --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_accept/post.js @@ -0,0 +1,26 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.order.acceptTransfer( + "order_123", + { + token: "transfer_token" + }, + { + Authorization: `Bearer ${token}` + } +) +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_cancel/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_cancel/post.js new file mode 100644 index 0000000000..0a8007c63f --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_cancel/post.js @@ -0,0 +1,24 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.order.cancelTransfer( + "order_123", + {}, + { + Authorization: `Bearer ${token}` + } +) +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_decline/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_decline/post.js new file mode 100644 index 0000000000..9dd26c572c --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_decline/post.js @@ -0,0 +1,26 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.order.declineTransfer( + "order_123", + { + token: "transfer_token" + }, + { + Authorization: `Bearer ${token}` + } +) +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_request/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_request/post.js new file mode 100644 index 0000000000..7f6e608a9b --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_orders_{id}_transfer_request/post.js @@ -0,0 +1,27 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.order.requestTransfer( + "order_123", + { + description: "I want to transfer this order to my friend." + }, + {}, + { + Authorization: `Bearer ${token}` + } +) +.then(({ order }) => { + console.log(order) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_payment-collections/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_payment-collections/post.js new file mode 100644 index 0000000000..8285c82216 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_payment-collections/post.js @@ -0,0 +1,26 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.payment.initiatePaymentSession( + cart, // assuming you already have the cart object. + { + provider_id: "pp_stripe_stripe", + data: { + // any data relevant for the provider. + } + } +) +.then(({ payment_collection }) => { + console.log(payment_collection) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_payment-providers/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_payment-providers/get.js new file mode 100644 index 0000000000..f5a2ac135f --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_payment-providers/get.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.payment.listPaymentProviders({ + region_id: "reg_123" +}) +.then(({ payment_providers, count, offset, limit }) => { + console.log(payment_providers) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_product-categories/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_product-categories/get.js new file mode 100644 index 0000000000..9108347cfc --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_product-categories/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.category.list() +.then(({ product_categories, count, offset, limit }) => { + console.log(product_categories) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_product-categories_{id}/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_product-categories_{id}/get.js new file mode 100644 index 0000000000..6dad1a4045 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_product-categories_{id}/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.category.retrieve("pcat_123") +.then(({ product_category }) => { + console.log(product_category) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_products/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_products/get.js new file mode 100644 index 0000000000..f193933498 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_products/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.product.list() +.then(({ products, count, offset, limit }) => { + console.log(products) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_products_{id}/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_products_{id}/get.js new file mode 100644 index 0000000000..d38b193a38 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_products_{id}/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.product.retrieve("prod_123") +.then(({ product }) => { + console.log(product) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_regions/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_regions/get.js new file mode 100644 index 0000000000..5ae2d9cae6 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_regions/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.region.list() +.then(({ regions, count, limit, offset }) => { + console.log(regions) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_regions_{id}/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_regions_{id}/get.js new file mode 100644 index 0000000000..e122e10904 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_regions_{id}/get.js @@ -0,0 +1,18 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.region.retrieve("reg_123") +.then(({ region }) => { + console.log(region) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_shipping-options/get.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_shipping-options/get.js new file mode 100644 index 0000000000..7b313d2a59 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_shipping-options/get.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.fulfillment.listCartOptions({ + cart_id: "cart_123" +}) +.then(({ shipping_options }) => { + console.log(shipping_options) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_shipping-options_{id}_calculate/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_shipping-options_{id}_calculate/post.js new file mode 100644 index 0000000000..c8386e204b --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_shipping-options_{id}_calculate/post.js @@ -0,0 +1,20 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +sdk.store.fulfillment.calculate("so_123", { + cart_id: "cart_123" +}) +.then(({ shipping_option }) => { + console.log(shipping_option) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/auth_customer_{auth_provider}/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/auth_customer_{auth_provider}/post.sh deleted file mode 100644 index 5a9ff33995..0000000000 --- a/www/apps/api-reference/specs/store/code_samples/Shell/auth_customer_{auth_provider}/post.sh +++ /dev/null @@ -1,6 +0,0 @@ -curl -X POST '{backend_url}/auth/customer/emailpass' \ --H 'Content-Type: application/json' \ ---data-raw '{ - "email": "customer@gmail.com", - "password": "supersecret" -}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/auth_customer_{auth_provider}_callback/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/auth_customer_{auth_provider}_callback/post.sh deleted file mode 100644 index 7624546390..0000000000 --- a/www/apps/api-reference/specs/store/code_samples/Shell/auth_customer_{auth_provider}_callback/post.sh +++ /dev/null @@ -1 +0,0 @@ -curl -X POST '{backend_url}/auth/customer/google/callback?code=123' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/TypeScript/auth_customer_{auth_provider}_callback/post.ts b/www/apps/api-reference/specs/store/code_samples/TypeScript/auth_customer_{auth_provider}_callback/post.ts new file mode 100644 index 0000000000..e681887491 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/TypeScript/auth_customer_{auth_provider}_callback/post.ts @@ -0,0 +1,28 @@ +import Medusa from "@medusajs/js-sdk" + +let MEDUSA_BACKEND_URL = "http://localhost:9000" + +if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL +} + +export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, +}) + +await sdk.auth.callback( + "customer", + "github", + { + code: "123", + state: "456" + } +) + +// all subsequent requests will use the token in the header +const { customer } = await sdk.store.customer.create({ + email: "customer@gmail.com", + password: "supersecret" +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderItems.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderItems.yaml new file mode 100644 index 0000000000..fc172864f4 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderItems.yaml @@ -0,0 +1,44 @@ +type: object +description: The details of the items to add to a draft order. +x-schemaName: AdminAddDraftOrderItems +properties: + items: + type: array + description: The items to add to the draft order. + items: + type: object + description: The item's details + required: + - quantity + properties: + quantity: + type: number + title: quantity + description: The item's quantity. + variant_id: + type: string + title: variant_id + description: The ID of the variant to add to the draft order. + title: + type: string + title: title + description: The item's title. + unit_price: + type: number + title: unit_price + description: The item's unit price. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the item. + allow_backorder: + type: boolean + title: allow_backorder + description: Whether the item can be purchased if it's out of stock. + metadata: + type: object + description: The item's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderPromotions.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderPromotions.yaml new file mode 100644 index 0000000000..8b73ae81ca --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderPromotions.yaml @@ -0,0 +1,13 @@ +type: object +description: The details of the promotions to add to a draft order. +x-schemaName: AdminAddDraftOrderPromotions +required: + - promo_codes +properties: + promo_codes: + type: array + description: The list promotion codes to add to the draft order. + items: + type: string + title: promo_codes + description: A promotion's code. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderShippingMethod.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderShippingMethod.yaml new file mode 100644 index 0000000000..443413665e --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminAddDraftOrderShippingMethod.yaml @@ -0,0 +1,27 @@ +type: object +description: The details of the shipping method to add to a draft order. +x-schemaName: AdminAddDraftOrderShippingMethod +required: + - shipping_option_id +properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the shipping option that this method is created from. + custom_amount: + type: number + title: custom_amount + description: >- + A custom amount to be charged for this shipping method. If not provided, + the shipping option's amount will be used. + description: + type: string + title: description + description: The shipping method's description. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreateOrderCreditLines.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreateOrderCreditLines.yaml new file mode 100644 index 0000000000..a5d094df4d --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreateOrderCreditLines.yaml @@ -0,0 +1,26 @@ +type: object +description: The details of a credit line to add to an order. +x-schemaName: AdminCreateOrderCreditLines +required: + - amount + - reference + - reference_id +properties: + amount: + type: number + title: amount + description: The amount of the credit line. + example: 100 + reference: + type: string + title: reference + description: The name of the table that the credit line is referencing. + example: order + reference_id: + type: string + title: reference_id + description: The ID of a record in the table that the credit line is referencing. + example: order_123 + metadata: + type: object + description: The credit line's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminDraftOrder.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminDraftOrder.yaml index 0db0d9d34e..7b02e34a88 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminDraftOrder.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminDraftOrder.yaml @@ -247,3 +247,10 @@ properties: type: number title: original_shipping_tax_total description: The tax total of the draft order's shipping excluding promotions. + region: + $ref: ./AdminRegion.yaml + credit_lines: + type: array + description: The draft order's credit lines. + items: + $ref: ./OrderCreditLine.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminDraftOrderPreview.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminDraftOrderPreview.yaml new file mode 100644 index 0000000000..76ed108602 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminDraftOrderPreview.yaml @@ -0,0 +1,655 @@ +type: object +description: The draft order preview's details. +x-schemaName: AdminDraftOrderPreview +required: + - return_requested_total + - order_change + - status + - currency_code + - id + - version + - region_id + - customer_id + - sales_channel_id + - email + - payment_collections + - payment_status + - fulfillment_status + - summary + - created_at + - updated_at + - original_item_total + - original_item_subtotal + - original_item_tax_total + - item_total + - item_subtotal + - item_tax_total + - original_total + - original_subtotal + - original_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - gift_card_total + - gift_card_tax_total + - shipping_total + - shipping_subtotal + - shipping_tax_total + - original_shipping_total + - original_shipping_subtotal + - original_shipping_tax_total +properties: + return_requested_total: + type: number + title: return_requested_total + description: The total of the requested return. + order_change: + $ref: ./AdminOrderChange.yaml + items: + type: array + description: The order's items. + items: + allOf: + - type: object + description: An order's item. + x-schemaName: BaseOrderLineItem + required: + - id + - title + - subtitle + - thumbnail + - variant_id + - product_id + - product_title + - product_description + - product_subtitle + - product_type + - product_collection + - product_handle + - variant_sku + - variant_barcode + - variant_title + - variant_option_values + - requires_shipping + - is_discountable + - is_tax_inclusive + - unit_price + - quantity + - detail + - created_at + - updated_at + - metadata + - original_total + - original_subtotal + - original_tax_total + - item_total + - item_subtotal + - item_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - refundable_total + - refundable_total_per_unit + properties: + id: + type: string + title: id + description: The item's ID. + title: + type: string + title: title + description: The item's title. + subtitle: + type: string + title: subtitle + description: The item's subtitle. + thumbnail: + type: string + title: thumbnail + description: The URL of the item's thumbnail. + variant: + $ref: ./BaseProductVariant.yaml + variant_id: + type: string + title: variant_id + description: The ID of the associated variant. + product: + $ref: ./AdminProduct.yaml + product_id: + type: string + title: product_id + description: The ID of the associated product. + product_title: + type: string + title: product_title + description: The title of the item's product. + product_description: + type: string + title: product_description + description: The description of the item's product. + product_subtitle: + type: string + title: product_subtitle + description: The subtitle of the item's product. + product_type: + type: string + title: product_type + description: The ID of type of the item's product. + product_collection: + type: string + title: product_collection + description: The ID of collection of the item's product. + product_handle: + type: string + title: product_handle + description: The handle of the item's product. + variant_sku: + type: string + title: variant_sku + description: The SKU of the item's variant. + variant_barcode: + type: string + title: variant_barcode + description: The barcode of the item's variant. + variant_title: + type: string + title: variant_title + description: The title of the item's variant. + variant_option_values: + type: object + description: >- + The option values of the item's variant as key-value pairs. The + key is the title of an option, and the value is the option's + value. + requires_shipping: + type: boolean + title: requires_shipping + description: Whether the item requires shipping. + is_discountable: + type: boolean + title: is_discountable + description: Whether the item is discountable. + is_tax_inclusive: + type: boolean + title: is_tax_inclusive + description: Whether the item's price includes taxes. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + unit_price: + type: number + title: unit_price + description: The item's unit price. + quantity: + type: number + title: quantity + description: The item's quantity. + tax_lines: + type: array + description: The item's tax lines. + items: + $ref: ./BaseOrderLineItemTaxLine.yaml + adjustments: + type: array + description: The item's adjustments. + items: + $ref: ./BaseOrderLineItemAdjustment.yaml + detail: + $ref: ./BaseOrderItemDetail.yaml + created_at: + type: string + format: date-time + title: created_at + description: The date the item was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the item was updated. + metadata: + type: object + description: The item's metadata, can hold custom key-value pairs. + original_total: + type: number + title: original_total + description: The item's total including taxes, excluding promotions. + original_subtotal: + type: number + title: original_subtotal + description: The item's total excluding taxes, including promotions. + original_tax_total: + type: number + title: original_tax_total + description: The tax total of the item excluding promotions. + item_total: + type: number + title: item_total + description: >- + The item's total for a single unit including taxes and + promotions. + item_subtotal: + type: number + title: item_subtotal + description: >- + The item's total for a single unit excluding taxes, including + promotions. + item_tax_total: + type: number + title: item_tax_total + description: >- + The tax total for a single unit of the item including + promotions. + total: + type: number + title: total + description: The item's total including taxes and promotions. + subtotal: + type: number + title: subtotal + description: The item's total excluding taxes, including promotions. + tax_total: + type: number + title: tax_total + description: The tax total of the item including promotions. + discount_total: + type: number + title: discount_total + description: The total of the item's discount / promotion. + discount_tax_total: + type: number + title: discount_tax_total + description: The tax total of the item's discount / promotion + refundable_total: + type: number + title: refundable_total + description: The total refundable amount of the item's total. + refundable_total_per_unit: + type: number + title: refundable_total_per_unit + description: >- + The total refundable amount of the item's total for a single + unit. + - type: object + description: An order's item. + properties: + actions: + type: array + description: The actions applied on an item. + items: + type: object + description: The action's details. + x-schemaName: BaseOrderChangeAction + shipping_methods: + type: array + description: The order's shipping methods. + items: + allOf: + - type: object + description: The shipping method's details. + x-schemaName: BaseOrderShippingMethod + required: + - id + - order_id + - name + - amount + - is_tax_inclusive + - shipping_option_id + - data + - metadata + - original_total + - original_subtotal + - original_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - created_at + - updated_at + properties: + id: + type: string + title: id + description: The shipping method's ID. + order_id: + type: string + title: order_id + description: The ID of the order this shipping method belongs to. + name: + type: string + title: name + description: The shipping method's name. + description: + type: string + title: description + description: The shipping method's description. + amount: + type: number + title: amount + description: The shipping method's amount. + is_tax_inclusive: + type: boolean + title: is_tax_inclusive + description: Whether the shipping method's amount is tax inclusive. + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the shipping option this method was created from. + data: + type: object + description: >- + The data relevant for the fulfillment provider to process this + shipment. + externalDocs: + url: >- + https://docs.medusajs.com/v2/resources/commerce-modules/order/concepts#data-property + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. + tax_lines: + type: array + description: The shipping method's tax lines. + items: + $ref: ./BaseOrderShippingMethodTaxLine.yaml + adjustments: + type: array + description: The shipping method's adjustments. + items: + $ref: ./BaseOrderShippingMethodAdjustment.yaml + original_total: + oneOf: + - type: string + title: original_total + description: >- + The shipping method's total including taxes, excluding + promotions. + - type: number + title: original_total + description: >- + The shipping method's total including taxes, excluding + promotions. + original_subtotal: + oneOf: + - type: string + title: original_subtotal + description: >- + The shipping method's total excluding taxes, including + promotions. + - type: number + title: original_subtotal + description: >- + The shipping method's total excluding taxes, including + promotions. + original_tax_total: + oneOf: + - type: string + title: original_tax_total + description: The tax total of the shipping method excluding promotions. + - type: number + title: original_tax_total + description: The tax total of the shipping method excluding promotions. + total: + oneOf: + - type: string + title: total + description: The shipping method's total including taxes and promotions. + - type: number + title: total + description: The shipping method's total including taxes and promotions. + subtotal: + oneOf: + - type: string + title: subtotal + description: >- + The shipping method's total excluding taxes, including + promotions. + - type: number + title: subtotal + description: >- + The shipping method's total excluding taxes, including + promotions. + tax_total: + oneOf: + - type: string + title: tax_total + description: The tax total of the shipping method including promotions. + - type: number + title: tax_total + description: The tax total of the shipping method including promotions. + discount_total: + oneOf: + - type: string + title: discount_total + description: The total of the shipping method's promotion. + - type: number + title: discount_total + description: The total of the shipping method's promotion. + discount_tax_total: + oneOf: + - type: string + title: discount_tax_total + description: The tax total of the shipping method's promotion. + - type: number + title: discount_tax_total + description: The shipping method's discount tax total. + created_at: + type: string + format: date-time + title: created_at + description: The date the shipping method was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the shipping method was updated. + - type: object + description: The shipping method's details. + properties: + actions: + type: array + description: The actions applied on the shipping method. + items: + type: object + description: The action's details. + x-schemaName: BaseOrderChangeAction + currency_code: + type: string + title: currency_code + description: The order's currency code. + version: + type: number + title: version + description: The order's version when this preview is applied. + id: + type: string + title: id + description: The order's ID. + region_id: + type: string + title: region_id + description: The ID of the order's associated region. + customer_id: + type: string + title: customer_id + description: The ID of the customer that placed the order. + sales_channel_id: + type: string + title: sales_channel_id + description: The ID of the sales channel that the order was placed in. + email: + type: string + title: email + description: The email of the customer that placed the order. + format: email + display_id: + type: number + title: display_id + description: The order's display ID. + shipping_address: + $ref: ./AdminOrderAddress.yaml + billing_address: + $ref: ./AdminOrderAddress.yaml + payment_collections: + type: array + description: The order's payment collections. + items: + $ref: ./AdminPaymentCollection.yaml + payment_status: + type: string + description: The order's payment status. + enum: + - canceled + - not_paid + - awaiting + - authorized + - partially_authorized + - captured + - partially_captured + - partially_refunded + - refunded + - requires_action + fulfillments: + type: array + description: The order's fulfillments. + items: + $ref: ./AdminOrderFulfillment.yaml + fulfillment_status: + type: string + description: The order's fulfillment status. + enum: + - canceled + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_delivered + - delivered + transactions: + type: array + description: The order's transactions. + items: + $ref: ./BaseOrderTransaction.yaml + summary: + $ref: ./BaseOrderSummary.yaml + metadata: + type: object + description: The order's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the order was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the order was updated. + original_item_total: + type: number + title: original_item_total + description: The total of the order's items including taxes, excluding promotions. + original_item_subtotal: + type: number + title: original_item_subtotal + description: The total of the order's items excluding taxes, including promotions. + original_item_tax_total: + type: number + title: original_item_tax_total + description: The tax total of the order's items excluding promotions. + item_total: + type: number + title: item_total + description: The total of the order's items including taxes and promotions. + item_subtotal: + type: number + title: item_subtotal + description: The total of the order's items excluding taxes, including promotions. + item_tax_total: + type: number + title: item_tax_total + description: The tax total of the order's items including promotions. + original_total: + type: number + title: original_total + description: The order's total excluding promotions, including taxes. + original_subtotal: + type: number + title: original_subtotal + description: The order's total excluding taxes, including promotions. + original_tax_total: + type: number + title: original_tax_total + description: The order's tax total, excluding promotions. + total: + type: number + title: total + description: The order's total including taxes and promotions. + subtotal: + type: number + title: subtotal + description: The order's total excluding taxes, including promotions. + tax_total: + type: number + title: tax_total + description: The order's tax total including promotions. + discount_total: + type: number + title: discount_total + description: The order's discount or promotions total. + discount_tax_total: + type: number + title: discount_tax_total + description: The tax total of order's discount or promotion. + gift_card_total: + type: number + title: gift_card_total + description: The order's gift card total. + gift_card_tax_total: + type: number + title: gift_card_tax_total + description: The tax total of the order's gift card. + shipping_total: + type: number + title: shipping_total + description: The order's shipping total including taxes and promotions. + shipping_subtotal: + type: number + title: shipping_subtotal + description: The order's shipping total excluding taxes, including promotions. + shipping_tax_total: + type: number + title: shipping_tax_total + description: The tax total of the order's shipping. + original_shipping_total: + type: number + title: original_shipping_total + description: The order's shipping total including taxes, excluding promotions. + original_shipping_subtotal: + type: number + title: original_shipping_subtotal + description: The order's shipping total excluding taxes, including promotions. + original_shipping_tax_total: + type: number + title: original_shipping_tax_total + description: The tax total of the order's shipping excluding promotions. + customer: + $ref: ./AdminCustomer.yaml + sales_channel: + $ref: ./AdminSalesChannel.yaml + status: + type: string + title: status + description: The order's status. + region: + $ref: ./AdminRegion.yaml + credit_lines: + type: array + description: The order preview's credit lines. + items: + $ref: ./OrderCreditLine.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminDraftOrderPreviewResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminDraftOrderPreviewResponse.yaml new file mode 100644 index 0000000000..96792be348 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminDraftOrderPreviewResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The details of the preview on the draft order. +x-schemaName: AdminDraftOrderPreviewResponse +required: + - draft_order_preview +properties: + draft_order_preview: + $ref: ./AdminDraftOrderPreview.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminOrder.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminOrder.yaml index f09a9d120e..ff5651f98a 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminOrder.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminOrder.yaml @@ -240,3 +240,10 @@ properties: type: string title: status description: The order's status. + region: + $ref: ./AdminRegion.yaml + credit_lines: + type: array + description: The order's credit lines. + items: + $ref: ./OrderCreditLine.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminOrderPreview.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminOrderPreview.yaml index 7a9ae25344..be48d39907 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminOrderPreview.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminOrderPreview.yaml @@ -648,3 +648,10 @@ properties: type: string title: status description: The order's status. + region: + $ref: ./AdminRegion.yaml + credit_lines: + type: array + description: The order preview's credit lines. + items: + $ref: ./OrderCreditLine.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminPlugin.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminPlugin.yaml new file mode 100644 index 0000000000..e08f3e29dc --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminPlugin.yaml @@ -0,0 +1,10 @@ +type: object +description: The plugin's details. +x-schemaName: AdminPlugin +required: + - name +properties: + name: + type: string + title: name + description: The plugin's name. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminPluginsListResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminPluginsListResponse.yaml new file mode 100644 index 0000000000..6d08ef7b16 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminPluginsListResponse.yaml @@ -0,0 +1,11 @@ +type: object +description: The list of plugins. +x-schemaName: AdminPluginsListResponse +required: + - plugins +properties: + plugins: + type: array + description: The list of plugins. + items: + $ref: ./AdminPlugin.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminRemoveDraftOrderPromotions.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminRemoveDraftOrderPromotions.yaml new file mode 100644 index 0000000000..770f208bbc --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminRemoveDraftOrderPromotions.yaml @@ -0,0 +1,13 @@ +type: object +description: The promotion codes to remove from the draft order. +x-schemaName: AdminRemoveDraftOrderPromotions +required: + - promo_codes +properties: + promo_codes: + type: array + description: The promotion codes to remove from the draft order. + items: + type: string + title: promo_codes + description: A promotion code to remove from the draft order. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrder.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrder.yaml index e324201489..b8a6ad7759 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrder.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrder.yaml @@ -106,3 +106,11 @@ properties: metadata: type: object description: The draft order's metadata, can hold custom key-value pairs. + customer_id: + type: string + title: customer_id + description: The ID of the customer associated with the draft order. + sales_channel_id: + type: string + title: sales_channel_id + description: The ID of the sales channel associated with the draft order. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderActionShippingMethod.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderActionShippingMethod.yaml new file mode 100644 index 0000000000..8b2d7422db --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderActionShippingMethod.yaml @@ -0,0 +1,27 @@ +type: object +description: The updates to make on a changed shipping method. +x-schemaName: AdminUpdateDraftOrderActionShippingMethod +required: + - shipping_option_id +properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the associated shipping option. + custom_amount: + type: number + title: custom_amount + description: >- + The custom amount of the shipping method. If not provided, the shipping + option's amount will be used. + description: + type: string + title: description + description: The shipping method's description. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderItem.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderItem.yaml new file mode 100644 index 0000000000..230c4f6f57 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderItem.yaml @@ -0,0 +1,22 @@ +type: object +description: The updates to make on a draft order's item. +x-schemaName: AdminUpdateDraftOrderItem +required: + - quantity +properties: + quantity: + type: number + title: quantity + description: The item's quantity. + unit_price: + type: number + title: unit_price + description: The item's unit price. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the item. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderShippingMethod.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderShippingMethod.yaml new file mode 100644 index 0000000000..e1656ddc82 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdateDraftOrderShippingMethod.yaml @@ -0,0 +1,18 @@ +type: object +description: The updates to make on a draft order's shipping method. +x-schemaName: AdminUpdateDraftOrderShippingMethod +properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the associated shipping option. + custom_amount: + type: number + title: custom_amount + description: >- + The custom amount of the shipping method. If not provided, the shipping + option's amount will be used. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. diff --git a/www/apps/api-reference/specs/store/components/schemas/Order.yaml b/www/apps/api-reference/specs/store/components/schemas/Order.yaml index fbb4d9bc32..5be6266d54 100644 --- a/www/apps/api-reference/specs/store/components/schemas/Order.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/Order.yaml @@ -97,6 +97,82 @@ properties: summary: type: object description: The order's summary. + properties: + pending_difference: + type: number + title: pending_difference + description: The remaining amount to be paid or refunded. + current_order_total: + type: number + title: current_order_total + description: The order's current total. + original_order_total: + type: number + title: original_order_total + description: The order's total before any changes. + transaction_total: + type: number + title: transaction_total + description: >- + The total of the transactions (payments and refunds) made on the + order. + paid_total: + type: number + title: paid_total + description: The total paid amount. + refunded_total: + type: number + title: refunded_total + description: The total refunded amount. + credit_line_total: + type: number + title: credit_line_total + description: The total credit line amount. + accounting_total: + type: number + title: accounting_total + description: The total amount for accounting purposes. + raw_pending_difference: + type: object + description: The summary's raw pending difference. + raw_current_order_total: + type: object + description: The summary's raw current order total. + raw_original_order_total: + type: object + description: The summary's raw original order total. + raw_transaction_total: + type: object + description: The summary's raw transaction total. + raw_paid_total: + type: object + description: The summary's raw paid total. + raw_refunded_total: + type: object + description: The summary's raw refunded total. + raw_credit_line_total: + type: object + description: The summary's raw credit line total. + raw_accounting_total: + type: object + description: The summary's raw accounting total. + required: + - pending_difference + - current_order_total + - original_order_total + - transaction_total + - paid_total + - refunded_total + - credit_line_total + - accounting_total + - raw_pending_difference + - raw_current_order_total + - raw_original_order_total + - raw_transaction_total + - raw_paid_total + - raw_refunded_total + - raw_credit_line_total + - raw_accounting_total metadata: type: object description: The order's metadata, can hold custom key-value pairs. @@ -218,3 +294,7 @@ properties: order. items: $ref: ./OrderCreditLine.yaml + is_draft_order: + type: boolean + title: is_draft_order + description: Whether the order is a draft order. diff --git a/www/apps/api-reference/specs/store/components/schemas/OrderLineItem.yaml b/www/apps/api-reference/specs/store/components/schemas/OrderLineItem.yaml index 1c7d686760..1a0cf29b96 100644 --- a/www/apps/api-reference/specs/store/components/schemas/OrderLineItem.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/OrderLineItem.yaml @@ -6,6 +6,7 @@ required: - title - requires_shipping - is_discountable + - is_giftcard - is_tax_inclusive - unit_price - quantity @@ -198,3 +199,7 @@ properties: type: string title: product_type_id description: The ID of the associated product's type. + is_giftcard: + type: boolean + title: is_giftcard + description: Whether the item is a gift card. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreCartRemovePromotion.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreCartRemovePromotion.yaml new file mode 100644 index 0000000000..b49b78ff44 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreCartRemovePromotion.yaml @@ -0,0 +1,13 @@ +type: object +description: The promotion code to remove from the cart. +x-schemaName: StoreCartRemovePromotion +required: + - promo_codes +properties: + promo_codes: + type: array + description: The promotion code to remove from the cart. + items: + type: string + title: promo_codes + description: A promotion code to remove from the cart. diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index 635ac73534..38fb1a7c35 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -21,7 +21,7 @@ tags: These API routes allow customers to create and manage their cart, and place an order. externalDocs: description: How to implement cart functionality in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/cart + url: https://docs.medusajs.com/resources/storefront-development/cart x-associatedSchema: $ref: '#/components/schemas/StoreCart' - name: Collections @@ -31,7 +31,7 @@ tags: These API routes allow customers to browse collections and their products. externalDocs: description: How to list product collections in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/products/collections/list + url: https://docs.medusajs.com/resources/storefront-development/products/collections/list x-associatedSchema: $ref: '#/components/schemas/StoreCollection' - name: Currencies @@ -43,7 +43,7 @@ tags: These API routes allow customers to browse currencies. externalDocs: description: How to retrieve product variant prices in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/products/price + url: https://docs.medusajs.com/resources/storefront-development/products/price x-associatedSchema: $ref: '#/components/schemas/StoreCurrency' - name: Customers @@ -55,7 +55,7 @@ tags: These API routes allow customers to create and manage their accounts. externalDocs: description: How to implement customer account functionalities in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/customers + url: https://docs.medusajs.com/resources/storefront-development/customers x-associatedSchema: $ref: '#/components/schemas/StoreCustomer' - name: Orders @@ -72,7 +72,7 @@ tags: Use these API routes during checkout to set the cart's payment provider and authorize its payment session. externalDocs: description: How to implement payment during checkout. - url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/payment + url: https://docs.medusajs.com/resources/storefront-development/checkout/payment x-associatedSchema: $ref: '#/components/schemas/StorePaymentCollection' - name: Payment Providers @@ -84,7 +84,7 @@ tags: These API routes allow customers to view available payment providers in their region. externalDocs: description: How to implement payment during checkout. - url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/payment + url: https://docs.medusajs.com/resources/storefront-development/checkout/payment x-associatedSchema: $ref: '#/components/schemas/StorePaymentProvider' - name: Product Categories @@ -94,7 +94,7 @@ tags: These API routes allow customers to browse categories and their products. externalDocs: description: How to list product categories in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/products/categories/list + url: https://docs.medusajs.com/resources/storefront-development/products/categories/list x-associatedSchema: $ref: '#/components/schemas/StoreProductCategory' - name: Product Tags @@ -112,7 +112,7 @@ tags: These API routes allow customers to browse products. externalDocs: description: How to list products, get their prices, and more in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/products + url: https://docs.medusajs.com/resources/storefront-development/products x-associatedSchema: $ref: '#/components/schemas/StoreProduct' - name: Regions @@ -124,7 +124,7 @@ tags: Use these API routes to retrieve available regions in the store. externalDocs: description: How to retrieve and store selected region in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/regions + url: https://docs.medusajs.com/resources/storefront-development/regions x-associatedSchema: $ref: '#/components/schemas/StoreRegion' - name: Return @@ -150,7 +150,7 @@ tags: These API routes allow customers to retrieve available shipping options for their context. externalDocs: description: How to implement shipping during checkout. - url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping + url: https://docs.medusajs.com/resources/storefront-development/checkout/shipping x-associatedSchema: $ref: '#/components/schemas/StoreShippingOption' paths: @@ -185,15 +185,42 @@ paths: For example, for email-pass authentication, pass `email` and `password` properties. For the Google and GitHub authentication providers, you can pass `callback_url` to indicate the URL in the frontend that the customer should be redirected to after completing their authentication. This will override the provider's `callbackUrl` configurations in `medusa-config.ts`. x-codeSamples: - - lang: Shell - label: EmailPass Provider + - lang: JavaScript + label: JS SDK source: |- - curl -X POST '{backend_url}/auth/customer/emailpass' \ - -H 'Content-Type: application/json' \ - --data-raw '{ - "email": "customer@gmail.com", - "password": "supersecret" - }' + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + const result = await sdk.auth.login( + "customer", + "emailpass", + { + email: "customer@gmail.com", + password: "supersecret" + } + ) + + if (typeof result !== "string") { + alert("Authentication requires additional steps") + // replace with the redirect logic of your application + window.location.href = result.location + return + } + + // customer is now authenticated + // all subsequent requests will use the token in the header + const { customer } = await sdk.store.customer.retrieve() - lang: Bash label: Google Provider source: curl -X POST '{backend_url}/auth/customer/google' @@ -240,12 +267,68 @@ paths: type: string example: google x-codeSamples: - - lang: Shell + - lang: JavaScript label: Google Provider - source: curl -X POST '{backend_url}/auth/customer/google/callback?code=123' - - lang: Bash + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + await sdk.auth.callback( + "customer", + "google", + { + code: "123", + state: "456" + } + ) + + // all subsequent requests will use the token in the header + const { customer } = await sdk.store.customer.create({ + email: "customer@gmail.com", + password: "supersecret" + }) + - lang: TypeScript label: GitHub Provider - source: curl -X POST '{backend_url}/auth/customer/github/callback?code=123' + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + await sdk.auth.callback( + "customer", + "github", + { + code: "123", + state: "456" + } + ) + + // all subsequent requests will use the token in the header + const { customer } = await sdk.store.customer.create({ + email: "customer@gmail.com", + password: "supersecret" + }) tags: - Auth responses: @@ -295,6 +378,37 @@ paths: email: customer@gmail.com password: supersecret x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + await sdk.auth.register( + "customer", + "emailpass", + { + email: "customer@gmail.com", + password: "supersecret" + } + ) + + // all subsequent requests will use the token in the header + const { customer } = await sdk.store.customer.create({ + email: "customer@gmail.com", + password: "supersecret" + }) - lang: Shell label: cURL source: |- @@ -358,6 +472,33 @@ paths: description: The customer's identifier for the selected auth provider. For example, for the `emailpass` auth provider, the value is the customer's email. example: customer@gmail.com x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.auth.resetPassword( + "customer", + "emailpass", + { + identifier: "customer@gmail.com" + } + ) + .then(() => { + // user receives token + }) - lang: Shell label: cURL source: |- @@ -413,6 +554,34 @@ paths: email: customer@gmail.com password: supersecret x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.auth.updateProvider( + "customer", + "emailpass", + { + password: "supersecret" + }, + token + ) + .then(() => { + // password updated + }) - lang: Shell label: cURL source: |- @@ -496,6 +665,27 @@ paths: description: Deletes the cookie session ID previously set for authentication. x-authenticated: true x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + await sdk.auth.logout() + + // customer is now logged out + // you can't send any requests that require authentication - lang: Shell label: cURL source: |- @@ -540,6 +730,27 @@ paths: description: 'Storefront development: Implement third-party (social) login.' x-authenticated: true x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + const token = await sdk.auth.refresh() + + // all subsequent requests will use the token in the header + const { customer } = await sdk.store.customer.retrieve() - lang: Shell label: cURL source: |- @@ -605,6 +816,29 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The cart's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.cart.create({ + region_id: "reg_123" + }) + .then(({ cart }) => { + console.log(cart) + }) - lang: Shell label: cURL source: |- @@ -664,6 +898,27 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.cart.retrieve("cart_123") + .then(({ cart }) => { + console.log(cart) + }) - lang: Shell label: cURL source: |- @@ -734,6 +989,29 @@ paths: description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. description: The properties to update in the cart item. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.cart.update("cart_123", { + region_id: "reg_123" + }) + .then(({ cart }) => { + console.log(cart) + }) - lang: Shell label: cURL source: |- @@ -802,6 +1080,33 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.cart.complete("cart_123") + .then((data) => { + if(data.type === "cart") { + // an error occurred + console.log(data.error, data.cart) + } else { + // order placed successfully + console.log(data.order) + } + }) - lang: Shell label: cURL source: |- @@ -916,6 +1221,27 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.cart.transferCart("cart_123") + .then(({ cart }) => { + console.log(cart) + }) - lang: Shell label: cURL source: |- @@ -984,6 +1310,30 @@ paths: schema: $ref: '#/components/schemas/StoreAddCartLineItem' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.cart.createLineItem("cart_123", { + variant_id: "variant_123", + quantity: 1 + }) + .then(({ cart }) => { + console.log(cart) + }) - lang: Shell label: cURL source: |- @@ -1064,6 +1414,33 @@ paths: schema: $ref: '#/components/schemas/StoreUpdateCartLineItem' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.cart.updateLineItem( + "cart_123", + "li_123", + { + quantity: 1 + } + ) + .then(({ cart }) => { + console.log(cart) + }) - lang: Shell label: cURL source: |- @@ -1137,6 +1514,30 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.cart.deleteLineItem( + "cart_123", + "li_123" + ) + .then(({ deleted, parent: cart }) => { + console.log(deleted, cart) + }) - lang: Shell label: cURL source: |- @@ -1326,6 +1727,11 @@ paths: '500': $ref: '#/components/responses/500_error' x-workflow: updateCartPromotionsWorkflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartRemovePromotion' /store/carts/{id}/shipping-methods: post: operationId: PostCartsIdShippingMethods @@ -1381,6 +1787,32 @@ paths: url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping#data-request-body-parameter description: Learn more about the data parameter. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.cart.addShippingMethod("cart_123", { + option_id: "so_123", + data: { + // custom data for fulfillment provider. + } + }) + .then(({ cart }) => { + console.log(cart) + }) - lang: Shell label: cURL source: |- @@ -2047,6 +2479,27 @@ paths: type: object title: $or x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.collection.list() + .then(({ collections, count, limit, offset }) => { + console.log(collections) + }) - lang: Shell label: cURL source: |- @@ -2137,6 +2590,27 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.collection.retrieve("pcol_123") + .then(({ collection }) => { + console.log(collection) + }) - lang: Shell label: cURL source: |- @@ -2377,6 +2851,40 @@ paths: schema: $ref: '#/components/schemas/StoreCreateCustomer' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + const token = await sdk.auth.register("customer", "emailpass", { + "email": "customer@gmail.com", + "password": "supersecret" + }) + + sdk.store.customer.create( + { + "email": "customer@gmail.com" + }, + {}, + { + Authorization: `Bearer ${token}` + } + ) + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -2449,6 +2957,27 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.customer.retrieve() + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -2512,6 +3041,29 @@ paths: schema: $ref: '#/components/schemas/StoreUpdateCustomer' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.customer.update({ + first_name: "John" + }) + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -2661,6 +3213,27 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.customer.listAddress() + .then(({ addresses, count, offset, limit }) => { + console.log(addresses) + }) - lang: Shell label: cURL source: |- @@ -2782,6 +3355,29 @@ paths: type: object description: Holds custom key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.customer.createAddress({ + country_code: "us" + }) + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -2861,6 +3457,29 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.customer.retrieveAddress( + "caddr_123" + ) + .then(({ address }) => { + console.log(address) + }) - lang: Shell label: cURL source: |- @@ -2988,6 +3607,32 @@ paths: type: object description: Holds custom key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.customer.updateAddress( + "caddr_123", + { + country_code: "us" + } + ) + .then(({ customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -3058,6 +3703,27 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.customer.deleteAddress("caddr_123") + .then(({ deleted, parent: customer }) => { + console.log(customer) + }) - lang: Shell label: cURL source: |- @@ -3235,6 +3901,27 @@ paths: - draft - archived x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.order.list() + .then(({ orders, count, offset, limit }) => { + console.log(orders) + }) - lang: Shell label: cURL source: |- @@ -3326,6 +4013,27 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.order.retrieve("order_123") + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -3394,6 +4102,35 @@ paths: schema: $ref: '#/components/schemas/StoreAcceptOrderTransfer' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.order.acceptTransfer( + "order_123", + { + token: "transfer_token" + }, + { + Authorization: `Bearer ${token}` + } + ) + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -3461,6 +4198,33 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.order.cancelTransfer( + "order_123", + {}, + { + Authorization: `Bearer ${token}` + } + ) + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -3532,6 +4296,35 @@ paths: schema: $ref: '#/components/schemas/StoreDeclineOrderTransferRequest' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.order.declineTransfer( + "order_123", + { + token: "transfer_token" + }, + { + Authorization: `Bearer ${token}` + } + ) + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -3604,6 +4397,36 @@ paths: schema: $ref: '#/components/schemas/StoreRequestOrderTransfer' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.order.requestTransfer( + "order_123", + { + description: "I want to transfer this order to my friend." + }, + {}, + { + Authorization: `Bearer ${token}` + } + ) + .then(({ order }) => { + console.log(order) + }) - lang: Shell label: cURL source: |- @@ -3668,6 +4491,35 @@ paths: schema: $ref: '#/components/schemas/StoreCreatePaymentCollection' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.payment.initiatePaymentSession( + cart, // assuming you already have the cart object. + { + provider_id: "pp_stripe_stripe", + data: { + // any data relevant for the provider. + } + } + ) + .then(({ payment_collection }) => { + console.log(payment_collection) + }) - lang: Shell label: cURL source: |- @@ -3836,6 +4688,29 @@ paths: title: region_id description: Filter by a region ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.payment.listPaymentProviders({ + region_id: "reg_123" + }) + .then(({ payment_providers, count, offset, limit }) => { + console.log(payment_providers) + }) - lang: Shell label: cURL source: |- @@ -4522,6 +5397,27 @@ paths: title: name description: A product category name. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.category.list() + .then(({ product_categories, count, offset, limit }) => { + console.log(product_categories) + }) - lang: Shell label: cURL source: |- @@ -4599,6 +5495,27 @@ paths: title: include_descendants_tree description: Whether to retrieve a list of child categories. If you enable this, add to the `fields` query parameter `category_children` to set the children of a category in this field. You can either pass `*category_children` to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example, `fields=category_children.id,category_children.name`. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.category.retrieve("pcat_123") + .then(({ product_category }) => { + console.log(product_category) + }) - lang: Shell label: cURL source: |- @@ -6682,6 +7599,27 @@ paths: title: cart_id description: The product's cart id. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.product.list() + .then(({ products, count, offset, limit }) => { + console.log(products) + }) - lang: Shell label: cURL source: |- @@ -6837,6 +7775,27 @@ paths: externalDocs: url: '#pagination' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.product.retrieve("prod_123") + .then(({ product }) => { + console.log(product) + }) - lang: Shell label: cURL source: |- @@ -6990,6 +7949,27 @@ paths: type: object title: $or x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.region.list() + .then(({ regions, count, limit, offset }) => { + console.log(regions) + }) - lang: Shell label: cURL source: |- @@ -7077,6 +8057,27 @@ paths: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.region.retrieve("reg_123") + .then(({ region }) => { + console.log(region) + }) - lang: Shell label: cURL source: curl '{backend_url}/store/regions/{id}' @@ -7436,6 +8437,29 @@ paths: title: is_return description: Whether the shipping option can be used for returns. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.fulfillment.listCartOptions({ + cart_id: "cart_123" + }) + .then(({ shipping_options }) => { + console.log(shipping_options) + }) - lang: Shell label: cURL source: |- @@ -7516,6 +8540,29 @@ paths: externalDocs: url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + let MEDUSA_BACKEND_URL = "http://localhost:9000" + + if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + } + + export const sdk = new Medusa({ + baseUrl: MEDUSA_BACKEND_URL, + debug: process.env.NODE_ENV === "development", + publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + }) + + sdk.store.fulfillment.calculate("so_123", { + cart_id: "cart_123" + }) + .then(({ shipping_option }) => { + console.log(shipping_option) + }) - lang: Shell label: cURL source: |- @@ -7549,6 +8596,91 @@ paths: x-workflow: calculateShippingOptionsPricesWorkflow components: schemas: + AdminAddDraftOrderItems: + type: object + description: The details of the items to add to a draft order. + x-schemaName: AdminAddDraftOrderItems + properties: + items: + type: array + description: The items to add to the draft order. + items: + type: object + description: The item's details + required: + - quantity + properties: + quantity: + type: number + title: quantity + description: The item's quantity. + variant_id: + type: string + title: variant_id + description: The ID of the variant to add to the draft order. + title: + type: string + title: title + description: The item's title. + unit_price: + type: number + title: unit_price + description: The item's unit price. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the item. + allow_backorder: + type: boolean + title: allow_backorder + description: Whether the item can be purchased if it's out of stock. + metadata: + type: object + description: The item's metadata, can hold custom key-value pairs. + AdminAddDraftOrderPromotions: + type: object + description: The details of the promotions to add to a draft order. + x-schemaName: AdminAddDraftOrderPromotions + required: + - promo_codes + properties: + promo_codes: + type: array + description: The list promotion codes to add to the draft order. + items: + type: string + title: promo_codes + description: A promotion's code. + AdminAddDraftOrderShippingMethod: + type: object + description: The details of the shipping method to add to a draft order. + x-schemaName: AdminAddDraftOrderShippingMethod + required: + - shipping_option_id + properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the shipping option that this method is created from. + custom_amount: + type: number + title: custom_amount + description: A custom amount to be charged for this shipping method. If not provided, the shipping option's amount will be used. + description: + type: string + title: description + description: The shipping method's description. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. AdminApiKey: type: object description: The API key's details. @@ -8938,6 +10070,33 @@ components: metadata: type: object description: The inventory item's metadata, used to store custom key-value pairs. + AdminCreateOrderCreditLines: + type: object + description: The details of a credit line to add to an order. + x-schemaName: AdminCreateOrderCreditLines + required: + - amount + - reference + - reference_id + properties: + amount: + type: number + title: amount + description: The amount of the credit line. + example: 100 + reference: + type: string + title: reference + description: The name of the table that the credit line is referencing. + example: order + reference_id: + type: string + title: reference_id + description: The ID of a record in the table that the credit line is referencing. + example: order_123 + metadata: + type: object + description: The credit line's metadata, can hold custom key-value pairs. AdminCreatePriceList: type: object description: The price list's details. @@ -11141,6 +12300,13 @@ components: type: number title: original_shipping_tax_total description: The tax total of the draft order's shipping excluding promotions. + region: + $ref: '#/components/schemas/AdminRegion' + credit_lines: + type: array + description: The draft order's credit lines. + items: + $ref: '#/components/schemas/OrderCreditLine' AdminDraftOrderListResponse: type: object description: The list of draft orders with pagination fields. @@ -11168,6 +12334,645 @@ components: description: The list of draft orders. items: $ref: '#/components/schemas/AdminDraftOrder' + AdminDraftOrderPreview: + type: object + description: The draft order preview's details. + x-schemaName: AdminDraftOrderPreview + required: + - return_requested_total + - order_change + - status + - currency_code + - id + - version + - region_id + - customer_id + - sales_channel_id + - email + - payment_collections + - payment_status + - fulfillment_status + - summary + - created_at + - updated_at + - original_item_total + - original_item_subtotal + - original_item_tax_total + - item_total + - item_subtotal + - item_tax_total + - original_total + - original_subtotal + - original_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - gift_card_total + - gift_card_tax_total + - shipping_total + - shipping_subtotal + - shipping_tax_total + - original_shipping_total + - original_shipping_subtotal + - original_shipping_tax_total + properties: + return_requested_total: + type: number + title: return_requested_total + description: The total of the requested return. + order_change: + $ref: '#/components/schemas/AdminOrderChange' + items: + type: array + description: The order's items. + items: + allOf: + - type: object + description: An order's item. + x-schemaName: BaseOrderLineItem + required: + - id + - title + - subtitle + - thumbnail + - variant_id + - product_id + - product_title + - product_description + - product_subtitle + - product_type + - product_collection + - product_handle + - variant_sku + - variant_barcode + - variant_title + - variant_option_values + - requires_shipping + - is_discountable + - is_tax_inclusive + - unit_price + - quantity + - detail + - created_at + - updated_at + - metadata + - original_total + - original_subtotal + - original_tax_total + - item_total + - item_subtotal + - item_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - refundable_total + - refundable_total_per_unit + properties: + id: + type: string + title: id + description: The item's ID. + title: + type: string + title: title + description: The item's title. + subtitle: + type: string + title: subtitle + description: The item's subtitle. + thumbnail: + type: string + title: thumbnail + description: The URL of the item's thumbnail. + variant: + $ref: '#/components/schemas/BaseProductVariant' + variant_id: + type: string + title: variant_id + description: The ID of the associated variant. + product: + $ref: '#/components/schemas/AdminProduct' + product_id: + type: string + title: product_id + description: The ID of the associated product. + product_title: + type: string + title: product_title + description: The title of the item's product. + product_description: + type: string + title: product_description + description: The description of the item's product. + product_subtitle: + type: string + title: product_subtitle + description: The subtitle of the item's product. + product_type: + type: string + title: product_type + description: The ID of type of the item's product. + product_collection: + type: string + title: product_collection + description: The ID of collection of the item's product. + product_handle: + type: string + title: product_handle + description: The handle of the item's product. + variant_sku: + type: string + title: variant_sku + description: The SKU of the item's variant. + variant_barcode: + type: string + title: variant_barcode + description: The barcode of the item's variant. + variant_title: + type: string + title: variant_title + description: The title of the item's variant. + variant_option_values: + type: object + description: The option values of the item's variant as key-value pairs. The key is the title of an option, and the value is the option's value. + requires_shipping: + type: boolean + title: requires_shipping + description: Whether the item requires shipping. + is_discountable: + type: boolean + title: is_discountable + description: Whether the item is discountable. + is_tax_inclusive: + type: boolean + title: is_tax_inclusive + description: Whether the item's price includes taxes. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + unit_price: + type: number + title: unit_price + description: The item's unit price. + quantity: + type: number + title: quantity + description: The item's quantity. + tax_lines: + type: array + description: The item's tax lines. + items: + $ref: '#/components/schemas/BaseOrderLineItemTaxLine' + adjustments: + type: array + description: The item's adjustments. + items: + $ref: '#/components/schemas/BaseOrderLineItemAdjustment' + detail: + $ref: '#/components/schemas/BaseOrderItemDetail' + created_at: + type: string + format: date-time + title: created_at + description: The date the item was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the item was updated. + metadata: + type: object + description: The item's metadata, can hold custom key-value pairs. + original_total: + type: number + title: original_total + description: The item's total including taxes, excluding promotions. + original_subtotal: + type: number + title: original_subtotal + description: The item's total excluding taxes, including promotions. + original_tax_total: + type: number + title: original_tax_total + description: The tax total of the item excluding promotions. + item_total: + type: number + title: item_total + description: The item's total for a single unit including taxes and promotions. + item_subtotal: + type: number + title: item_subtotal + description: The item's total for a single unit excluding taxes, including promotions. + item_tax_total: + type: number + title: item_tax_total + description: The tax total for a single unit of the item including promotions. + total: + type: number + title: total + description: The item's total including taxes and promotions. + subtotal: + type: number + title: subtotal + description: The item's total excluding taxes, including promotions. + tax_total: + type: number + title: tax_total + description: The tax total of the item including promotions. + discount_total: + type: number + title: discount_total + description: The total of the item's discount / promotion. + discount_tax_total: + type: number + title: discount_tax_total + description: The tax total of the item's discount / promotion + refundable_total: + type: number + title: refundable_total + description: The total refundable amount of the item's total. + refundable_total_per_unit: + type: number + title: refundable_total_per_unit + description: The total refundable amount of the item's total for a single unit. + - type: object + description: An order's item. + properties: + actions: + type: array + description: The actions applied on an item. + items: + type: object + description: The action's details. + x-schemaName: BaseOrderChangeAction + shipping_methods: + type: array + description: The order's shipping methods. + items: + allOf: + - type: object + description: The shipping method's details. + x-schemaName: BaseOrderShippingMethod + required: + - id + - order_id + - name + - amount + - is_tax_inclusive + - shipping_option_id + - data + - metadata + - original_total + - original_subtotal + - original_tax_total + - total + - subtotal + - tax_total + - discount_total + - discount_tax_total + - created_at + - updated_at + properties: + id: + type: string + title: id + description: The shipping method's ID. + order_id: + type: string + title: order_id + description: The ID of the order this shipping method belongs to. + name: + type: string + title: name + description: The shipping method's name. + description: + type: string + title: description + description: The shipping method's description. + amount: + type: number + title: amount + description: The shipping method's amount. + is_tax_inclusive: + type: boolean + title: is_tax_inclusive + description: Whether the shipping method's amount is tax inclusive. + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the shipping option this method was created from. + data: + type: object + description: The data relevant for the fulfillment provider to process this shipment. + externalDocs: + url: https://docs.medusajs.com/v2/resources/commerce-modules/order/concepts#data-property + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. + tax_lines: + type: array + description: The shipping method's tax lines. + items: + $ref: '#/components/schemas/BaseOrderShippingMethodTaxLine' + adjustments: + type: array + description: The shipping method's adjustments. + items: + $ref: '#/components/schemas/BaseOrderShippingMethodAdjustment' + original_total: + oneOf: + - type: string + title: original_total + description: The shipping method's total including taxes, excluding promotions. + - type: number + title: original_total + description: The shipping method's total including taxes, excluding promotions. + original_subtotal: + oneOf: + - type: string + title: original_subtotal + description: The shipping method's total excluding taxes, including promotions. + - type: number + title: original_subtotal + description: The shipping method's total excluding taxes, including promotions. + original_tax_total: + oneOf: + - type: string + title: original_tax_total + description: The tax total of the shipping method excluding promotions. + - type: number + title: original_tax_total + description: The tax total of the shipping method excluding promotions. + total: + oneOf: + - type: string + title: total + description: The shipping method's total including taxes and promotions. + - type: number + title: total + description: The shipping method's total including taxes and promotions. + subtotal: + oneOf: + - type: string + title: subtotal + description: The shipping method's total excluding taxes, including promotions. + - type: number + title: subtotal + description: The shipping method's total excluding taxes, including promotions. + tax_total: + oneOf: + - type: string + title: tax_total + description: The tax total of the shipping method including promotions. + - type: number + title: tax_total + description: The tax total of the shipping method including promotions. + discount_total: + oneOf: + - type: string + title: discount_total + description: The total of the shipping method's promotion. + - type: number + title: discount_total + description: The total of the shipping method's promotion. + discount_tax_total: + oneOf: + - type: string + title: discount_tax_total + description: The tax total of the shipping method's promotion. + - type: number + title: discount_tax_total + description: The shipping method's discount tax total. + created_at: + type: string + format: date-time + title: created_at + description: The date the shipping method was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the shipping method was updated. + - type: object + description: The shipping method's details. + properties: + actions: + type: array + description: The actions applied on the shipping method. + items: + type: object + description: The action's details. + x-schemaName: BaseOrderChangeAction + currency_code: + type: string + title: currency_code + description: The order's currency code. + version: + type: number + title: version + description: The order's version when this preview is applied. + id: + type: string + title: id + description: The order's ID. + region_id: + type: string + title: region_id + description: The ID of the order's associated region. + customer_id: + type: string + title: customer_id + description: The ID of the customer that placed the order. + sales_channel_id: + type: string + title: sales_channel_id + description: The ID of the sales channel that the order was placed in. + email: + type: string + title: email + description: The email of the customer that placed the order. + format: email + display_id: + type: number + title: display_id + description: The order's display ID. + shipping_address: + $ref: '#/components/schemas/AdminOrderAddress' + billing_address: + $ref: '#/components/schemas/AdminOrderAddress' + payment_collections: + type: array + description: The order's payment collections. + items: + $ref: '#/components/schemas/AdminPaymentCollection' + payment_status: + type: string + description: The order's payment status. + enum: + - canceled + - not_paid + - awaiting + - authorized + - partially_authorized + - captured + - partially_captured + - partially_refunded + - refunded + - requires_action + fulfillments: + type: array + description: The order's fulfillments. + items: + $ref: '#/components/schemas/AdminOrderFulfillment' + fulfillment_status: + type: string + description: The order's fulfillment status. + enum: + - canceled + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_delivered + - delivered + transactions: + type: array + description: The order's transactions. + items: + $ref: '#/components/schemas/BaseOrderTransaction' + summary: + $ref: '#/components/schemas/BaseOrderSummary' + metadata: + type: object + description: The order's metadata, can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the order was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the order was updated. + original_item_total: + type: number + title: original_item_total + description: The total of the order's items including taxes, excluding promotions. + original_item_subtotal: + type: number + title: original_item_subtotal + description: The total of the order's items excluding taxes, including promotions. + original_item_tax_total: + type: number + title: original_item_tax_total + description: The tax total of the order's items excluding promotions. + item_total: + type: number + title: item_total + description: The total of the order's items including taxes and promotions. + item_subtotal: + type: number + title: item_subtotal + description: The total of the order's items excluding taxes, including promotions. + item_tax_total: + type: number + title: item_tax_total + description: The tax total of the order's items including promotions. + original_total: + type: number + title: original_total + description: The order's total excluding promotions, including taxes. + original_subtotal: + type: number + title: original_subtotal + description: The order's total excluding taxes, including promotions. + original_tax_total: + type: number + title: original_tax_total + description: The order's tax total, excluding promotions. + total: + type: number + title: total + description: The order's total including taxes and promotions. + subtotal: + type: number + title: subtotal + description: The order's total excluding taxes, including promotions. + tax_total: + type: number + title: tax_total + description: The order's tax total including promotions. + discount_total: + type: number + title: discount_total + description: The order's discount or promotions total. + discount_tax_total: + type: number + title: discount_tax_total + description: The tax total of order's discount or promotion. + gift_card_total: + type: number + title: gift_card_total + description: The order's gift card total. + gift_card_tax_total: + type: number + title: gift_card_tax_total + description: The tax total of the order's gift card. + shipping_total: + type: number + title: shipping_total + description: The order's shipping total including taxes and promotions. + shipping_subtotal: + type: number + title: shipping_subtotal + description: The order's shipping total excluding taxes, including promotions. + shipping_tax_total: + type: number + title: shipping_tax_total + description: The tax total of the order's shipping. + original_shipping_total: + type: number + title: original_shipping_total + description: The order's shipping total including taxes, excluding promotions. + original_shipping_subtotal: + type: number + title: original_shipping_subtotal + description: The order's shipping total excluding taxes, including promotions. + original_shipping_tax_total: + type: number + title: original_shipping_tax_total + description: The tax total of the order's shipping excluding promotions. + customer: + $ref: '#/components/schemas/AdminCustomer' + sales_channel: + $ref: '#/components/schemas/AdminSalesChannel' + status: + type: string + title: status + description: The order's status. + region: + $ref: '#/components/schemas/AdminRegion' + credit_lines: + type: array + description: The order preview's credit lines. + items: + $ref: '#/components/schemas/OrderCreditLine' + AdminDraftOrderPreviewResponse: + type: object + description: The details of the preview on the draft order. + x-schemaName: AdminDraftOrderPreviewResponse + required: + - draft_order_preview + properties: + draft_order_preview: + $ref: '#/components/schemas/AdminDraftOrderPreview' AdminDraftOrderResponse: type: object description: The draft order's details. @@ -12532,6 +14337,13 @@ components: type: string title: status description: The order's status. + region: + $ref: '#/components/schemas/AdminRegion' + credit_lines: + type: array + description: The order's credit lines. + items: + $ref: '#/components/schemas/OrderCreditLine' AdminOrderAddress: type: object description: An order address. @@ -13839,6 +15651,13 @@ components: type: string title: status description: The order's status. + region: + $ref: '#/components/schemas/AdminRegion' + credit_lines: + type: array + description: The order preview's credit lines. + items: + $ref: '#/components/schemas/OrderCreditLine' AdminOrderPreviewResponse: type: object description: The preview of an order. @@ -14230,6 +16049,29 @@ components: - provider_id - data - status + AdminPlugin: + type: object + description: The plugin's details. + x-schemaName: AdminPlugin + required: + - name + properties: + name: + type: string + title: name + description: The plugin's name. + AdminPluginsListResponse: + type: object + description: The list of plugins. + x-schemaName: AdminPluginsListResponse + required: + - plugins + properties: + plugins: + type: array + description: The list of plugins. + items: + $ref: '#/components/schemas/AdminPlugin' AdminPostCancelClaimReqSchema: type: object description: The details of canceling a claim. @@ -16710,6 +18552,20 @@ components: properties: region: $ref: '#/components/schemas/AdminRegion' + AdminRemoveDraftOrderPromotions: + type: object + description: The promotion codes to remove from the draft order. + x-schemaName: AdminRemoveDraftOrderPromotions + required: + - promo_codes + properties: + promo_codes: + type: array + description: The promotion codes to remove from the draft order. + items: + type: string + title: promo_codes + description: A promotion code to remove from the draft order. AdminReservation: type: object description: The reservation's details. @@ -18379,6 +20235,80 @@ components: metadata: type: object description: The draft order's metadata, can hold custom key-value pairs. + customer_id: + type: string + title: customer_id + description: The ID of the customer associated with the draft order. + sales_channel_id: + type: string + title: sales_channel_id + description: The ID of the sales channel associated with the draft order. + AdminUpdateDraftOrderActionShippingMethod: + type: object + description: The updates to make on a changed shipping method. + x-schemaName: AdminUpdateDraftOrderActionShippingMethod + required: + - shipping_option_id + properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the associated shipping option. + custom_amount: + type: number + title: custom_amount + description: The custom amount of the shipping method. If not provided, the shipping option's amount will be used. + description: + type: string + title: description + description: The shipping method's description. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. + metadata: + type: object + description: The shipping method's metadata, can hold custom key-value pairs. + AdminUpdateDraftOrderItem: + type: object + description: The updates to make on a draft order's item. + x-schemaName: AdminUpdateDraftOrderItem + required: + - quantity + properties: + quantity: + type: number + title: quantity + description: The item's quantity. + unit_price: + type: number + title: unit_price + description: The item's unit price. + compare_at_unit_price: + type: number + title: compare_at_unit_price + description: The original price of the item before a promotion or sale. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the item. + AdminUpdateDraftOrderShippingMethod: + type: object + description: The updates to make on a draft order's shipping method. + x-schemaName: AdminUpdateDraftOrderShippingMethod + properties: + shipping_option_id: + type: string + title: shipping_option_id + description: The ID of the associated shipping option. + custom_amount: + type: number + title: custom_amount + description: The custom amount of the shipping method. If not provided, the shipping option's amount will be used. + internal_note: + type: string + title: internal_note + description: A note viewed only by admin users about the shipping method. AdminUpdateOrder: type: object description: The details to update in the order. @@ -23393,6 +25323,80 @@ components: summary: type: object description: The order's summary. + properties: + pending_difference: + type: number + title: pending_difference + description: The remaining amount to be paid or refunded. + current_order_total: + type: number + title: current_order_total + description: The order's current total. + original_order_total: + type: number + title: original_order_total + description: The order's total before any changes. + transaction_total: + type: number + title: transaction_total + description: The total of the transactions (payments and refunds) made on the order. + paid_total: + type: number + title: paid_total + description: The total paid amount. + refunded_total: + type: number + title: refunded_total + description: The total refunded amount. + credit_line_total: + type: number + title: credit_line_total + description: The total credit line amount. + accounting_total: + type: number + title: accounting_total + description: The total amount for accounting purposes. + raw_pending_difference: + type: object + description: The summary's raw pending difference. + raw_current_order_total: + type: object + description: The summary's raw current order total. + raw_original_order_total: + type: object + description: The summary's raw original order total. + raw_transaction_total: + type: object + description: The summary's raw transaction total. + raw_paid_total: + type: object + description: The summary's raw paid total. + raw_refunded_total: + type: object + description: The summary's raw refunded total. + raw_credit_line_total: + type: object + description: The summary's raw credit line total. + raw_accounting_total: + type: object + description: The summary's raw accounting total. + required: + - pending_difference + - current_order_total + - original_order_total + - transaction_total + - paid_total + - refunded_total + - credit_line_total + - accounting_total + - raw_pending_difference + - raw_current_order_total + - raw_original_order_total + - raw_transaction_total + - raw_paid_total + - raw_refunded_total + - raw_credit_line_total + - raw_accounting_total metadata: type: object description: The order's metadata, can hold custom key-value pairs. @@ -23512,6 +25516,10 @@ components: description: The order's credit lines, useful to add additional payment amounts for an order. items: $ref: '#/components/schemas/OrderCreditLine' + is_draft_order: + type: boolean + title: is_draft_order + description: Whether the order is a draft order. OrderAddress: type: object description: The address's details. @@ -24177,6 +26185,7 @@ components: - title - requires_shipping - is_discountable + - is_giftcard - is_tax_inclusive - unit_price - quantity @@ -24367,6 +26376,10 @@ components: type: string title: product_type_id description: The ID of the associated product's type. + is_giftcard: + type: boolean + title: is_giftcard + description: Whether the item is a gift card. OrderLineItemAdjustment: type: object description: The line item adjustment's details. @@ -25805,6 +27818,20 @@ components: type: string title: currency_code description: The application method's currency code. + StoreCartRemovePromotion: + type: object + description: The promotion code to remove from the cart. + x-schemaName: StoreCartRemovePromotion + required: + - promo_codes + properties: + promo_codes: + type: array + description: The promotion code to remove from the cart. + items: + type: string + title: promo_codes + description: A promotion code to remove from the cart. StoreCartResponse: type: object description: The cart's details. diff --git a/www/apps/api-reference/specs/store/openapi.yaml b/www/apps/api-reference/specs/store/openapi.yaml index 6f59271631..c85da21706 100644 --- a/www/apps/api-reference/specs/store/openapi.yaml +++ b/www/apps/api-reference/specs/store/openapi.yaml @@ -25,7 +25,7 @@ tags: place an order. externalDocs: description: How to implement cart functionality in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/cart + url: https://docs.medusajs.com/resources/storefront-development/cart x-associatedSchema: $ref: ./components/schemas/StoreCart.yaml - name: Collections @@ -38,7 +38,7 @@ tags: externalDocs: description: How to list product collections in a storefront. url: >- - https://docs.medusajs.com/v2/resources/storefront-development/products/collections/list + https://docs.medusajs.com/resources/storefront-development/products/collections/list x-associatedSchema: $ref: ./components/schemas/StoreCollection.yaml - name: Currencies @@ -55,7 +55,7 @@ tags: externalDocs: description: How to retrieve product variant prices in a storefront. url: >- - https://docs.medusajs.com/v2/resources/storefront-development/products/price + https://docs.medusajs.com/resources/storefront-development/products/price x-associatedSchema: $ref: ./components/schemas/StoreCurrency.yaml - name: Customers @@ -70,7 +70,7 @@ tags: These API routes allow customers to create and manage their accounts. externalDocs: description: How to implement customer account functionalities in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/customers + url: https://docs.medusajs.com/resources/storefront-development/customers x-associatedSchema: $ref: ./components/schemas/StoreCustomer.yaml - name: Orders @@ -90,7 +90,7 @@ tags: externalDocs: description: How to implement payment during checkout. url: >- - https://docs.medusajs.com/v2/resources/storefront-development/checkout/payment + https://docs.medusajs.com/resources/storefront-development/checkout/payment x-associatedSchema: $ref: ./components/schemas/StorePaymentCollection.yaml - name: Payment Providers @@ -108,7 +108,7 @@ tags: externalDocs: description: How to implement payment during checkout. url: >- - https://docs.medusajs.com/v2/resources/storefront-development/checkout/payment + https://docs.medusajs.com/resources/storefront-development/checkout/payment x-associatedSchema: $ref: ./components/schemas/StorePaymentProvider.yaml - name: Product Categories @@ -119,7 +119,7 @@ tags: externalDocs: description: How to list product categories in a storefront. url: >- - https://docs.medusajs.com/v2/resources/storefront-development/products/categories/list + https://docs.medusajs.com/resources/storefront-development/products/categories/list x-associatedSchema: $ref: ./components/schemas/StoreProductCategory.yaml - name: Product Tags @@ -140,7 +140,7 @@ tags: These API routes allow customers to browse products. externalDocs: description: How to list products, get their prices, and more in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/products + url: https://docs.medusajs.com/resources/storefront-development/products x-associatedSchema: $ref: ./components/schemas/StoreProduct.yaml - name: Regions @@ -156,7 +156,7 @@ tags: Use these API routes to retrieve available regions in the store. externalDocs: description: How to retrieve and store selected region in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/regions + url: https://docs.medusajs.com/resources/storefront-development/regions x-associatedSchema: $ref: ./components/schemas/StoreRegion.yaml - name: Return @@ -191,7 +191,7 @@ tags: externalDocs: description: How to implement shipping during checkout. url: >- - https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping + https://docs.medusajs.com/resources/storefront-development/checkout/shipping x-associatedSchema: $ref: ./components/schemas/StoreShippingOption.yaml paths: diff --git a/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}.yaml b/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}.yaml index 06b65f7e63..ded360ddb4 100644 --- a/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}.yaml +++ b/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}.yaml @@ -40,10 +40,10 @@ post: will override the provider's `callbackUrl` configurations in `medusa-config.ts`. x-codeSamples: - - lang: Shell - label: EmailPass Provider + - lang: JavaScript + label: JS SDK source: - $ref: ../code_samples/Shell/auth_customer_{auth_provider}/post.sh + $ref: ../code_samples/JavaScript/auth_customer_{auth_provider}/post.js - lang: Bash label: Google Provider source: diff --git a/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_callback.yaml b/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_callback.yaml index fd375ec3b2..074fe0b48b 100644 --- a/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_callback.yaml +++ b/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_callback.yaml @@ -28,14 +28,16 @@ post: type: string example: google x-codeSamples: - - lang: Shell + - lang: JavaScript label: Google Provider source: - $ref: ../code_samples/Shell/auth_customer_{auth_provider}_callback/post.sh - - lang: Bash + $ref: >- + ../code_samples/JavaScript/auth_customer_{auth_provider}_callback/post.js + - lang: TypeScript label: GitHub Provider source: - $ref: ../code_samples/Bash/auth_customer_{auth_provider}_callback/post.sh + $ref: >- + ../code_samples/TypeScript/auth_customer_{auth_provider}_callback/post.ts tags: - Auth responses: diff --git a/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_register.yaml b/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_register.yaml index b5295a1457..fe5ac1669c 100644 --- a/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_register.yaml +++ b/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_register.yaml @@ -30,6 +30,11 @@ post: email: customer@gmail.com password: supersecret x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/auth_customer_{auth_provider}_register/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_reset-password.yaml b/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_reset-password.yaml index 76e0e5a44a..323bdbeca0 100644 --- a/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_reset-password.yaml +++ b/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_reset-password.yaml @@ -44,6 +44,11 @@ post: customer's email. example: customer@gmail.com x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/auth_customer_{auth_provider}_reset-password/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_update.yaml b/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_update.yaml index f6d4de22e6..87812ec0bb 100644 --- a/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_update.yaml +++ b/www/apps/api-reference/specs/store/paths/auth_customer_{auth_provider}_update.yaml @@ -34,6 +34,11 @@ post: email: customer@gmail.com password: supersecret x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/auth_customer_{auth_provider}_update/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/auth_session.yaml b/www/apps/api-reference/specs/store/paths/auth_session.yaml index 0962c7f061..8fe99e2c4f 100644 --- a/www/apps/api-reference/specs/store/paths/auth_session.yaml +++ b/www/apps/api-reference/specs/store/paths/auth_session.yaml @@ -42,6 +42,10 @@ delete: description: Deletes the cookie session ID previously set for authentication. x-authenticated: true x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/auth_session/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/auth_token_refresh.yaml b/www/apps/api-reference/specs/store/paths/auth_token_refresh.yaml index efa20af735..141a0be55f 100644 --- a/www/apps/api-reference/specs/store/paths/auth_token_refresh.yaml +++ b/www/apps/api-reference/specs/store/paths/auth_token_refresh.yaml @@ -12,6 +12,10 @@ post: description: 'Storefront development: Implement third-party (social) login.' x-authenticated: true x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/auth_token_refresh/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_carts.yaml b/www/apps/api-reference/specs/store/paths/store_carts.yaml index 2abc350063..12d9d1dc8e 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts.yaml @@ -47,6 +47,10 @@ post: `additional_data` parameter. description: The cart's details. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_carts/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}.yaml index d4561870d3..105c8a2403 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}.yaml @@ -39,6 +39,10 @@ get: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_carts_{id}/get.js - lang: Shell label: cURL source: @@ -125,6 +129,10 @@ post: `additional_data` parameter. description: The properties to update in the cart item. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_carts_{id}/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_complete.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_complete.yaml index 3c4759c94d..a66ea71ab9 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_complete.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_complete.yaml @@ -41,6 +41,10 @@ post: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_carts_{id}_complete/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml index ad6eea5123..289ec6ad87 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml @@ -46,6 +46,10 @@ post: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_carts_{id}_customer/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items.yaml index be9239f653..5a8698812d 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items.yaml @@ -47,6 +47,10 @@ post: schema: $ref: ../components/schemas/StoreAddCartLineItem.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_carts_{id}_line-items/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items_{line_id}.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items_{line_id}.yaml index 67549c2e46..abf4851c91 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items_{line_id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_line-items_{line_id}.yaml @@ -53,6 +53,11 @@ post: schema: $ref: ../components/schemas/StoreUpdateCartLineItem.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/post.js - lang: Shell label: cURL source: @@ -129,6 +134,11 @@ delete: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml index 6c49306c91..119fe5a1cb 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml @@ -140,3 +140,8 @@ delete: '500': $ref: ../components/responses/500_error.yaml x-workflow: updateCartPromotionsWorkflow + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/StoreCartRemovePromotion.yaml diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_shipping-methods.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_shipping-methods.yaml index 8440d54a98..85d3b5e5f2 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_shipping-methods.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_shipping-methods.yaml @@ -66,6 +66,10 @@ post: https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping#data-request-body-parameter description: Learn more about the data parameter. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_carts_{id}_shipping-methods/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_collections.yaml b/www/apps/api-reference/specs/store/paths/store_collections.yaml index c74c40f5eb..51b2ede8b7 100644 --- a/www/apps/api-reference/specs/store/paths/store_collections.yaml +++ b/www/apps/api-reference/specs/store/paths/store_collections.yaml @@ -672,6 +672,10 @@ get: type: object title: $or x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_collections/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_collections_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_collections_{id}.yaml index b2cd92c22a..f17491220b 100644 --- a/www/apps/api-reference/specs/store/paths/store_collections_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_collections_{id}.yaml @@ -43,6 +43,10 @@ get: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_collections_{id}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_customers.yaml b/www/apps/api-reference/specs/store/paths/store_customers.yaml index c3b0ff17da..2740dcee1c 100644 --- a/www/apps/api-reference/specs/store/paths/store_customers.yaml +++ b/www/apps/api-reference/specs/store/paths/store_customers.yaml @@ -43,6 +43,10 @@ post: schema: $ref: ../components/schemas/StoreCreateCustomer.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_customers/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_customers_me.yaml b/www/apps/api-reference/specs/store/paths/store_customers_me.yaml index d44278bfd1..7c9689fc97 100644 --- a/www/apps/api-reference/specs/store/paths/store_customers_me.yaml +++ b/www/apps/api-reference/specs/store/paths/store_customers_me.yaml @@ -41,6 +41,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_customers_me/get.js - lang: Shell label: cURL source: @@ -111,6 +115,10 @@ post: schema: $ref: ../components/schemas/StoreUpdateCustomer.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_customers_me/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_customers_me_addresses.yaml b/www/apps/api-reference/specs/store/paths/store_customers_me_addresses.yaml index 8440a7fc2d..821d058df9 100644 --- a/www/apps/api-reference/specs/store/paths/store_customers_me_addresses.yaml +++ b/www/apps/api-reference/specs/store/paths/store_customers_me_addresses.yaml @@ -128,6 +128,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_customers_me_addresses/get.js - lang: Shell label: cURL source: @@ -260,6 +264,10 @@ post: type: object description: Holds custom key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_customers_me_addresses/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_customers_me_addresses_{address_id}.yaml b/www/apps/api-reference/specs/store/paths/store_customers_me_addresses_{address_id}.yaml index 38289fba90..4ce71a0912 100644 --- a/www/apps/api-reference/specs/store/paths/store_customers_me_addresses_{address_id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_customers_me_addresses_{address_id}.yaml @@ -43,6 +43,11 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/store_customers_me_addresses_{address_id}/get.js - lang: Shell label: cURL source: @@ -181,6 +186,11 @@ post: type: object description: Holds custom key-value pairs. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/store_customers_me_addresses_{address_id}/post.js - lang: Shell label: cURL source: @@ -255,6 +265,11 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/store_customers_me_addresses_{address_id}/delete.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_orders.yaml b/www/apps/api-reference/specs/store/paths/store_orders.yaml index e555db9f7c..fbab819c9a 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders.yaml @@ -134,6 +134,10 @@ get: - draft - archived x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_orders/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}.yaml index fe93686fa0..212b812f49 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}.yaml @@ -39,6 +39,10 @@ get: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_orders_{id}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml index 7dc8f69a75..899084e429 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml @@ -52,6 +52,10 @@ post: schema: $ref: ../components/schemas/StoreAcceptOrderTransfer.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_orders_{id}_transfer_accept/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml index 6b524974c5..0291d4db0f 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml @@ -44,6 +44,10 @@ post: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_orders_{id}_transfer_cancel/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml index 32aa23de61..599e5e4e6b 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml @@ -48,6 +48,10 @@ post: schema: $ref: ../components/schemas/StoreDeclineOrderTransferRequest.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_orders_{id}_transfer_decline/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml index eada17f257..a1e0ec0f66 100644 --- a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml @@ -49,6 +49,10 @@ post: schema: $ref: ../components/schemas/StoreRequestOrderTransfer.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_orders_{id}_transfer_request/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_payment-collections.yaml b/www/apps/api-reference/specs/store/paths/store_payment-collections.yaml index a565762fde..092b1cb438 100644 --- a/www/apps/api-reference/specs/store/paths/store_payment-collections.yaml +++ b/www/apps/api-reference/specs/store/paths/store_payment-collections.yaml @@ -42,6 +42,10 @@ post: schema: $ref: ../components/schemas/StoreCreatePaymentCollection.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_payment-collections/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_payment-providers.yaml b/www/apps/api-reference/specs/store/paths/store_payment-providers.yaml index 9556fb2f62..86016ded76 100644 --- a/www/apps/api-reference/specs/store/paths/store_payment-providers.yaml +++ b/www/apps/api-reference/specs/store/paths/store_payment-providers.yaml @@ -80,6 +80,10 @@ get: title: region_id description: Filter by a region ID. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_payment-providers/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_product-categories.yaml b/www/apps/api-reference/specs/store/paths/store_product-categories.yaml index f1aa4a515b..06ee3647bb 100644 --- a/www/apps/api-reference/specs/store/paths/store_product-categories.yaml +++ b/www/apps/api-reference/specs/store/paths/store_product-categories.yaml @@ -753,6 +753,10 @@ get: title: name description: A product category name. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_product-categories/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_product-categories_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_product-categories_{id}.yaml index 924298e3de..fc558905d1 100644 --- a/www/apps/api-reference/specs/store/paths/store_product-categories_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_product-categories_{id}.yaml @@ -83,6 +83,10 @@ get: or select specific fields to make the response size smaller. For example, `fields=category_children.id,category_children.name`. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_product-categories_{id}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_products.yaml b/www/apps/api-reference/specs/store/paths/store_products.yaml index 9e710182ae..60b24e8695 100644 --- a/www/apps/api-reference/specs/store/paths/store_products.yaml +++ b/www/apps/api-reference/specs/store/paths/store_products.yaml @@ -838,6 +838,10 @@ get: title: cart_id description: The product's cart id. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_products/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_products_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_products_{id}.yaml index 70b2fa1012..f5e3e16314 100644 --- a/www/apps/api-reference/specs/store/paths/store_products_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_products_{id}.yaml @@ -133,6 +133,10 @@ get: externalDocs: url: '#pagination' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_products_{id}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_regions.yaml b/www/apps/api-reference/specs/store/paths/store_regions.yaml index 4fd2f00027..4337a44ec4 100644 --- a/www/apps/api-reference/specs/store/paths/store_regions.yaml +++ b/www/apps/api-reference/specs/store/paths/store_regions.yaml @@ -149,6 +149,10 @@ get: type: object title: $or x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_regions/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_regions_{id}.yaml b/www/apps/api-reference/specs/store/paths/store_regions_{id}.yaml index 757e5405fb..00cf426dc6 100644 --- a/www/apps/api-reference/specs/store/paths/store_regions_{id}.yaml +++ b/www/apps/api-reference/specs/store/paths/store_regions_{id}.yaml @@ -39,6 +39,10 @@ get: externalDocs: url: '#select-fields-and-relations' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_regions_{id}/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_shipping-options.yaml b/www/apps/api-reference/specs/store/paths/store_shipping-options.yaml index 66831d2008..89554ee0f9 100644 --- a/www/apps/api-reference/specs/store/paths/store_shipping-options.yaml +++ b/www/apps/api-reference/specs/store/paths/store_shipping-options.yaml @@ -117,6 +117,10 @@ get: title: is_return description: Whether the shipping option can be used for returns. x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/store_shipping-options/get.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/store/paths/store_shipping-options_{id}_calculate.yaml b/www/apps/api-reference/specs/store/paths/store_shipping-options_{id}_calculate.yaml index b68831abf1..6492ae49e6 100644 --- a/www/apps/api-reference/specs/store/paths/store_shipping-options_{id}_calculate.yaml +++ b/www/apps/api-reference/specs/store/paths/store_shipping-options_{id}_calculate.yaml @@ -60,6 +60,11 @@ post: url: >- https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: >- + ../code_samples/JavaScript/store_shipping-options_{id}_calculate/post.js - lang: Shell label: cURL source: diff --git a/www/utils/generated/oas-output/base/admin.oas.base.yaml b/www/utils/generated/oas-output/base/admin.oas.base.yaml index da436df92f..0a74ee4e12 100644 --- a/www/utils/generated/oas-output/base/admin.oas.base.yaml +++ b/www/utils/generated/oas-output/base/admin.oas.base.yaml @@ -6,9 +6,6 @@ info: name: MIT url: https://github.com/medusajs/medusa/blob/develop/LICENSE tags: - - name: Auth - description: > - Auth API routes allow you to manage an admin user's authentication. - name: Api Keys description: > API keys can be used for authentication or resource-scoping. @@ -20,9 +17,12 @@ tags: These API routes allow admin users to manage both publishable and secret API keys. externalDocs: description: Learn more about the API Key Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/api-key + url: https://docs.medusajs.com/resources/commerce-modules/api-key x-associatedSchema: $ref: "#/components/schemas/AdminApiKey" + - name: Auth + description: | + Auth API routes allow you to manage an admin user's authentication. - name: Campaigns description: > A campaign is a group of promotions that have the same conditions, such as @@ -32,7 +32,7 @@ tags: These API routes allow admin users to manage campaigns, their conditions, and promotions that belong to them. externalDocs: description: Learn more about campaigns. - url: https://docs.medusajs.com/v2/resources/commerce-modules/promotion/campaign + url: https://docs.medusajs.com/resources/commerce-modules/promotion/campaign x-associatedSchema: $ref: "#/components/schemas/AdminCampaign" - name: Claims @@ -46,7 +46,7 @@ tags: $ref: "#/components/schemas/AdminClaim" externalDocs: description: Learn more about order claims. - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/claim + url: https://docs.medusajs.com/resources/commerce-modules/order/claim - name: Collections description: > A product collection organizes products into a collection for marketing @@ -65,7 +65,7 @@ tags: Currencies are defined by the Currency Module. Currency API Routes allow admins to list and update currencies. externalDocs: description: Learn more about the Currency Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/currency + url: https://docs.medusajs.com/resources/commerce-modules/currency x-associatedSchema: $ref: "#/components/schemas/AdminCurrency" - name: Customer Groups @@ -80,7 +80,7 @@ tags: These API routes allow admin users to manage groups and the customers in them. externalDocs: description: Learn more about the Customer Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/customer + url: https://docs.medusajs.com/resources/commerce-modules/customer x-associatedSchema: $ref: "#/components/schemas/AdminCustomerGroup" - name: Customers @@ -92,7 +92,7 @@ tags: These API routes allow admin users to manage customers in their store. externalDocs: description: Learn more about the Customer Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/customer + url: https://docs.medusajs.com/resources/commerce-modules/customer x-associatedSchema: $ref: "#/components/schemas/AdminCustomer" - name: Draft Orders @@ -105,7 +105,7 @@ tags: These API routes allow admin users to create and manage draft orders. externalDocs: description: Learn more about the Order Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/order + url: https://docs.medusajs.com/resources/commerce-modules/order x-associatedSchema: $ref: "#/components/schemas/AdminDraftOrder" - name: Exchanges @@ -117,7 +117,7 @@ tags: These API routes allow admin users t create and manage exchanges. externalDocs: description: Learn more about the order exchanges. - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/exchange + url: https://docs.medusajs.com/resources/commerce-modules/order/exchange x-associatedSchema: $ref: "#/components/schemas/AdminExchange" - name: Fulfillment Providers @@ -129,7 +129,7 @@ tags: Fulfillment providers are installed as module providers. externalDocs: description: Learn more about the fulfillment providers and how to create them. - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/fulfillment-provider + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/fulfillment-provider x-associatedSchema: $ref: "#/components/schemas/AdminFulfillmentProvider" - name: Fulfillment Sets @@ -144,7 +144,7 @@ tags: These API routes allow admin users to manage fulfillment sets. externalDocs: description: Learn more about fulfillment sets. - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/concepts + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/concepts x-associatedSchema: $ref: "#/components/schemas/AdminFulfillmentSet" - name: Fulfillments @@ -156,7 +156,7 @@ tags: These API routes allow admin users to manage fulfillments. externalDocs: description: Learn more about fulfillments. - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/item-fulfillment + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/item-fulfillment x-associatedSchema: $ref: "#/components/schemas/AdminFulfillment" - name: Inventory Items @@ -166,7 +166,7 @@ tags: These API routes allow admin users to manage inventory items. externalDocs: description: Learn more about inventory items. - url: https://docs.medusajs.com/v2/resources/commerce-modules/inventory/concepts + url: https://docs.medusajs.com/resources/commerce-modules/inventory/concepts x-associatedSchema: $ref: "#/components/schemas/AdminInventoryItem" - name: Invites @@ -178,7 +178,7 @@ tags: These API routes allow admin users to manage invites. externalDocs: description: Learn more about the User Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/user + url: https://docs.medusajs.com/resources/commerce-modules/user x-associatedSchema: $ref: "#/components/schemas/AdminInvite" - name: Notifications @@ -205,7 +205,7 @@ tags: These API routes allow admin users to make edits to an order and manage those edits. externalDocs: description: Learn more about the Order Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/order + url: https://docs.medusajs.com/resources/commerce-modules/order - name: Orders description: | An order is a purchase made by a customer through a storefront. @@ -215,7 +215,7 @@ tags: These API routes allow admin users to view and manage orders. externalDocs: description: Learn more about the orders - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/concepts + url: https://docs.medusajs.com/resources/commerce-modules/order/concepts x-associatedSchema: $ref: "#/components/schemas/AdminOrder" - name: Payment Collections @@ -233,7 +233,7 @@ tags: These API routes allow admin users to manage payment collections. externalDocs: description: Learn more about payment collections. - url: https://docs.medusajs.com/v2/resources/commerce-modules/payment/payment-collection + url: https://docs.medusajs.com/resources/commerce-modules/payment/payment-collection x-associatedSchema: $ref: "#/components/schemas/AdminPaymentCollection" - name: Payments @@ -248,9 +248,21 @@ tags: These API routes allow admin users to manage payments. externalDocs: description: Learn more about payments. - url: https://docs.medusajs.com/v2/resources/commerce-modules/payment/payment + url: https://docs.medusajs.com/resources/commerce-modules/payment/payment x-associatedSchema: $ref: "#/components/schemas/AdminPayment" + - name: Plugins + description: > + A plugin is a package of reusable Medusa customizations that you can install in any Medusa application. + + Plugins can be used to add new functionality, such as wishlists, or integrate third-party services, such as payment providers. + + These API routes allow admin users to retrieve plugins installed in their Medusa application. + externalDocs: + description: Learn more about plugins. + url: https://docs.medusajs.com/learn/fundamentals/plugins + x-associatedSchema: + $ref: "#/components/schemas/AdminPlugin" - name: Price Lists description: > A price list is a group of prices applied if the specified conditions and @@ -263,7 +275,7 @@ tags: These API routes allow admin users to manage price lists. externalDocs: description: Learn more about price lists. - url: https://docs.medusajs.com/v2/resources/commerce-modules/pricing/concepts#price-list + url: https://docs.medusajs.com/resources/commerce-modules/pricing/concepts#price-list x-associatedSchema: $ref: "#/components/schemas/AdminPriceList" - name: Price Preferences @@ -275,7 +287,7 @@ tags: These API routes allow admin users to manage whether a region or currency is tax inclusive. externalDocs: description: Learn more about tax-inclusiveness and the role of a price preference. - url: https://docs.medusajs.com/v2/resources/commerce-modules/pricing/tax-inclusive-pricing + url: https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing x-associatedSchema: $ref: "#/components/schemas/AdminPricePreference" - name: Product Categories @@ -289,7 +301,7 @@ tags: These API routes allow admin users to manage categories and the products in them. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: "#/components/schemas/AdminProductCategory" - name: Product Tags @@ -304,7 +316,7 @@ tags: These API routes allow admin users to manage product tags. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: "#/components/schemas/AdminProductTag" - name: Product Types @@ -316,7 +328,7 @@ tags: These API routes allow admin users to manage product types. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: "#/components/schemas/AdminProductType" - name: Product Variants @@ -330,7 +342,7 @@ tags: These API routes allow admin users to manage product variants. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: "#/components/schemas/AdminProductVariant" - name: Products @@ -348,7 +360,7 @@ tags: These API routes allow admin users to manage products. externalDocs: description: Learn more about the Product Module - url: https://docs.medusajs.com/v2/resources/commerce-modules/product + url: https://docs.medusajs.com/resources/commerce-modules/product x-associatedSchema: $ref: "#/components/schemas/AdminProduct" - name: Promotions @@ -369,7 +381,7 @@ tags: These API routes allow admin users to manage promotions. externalDocs: description: Learn more about promotions. - url: https://docs.medusajs.com/v2/resources/commerce-modules/promotion/concepts + url: https://docs.medusajs.com/resources/commerce-modules/promotion/concepts x-associatedSchema: $ref: "#/components/schemas/AdminPromotion" - name: Refund Reasons @@ -390,7 +402,7 @@ tags: These API routes allow admin users to manage regions, their providers, and more. externalDocs: description: Learn more about the Region Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/region + url: https://docs.medusajs.com/resources/commerce-modules/region x-associatedSchema: $ref: "#/components/schemas/AdminRegion" - name: Reservations @@ -404,7 +416,7 @@ tags: These API routes allow admin users to manage reservations. externalDocs: description: Learn more about reservations and other inventory concepts. - url: https://docs.medusajs.com/v2/resources/commerce-modules/inventory/concepts + url: https://docs.medusajs.com/resources/commerce-modules/inventory/concepts x-associatedSchema: $ref: "#/components/schemas/AdminReservation" - name: Return Reasons @@ -427,7 +439,7 @@ tags: These API routes allow admin users to manage returns. externalDocs: description: Learn more about order returns. - url: https://docs.medusajs.com/v2/resources/commerce-modules/order/return + url: https://docs.medusajs.com/resources/commerce-modules/order/return x-associatedSchema: $ref: "#/components/schemas/AdminReturn" - name: Sales Channels @@ -439,7 +451,7 @@ tags: These API routes allow admins to manage sales channels and the products available in them. externalDocs: description: Learn more about the Sales Channel Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/sales-channel + url: https://docs.medusajs.com/resources/commerce-modules/sales-channel x-associatedSchema: $ref: "#/components/schemas/AdminSalesChannel" - name: Shipping Options @@ -456,7 +468,7 @@ tags: These API routes allow admins to manage shipping options. externalDocs: description: Learn more about shipping options. - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option x-associatedSchema: $ref: "#/components/schemas/AdminShippingOption" - name: Shipping Profiles @@ -469,7 +481,7 @@ tags: These API routes allow admin users to manage shipping profiles. externalDocs: description: Learn more about shipping profiles and other fulfillment concepts. - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/concepts#shipping-profile + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/concepts#shipping-profile x-associatedSchema: $ref: "#/components/schemas/AdminShippingProfile" - name: Stock Locations @@ -486,7 +498,7 @@ tags: These API routes allow admin users to manage stock locations and their linked data. externalDocs: description: Learn more about stock locations. - url: https://docs.medusajs.com/v2/resources/commerce-modules/stock-location/concepts + url: https://docs.medusajs.com/resources/commerce-modules/stock-location/concepts x-associatedSchema: $ref: "#/components/schemas/AdminStockLocation" - name: Stores @@ -501,7 +513,7 @@ tags: These API routes allow admin users to manage their store. externalDocs: description: Learn more about the Store Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/store + url: https://docs.medusajs.com/resources/commerce-modules/store x-associatedSchema: $ref: "#/components/schemas/AdminStore" - name: Tax Rates @@ -516,7 +528,7 @@ tags: These API routes allow admin users to manage tax rates and their rules. externalDocs: description: Learn more about tax rates and rules. - url: https://docs.medusajs.com/v2/resources/commerce-modules/tax/tax-rates-and-rules + url: https://docs.medusajs.com/resources/commerce-modules/tax/tax-rates-and-rules x-associatedSchema: $ref: "#/components/schemas/AdminTaxRate" - name: Tax Regions @@ -531,7 +543,7 @@ tags: These API routes allow admin users to manage tax regions. externalDocs: description: Learn more about tax regions. - url: https://docs.medusajs.com/v2/resources/commerce-modules/tax/tax-region + url: https://docs.medusajs.com/resources/commerce-modules/tax/tax-region x-associatedSchema: $ref: "#/components/schemas/AdminTaxRegion" - name: Uploads @@ -543,7 +555,7 @@ tags: You can upload public files, such as product images, or private files, such as CSV files used to import products. externalDocs: description: Check out available file module providers. - url: https://docs.medusajs.com/v2/resources/architectural-modules/file + url: https://docs.medusajs.com/resources/architectural-modules/file - name: Users description: > A user is an admin user that can authenticate and perform functionalities @@ -556,7 +568,7 @@ tags: These API routes allow admin users to manage their team. externalDocs: description: Learn more about the User Module. - url: https://docs.medusajs.com/v2/resources/commerce-modules/user + url: https://docs.medusajs.com/resources/commerce-modules/user x-associatedSchema: $ref: "#/components/schemas/AdminUser" - name: Workflows Executions @@ -568,7 +580,7 @@ tags: Depending on the workflow engine you use, executions may only be retained for a short while, or only until the Medusa application is restarted. externalDocs: description: Check out available Workflow Engine Modules - url: https://docs.medusajs.com/v2/resources/architectural-modules/workflow-engine + url: https://docs.medusajs.com/resources/architectural-modules/workflow-engine servers: - url: http://localhost:9000 - url: https://api.medusajs.com @@ -753,4 +765,4 @@ components: type: http x-displayName: Reset Password Token scheme: bearer - x-is-auth: false \ No newline at end of file + x-is-auth: false diff --git a/www/utils/generated/oas-output/base/store.oas.base.yaml b/www/utils/generated/oas-output/base/store.oas.base.yaml index c492c1c27e..06ec343cc8 100644 --- a/www/utils/generated/oas-output/base/store.oas.base.yaml +++ b/www/utils/generated/oas-output/base/store.oas.base.yaml @@ -21,7 +21,7 @@ tags: These API routes allow customers to create and manage their cart, and place an order. externalDocs: description: How to implement cart functionality in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/cart + url: https://docs.medusajs.com/resources/storefront-development/cart x-associatedSchema: $ref: "#/components/schemas/StoreCart" - name: Collections @@ -33,7 +33,7 @@ tags: These API routes allow customers to browse collections and their products. externalDocs: description: How to list product collections in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/products/collections/list + url: https://docs.medusajs.com/resources/storefront-development/products/collections/list x-associatedSchema: $ref: "#/components/schemas/StoreCollection" - name: Currencies @@ -48,7 +48,7 @@ tags: These API routes allow customers to browse currencies. externalDocs: description: How to retrieve product variant prices in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/products/price + url: https://docs.medusajs.com/resources/storefront-development/products/price x-associatedSchema: $ref: "#/components/schemas/StoreCurrency" - name: Customers @@ -62,7 +62,7 @@ tags: These API routes allow customers to create and manage their accounts. externalDocs: description: How to implement customer account functionalities in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/customers + url: https://docs.medusajs.com/resources/storefront-development/customers x-associatedSchema: $ref: "#/components/schemas/StoreCustomer" - name: Orders @@ -80,7 +80,7 @@ tags: Use these API routes during checkout to set the cart's payment provider and authorize its payment session. externalDocs: description: How to implement payment during checkout. - url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/payment + url: https://docs.medusajs.com/resources/storefront-development/checkout/payment x-associatedSchema: $ref: "#/components/schemas/StorePaymentCollection" - name: Payment Providers @@ -94,7 +94,7 @@ tags: These API routes allow customers to view available payment providers in their region. externalDocs: description: How to implement payment during checkout. - url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/payment + url: https://docs.medusajs.com/resources/storefront-development/checkout/payment x-associatedSchema: $ref: "#/components/schemas/StorePaymentProvider" - name: Product Categories @@ -104,7 +104,7 @@ tags: These API routes allow customers to browse categories and their products. externalDocs: description: How to list product categories in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/products/categories/list + url: https://docs.medusajs.com/resources/storefront-development/products/categories/list x-associatedSchema: $ref: "#/components/schemas/StoreProductCategory" - name: Product Tags @@ -124,7 +124,7 @@ tags: These API routes allow customers to browse products. externalDocs: description: How to list products, get their prices, and more in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/products + url: https://docs.medusajs.com/resources/storefront-development/products x-associatedSchema: $ref: "#/components/schemas/StoreProduct" - name: Regions @@ -139,7 +139,7 @@ tags: Use these API routes to retrieve available regions in the store. externalDocs: description: How to retrieve and store selected region in a storefront. - url: https://docs.medusajs.com/v2/resources/storefront-development/regions + url: https://docs.medusajs.com/resources/storefront-development/regions x-associatedSchema: $ref: "#/components/schemas/StoreRegion" - name: Return @@ -170,7 +170,7 @@ tags: These API routes allow customers to retrieve available shipping options for their context. externalDocs: description: How to implement shipping during checkout. - url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping + url: https://docs.medusajs.com/resources/storefront-development/checkout/shipping x-associatedSchema: $ref: "#/components/schemas/StoreShippingOption" servers: diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_api-keys_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_api-keys_[id].ts index 703ff0b29c..cc5b395171 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_api-keys_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_api-keys_[id].ts @@ -17,6 +17,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.apiKey.delete("apk_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_campaigns_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_campaigns_[id].ts index 6afd935598..fd0ee1d658 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_campaigns_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_campaigns_[id].ts @@ -17,6 +17,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.campaign.delete("procamp_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_claim-items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_claim-items_[action_id].ts index 7de754283c..3fb9e2b13b 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_claim-items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_claim-items_[action_id].ts @@ -38,6 +38,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.removeItem( + * "claim_123", + * "ordchact_123", + * ) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_inbound_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_inbound_items_[action_id].ts index 3885cb3acb..23265055b9 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_inbound_items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_inbound_items_[action_id].ts @@ -26,6 +26,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.removeInboundItem( + * "claim_123", + * "ordchact_123", + * ) + * .then(({ return: returnData }) => { + * console.log(returnData) + * }) * - lang: Shell * label: cURL * source: "curl -X DELETE '{backend_url}/admin/claims/{id}/inbound/items/{action_id}' \\ -H 'Authorization: Bearer {access_token}'" diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_inbound_shipping-method_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_inbound_shipping-method_[action_id].ts index 3f77af3e49..5f478bd576 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_inbound_shipping-method_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_inbound_shipping-method_[action_id].ts @@ -26,6 +26,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.deleteInboundShipping( + * "claim_123", + * "ordchact_123", + * ) + * .then(({ return: returnData }) => { + * console.log(returnData) + * }) * - lang: Shell * label: cURL * source: "curl -X DELETE '{backend_url}/admin/claims/{id}/inbound/shipping-method/{action_id}' \\ -H 'Authorization: Bearer {access_token}'" diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_outbound_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_outbound_items_[action_id].ts index 90115d50cc..ddb59004b6 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_outbound_items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_outbound_items_[action_id].ts @@ -38,6 +38,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.removeOutboundItem( + * "claim_123", + * "ordchact_123", + * ) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: "curl -X DELETE '{backend_url}/admin/claims/{id}/outbound/items/{action_id}' \\ -H 'Authorization: Bearer {access_token}'" diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_outbound_shipping-method_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_outbound_shipping-method_[action_id].ts index d44c436079..7b40dd11ca 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_outbound_shipping-method_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_outbound_shipping-method_[action_id].ts @@ -38,6 +38,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.deleteOutboundShipping( + * "claim_123", + * "ordchact_123", + * ) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: "curl -X DELETE '{backend_url}/admin/claims/{id}/outbound/shipping-method/{action_id}' \\ -H 'Authorization: Bearer {access_token}'" diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_request.ts b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_request.ts index a4fe12807e..c1c9faa8ea 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_request.ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_claims_[id]_request.ts @@ -16,6 +16,25 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.cancelRequest( + * "claim_123", + * ) + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_collections_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_collections_[id].ts index 790568e86c..c528e6bb94 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_collections_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_collections_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCollection.delete("pcol_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_customer-groups_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_customer-groups_[id].ts index 61fd23a379..02485e0363 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_customer-groups_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_customer-groups_[id].ts @@ -17,6 +17,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customerGroup.delete("cusgroup_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_customers_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_customers_[id].ts index fcbddfa254..35dfbb8ac9 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_customers_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_customers_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customer.delete("cus_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_customers_[id]_addresses_[address_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_customers_[id]_addresses_[address_id].ts index 597f33b33c..cfdef7c2c0 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_customers_[id]_addresses_[address_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_customers_[id]_addresses_[address_id].ts @@ -34,6 +34,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customer.deleteAddress("cus_123", "cus_addr_123") + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: "curl -X DELETE '{backend_url}/admin/customers/{id}/addresses/{address_id}' \\ -H 'Authorization: Bearer {access_token}'" diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit.ts b/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit.ts new file mode 100644 index 0000000000..226a2a3b32 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit.ts @@ -0,0 +1,62 @@ +/** + * @oas [delete] /admin/draft-orders/{id}/edit + * operationId: DeleteDraftOrdersIdEdit + * summary: Cancel Edit on Draft Order + * x-sidebar-summary: Cancel Edit + * description: Cancel an unconfirmed edit on a draft order. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.cancelEdit("order_123") + * .then(({ id, object, deleted }) => { + * console.log(id, object, deleted) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: cancelDraftOrderEditWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_items_[action_id].ts new file mode 100644 index 0000000000..c6bf987942 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_items_[action_id].ts @@ -0,0 +1,71 @@ +/** + * @oas [delete] /admin/draft-orders/{id}/edit/items/{action_id} + * operationId: DeleteDraftOrdersIdEditItemsAction_id + * summary: Remove Item from Draft Order + * x-sidebar-summary: Remove Item + * description: | + * Remove an order item from a draft order by the ID of the item's `ITEM_REMOVE` action. + * + * Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * - name: action_id + * in: path + * description: The ID of the order item's `ITEM_REMOVE` action. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.removeActionItem("order_123", "action_123") + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit/items/{action_id}' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: removeDraftOrderActionItemWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_promotions.ts b/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_promotions.ts new file mode 100644 index 0000000000..ed44defb59 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_promotions.ts @@ -0,0 +1,70 @@ +/** + * @oas [delete] /admin/draft-orders/{id}/edit/promotions + * operationId: DeleteDraftOrdersIdEditPromotions + * summary: Remove Promotions from Draft Order + * x-sidebar-summary: Remove Promotions + * description: Remove specified promotions from a draft order. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.removePromotions("order_123", { + * promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"], + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit/promotions' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminDraftOrderPreviewResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: removeDraftOrderPromotionsWorkflow + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminRemoveDraftOrderPromotions" + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_shipping-methods_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_shipping-methods_[action_id].ts new file mode 100644 index 0000000000..8cd294a91a --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_draft-orders_[id]_edit_shipping-methods_[action_id].ts @@ -0,0 +1,71 @@ +/** + * @oas [delete] /admin/draft-orders/{id}/edit/shipping-methods/{action_id} + * operationId: DeleteDraftOrdersIdEditShippingMethodsAction_id + * summary: Remove Shipping Method from Draft Order + * x-sidebar-summary: Remove Shipping Method + * description: | + * Remove the shipping method in a draft order using the `ID` of the method's `SHIPPING_ADD` action. + * + * Every shipping method has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * - name: action_id + * in: path + * description: The ID of the shipping method's `SHIPPING_ADD` action. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.removeShippingMethod("order_123", "action_123") + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods/{action_id}' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: removeDraftOrderActionShippingMethodWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_inbound_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_inbound_items_[action_id].ts index 0aab9eec8f..2875f15eed 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_inbound_items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_inbound_items_[action_id].ts @@ -26,6 +26,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.removeInboundItem( + * "exchange_123", + * "ordchact_123", + * ) + * .then(({ return: returnData }) => { + * console.log(returnData) + * }) * - lang: Shell * label: cURL * source: "curl -X DELETE '{backend_url}/admin/exchanges/{id}/inbound/items/{action_id}' \\ -H 'Authorization: Bearer {access_token}'" diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_inbound_shipping-method_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_inbound_shipping-method_[action_id].ts index 2efa199d1b..4328efd403 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_inbound_shipping-method_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_inbound_shipping-method_[action_id].ts @@ -26,6 +26,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.deleteInboundShipping( + * "exchange_123", + * "ordchact_123", + * ) + * .then(({ return: returnData }) => { + * console.log(returnData) + * }) * - lang: Shell * label: cURL * source: "curl -X DELETE '{backend_url}/admin/exchanges/{id}/inbound/shipping-method/{action_id}' \\ -H 'Authorization: Bearer {access_token}'" diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_outbound_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_outbound_items_[action_id].ts index 779c591f67..69899f6dc7 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_outbound_items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_outbound_items_[action_id].ts @@ -38,6 +38,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.removeOutboundItem( + * "exchange_123", + * "ordchact_123", + * ) + * .then(({ exchange }) => { + * console.log(exchange) + * }) * - lang: Shell * label: cURL * source: "curl -X DELETE '{backend_url}/admin/exchanges/{id}/outbound/items/{action_id}' \\ -H 'Authorization: Bearer {access_token}'" diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_outbound_shipping-method_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_outbound_shipping-method_[action_id].ts index 66efefcbef..b826e1cf99 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_outbound_shipping-method_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_outbound_shipping-method_[action_id].ts @@ -38,6 +38,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.deleteOutboundShipping( + * "exchange_123", + * "ordchact_123", + * ) + * .then(({ exchange }) => { + * console.log(exchange) + * }) * - lang: Shell * label: cURL * source: "curl -X DELETE '{backend_url}/admin/exchanges/{id}/outbound/shipping-method/{action_id}'\\ -H 'Authorization: Bearer {access_token}'" diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_request.ts b/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_request.ts index 6810abdd9a..a9d80986a8 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_request.ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_exchanges_[id]_request.ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.cancel("exchange_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_fulfillment-sets_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_fulfillment-sets_[id].ts index f55829fee8..fd1390f0c6 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_fulfillment-sets_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_fulfillment-sets_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.fulfillmentSet.delete("fset_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts index 59ad9aa3af..0c951943ce 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts @@ -23,6 +23,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.fulfillmentSet.deleteServiceZone( + * "fset_123", + * "serzo_123", + * ) + * .then(({ deleted, parent: fulfillmentSet }) => { + * console.log(deleted, fulfillmentSet) + * }) * - lang: Shell * label: cURL * source: "curl -X DELETE '{backend_url}/admin/fulfillment-sets/{id}/service-zones/{zone_id}' \\ -H 'Authorization: Bearer {access_token}'" diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_inventory-items_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_inventory-items_[id].ts index fea2dca258..e860cd66bb 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_inventory-items_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_inventory-items_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.inventoryItem.delete("iitem_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_inventory-items_[id]_location-levels_[location_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_inventory-items_[id]_location-levels_[location_id].ts index 86c3553c1b..92acef7bc8 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_inventory-items_[id]_location-levels_[location_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_inventory-items_[id]_location-levels_[location_id].ts @@ -38,6 +38,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.inventoryItem.deleteLevel( + * "iitem_123", + * "sloc_123", + * ) + * .then(({ deleted, parent: inventoryItem }) => { + * console.log(deleted, inventoryItem) + * }) * - lang: Shell * label: cURL * source: "curl -X DELETE '{backend_url}/admin/inventory-items/{id}/location-levels/{location_id}' \\ -H 'Authorization: Bearer {access_token}'" diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_invites_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_invites_[id].ts index 59a970b5ec..2d9f7b9c82 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_invites_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_invites_[id].ts @@ -12,6 +12,23 @@ * schema: * type: string * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.invite.delete("invite_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: curl -X DELETE '{backend_url}/admin/invites/{id}' diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id].ts index 7d622a2b5a..bf069cd9a6 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.orderEdit.cancelRequest("ordch_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id]_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id]_items_[action_id].ts index 54b99e0806..c602bb84e8 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id]_items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_order-edits_[id]_items_[action_id].ts @@ -26,6 +26,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.orderEdit.removeAddedItem( + * "ordch_123", + * "orli_123", + * ) + * .then(({ order_preview }) => { + * console.log(order_preview) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_payment-collections_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_payment-collections_[id].ts index 5028c156fd..439457465d 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_payment-collections_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_payment-collections_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.paymentCollection.delete("paycol_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_price-lists_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_price-lists_[id].ts index 9584b79658..f8e9ecff45 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_price-lists_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_price-lists_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.priceList.delete("plist_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_price-preferences_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_price-preferences_[id].ts index 8c0abfdf10..0bb194a480 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_price-preferences_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_price-preferences_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.pricePreference.delete("prpref_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_product-categories_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_product-categories_[id].ts index 4fe30edf13..5abd7e17a3 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_product-categories_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_product-categories_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCategory.delete("pcat_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_product-tags_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_product-tags_[id].ts index 6a61b75be7..75c5380153 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_product-tags_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_product-tags_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productTag.delete("ptag_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_product-types_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_product-types_[id].ts index 7633a6928f..16712c4797 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_product-types_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_product-types_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productType.delete("ptyp_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id].ts index 3ebc410412..19767978d7 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.delete("prod_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id]_options_[option_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id]_options_[option_id].ts index 117cf31c3d..b2af5d2541 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id]_options_[option_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id]_options_[option_id].ts @@ -38,6 +38,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.deleteOption("prod_123", "prodopt_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id]_variants_[variant_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id]_variants_[variant_id].ts index 7ca1cb0425..18ac2ba53a 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id]_variants_[variant_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_products_[id]_variants_[variant_id].ts @@ -35,6 +35,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.deleteVariant("prod_123", "variant_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_promotions_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_promotions_[id].ts index 34515eda96..c3e02d9bcb 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_promotions_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_promotions_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.promotion.delete("promo_123") + * .then(({ promotion }) => { + * console.log(promotion) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_regions_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_regions_[id].ts index 0fbff301cd..059afe2f76 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_regions_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_regions_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.region.delete("region_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_reservations_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_reservations_[id].ts index d9468e6e40..1b90fbbf6b 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_reservations_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_reservations_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.reservation.delete("res_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_return-reasons_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_return-reasons_[id].ts index 30af2de37d..bb585e4770 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_return-reasons_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_return-reasons_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.returnReason.delete("ret_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_dismiss-items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_dismiss-items_[action_id].ts index 294d5d238c..4b292fcf3b 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_dismiss-items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_dismiss-items_[action_id].ts @@ -38,6 +38,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.removeDismissItem("return_123", "orchach_123") + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_receive-items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_receive-items_[action_id].ts index 986b528d0a..5ea879c454 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_receive-items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_receive-items_[action_id].ts @@ -38,6 +38,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.removeReceiveItem("return_123", "orchach_123") + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_receive.ts b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_receive.ts index d94ee4cd3f..bbe82b60af 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_receive.ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_receive.ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.cancelReceive("return_123") + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_request-items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_request-items_[action_id].ts index b27f93b7ab..5853cbc281 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_request-items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_request-items_[action_id].ts @@ -38,6 +38,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.removeReturnItem("return_123", "orchach_123") + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_request.ts b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_request.ts index bf161a4550..579aa2066c 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_request.ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_request.ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.cancelRequest("return_123") + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_shipping-method_[action_id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_shipping-method_[action_id].ts index 8115af5cb7..99032d1988 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_shipping-method_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_returns_[id]_shipping-method_[action_id].ts @@ -38,6 +38,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.deleteReturnShipping("return_123", "orchach_123") + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_sales-channels_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_sales-channels_[id].ts index 1cbf6c805e..a954a2bf86 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_sales-channels_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_sales-channels_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.salesChannel.delete("sc_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_shipping-options_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_shipping-options_[id].ts index 787999b401..ccd0081bd5 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_shipping-options_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_shipping-options_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.shippingOption.delete("so_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_shipping-profiles_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_shipping-profiles_[id].ts index 7664e39b7a..9cf24e4131 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_shipping-profiles_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_shipping-profiles_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.shippingProfile.delete("sp_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_stock-locations_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_stock-locations_[id].ts index 7defb659ee..b0514b630f 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_stock-locations_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_stock-locations_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.stockLocation.delete("sloc_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_tax-rates_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_tax-rates_[id].ts index 924992627b..49abff3129 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_tax-rates_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_tax-rates_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.taxRate.delete("txrat_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_tax-regions_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_tax-regions_[id].ts index 28f433b0ce..e4ad95a629 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_tax-regions_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_tax-regions_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.taxRegion.delete("txreg_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_uploads_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_uploads_[id].ts index 9c8d030185..cc7adb896c 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_uploads_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_uploads_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.upload.delete("test.txt") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_users_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_users_[id].ts index d0e600c2c5..7a0bafe8ed 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_users_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_users_[id].ts @@ -12,6 +12,23 @@ * schema: * type: string * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.user.delete("user_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: curl -X DELETE '{backend_url}/admin/users/{id}' diff --git a/www/utils/generated/oas-output/operations/admin/delete_auth_session.ts b/www/utils/generated/oas-output/operations/admin/delete_auth_session.ts index 16b1473b5a..c4c07ad19b 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_auth_session.ts +++ b/www/utils/generated/oas-output/operations/admin/delete_auth_session.ts @@ -5,6 +5,23 @@ * description: Deletes the cookie session ID previously set for authentication. * x-authenticated: true * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * await sdk.auth.logout() + * + * // user is now logged out + * // you can't send any requests that require authentication * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_api-keys.ts b/www/utils/generated/oas-output/operations/admin/get_admin_api-keys.ts index 58641d6708..e612f7d42c 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_api-keys.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_api-keys.ts @@ -1055,6 +1055,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.apiKey.list() + * .then(({ api_keys, count, limit, offset }) => { + * console.log(api_keys) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_api-keys_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_api-keys_[id].ts index ab78189bb3..7e93e2b280 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_api-keys_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_api-keys_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.apiKey.retrieve("apk_123") + * .then(({ api_key }) => { + * console.log(api_key) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_campaigns.ts b/www/utils/generated/oas-output/operations/admin/get_admin_campaigns.ts index 1a3d0f1157..5d90ca0286 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_campaigns.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_campaigns.ts @@ -50,6 +50,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.campaign.list() + * .then(({ campaigns, count, limit, offset }) => { + * console.log(campaigns) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_campaigns_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_campaigns_[id].ts index abd65a04d1..eb3d2e8023 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_campaigns_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_campaigns_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.campaign.retrieve("procamp_123") + * .then(({ campaign }) => { + * console.log(campaign) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_claims.ts b/www/utils/generated/oas-output/operations/admin/get_admin_claims.ts index 92323a5851..1ac8b0fccc 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_claims.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_claims.ts @@ -813,6 +813,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.list() + * .then(({ claims, count, limit, offset }) => { + * console.log(claims) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_claims_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_claims_[id].ts index 72d3c1fd29..fff191a98b 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_claims_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_claims_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.retrieve("claim_123") + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_collections.ts b/www/utils/generated/oas-output/operations/admin/get_admin_collections.ts index b76f4b5acd..c75b8fcacf 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_collections.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_collections.ts @@ -813,6 +813,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCollection.list() + * .then(({ collections, count, limit, offset }) => { + * console.log(collections) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_collections_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_collections_[id].ts index ceade34f44..62b97381c6 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_collections_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_collections_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCollection.retrieve("pcol_123") + * .then(({ collection }) => { + * console.log(collection) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_currencies.ts b/www/utils/generated/oas-output/operations/admin/get_admin_currencies.ts index c75ead460f..900529567d 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_currencies.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_currencies.ts @@ -92,6 +92,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.currency.list() + * .then(({ currencies, count, limit, offset }) => { + * console.log(currencies) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_currencies_[code].ts b/www/utils/generated/oas-output/operations/admin/get_admin_currencies_[code].ts index ab7b898d95..fb9532e321 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_currencies_[code].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_currencies_[code].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.currency.retrieve("usd") + * .then(({ currency }) => { + * console.log(currency) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_customer-groups.ts b/www/utils/generated/oas-output/operations/admin/get_admin_customer-groups.ts index 6da6416f81..a687150683 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_customer-groups.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_customer-groups.ts @@ -828,6 +828,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customerGroup.list() + * .then(({ customer_groups, count, limit, offset }) => { + * console.log(customer_groups) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_customer-groups_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_customer-groups_[id].ts index 29414ee676..477b148d3f 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_customer-groups_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_customer-groups_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customerGroup.retrieve("cusgroup_123") + * .then(({ customer_group }) => { + * console.log(customer_group) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_customers.ts b/www/utils/generated/oas-output/operations/admin/get_admin_customers.ts index 15377f04e3..5071041e62 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_customers.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_customers.ts @@ -3334,6 +3334,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customer.list() + * .then(({ customers, count, limit, offset }) => { + * console.log(customers) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id].ts index 0e3f54ba86..09db246584 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customer.retrieve("cus_123") + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id]_addresses.ts b/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id]_addresses.ts index 29c40a4d04..24982a2270 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id]_addresses.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id]_addresses.ts @@ -154,6 +154,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customer.listAddresses("cus_123") + * .then(({ addresses }) => { + * console.log(addresses) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id]_addresses_[address_id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id]_addresses_[address_id].ts index 24683b61cc..317ec2b821 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id]_addresses_[address_id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_customers_[id]_addresses_[address_id].ts @@ -34,6 +34,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customer.retrieveAddress("cus_123", "cus_addr_123") + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts b/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts index a366736891..727d8943a4 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts @@ -1426,6 +1426,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.list() + * .then(({ draft_orders, count, limit, offset }) => { + * console.log(draft_orders) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders_[id].ts index 2f34b9b666..f32a6d3c14 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders_[id].ts @@ -30,6 +30,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.retrieve("order_123") + * .then(({ draft_order }) => { + * console.log(draft_order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_exchanges.ts b/www/utils/generated/oas-output/operations/admin/get_admin_exchanges.ts index d3ffaea1e3..efd1d105f7 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_exchanges.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_exchanges.ts @@ -785,6 +785,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.list() + * .then(({ exchanges, count, limit, offset }) => { + * console.log(exchanges) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_exchanges_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_exchanges_[id].ts index 9ae952f47a..44b13e0bc7 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_exchanges_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_exchanges_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.retrieve("exchange_123") + * .then(({ exchange }) => { + * console.log(exchange) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-providers.ts b/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-providers.ts index c50eae4ef5..47eae9c83b 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-providers.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-providers.ts @@ -94,6 +94,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.fulfillmentProvider.list() + * .then(({ fulfillment_providers, count, limit, offset }) => { + * console.log(fulfillment_providers) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-providers_[id]_options.ts b/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-providers_[id]_options.ts index 0c24dc2782..2ca16eb5b1 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-providers_[id]_options.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-providers_[id]_options.ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.fulfillmentProvider.listFulfillmentOptions("fp_123") + * .then(({ fulfillment_options }) => { + * console.log(fulfillment_options) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts index 04e0fbaba1..10efbe2a23 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts @@ -35,6 +35,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.fulfillmentSet.retrieveServiceZone( + * "fset_123", + * "serzo_123" + * ) + * .then(({ service_zone }) => { + * console.log(service_zone) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items.ts b/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items.ts index 08e8dc8e81..742806d7bb 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items.ts @@ -385,6 +385,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.inventoryItem.list() + * .then(({ inventory_items, count, limit, offset }) => { + * console.log(inventory_items) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id].ts index b41b6a8573..91702dd5bb 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.inventoryItem.retrieve("iitem_123") + * .then(({ inventory_item }) => { + * console.log(inventory_item) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id]_location-levels.ts b/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id]_location-levels.ts index a64c55ebb6..05211b2dc5 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id]_location-levels.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id]_location-levels.ts @@ -74,6 +74,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.inventoryItem.listLevels("iitem_123") + * .then(({ inventory_levels, count, limit, offset }) => { + * console.log(inventory_levels) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_invites.ts b/www/utils/generated/oas-output/operations/admin/get_admin_invites.ts index e699fb8ec1..4e654a5327 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_invites.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_invites.ts @@ -459,6 +459,23 @@ * type: object * title: $or * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.invite.list() + * .then(({ invites, count, limit, offset }) => { + * console.log(invites) + * }) * - lang: Shell * label: cURL * source: curl '{backend_url}/admin/invites' diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_invites_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_invites_[id].ts index d0ff01117c..1f117f900a 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_invites_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_invites_[id].ts @@ -24,6 +24,23 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.invite.retrieve("invite_123") + * .then(({ invite }) => { + * console.log(invite) + * }) * - lang: Shell * label: cURL * source: curl '{backend_url}/admin/invites/{id}' diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_notifications.ts b/www/utils/generated/oas-output/operations/admin/get_admin_notifications.ts index 39a2f993ce..c2ac135fd9 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_notifications.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_notifications.ts @@ -106,6 +106,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.notification.list() + * .then(({ notifications, count, limit, offset }) => { + * console.log(notifications) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_notifications_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_notifications_[id].ts index ef29e7302f..abc8f1714c 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_notifications_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_notifications_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.notification.retrieve("notif_123") + * .then(({ notification }) => { + * console.log(notification) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts b/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts index b1835e7232..05670faba2 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts @@ -608,6 +608,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.list() + * .then(({ orders, count, limit, offset }) => { + * console.log(orders) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id].ts index a896c8d963..b2eeebb78b 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id].ts @@ -76,6 +76,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.retrieve("order_123") + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_changes.ts b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_changes.ts index 13b079c699..3ea51630cf 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_changes.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_changes.ts @@ -34,6 +34,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.listChanges("order_123") + * .then(({ order_changes }) => { + * console.log(order_changes) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_line-items.ts b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_line-items.ts index 194e9dcfe5..0d68f0b8b4 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_line-items.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_line-items.ts @@ -116,6 +116,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.listLineItems("order_123") + * .then(({ order_items }) => { + * console.log(order_items) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_preview.ts b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_preview.ts index 5f119ef62a..c0199cf10c 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_preview.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_preview.ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.retrievePreview("order_123") + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_payments.ts b/www/utils/generated/oas-output/operations/admin/get_admin_payments.ts index c92698e129..a8a282598e 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_payments.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_payments.ts @@ -461,6 +461,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.payment.list() + * .then(({ payments, count, limit, offset }) => { + * console.log(payments) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_payments_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_payments_[id].ts index 3eec31706c..c73e31fadc 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_payments_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_payments_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.payment.retrieve("pay_123") + * .then(({ payment }) => { + * console.log(payment) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_payments_payment-providers.ts b/www/utils/generated/oas-output/operations/admin/get_admin_payments_payment-providers.ts index c5a7719e19..71f267f62d 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_payments_payment-providers.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_payments_payment-providers.ts @@ -90,6 +90,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.payment.listPaymentProviders() + * .then(({ payment_providers, count, limit, offset }) => { + * console.log(payment_providers) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_plugins.ts b/www/utils/generated/oas-output/operations/admin/get_admin_plugins.ts new file mode 100644 index 0000000000..cbf4b6370f --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_plugins.ts @@ -0,0 +1,57 @@ +/** + * @oas [get] /admin/plugins + * operationId: GetPlugins + * summary: List Plugins + * description: Retrieve the list of plugins installed in the Medusa application. + * x-authenticated: true + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.plugin.list() + * .then(({ plugins }) => { + * console.log(plugins) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/admin/plugins' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Plugins + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminPluginsListResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_price-lists.ts b/www/utils/generated/oas-output/operations/admin/get_admin_price-lists.ts index 850dd4b31c..ac50443480 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_price-lists.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_price-lists.ts @@ -354,6 +354,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.priceList.list() + * .then(({ price_lists, count, limit, offset }) => { + * console.log(price_lists) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_price-lists_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_price-lists_[id].ts index c91684adde..1621132dee 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_price-lists_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_price-lists_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.priceList.retrieve("plist_123") + * .then(({ price_list }) => { + * console.log(price_list) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_price-preferences.ts b/www/utils/generated/oas-output/operations/admin/get_admin_price-preferences.ts index c0a4fc2bd3..1413fcb2d6 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_price-preferences.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_price-preferences.ts @@ -120,6 +120,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.pricePreference.list() + * .then(({ price_preferences, count, limit, offset }) => { + * console.log(price_preferences) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_price-preferences_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_price-preferences_[id].ts index 1756b8c2c6..d21f336ea0 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_price-preferences_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_price-preferences_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.pricePreference.retrieve("prpref_123") + * .then(({ price_preference }) => { + * console.log(price_preference) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_product-categories.ts b/www/utils/generated/oas-output/operations/admin/get_admin_product-categories.ts index fc06cf312c..258579144c 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_product-categories.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_product-categories.ts @@ -543,6 +543,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCategory.list() + * .then(({ product_categories, count, limit, offset }) => { + * console.log(product_categories) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_product-categories_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_product-categories_[id].ts index 588d2fdc37..ab9822997b 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_product-categories_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_product-categories_[id].ts @@ -50,6 +50,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCategory.retrieve("pcat_123") + * .then(({ product_category }) => { + * console.log(product_category) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_product-tags.ts b/www/utils/generated/oas-output/operations/admin/get_admin_product-tags.ts index 8cd05c4200..87c057e73c 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_product-tags.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_product-tags.ts @@ -461,6 +461,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productTag.list() + * .then(({ product_tags, count, limit, offset }) => { + * console.log(product_tags) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_product-tags_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_product-tags_[id].ts index 23c4a4b5af..77142b1206 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_product-tags_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_product-tags_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productTag.retrieve("ptag_123") + * .then(({ product_tag }) => { + * console.log(product_tag) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_product-types.ts b/www/utils/generated/oas-output/operations/admin/get_admin_product-types.ts index e1ceb0195f..c33ded0782 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_product-types.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_product-types.ts @@ -461,6 +461,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productType.list() + * .then(({ product_types, count, limit, offset }) => { + * console.log(product_types) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_product-types_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_product-types_[id].ts index 0aaf099472..726abbde49 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_product-types_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_product-types_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productType.retrieve("ptyp_123") + * .then(({ product_type }) => { + * console.log(product_type) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_product-variants.ts b/www/utils/generated/oas-output/operations/admin/get_admin_product-variants.ts index 5a1f0c5080..bd45917707 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_product-variants.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_product-variants.ts @@ -465,6 +465,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productVariant.list() + * .then(({ variants, count, limit, offset }) => { + * console.log(variants) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_products.ts b/www/utils/generated/oas-output/operations/admin/get_admin_products.ts index 57cb65ab8d..126769f1ca 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_products.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_products.ts @@ -990,6 +990,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.list() + * .then(({ products, count, limit, offset }) => { + * console.log(products) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_products_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_products_[id].ts index ce416df85e..5192cea5e7 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_products_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_products_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.retrieve("prod_123") + * .then(({ product }) => { + * console.log(product) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_options.ts b/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_options.ts index 19d8975933..b80c493994 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_options.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_options.ts @@ -113,6 +113,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.listOptions("prod_123") + * .then(({ product_options, count, limit, offset }) => { + * console.log(product_options) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_options_[option_id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_options_[option_id].ts index 155566c1a7..4defdcc87e 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_options_[option_id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_options_[option_id].ts @@ -35,6 +35,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.retrieveOption( + * "prod_123", + * "prodopt_123" + * ) + * .then(({ product_option }) => { + * console.log(product_option) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_variants.ts b/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_variants.ts index 7affead612..e5747beb26 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_variants.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_variants.ts @@ -472,6 +472,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.listVariants("prod_123") + * .then(({ variants, count, limit, offset }) => { + * console.log(variants) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_variants_[variant_id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_variants_[variant_id].ts index defc105315..ffffb54db5 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_variants_[variant_id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_products_[id]_variants_[variant_id].ts @@ -35,6 +35,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.retrieveVariant( + * "prod_123", + * "variant_123" + * ) + * .then(({ variant }) => { + * console.log(variant) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_promotions.ts b/www/utils/generated/oas-output/operations/admin/get_admin_promotions.ts index 59f23f57c9..3ade016505 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_promotions.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_promotions.ts @@ -475,11 +475,56 @@ * items: * type: object * title: $or + * - name: currency_code + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: currency_code + * description: Filter by a currency code. The promotions are filtered based on their application method's currency code. + * - type: array + * description: Filter by currency codes. The promotions are filtered based on their application method's currency code. + * items: + * type: string + * title: currency_code + * description: A currency code. + * - name: application_method_type + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: application_method_type + * description: Filter by an application method type. The promotions are filtered based on their application method's type. + * - type: array + * description: Filter by application method types. The promotions are filtered based on their application method's type. + * items: + * type: string + * title: application_method_type + * description: An application method type. * security: * - api_token: [] * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.promotion.list() + * .then(({ promotions, count, limit, offset }) => { + * console.log(promotions) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_[id].ts index cec96a3d21..cd89ff2ab4 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.promotion.retrieve("promo_123") + * .then(({ promotion }) => { + * console.log(promotion) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_[id]_[rule_type].ts b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_[id]_[rule_type].ts index 4d2476005e..ca99a3069d 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_[id]_[rule_type].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_[id]_[rule_type].ts @@ -43,6 +43,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.promotion.listRules("promo_123", "rules") + * .then(({ rules }) => { + * console.log(rules) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-attribute-options_[rule_type].ts b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-attribute-options_[rule_type].ts index d436ccec3c..0e50789276 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-attribute-options_[rule_type].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-attribute-options_[rule_type].ts @@ -50,6 +50,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.promotion.listRuleAttributes("rules", "standard") + * .then(({ attributes }) => { + * console.log(attributes) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-value-options_[rule_type]_[rule_attribute_id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-value-options_[rule_type]_[rule_attribute_id].ts index e4e3469d50..6dac6c2ee9 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-value-options_[rule_type]_[rule_attribute_id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-value-options_[rule_type]_[rule_attribute_id].ts @@ -79,6 +79,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.promotion.listRuleValues("rules", "attr_123") + * .then(({ values }) => { + * console.log(values) + * }) * - lang: Shell * label: cURL * source: |- @@ -92,16 +109,37 @@ * content: * application/json: * schema: - * type: object - * description: The list of rule values. - * required: - * - values - * properties: - * values: - * type: array + * allOf: + * - type: object + * description: The pagination fields. + * required: + * - limit + * - offset + * - count + * properties: + * limit: + * type: number + * title: limit + * description: The maximum number of items returned. + * offset: + * type: number + * title: offset + * description: The number of items skipped before retrieving the returned items. + * count: + * type: number + * title: count + * description: The total number of items. + * - type: object * description: The list of rule values. - * items: - * $ref: "#/components/schemas/AdminRuleValueOption" + * required: + * - values + * properties: + * values: + * type: array + * description: The list of rule values. + * items: + * $ref: "#/components/schemas/AdminRuleValueOption" + * description: The paginated list of rule values. * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_refund-reasons.ts b/www/utils/generated/oas-output/operations/admin/get_admin_refund-reasons.ts index a4b0837b95..7b3f3c9183 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_refund-reasons.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_refund-reasons.ts @@ -92,6 +92,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.refundReason.list() + * .then(({ refund_reasons, count, limit, offset }) => { + * console.log(refund_reasons) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_regions.ts b/www/utils/generated/oas-output/operations/admin/get_admin_regions.ts index 4aac12d5d6..08a4587335 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_regions.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_regions.ts @@ -475,6 +475,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.region.list() + * .then(({ regions, count, limit, offset }) => { + * console.log(regions) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_regions_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_regions_[id].ts index 827102b5c8..29e1ade644 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_regions_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_regions_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.region.retrieve("region_123") + * .then(({ region }) => { + * console.log(region) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_reservations.ts b/www/utils/generated/oas-output/operations/admin/get_admin_reservations.ts index ee9470dcdb..0028ddff2d 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_reservations.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_reservations.ts @@ -516,6 +516,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.reservation.list() + * .then(({ reservations, count, limit, offset }) => { + * console.log(reservations) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_reservations_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_reservations_[id].ts index 1676b6107c..3b9d12fb63 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_reservations_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_reservations_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.reservation.retrieve("res_123") + * .then(({ reservation }) => { + * console.log(reservation) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_return-reasons.ts b/www/utils/generated/oas-output/operations/admin/get_admin_return-reasons.ts index bf7c2bfbb7..a725bb5535 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_return-reasons.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_return-reasons.ts @@ -505,6 +505,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.returnReason.list() + * .then(({ return_reasons, count, limit, offset }) => { + * console.log(return_reasons) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_return-reasons_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_return-reasons_[id].ts index d3dfcf213f..42317af129 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_return-reasons_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_return-reasons_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.returnReason.retrieve("ret_123") + * .then(({ return_reason }) => { + * console.log(return_reason) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts b/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts index 13c2887b02..79e1f125c9 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts @@ -608,6 +608,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.list() + * .then(({ returns, count, limit, offset }) => { + * console.log(returns) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_returns_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_returns_[id].ts index c8ec7c0683..51e4500932 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_returns_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_returns_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.retrieve("return_123") + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_sales-channels.ts b/www/utils/generated/oas-output/operations/admin/get_admin_sales-channels.ts index d000f31424..e1aa2d48db 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_sales-channels.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_sales-channels.ts @@ -505,6 +505,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.salesChannel.list() + * .then(({ sales_channels, count, limit, offset }) => { + * console.log(sales_channels) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_sales-channels_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_sales-channels_[id].ts index cfdf05efa1..2075a6ef3d 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_sales-channels_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_sales-channels_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.salesChannel.retrieve("sc_123") + * .then(({ sales_channel }) => { + * console.log(sales_channel) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_shipping-options.ts b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-options.ts index 3d9b2e72de..93cb0fae96 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_shipping-options.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-options.ts @@ -515,6 +515,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.shippingOption.list() + * .then(({ shipping_options, count, limit, offset }) => { + * console.log(shipping_options) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_shipping-options_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-options_[id].ts index fdd96bfe9d..9e2acaae16 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_shipping-options_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-options_[id].ts @@ -30,6 +30,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.shippingOption.retrieve("so_123") + * .then(({ shipping_option }) => { + * console.log(shipping_option) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_shipping-profiles.ts b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-profiles.ts index f9f75b6d40..dd40d0e967 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_shipping-profiles.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-profiles.ts @@ -463,6 +463,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.shippingProfile.list() + * .then(({ shipping_profiles, count, limit, offset }) => { + * console.log(shipping_profiles) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_shipping-profiles_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-profiles_[id].ts index 9467a53fe7..b877d012e5 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_shipping-profiles_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-profiles_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.shippingProfile.retrieve("sp_123") + * .then(({ shipping_profile }) => { + * console.log(shipping_profile) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_stock-locations.ts b/www/utils/generated/oas-output/operations/admin/get_admin_stock-locations.ts index b0bbee6330..6c36aed778 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_stock-locations.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_stock-locations.ts @@ -489,6 +489,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.stockLocation.list() + * .then(({ stock_locations, count, limit, offset }) => { + * console.log(stock_locations) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_stock-locations_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_stock-locations_[id].ts index 9a0aec6cda..c16988f89b 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_stock-locations_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_stock-locations_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.stockLocation.retrieve("sloc_123") + * .then(({ stock_location }) => { + * console.log(stock_location) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_stores.ts b/www/utils/generated/oas-output/operations/admin/get_admin_stores.ts index 78301c6d4c..373e08f375 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_stores.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_stores.ts @@ -104,6 +104,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.store.list() + * .then(({ stores, count, limit, offset }) => { + * console.log(stores) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_stores_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_stores_[id].ts index f613f597ef..1c8cf0d845 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_stores_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_stores_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.store.retrieve("store_123") + * .then(({ store }) => { + * console.log(store) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_tax-rates.ts b/www/utils/generated/oas-output/operations/admin/get_admin_tax-rates.ts index 791497c3ed..9b68df6a67 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_tax-rates.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_tax-rates.ts @@ -533,6 +533,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.taxRate.list() + * .then(({ tax_rates, count, limit, offset }) => { + * console.log(tax_rates) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_tax-rates_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_tax-rates_[id].ts index 474a07a20f..cc61910ba5 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_tax-rates_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_tax-rates_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.taxRate.retrieve("txrat_123") + * .then(({ tax_rate }) => { + * console.log(tax_rate) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_tax-regions.ts b/www/utils/generated/oas-output/operations/admin/get_admin_tax-regions.ts index 655b1c2d2b..ba6a442904 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_tax-regions.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_tax-regions.ts @@ -986,6 +986,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.taxRegion.list() + * .then(({ tax_regions, count, limit, offset }) => { + * console.log(tax_regions) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_tax-regions_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_tax-regions_[id].ts index c97f86b545..cff7412ab7 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_tax-regions_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_tax-regions_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.taxRegion.retrieve("txreg_123") + * .then(({ tax_region }) => { + * console.log(tax_region) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_uploads_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_uploads_[id].ts index edc086d0f2..7caea79584 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_uploads_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_uploads_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.upload.retrieve("test.txt") + * .then(({ file }) => { + * console.log(file) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_users.ts b/www/utils/generated/oas-output/operations/admin/get_admin_users.ts index 5b8453a45f..643c6fae46 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_users.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_users.ts @@ -450,6 +450,23 @@ * title: $exists * description: Filter by whether a value for this parameter exists (not `null`). * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.user.list() + * .then(({ users, count, limit, offset }) => { + * console.log(users) + * }) * - lang: Shell * label: cURL * source: curl '{backend_url}/admin/users' diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_users_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_users_[id].ts index f106fa055d..aa194e0a27 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_users_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_users_[id].ts @@ -24,6 +24,23 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.user.retrieve("user_123") + * .then(({ user }) => { + * console.log(user) + * }) * - lang: Shell * label: cURL * source: curl '{backend_url}/admin/users/{id}' diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_users_me.ts b/www/utils/generated/oas-output/operations/admin/get_admin_users_me.ts index cbe5a6dcbf..e45bb40c76 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_users_me.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_users_me.ts @@ -18,6 +18,23 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.user.me() + * .then(({ user }) => { + * console.log(user) + * }) * - lang: Shell * label: cURL * source: curl '{backend_url}/admin/users/me' diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_workflows-executions.ts b/www/utils/generated/oas-output/operations/admin/get_admin_workflows-executions.ts index e720485bd3..381e81bcf8 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_workflows-executions.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_workflows-executions.ts @@ -78,6 +78,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.workflowExecution.list() + * .then(({ workflow_executions, count, limit, offset }) => { + * console.log(workflow_executions) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_workflows-executions_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_workflows-executions_[id].ts index da9b77f778..96c59e4823 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_workflows-executions_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_workflows-executions_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.workflowExecution.retrieve("wrk_123") + * .then(({ workflow_execution }) => { + * console.log(workflow_execution) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_api-keys.ts b/www/utils/generated/oas-output/operations/admin/post_admin_api-keys.ts index 632f9d72ec..7907dbc946 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_api-keys.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_api-keys.ts @@ -18,6 +18,26 @@ * schema: * $ref: "#/components/schemas/AdminCreateApiKey" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.apiKey.create({ + * title: "Development", + * type: "publishable" + * }) + * .then(({ api_key }) => { + * console.log(api_key) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id].ts index 560d43bdfa..0f9347a08d 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id].ts @@ -33,6 +33,25 @@ * schema: * $ref: "#/components/schemas/AdminUpdateApiKey" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.apiKey.update("apk_123", { + * title: "Development" + * }) + * .then(({ api_key }) => { + * console.log(api_key) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id]_revoke.ts b/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id]_revoke.ts index d2db89625b..85d9b91c0c 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id]_revoke.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id]_revoke.ts @@ -34,6 +34,23 @@ * schema: * $ref: "#/components/schemas/AdminRevokeApiKey" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.apiKey.revoke("apk_123") + * .then(({ api_key }) => { + * console.log(api_key) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id]_sales-channels.ts b/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id]_sales-channels.ts index cb517799e3..361816b9ed 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id]_sales-channels.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_api-keys_[id]_sales-channels.ts @@ -50,6 +50,26 @@ * title: remove * description: A sales channel's ID. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.apiKey.batchSalesChannels("apk_123", { + * add: ["sc_123"], + * remove: ["sc_321"] + * }) + * .then(({ api_key }) => { + * console.log(api_key) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_campaigns.ts b/www/utils/generated/oas-output/operations/admin/post_admin_campaigns.ts index 7336349321..1d2d854a48 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_campaigns.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_campaigns.ts @@ -104,6 +104,25 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The campaign's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.campaign.create({ + * name: "Summer Campaign" + * }) + * .then(({ campaign }) => { + * console.log(campaign) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_campaigns_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_campaigns_[id].ts index 2a8e39bf37..07c4a4b1cc 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_campaigns_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_campaigns_[id].ts @@ -92,6 +92,25 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The campaign's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.campaign.update("procamp_123", { + * name: "Summer Campaign" + * }) + * .then(({ campaign }) => { + * console.log(campaign) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_campaigns_[id]_promotions.ts b/www/utils/generated/oas-output/operations/admin/post_admin_campaigns_[id]_promotions.ts index 9a9c79368f..95e894e142 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_campaigns_[id]_promotions.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_campaigns_[id]_promotions.ts @@ -50,6 +50,26 @@ * title: remove * description: A promotion's ID. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.campaign.batchPromotions("procamp_123", { + * add: ["prom_123", "prom_456"], + * remove: ["prom_789"] + * }) + * .then(({ campaign }) => { + * console.log(campaign) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims.ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims.ts index 71cf8e323d..84ccf8db59 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims.ts @@ -27,6 +27,26 @@ * schema: * $ref: "#/components/schemas/AdminPostOrderClaimsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.create({ + * type: "refund", + * order_id: "order_123", + * }) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_cancel.ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_cancel.ts index 789d4bcae7..8fcf17900e 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_cancel.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_cancel.ts @@ -21,6 +21,23 @@ * schema: * $ref: "#/components/schemas/AdminPostCancelClaimReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.cancel("claim_123") + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_claim-items.ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_claim-items.ts index 4e84958e51..b6391f6b84 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_claim-items.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_claim-items.ts @@ -34,6 +34,30 @@ * schema: * $ref: "#/components/schemas/AdminPostClaimItemsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.addItems("claim_123", { + * items: [ + * { + * id: "orli_123", + * quantity: 1 + * } + * ] + * }) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_claim-items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_claim-items_[action_id].ts index 7994e58204..172a0b1b71 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_claim-items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_claim-items_[action_id].ts @@ -42,6 +42,29 @@ * schema: * $ref: "#/components/schemas/AdminPostClaimsItemsActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.updateItem( + * "claim_123", + * "ordchact_123", + * { + * quantity: 1 + * } + * ) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_items.ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_items.ts index 4766c649e9..4f529722a4 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_items.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_items.ts @@ -23,6 +23,33 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsRequestItemsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.addInboundItems( + * "claim_123", + * { + * items: [ + * { + * id: "orli_123", + * quantity: 1 + * } + * ] + * }, + * ) + * .then(({ return: returnData }) => { + * console.log(returnData) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_items_[action_id].ts index d39e7208cd..37a85835be 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_items_[action_id].ts @@ -31,6 +31,29 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsRequestItemsActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.updateInboundItem( + * "claim_123", + * "ordchact_123", + * { + * quantity: 1 + * }, + * ) + * .then(({ return: returnData }) => { + * console.log(returnData) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_shipping-method.ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_shipping-method.ts index 17ea6df137..4930925915 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_shipping-method.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_shipping-method.ts @@ -23,6 +23,29 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsShippingReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.addInboundShipping( + * "claim_123", + * { + * shipping_option_id: "so_123", + * custom_amount: 10 + * }, + * ) + * .then(({ return: returnData }) => { + * console.log(returnData) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_shipping-method_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_shipping-method_[action_id].ts index 8274a4f321..55c1014c8b 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_shipping-method_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_inbound_shipping-method_[action_id].ts @@ -43,6 +43,29 @@ * schema: * $ref: "#/components/schemas/AdminPostClaimsShippingActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.updateInboundShipping( + * "claim_123", + * "ordchact_123", + * { + * custom_amount: 10 + * }, + * ) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_items.ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_items.ts index f5a9c5c61c..2404c45c37 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_items.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_items.ts @@ -35,6 +35,31 @@ * schema: * $ref: "#/components/schemas/AdminPostClaimsAddItemsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.addOutboundItems( + * "claim_123", + * { + * items: [{ + * id: "orli_123", + * quantity: 1 + * }] + * }, + * ) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_items_[action_id].ts index accf9d712b..bab7b98fb9 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_items_[action_id].ts @@ -43,6 +43,29 @@ * schema: * $ref: "#/components/schemas/AdminPostClaimsItemsActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.updateOutboundItem( + * "claim_123", + * "ordchact_123", + * { + * quantity: 1 + * }, + * ) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_shipping-method.ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_shipping-method.ts index 934d1bb14b..fc924f6585 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_shipping-method.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_shipping-method.ts @@ -35,6 +35,29 @@ * schema: * $ref: "#/components/schemas/AdminPostClaimsShippingReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.addOutboundShipping( + * "claim_123", + * { + * shipping_option_id: "so_123", + * custom_amount: 10 + * }, + * ) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_shipping-method_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_shipping-method_[action_id].ts index 0cb477e90c..1fb2a334d8 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_shipping-method_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_outbound_shipping-method_[action_id].ts @@ -43,6 +43,29 @@ * schema: * $ref: "#/components/schemas/AdminPostClaimsShippingActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.updateOutboundShipping( + * "claim_123", + * "ordchact_123", + * { + * custom_amount: 10 + * }, + * ) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_request.ts b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_request.ts index cfab4597cf..b37e776a13 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_request.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_claims_[id]_request.ts @@ -29,6 +29,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.claim.request( + * "claim_123", + * {}, + * ) + * .then(({ claim }) => { + * console.log(claim) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_collections.ts b/www/utils/generated/oas-output/operations/admin/post_admin_collections.ts index d51ca82cdd..38b0967a70 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_collections.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_collections.ts @@ -27,6 +27,25 @@ * schema: * $ref: "#/components/schemas/AdminCreateCollection" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCollection.create({ + * title: "Summer Collection" + * }) + * .then(({ collection }) => { + * console.log(collection) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_collections_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_collections_[id].ts index 3335187bb1..7a11fc59b4 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_collections_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_collections_[id].ts @@ -33,6 +33,25 @@ * schema: * $ref: "#/components/schemas/AdminUpdateCollection" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCollection.update("pcol_123", { + * title: "Summer Collection" + * }) + * .then(({ collection }) => { + * console.log(collection) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_collections_[id]_products.ts b/www/utils/generated/oas-output/operations/admin/post_admin_collections_[id]_products.ts index 99647c7095..09597d9ded 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_collections_[id]_products.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_collections_[id]_products.ts @@ -50,6 +50,26 @@ * title: remove * description: A product's ID. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCollection.updateProducts("pcol_123", { + * add: ["prod_123"], + * remove: ["prod_321"] + * }) + * .then(({ collection }) => { + * console.log(collection) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups.ts b/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups.ts index 5dd77b277c..7a96624a22 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups.ts @@ -27,6 +27,25 @@ * schema: * $ref: "#/components/schemas/AdminCreateCustomerGroup" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customerGroup.create({ + * name: "VIP" + * }) + * .then(({ customer_group }) => { + * console.log(customer_group) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups_[id].ts index 024f294894..da883ff5aa 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups_[id].ts @@ -33,6 +33,25 @@ * schema: * $ref: "#/components/schemas/AdminUpdateCustomerGroup" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customerGroup.update("cusgroup_123", { + * name: "VIP" + * }) + * .then(({ customer_group }) => { + * console.log(customer_group) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups_[id]_customers.ts b/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups_[id]_customers.ts index d5fe6af533..e69700c66f 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups_[id]_customers.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_customer-groups_[id]_customers.ts @@ -50,6 +50,26 @@ * title: remove * description: A customer's ID. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customerGroup.batchCustomers("cusgroup_123", { + * add: ["cus_123"], + * remove: ["cus_321"] + * }) + * .then(({ customer_group }) => { + * console.log(customer_group) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_customers.ts b/www/utils/generated/oas-output/operations/admin/post_admin_customers.ts index 0ceddd0ffa..46d5b63ca0 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_customers.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_customers.ts @@ -68,6 +68,25 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The customer's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customer.create({ + * email: "customer@gmail.com" + * }) + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id].ts index 3782cc7789..0ac13be923 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id].ts @@ -74,6 +74,25 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The customer's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customer.update("cus_123", { + * first_name: "John" + * }) + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_addresses.ts b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_addresses.ts index ce210fc49a..04456ad82a 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_addresses.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_addresses.ts @@ -112,6 +112,28 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The address's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customer.createAddress("cus_123", { + * address_1: "123 Main St", + * city: "Anytown", + * country_code: "US", + * postal_code: "12345" + * }) + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_addresses_[address_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_addresses_[address_id].ts index a594f168d4..8ae2fe3385 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_addresses_[address_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_addresses_[address_id].ts @@ -118,6 +118,28 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The address's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customer.updateAddress("cus_123", "cus_addr_123", { + * address_1: "123 Main St", + * city: "Anytown", + * country_code: "US", + * postal_code: "12345" + * }) + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts index b824a2eaca..55c9f88d09 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts @@ -52,6 +52,26 @@ * title: remove * description: The ID of the group to remove the customer from. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.customer.batchCustomerGroups("cus_123", { + * add: ["cusgroup_123"], + * remove: ["cusgroup_321"] + * }) + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders.ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders.ts index da8abdbc09..d0b3eec617 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders.ts @@ -314,6 +314,33 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The draft order's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.create({ + * email: "test@test.com", + * items: [ + * { + * variant_id: "variant_123", + * quantity: 1, + * }, + * ], + * region_id: "region_123", + * sales_channel_id: "sc_123", + * }) + * .then(({ draft_order }) => { + * console.log(draft_order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id].ts index 8f61d1146d..ca28b2d3da 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id].ts @@ -35,6 +35,25 @@ * schema: * $ref: "#/components/schemas/AdminUpdateDraftOrder" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.update("order_123", { + * email: "test@test.com", + * }) + * .then(({ draft_order }) => { + * console.log(draft_order) + * }) * - lang: Shell * label: cURL * source: |- @@ -61,7 +80,7 @@ * $ref: "#/components/responses/invalid_request_error" * "500": * $ref: "#/components/responses/500_error" - * x-workflow: updateOrderWorkflow + * x-workflow: updateDraftOrderWorkflow * */ diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_convert-to-order.ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_convert-to-order.ts new file mode 100644 index 0000000000..77da39e592 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_convert-to-order.ts @@ -0,0 +1,79 @@ +/** + * @oas [post] /admin/draft-orders/{id}/convert-to-order + * operationId: PostDraftOrdersIdConvertToOrder + * summary: Convert a Draft Order to an Order + * x-sidebar-summary: Convert to Order + * description: Convert a draft order to an order. This will finalize the draft order and create a new order with the same details. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * description: |- + * Comma-separated fields that should be included in the returned data. + * if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + * without prefix it will replace the entire default fields. + * required: false + * schema: + * type: string + * title: fields + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * externalDocs: + * url: "#select-fields-and-relations" + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * To convert a draft order to an order: + * + * ```ts + * sdk.admin.draftOrder.convertToOrder("order_123") + * .then(({ order }) => { + * console.log(order) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/draft-orders/{id}/convert-to-order' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: convertDraftOrderWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit.ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit.ts new file mode 100644 index 0000000000..38a55a7c1e --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit.ts @@ -0,0 +1,62 @@ +/** + * @oas [post] /admin/draft-orders/{id}/edit + * operationId: PostDraftOrdersIdEdit + * summary: Create a Draft Order Edit + * x-sidebar-summary: Create Edit + * description: Create an edit on a draft order. This will allow you to make changes to the draft order's items, shipping methods, or promotions before confirming them later. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.beginEdit("order_123") + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/draft-orders/{id}/edit' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: beginDraftOrderEditWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_confirm.ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_confirm.ts new file mode 100644 index 0000000000..f20c245efa --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_confirm.ts @@ -0,0 +1,62 @@ +/** + * @oas [post] /admin/draft-orders/{id}/edit/confirm + * operationId: PostDraftOrdersIdEditConfirm + * summary: Confirm an Edit on a Draft Order + * x-sidebar-summary: Confirm Edit + * description: Confirm an edit on a draft order. This will apply the changes made to the draft order. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.confirmEdit("order_123") + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/confirm' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: confirmDraftOrderEditWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items.ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items.ts new file mode 100644 index 0000000000..f55bb8f349 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items.ts @@ -0,0 +1,74 @@ +/** + * @oas [post] /admin/draft-orders/{id}/edit/items + * operationId: PostDraftOrdersIdEditItems + * summary: Add Item to Draft Order + * x-sidebar-summary: Add Item + * description: Add an Item to a draft order. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminAddDraftOrderItems" + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.addItems("order_123", { + * items: [ + * { + * variant_id: "variant_123", + * quantity: 1, + * }, + * ], + * }) + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/items' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: addDraftOrderItemsWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items_[action_id].ts new file mode 100644 index 0000000000..c16ee8fc9f --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items_[action_id].ts @@ -0,0 +1,82 @@ +/** + * @oas [post] /admin/draft-orders/{id}/edit/items/{action_id} + * operationId: PostDraftOrdersIdEditItemsAction_id + * summary: Update Item Changes in Draft Order + * x-sidebar-summary: Update Item Changes + * description: | + * Update changes made on an item (addition or update) in the draft order by the ID of the item's `ITEM_ADD` or `ITEM_UPDATE` action. + * + * Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * - name: action_id + * in: path + * description: The ID of the item's `ITEM_ADD` or `ITEM_UPDATE` action. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminUpdateDraftOrderItem" + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.updateActionItem("order_123", "action_123", { + * quantity: 2, + * }) + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/items/{action_id}' \ + * -H 'Authorization: Bearer {access_token}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "quantity": 39 + * }' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: updateDraftOrderActionItemWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items_item_[item_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items_item_[item_id].ts new file mode 100644 index 0000000000..bdfa26dc53 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_items_item_[item_id].ts @@ -0,0 +1,79 @@ +/** + * @oas [post] /admin/draft-orders/{id}/edit/items/item/{item_id} + * operationId: PostDraftOrdersIdEditItemsItemItem_id + * summary: Update Item in Draft Order + * x-sidebar-summary: Update Item + * description: Update an item in a draft order. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * - name: item_id + * in: path + * description: The item's ID. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminUpdateDraftOrderItem" + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.updateItem("order_123", "item_123", { + * quantity: 2, + * }) + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/items/item/{item_id}' \ + * -H 'Authorization: Bearer {access_token}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "quantity": 0 + * }' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: updateDraftOrderItemWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_promotions.ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_promotions.ts new file mode 100644 index 0000000000..d15a0ae405 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_promotions.ts @@ -0,0 +1,79 @@ +/** + * @oas [post] /admin/draft-orders/{id}/edit/promotions + * operationId: PostDraftOrdersIdEditPromotions + * summary: Add Promotions to Draft Order + * x-sidebar-summary: Add Promotions + * description: Add promotions to a draft order. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminAddDraftOrderPromotions" + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.addPromotions("order_123", { + * promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"], + * }) + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/promotions' \ + * -H 'Authorization: Bearer {access_token}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "promo_codes": [ + * "{value}" + * ] + * }' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminDraftOrderPreviewResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: addDraftOrderPromotionWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_request.ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_request.ts new file mode 100644 index 0000000000..196f8eeef1 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_request.ts @@ -0,0 +1,62 @@ +/** + * @oas [post] /admin/draft-orders/{id}/edit/request + * operationId: PostDraftOrdersIdEditRequest + * summary: Request Edit on Draft Order + * x-sidebar-summary: Request Edit + * description: Change the status of a draft order's edit to be requested. Later, the edit can be confirmed or canceled. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.requestEdit("order_123") + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/request' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: requestDraftOrderEditWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods.ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods.ts new file mode 100644 index 0000000000..b76b472e3a --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods.ts @@ -0,0 +1,73 @@ +/** + * @oas [post] /admin/draft-orders/{id}/edit/shipping-methods + * operationId: PostDraftOrdersIdEditShippingMethods + * summary: Add Shipping Method to Draft Order + * x-sidebar-summary: Add Shipping Method + * description: Add a shipping method to a draft order. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminAddDraftOrderShippingMethod" + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.addShippingMethod("order_123", { + * shipping_option_id: "shipping_option_123", + * }) + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods' \ + * -H 'Authorization: Bearer {access_token}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "shipping_option_id": "{value}" + * }' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: addDraftOrderShippingMethodsWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods_[action_id].ts new file mode 100644 index 0000000000..e077847272 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods_[action_id].ts @@ -0,0 +1,82 @@ +/** + * @oas [post] /admin/draft-orders/{id}/edit/shipping-methods/{action_id} + * operationId: PostDraftOrdersIdEditShippingMethodsAction_id + * summary: Update Shipping Method Changes in Draft Order + * x-sidebar-summary: Update Shipping Method Changes + * description: | + * Update changes made on a shipping method (addition or update) in a draft order using the `ID` of the method's `SHIPPING_ADD` or `SHIPPING_UPDATE` action. + * + * Every shipping method has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * - name: action_id + * in: path + * description: The ID of the shipping method's `SHIPPING_ADD` or `SHIPPING_UPDATE` action. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminUpdateDraftOrderActionShippingMethod" + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.updateShippingMethod("order_123", "action_123", { + * shipping_option_id: "shipping_option_123", + * }) + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods/{action_id}' \ + * -H 'Authorization: Bearer {access_token}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "shipping_option_id": "{value}" + * }' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: updateDraftOrderActionShippingMethodWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods_method_[method_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods_method_[method_id].ts new file mode 100644 index 0000000000..061f36a922 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders_[id]_edit_shipping-methods_method_[method_id].ts @@ -0,0 +1,75 @@ +/** + * @oas [post] /admin/draft-orders/{id}/edit/shipping-methods/method/{method_id} + * operationId: PostDraftOrdersIdEditShippingMethodsMethodMethod_id + * summary: Update Shipping Method in Draft Order + * x-sidebar-summary: Update Shipping Method + * description: Update a shipping method in a draft order + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The draft order's ID. + * required: true + * schema: + * type: string + * - name: method_id + * in: path + * description: The ID of the shipping method. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminUpdateDraftOrderShippingMethod" + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.draftOrder.updateShippingMethod("order_123", "sm_123", { + * shipping_option_id: "so_123", + * }) + * .then(({ draft_order_preview }) => { + * console.log(draft_order_preview) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods/method/{method_id}' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Draft Orders + * responses: + * "200": + * description: OK + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: updateDraftOrderShippingMethodWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges.ts b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges.ts index fa47fba5c3..b628d2644b 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges.ts @@ -27,6 +27,25 @@ * schema: * $ref: "#/components/schemas/AdminPostOrderExchangesReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.create({ + * order_id: "order_123" + * }) + * .then(({ exchange }) => { + * console.log(exchange) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_cancel.ts b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_cancel.ts index 7ce2c03d52..d586f3ef8d 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_cancel.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_cancel.ts @@ -21,6 +21,23 @@ * schema: * $ref: "#/components/schemas/AdminPostCancelExchangeReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.cancel("exchange_123") + * .then(({ exchange }) => { + * console.log(exchange) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_items.ts b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_items.ts index c8e7175fea..81e8e24aca 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_items.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_items.ts @@ -22,6 +22,28 @@ * schema: * $ref: "#/components/schemas/AdminPostExchangesReturnRequestItemsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.addInboundItems("exchange_123", { + * items: [{ + * id: "orli_123", + * quantity: 1 + * }] + * }) + * .then(({ return: returnData }) => { + * console.log(returnData) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_items_[action_id].ts index 0d2a926f73..3ed653db39 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_items_[action_id].ts @@ -31,6 +31,29 @@ * schema: * $ref: "#/components/schemas/AdminPostExchangesRequestItemsReturnActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.updateInboundItem( + * "exchange_123", + * "ordchact_123", + * { + * quantity: 1 + * } + * ) + * .then(({ return: returnData }) => { + * console.log(returnData) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_shipping-method.ts b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_shipping-method.ts index 31091a1813..3c2fb5f0d4 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_shipping-method.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_shipping-method.ts @@ -22,6 +22,25 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsShippingReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.addInboundShipping("exchange_123", { + * shipping_option_id: "so_123" + * }) + * .then(({ return: returnData }) => { + * console.log(returnData) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_shipping-method_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_shipping-method_[action_id].ts index e726e6d0e8..22e358c50d 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_shipping-method_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_inbound_shipping-method_[action_id].ts @@ -43,6 +43,29 @@ * schema: * $ref: "#/components/schemas/AdminPostExchangesShippingActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.updateInboundShipping( + * "exchange_123", + * "ordchact_123", + * { + * custom_amount: 10 + * } + * ) + * .then(({ return: returnData }) => { + * console.log(returnData) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_items.ts b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_items.ts index 31db3bc407..c6edaf3891 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_items.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_items.ts @@ -33,6 +33,28 @@ * schema: * $ref: "#/components/schemas/AdminPostExchangesAddItemsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.addOutboundItems("exchange_123", { + * items: [{ + * id: "variant_123", + * quantity: 1 + * }] + * }) + * .then(({ exchange }) => { + * console.log(exchange) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_items_[action_id].ts index 0a53dd8b28..45b9975f01 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_items_[action_id].ts @@ -43,6 +43,29 @@ * schema: * $ref: "#/components/schemas/AdminPostExchangesItemsActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.updateOutboundItem( + * "exchange_123", + * "ordchact_123", + * { + * quantity: 1 + * } + * ) + * .then(({ exchange }) => { + * console.log(exchange) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_shipping-method.ts b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_shipping-method.ts index 607b291136..0be11a5090 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_shipping-method.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_shipping-method.ts @@ -34,6 +34,25 @@ * schema: * $ref: "#/components/schemas/AdminPostExchangesShippingReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.addOutboundShipping("exchange_123", { + * shipping_option_id: "so_123" + * }) + * .then(({ exchange }) => { + * console.log(exchange) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_shipping-method_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_shipping-method_[action_id].ts index e838806ce2..2da4b5e600 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_shipping-method_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_outbound_shipping-method_[action_id].ts @@ -43,6 +43,29 @@ * schema: * $ref: "#/components/schemas/AdminPostExchangesShippingActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.updateOutboundShipping( + * "exchange_123", + * "ordchact_123", + * { + * custom_amount: 10 + * } + * ) + * .then(({ exchange }) => { + * console.log(exchange) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_request.ts b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_request.ts index 66db07460c..7a083038d9 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_request.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_exchanges_[id]_request.ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.exchange.request("exchange_123", {}) + * .then(({ exchange }) => { + * console.log(exchange) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones.ts b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones.ts index 5c483a2148..a09b11cd1c 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones.ts @@ -152,6 +152,29 @@ * type: object * description: The geo zone's postal expression or ZIP code. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.fulfillmentSet.createServiceZone("fset_123", { + * name: "Europe Service Zone", + * geo_zones: [{ + * type: "country", + * country_code: "us" + * }] + * }) + * .then(({ fulfillment_set }) => { + * console.log(fulfillment_set) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts index 240e328cb3..331af09f79 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillment-sets_[id]_service-zones_[zone_id].ts @@ -172,6 +172,29 @@ * title: id * description: The ID of an existing geo zone. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.fulfillmentSet.updateServiceZone( + * "fset_123", + * "serzo_123", + * { + * name: "Europe Service Zone", + * } + * ) + * .then(({ fulfillment_set }) => { + * console.log(fulfillment_set) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments.ts b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments.ts index bbbcee47cb..67c84c69fc 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments.ts @@ -27,6 +27,40 @@ * schema: * $ref: "#/components/schemas/AdminCreateFulfillment" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.fulfillment.create({ + * location_id: "sloc_123", + * provider_id: "my_fulfillment", + * delivery_address: { + * country_code: "us" + * }, + * items: [ + * { + * title: "Shirt", + * sku: "SHIRT", + * quantity: 1, + * barcode: "123" + * } + * ], + * labels: [], + * order: {}, + * order_id: "order_123" + * }) + * .then(({ fulfillment }) => { + * console.log(fulfillment) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments_[id]_cancel.ts b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments_[id]_cancel.ts index 59e1f28658..018d663fa5 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments_[id]_cancel.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments_[id]_cancel.ts @@ -31,6 +31,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.fulfillment.cancel("ful_123") + * .then(({ fulfillment }) => { + * console.log(fulfillment) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments_[id]_shipment.ts b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments_[id]_shipment.ts index 7c2e718118..ce74a48287 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments_[id]_shipment.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_fulfillments_[id]_shipment.ts @@ -34,6 +34,31 @@ * schema: * $ref: "#/components/schemas/AdminCreateShipment" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.fulfillment.createShipment("ful_123", { + * labels: [ + * { + * tracking_number: "123", + * tracking_url: "example.com", + * label_url: "example.com" + * } + * ] + * }) + * .then(({ fulfillment }) => { + * console.log(fulfillment) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items.ts b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items.ts index b44e4231cc..abdca1bedb 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items.ts @@ -27,6 +27,25 @@ * schema: * $ref: "#/components/schemas/AdminCreateInventoryItem" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.inventoryItem.create({ + * sku: "SHIRT" + * }) + * .then(({ inventory_item }) => { + * console.log(inventory_item) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id].ts index 2eec3d5cc4..0dfa3b0aae 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id].ts @@ -90,6 +90,25 @@ * type: object * description: The inventory item's metadata. Can be custom data in key-value pairs. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.inventoryItem.update("iitem_123", { + * sku: "SHIRT" + * }) + * .then(({ inventory_item }) => { + * console.log(inventory_item) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_[location_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_[location_id].ts index 36b60e4d20..8a325bac89 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_[location_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_[location_id].ts @@ -50,6 +50,29 @@ * title: incoming_quantity * description: The inventory level's incoming quantity. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.inventoryItem.updateLevel( + * "iitem_123", + * "sloc_123", + * { + * stocked_quantity: 10 + * } + * ) + * .then(({ inventory_item }) => { + * console.log(inventory_item) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_batch.ts b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_batch.ts index 85c47d3cb5..e9c12ae38f 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_batch.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_[id]_location-levels_batch.ts @@ -22,6 +22,29 @@ * schema: * $ref: "#/components/schemas/AdminBatchInventoryItemLocationsLevel" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.inventoryItem.batchInventoryItemLocationLevels("iitem_123", { + * create: [{ + * location_id: "sloc_123", + * stocked_quantity: 10 + * }], + * delete: ["ilvl_123"] + * }) + * .then(({ created, updated, deleted }) => { + * console.log(created, updated, deleted) + * }) * - lang: Shell * label: cURL * source: |- @@ -30,6 +53,8 @@ * tags: * - Inventory Items * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_location-levels_batch.ts b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_location-levels_batch.ts index 0dbd7d7948..a3b1f98e3c 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_location-levels_batch.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_inventory-items_location-levels_batch.ts @@ -14,6 +14,30 @@ * schema: * $ref: "#/components/schemas/AdminBatchInventoryItemsLocationLevels" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.inventoryItem.batchInventoryItemsLocationLevels({ + * create: [{ + * inventory_item_id: "iitem_123", + * location_id: "sloc_123", + * stocked_quantity: 10 + * }], + * delete: ["ilvl_123"] + * }) + * .then(({ created, updated, deleted }) => { + * console.log(created, updated, deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_invites.ts b/www/utils/generated/oas-output/operations/admin/post_admin_invites.ts index d818193ad4..bb1539d93f 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_invites.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_invites.ts @@ -35,6 +35,25 @@ * type: object * description: The invite's metadata. Can be custom data in key-value pairs. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.invite.create({ + * email: "user@gmail.com", + * }) + * .then(({ invite }) => { + * console.log(invite) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_invites_[id]_resend.ts b/www/utils/generated/oas-output/operations/admin/post_admin_invites_[id]_resend.ts index 0b1fb6d106..c4939a3685 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_invites_[id]_resend.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_invites_[id]_resend.ts @@ -24,6 +24,23 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.invite.resend("invite_123") + * .then(({ invite }) => { + * console.log(invite) + * }) * - lang: Shell * label: cURL * source: curl -X POST '{backend_url}/admin/invites/{id}/resend' diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_invites_accept.ts b/www/utils/generated/oas-output/operations/admin/post_admin_invites_accept.ts index 7c1e389b2a..93d68d5496 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_invites_accept.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_invites_accept.ts @@ -28,6 +28,33 @@ * title: last_name * description: The user's last name. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * await sdk.auth.register("user", "emailpass", { + * email: "user@gmail.com", + * password: "supersecret" + * }) + * + * // all subsequent requests will use the token in the header + * const { user } = await sdk.admin.invite.accept( + * { + * email: "user@gmail.com", + * first_name: "John", + * last_name: "Smith", + * invite_token: "12345..." + * }, + * ) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits.ts b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits.ts index bdd711816a..844ce8c004 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits.ts @@ -14,6 +14,25 @@ * schema: * $ref: "#/components/schemas/AdminPostOrderEditsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.orderEdit.initiateRequest({ + * order_id: "order_123" + * }) + * .then(({ order_change }) => { + * console.log(order_change) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_confirm.ts b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_confirm.ts index d1d3ab7d44..4f05531f18 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_confirm.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_confirm.ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.orderEdit.confirm("ordch_123") + * .then(({ order_preview }) => { + * console.log(order_preview) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items.ts b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items.ts index 3e6b2834ae..8a382431d8 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items.ts @@ -22,6 +22,30 @@ * schema: * $ref: "#/components/schemas/AdminPostOrderEditsAddItemsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.orderEdit.addItems("ordch_123", { + * items: [ + * { + * variant_id: "variant_123", + * quantity: 1 + * } + * ] + * }) + * .then(({ order_preview }) => { + * console.log(order_preview) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_[action_id].ts index 91fac6366e..e5ca36ffb8 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_[action_id].ts @@ -31,6 +31,29 @@ * schema: * $ref: "#/components/schemas/AdminPostOrderEditsItemsActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.orderEdit.updateAddedItem( + * "ordch_123", + * "orli_123", + * { + * quantity: 1 + * } + * ) + * .then(({ order_preview }) => { + * console.log(order_preview) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_item_[item_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_item_[item_id].ts index b4464c331b..50da738012 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_item_[item_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_items_item_[item_id].ts @@ -28,6 +28,29 @@ * schema: * $ref: "#/components/schemas/AdminPostOrderEditsUpdateItemQuantityReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.orderEdit.updateOriginalItem( + * "ordch_123", + * "orli_123", + * { + * quantity: 1 + * } + * ) + * .then(({ order_preview }) => { + * console.log(order_preview) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_request.ts b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_request.ts index 7eb82563f7..6838cea330 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_request.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_order-edits_[id]_request.ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.orderEdit.request("ordch_123") + * .then(({ order_preview }) => { + * console.log(order_preview) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id].ts index 5fdfaf5651..c3f73533d9 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id].ts @@ -35,6 +35,33 @@ * schema: * $ref: "#/components/schemas/AdminUpdateOrder" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.update( + * "order_123", + * { + * email: "new_email@example.com", + * shipping_address: { + * first_name: "John", + * last_name: "Doe", + * address_1: "123 Main St", + * } + * } + * ) + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_cancel.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_cancel.ts index 9d13689416..40b3c57e40 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_cancel.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_cancel.ts @@ -36,6 +36,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.cancel("order_123") + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_credit-lines.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_credit-lines.ts new file mode 100644 index 0000000000..ba6da0228d --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_credit-lines.ts @@ -0,0 +1,98 @@ +/** + * @oas [post] /admin/orders/{id}/credit-lines + * operationId: PostOrdersIdCreditLines + * summary: Create Credit Line for Order + * x-sidebar-summary: Create Credit Line + * description: Create a credit line for an order. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The order's ID. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * description: |- + * Comma-separated fields that should be included in the returned data. + * if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + * without prefix it will replace the entire default fields. + * required: false + * schema: + * type: string + * title: fields + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * externalDocs: + * url: "#select-fields-and-relations" + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminCreateOrderCreditLines" + * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.createCreditLine( + * "order_123", + * { + * amount: 100, + * reference: "order", + * reference_id: "order_123", + * } + * ) + * .then(({ order }) => { + * console.log(order) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/orders/{id}/credit-lines' \ + * -H 'Authorization: Bearer {access_token}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "amount": 32, + * "reference": "{value}", + * "reference_id": "{value}" + * }' + * tags: + * - Orders + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminOrderResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: createOrderCreditLinesWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments.ts index 50a4c6ef7e..6f4013d015 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments.ts @@ -77,6 +77,30 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The fulfillment's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.createFulfillment("order_123", { + * items: [ + * { + * id: "orli_123", + * quantity: 1 + * } + * ] + * }) + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_cancel.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_cancel.ts index 7e8067ea30..51a64dc457 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_cancel.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_cancel.ts @@ -53,6 +53,29 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The cancelation details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.cancelFulfillment( + * "order_123", + * "ful_123", + * { + * no_notification: false + * } + * ) + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_mark-as-delivered.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_mark-as-delivered.ts index 0652b79a94..d3940ec4ec 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_mark-as-delivered.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_mark-as-delivered.ts @@ -35,6 +35,26 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.markAsDelivered( + * "order_123", + * "ful_123", + * ) + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_shipments.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_shipments.ts index 3577cf3d97..b8c7eef293 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_shipments.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_fulfillments_[fulfillment_id]_shipments.ts @@ -101,6 +101,34 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The shipment's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.createShipment( + * "order_123", + * "ful_123", + * { + * items: [ + * { + * id: "fulit_123", + * quantity: 1 + * } + * ] + * } + * ) + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer.ts index 5c4cec62fc..31326e1561 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer.ts @@ -37,6 +37,26 @@ * schema: * $ref: "#/components/schemas/AdminTransferOrder" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.requestTransfer("order_123", { + * customer_id: "cus_123", + * internal_note: "Internal note", + * }) + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer_cancel.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer_cancel.ts index 11b0a9c561..4797cbe0ab 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer_cancel.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer_cancel.ts @@ -31,6 +31,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.order.cancelTransfer("order_123") + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections.ts b/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections.ts index 358369fe97..80b1bbf8c0 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections.ts @@ -40,6 +40,25 @@ * title: amount * description: The amount to be paid. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.paymentCollection.create({ + * order_id: "order_123" + * }) + * .then(({ payment_collection }) => { + * console.log(payment_collection) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections_[id]_mark-as-paid.ts b/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections_[id]_mark-as-paid.ts index 40942a21cb..ff48f77386 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections_[id]_mark-as-paid.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_payment-collections_[id]_mark-as-paid.ts @@ -42,6 +42,25 @@ * title: order_id * description: The ID of the order associated with the payment collection. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.paymentCollection.markAsPaid("paycol_123", { + * order_id: "order_123" + * }) + * .then(({ payment_collection }) => { + * console.log(payment_collection) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_capture.ts b/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_capture.ts index a9cb527806..f0f7873651 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_capture.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_capture.ts @@ -39,6 +39,23 @@ * title: amount * description: The amount to capture. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.payment.capture("paycol_123", {}) + * .then(({ payment }) => { + * console.log(payment) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_refund.ts b/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_refund.ts index abcd978b4a..9f3011f8c1 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_refund.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_payments_[id]_refund.ts @@ -47,6 +47,23 @@ * title: note * description: A note to attach to the refund. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.payment.refund("paycol_123", {}) + * .then(({ payment }) => { + * console.log(payment) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_price-lists.ts b/www/utils/generated/oas-output/operations/admin/post_admin_price-lists.ts index 0941876393..33d606e97e 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_price-lists.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_price-lists.ts @@ -27,6 +27,37 @@ * schema: * $ref: "#/components/schemas/AdminCreatePriceList" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.priceList.create({ + * title: "My Price List", + * status: "active", + * type: "sale", + * prices: [ + * { + * variant_id: "variant_123", + * amount: 10, + * currency_code: "usd", + * rules: { + * region_id: "reg_123" + * } + * } + * ] + * }) + * .then(({ price_list }) => { + * console.log(price_list) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id].ts index 5553ad2d2a..74dab74c52 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id].ts @@ -33,6 +33,25 @@ * schema: * $ref: "#/components/schemas/AdminUpdatePriceList" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.priceList.update("plist_123", { + * title: "My Price List", + * }) + * .then(({ price_list }) => { + * console.log(price_list) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id]_prices_batch.ts b/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id]_prices_batch.ts index 26cc844134..de070668af 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id]_prices_batch.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id]_prices_batch.ts @@ -106,6 +106,38 @@ * title: delete * description: A price's ID. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.priceList.batchPrices("plist_123", { + * create: [{ + * variant_id: "variant_123", + * currency_code: "usd", + * amount: 10, + * rules: { + * region_id: "reg_123" + * } + * }], + * update: [{ + * id: "price_123", + * variant_id: "variant_123", + * amount: 20, + * }], + * delete: ["price_123"] + * }) + * .then(({ created, updated, deleted }) => { + * console.log(created, updated, deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id]_products.ts b/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id]_products.ts index 261d31b999..92f1b4a2fb 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id]_products.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_price-lists_[id]_products.ts @@ -33,6 +33,25 @@ * schema: * $ref: "#/components/schemas/AdminLinkPriceListProducts" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.priceList.linkProducts("plist_123", { + * remove: ["prod_123"] + * }) + * .then(({ price_list }) => { + * console.log(price_list) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_price-preferences.ts b/www/utils/generated/oas-output/operations/admin/post_admin_price-preferences.ts index 1bf166c394..0c17b781f2 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_price-preferences.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_price-preferences.ts @@ -27,6 +27,27 @@ * schema: * $ref: "#/components/schemas/AdminCreatePricePreference" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.pricePreference.create({ + * attribute: "region_id", + * value: "region_123", + * is_tax_inclusive: true + * }) + * .then(({ price_preference }) => { + * console.log(price_preference) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_price-preferences_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_price-preferences_[id].ts index 7b9407de80..fc240aa8e2 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_price-preferences_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_price-preferences_[id].ts @@ -33,6 +33,25 @@ * schema: * $ref: "#/components/schemas/AdminUpdatePricePreference" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.pricePreference.update("prpref_123", { + * is_tax_inclusive: true + * }) + * .then(({ price_preference }) => { + * console.log(price_preference) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories.ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories.ts index e7283bce9f..0a839fbc58 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories.ts @@ -27,6 +27,25 @@ * schema: * $ref: "#/components/schemas/AdminCreateProductCategory" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCategory.create({ + * name: "Shirts" + * }) + * .then(({ product_category }) => { + * console.log(product_category) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts index 5f6812aaab..f60df8c6c3 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts @@ -66,6 +66,25 @@ * title: rank * description: The product category's rank among other categories. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCategory.update("pcat_123", { + * name: "Shirts" + * }) + * .then(({ product_category }) => { + * console.log(product_category) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id]_products.ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id]_products.ts index 71b819f272..7a6f1b2c77 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id]_products.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id]_products.ts @@ -50,6 +50,26 @@ * title: remove * description: A product ID. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productCategory.updateProducts("pcat_123", { + * add: ["prod_123"], + * remove: ["prod_321"] + * }) + * .then(({ product_category }) => { + * console.log(product_category) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-tags.ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-tags.ts index 54908f1d76..32f1b91d5b 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-tags.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-tags.ts @@ -27,6 +27,25 @@ * schema: * $ref: "#/components/schemas/AdminCreateProductTag" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productTag.create({ + * value: "shirt" + * }) + * .then(({ product_tag }) => { + * console.log(product_tag) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-tags_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-tags_[id].ts index eeeba17748..6d34225d3f 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-tags_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-tags_[id].ts @@ -42,6 +42,25 @@ * type: object * description: The product tag's metadata. Can hold custom key-value pairs. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productTag.update("ptag_123", { + * value: "shirt" + * }) + * .then(({ product_tag }) => { + * console.log(product_tag) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-types.ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-types.ts index a2f4efc205..a443a42ca9 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-types.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-types.ts @@ -27,6 +27,25 @@ * schema: * $ref: "#/components/schemas/AdminCreateProductType" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productType.create({ + * value: "Clothes" + * }) + * .then(({ product_type }) => { + * console.log(product_type) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-types_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-types_[id].ts index d43ecd089f..5d9097588e 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-types_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-types_[id].ts @@ -42,6 +42,25 @@ * type: object * description: The product type's metadata. Can hold custom key-value pairs. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.productType.update("ptyp_123", { + * value: "Clothes" + * }) + * .then(({ product_type }) => { + * console.log(product_type) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products.ts b/www/utils/generated/oas-output/operations/admin/post_admin_products.ts index cb708e9f8a..18793be1ed 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products.ts @@ -35,6 +35,39 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The product's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.create({ + * title: "Shirt", + * options: [{ + * title: "Default", + * values: ["Default Option"] + * }], + * variants: [ + * { + * title: "Default", + * options: { + * Default: "Default Option" + * }, + * prices: [] + * } + * ], + * shipping_profile_id: "sp_123" + * }) + * .then(({ product }) => { + * console.log(product) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id].ts index 8d41e66ff6..862fe2458d 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id].ts @@ -41,6 +41,25 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The properties to update in a product. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.update("prod_123", { + * title: "Shirt", + * }) + * .then(({ product }) => { + * console.log(product) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_options.ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_options.ts index 68639b09d2..3a9e679356 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_options.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_options.ts @@ -42,6 +42,29 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The product option's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.createOption( + * "prod_123", + * { + * title: "Color", + * values: ["Green", "Blue"] + * } + * ) + * .then(({ product }) => { + * console.log(product) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_options_[option_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_options_[option_id].ts index 30498dbe7c..cc7c990ca3 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_options_[option_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_options_[option_id].ts @@ -48,6 +48,29 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The properties to update in the product option. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.updateOption( + * "prod_123", + * "prodopt_123", + * { + * title: "Color" + * } + * ) + * .then(({ product }) => { + * console.log(product) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants.ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants.ts index af8f87f1fe..f1db7865ae 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants.ts @@ -42,6 +42,34 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The product variant's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.createVariant("prod_123", { + * title: "Blue Shirt", + * options: { + * Color: "Blue" + * }, + * prices: [ + * { + * amount: 10, + * currency_code: "usd" + * } + * ] + * }) + * .then(({ product }) => { + * console.log(product) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_[variant_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_[variant_id].ts index ebe3de7a8a..99fc38a653 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_[variant_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_[variant_id].ts @@ -48,6 +48,29 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The properties to update in the variant. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.updateVariant( + * "prod_123", + * "variant_123", + * { + * title: "Blue Shirt", + * } + * ) + * .then(({ product }) => { + * console.log(product) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_batch.ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_batch.ts index 5550c30426..a175a1bc02 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_batch.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_batch.ts @@ -34,6 +34,40 @@ * schema: * $ref: "#/components/schemas/AdminBatchProductVariantRequest" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.batchVariants("prod_123", { + * create: [ + * { + * title: "Blue Shirt", + * options: { + * Color: "Blue" + * }, + * prices: [] + * } + * ], + * update: [ + * { + * id: "variant_123", + * title: "Pants" + * } + * ], + * delete: ["variant_123"] + * }) + * .then(({ created, updated, deleted }) => { + * console.log(created, updated, deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_inventory-items_batch.ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_inventory-items_batch.ts index 59e0e331cf..aea4b3a658 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_inventory-items_batch.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_[id]_variants_inventory-items_batch.ts @@ -90,6 +90,47 @@ * title: variant_id * description: The ID of the variant. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.batchVariantInventoryItems( + * "prod_123", + * { + * create: [ + * { + * inventory_item_id: "iitem_123", + * variant_id: "variant_123", + * required_quantity: 10 + * } + * ], + * update: [ + * { + * inventory_item_id: "iitem_1234", + * variant_id: "variant_1234", + * required_quantity: 20 + * } + * ], + * delete: [ + * { + * inventory_item_id: "iitem_321", + * variant_id: "variant_321" + * } + * ] + * } + * ) + * .then(({ created, updated, deleted }) => { + * console.log(created, updated, deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_batch.ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_batch.ts index 00be15b6b4..d6257f8a99 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_batch.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_batch.ts @@ -27,6 +27,47 @@ * schema: * $ref: "#/components/schemas/AdminBatchProductRequest" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.batch({ + * create: [ + * { + * title: "Shirt", + * options: [{ + * title: "Default", + * values: ["Default Option"] + * }], + * variants: [ + * { + * title: "Default", + * options: { + * Default: "Default Option" + * }, + * prices: [] + * } + * ] + * } + * ], + * update: [{ + * id: "prod_123", + * title: "Pants" + * }], + * delete: ["prod_321"] + * }) + * .then(({ created, updated, deleted }) => { + * console.log(created, updated, deleted) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_export.ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_export.ts index ab3848f1c0..0991c6f6ef 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_export.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_export.ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.export({}) + * .then(({ transaction_id }) => { + * console.log(transaction_id) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_import.ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_import.ts index 82378dc301..30cde6296c 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_import.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_import.ts @@ -14,6 +14,25 @@ * schema: * $ref: "#/components/schemas/AdminImportProductRequest" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.import({ + * file // uploaded File instance + * }) + * .then(({ transaction_id }) => { + * console.log(transaction_id) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_products_import_[transaction_id]_confirm.ts b/www/utils/generated/oas-output/operations/admin/post_admin_products_import_[transaction_id]_confirm.ts index e7e2ea133a..468d3afc49 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_products_import_[transaction_id]_confirm.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_products_import_[transaction_id]_confirm.ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.product.confirmImport("transaction_123") + * .then(() => { + * console.log("Import confirmed") + * }) * - lang: Shell * label: cURL * source: |- @@ -24,6 +41,8 @@ * tags: * - Products * responses: + * "202": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_promotions.ts b/www/utils/generated/oas-output/operations/admin/post_admin_promotions.ts index c82a36f76f..b93ee9dd6d 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_promotions.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_promotions.ts @@ -310,6 +310,29 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The promotion's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.promotion.create({ + * name: "My Promotion", + * description: "This is a test promotion", + * code: "PROMO123", + * starts_at: "2021-01-01", + * ends_at: "2021-01-01", + * }) + * .then(({ promotion }) => { + * console.log(promotion) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_promotions_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_promotions_[id].ts index e014405c31..5451b07a8a 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_promotions_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_promotions_[id].ts @@ -123,6 +123,25 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The properties to update in a promotion. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.promotion.update("promo_123", { + * code: "PROMO123", + * }) + * .then(({ promotion }) => { + * console.log(promotion) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_regions.ts b/www/utils/generated/oas-output/operations/admin/post_admin_regions.ts index f4cbc02f53..ba0efb922a 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_regions.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_regions.ts @@ -27,6 +27,26 @@ * schema: * $ref: "#/components/schemas/AdminCreateRegion" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.region.create({ + * name: "United States", + * currency_code: "usd", + * }) + * .then(({ region }) => { + * console.log(region) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_regions_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_regions_[id].ts index 07e973ce4f..804bebba1e 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_regions_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_regions_[id].ts @@ -68,6 +68,25 @@ * title: is_tax_inclusive * description: Whether the prices in the region are tax inclusive. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.region.update("region_123", { + * name: "United States", + * }) + * .then(({ region }) => { + * console.log(region) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_reservations.ts b/www/utils/generated/oas-output/operations/admin/post_admin_reservations.ts index 321376cdb9..5de70260bf 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_reservations.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_reservations.ts @@ -27,6 +27,27 @@ * schema: * $ref: "#/components/schemas/AdminCreateReservation" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.reservation.create({ + * inventory_item_id: "iitem_123", + * location_id: "sloc_123", + * quantity: 10, + * }) + * .then(({ reservation }) => { + * console.log(reservation) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_reservations_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_reservations_[id].ts index 0fee20f987..f18d8e75df 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_reservations_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_reservations_[id].ts @@ -50,6 +50,25 @@ * type: object * description: The reservation's metadata. Can hold custom key-value pairs. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.reservation.update("res_123", { + * quantity: 20, + * }) + * .then(({ reservation }) => { + * console.log(reservation) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_return-reasons.ts b/www/utils/generated/oas-output/operations/admin/post_admin_return-reasons.ts index 661a5be1d3..71a56097cb 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_return-reasons.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_return-reasons.ts @@ -27,6 +27,26 @@ * schema: * $ref: "#/components/schemas/AdminCreateReturnReason" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.returnReason.create({ + * value: "refund", + * label: "Refund", + * }) + * .then(({ return_reason }) => { + * console.log(return_reason) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_return-reasons_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_return-reasons_[id].ts index 91b991542a..db0f87a908 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_return-reasons_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_return-reasons_[id].ts @@ -33,6 +33,26 @@ * schema: * $ref: "#/components/schemas/AdminUpdateReturnReason" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.returnReason.update("ret_123", { + * value: "refund", + * label: "Refund", + * }) + * .then(({ return_reason }) => { + * console.log(return_reason) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns.ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns.ts index 921c41b62a..10a6e4bad3 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns.ts @@ -27,6 +27,25 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.initiateRequest({ + * order_id: "order_123", + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id].ts index 478414bf9b..a185d5d8a0 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id].ts @@ -33,6 +33,25 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsReturnReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.updateRequest("return_123", { + * location_id: "sloc_123", + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_cancel.ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_cancel.ts index d34058ed14..7a8b2cbc98 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_cancel.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_cancel.ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.cancel("return_123") + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_dismiss-items.ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_dismiss-items.ts index 3997689c05..ac62b647ef 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_dismiss-items.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_dismiss-items.ts @@ -34,6 +34,27 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsReceiveItemsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.dismissItems("return_123", { + * items: [ + * { id: "orli_123", quantity: 1 }, + * ], + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_dismiss-items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_dismiss-items_[action_id].ts index 47bdbb938b..8ba6de6116 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_dismiss-items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_dismiss-items_[action_id].ts @@ -43,6 +43,25 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsDismissItemsActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.updateDismissItem("return_123", "orchach_123", { + * quantity: 2, + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive-items.ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive-items.ts index ca1b15f5f7..81caeb5045 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive-items.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive-items.ts @@ -34,6 +34,27 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsReceiveItemsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.receiveItems("return_123", { + * items: [ + * { id: "item_123", quantity: 1 }, + * ], + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive-items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive-items_[action_id].ts index 43e409ea62..302d84f1f5 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive-items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive-items_[action_id].ts @@ -43,6 +43,25 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsReceiveItemsActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.updateReceiveItem("return_123", "orchach_123", { + * quantity: 2, + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive.ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive.ts index 9e7736f676..9af495c483 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive.ts @@ -33,6 +33,25 @@ * schema: * $ref: "#/components/schemas/AdminPostReceiveReturnsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.initiateReceive("return_123", { + * internal_note: "Return received by the customer", + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive_confirm.ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive_confirm.ts index aefc042df3..a1dc6d2c7d 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive_confirm.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_receive_confirm.ts @@ -34,6 +34,25 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsConfirmRequestReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.confirmReceive("return_123", { + * no_notification: true, + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request-items.ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request-items.ts index fbcac8a4e2..43cf44f8d9 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request-items.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request-items.ts @@ -34,6 +34,26 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsRequestItemsReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.addReturnItem("return_123", { + * id: "orlitem_123", + * quantity: 1, + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request-items_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request-items_[action_id].ts index a794d2da43..5ef377d7fe 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request-items_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request-items_[action_id].ts @@ -43,6 +43,25 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsRequestItemsActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.updateReturnItem("return_123", "orchach_123", { + * quantity: 2, + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request.ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request.ts index 42b371ba82..ae89201de1 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_request.ts @@ -34,6 +34,25 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsConfirmRequestReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.confirmRequest("return_123", { + * no_notification: true, + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_shipping-method.ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_shipping-method.ts index a59e1489be..9181b42b8a 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_shipping-method.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_shipping-method.ts @@ -34,6 +34,25 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsShippingReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.addReturnShipping("return_123", { + * shipping_option_id: "so_123", + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_shipping-method_[action_id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_shipping-method_[action_id].ts index 19f620638d..542a975a88 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_shipping-method_[action_id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_returns_[id]_shipping-method_[action_id].ts @@ -43,6 +43,25 @@ * schema: * $ref: "#/components/schemas/AdminPostReturnsShippingActionReqSchema" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.return.updateReturnShipping("return_123", "orchach_123", { + * custom_amount: 100, + * }) + * .then(({ return }) => { + * console.log(return) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels.ts b/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels.ts index 24fde74d0b..114a06dd78 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels.ts @@ -27,6 +27,25 @@ * schema: * $ref: "#/components/schemas/AdminCreateSalesChannel" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.salesChannel.create({ + * name: "Storefront", + * }) + * .then(({ salesChannel }) => { + * console.log(salesChannel) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels_[id].ts index 900a7381dc..921e338ce6 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels_[id].ts @@ -33,6 +33,28 @@ * schema: * $ref: "#/components/schemas/AdminUpdateSalesChannel" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.salesChannel.update( + * "sc_123", + * { + * name: "Storefront", + * } + * ) + * .then(({ salesChannel }) => { + * console.log(salesChannel) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels_[id]_products.ts b/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels_[id]_products.ts index 88d7d9f946..f397a5af41 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels_[id]_products.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_sales-channels_[id]_products.ts @@ -50,6 +50,26 @@ * title: remove * description: A product's ID. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.salesChannel.batchProducts("sc_123", { + * add: ["prod_123", "prod_456"], + * remove: ["prod_789"] + * }) + * .then(({ sales_channel }) => { + * console.log(sales_channel) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options.ts b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options.ts index f030a342fe..181d6982ae 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options.ts @@ -27,6 +27,26 @@ * schema: * $ref: "#/components/schemas/AdminCreateShippingOption" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.shippingOption.create({ + * name: "Standard Shipping", + * profile_id: "shp_123", + * }) + * .then(({ shipping_option }) => { + * console.log(shipping_option) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id].ts index 3afd215395..3928dee186 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id].ts @@ -199,6 +199,25 @@ * description: A value of the attribute that enables this rule. * example: cusgroup_123 * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.shippingOption.update("so_123", { + * name: "Standard Shipping", + * }) + * .then(({ shipping_option }) => { + * console.log(shipping_option) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id]_rules_batch.ts b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id]_rules_batch.ts index 6b55dbbeff..c2a1a4fa5c 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id]_rules_batch.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options_[id]_rules_batch.ts @@ -53,6 +53,25 @@ * title: delete * description: A rule's ID. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.shippingOption.updateRules("so_123", { + * create: [{ attribute: "enabled_in_store", operator: "eq", value: "true" }], + * }) + * .then(({ shipping_option }) => { + * console.log(shipping_option) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles.ts b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles.ts index be33f3d0bb..28f09dee77 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles.ts @@ -27,6 +27,25 @@ * schema: * $ref: "#/components/schemas/AdminCreateShippingProfile" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.shippingProfile.create({ + * name: "Default Shipping Profile", + * }) + * .then(({ shipping_profile }) => { + * console.log(shipping_profile) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles_[id].ts index f396c63610..8adb5ed11d 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-profiles_[id].ts @@ -46,6 +46,25 @@ * type: object * description: The shipping profile's metadata. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.shippingProfile.update("sp_123", { + * name: "Updated Shipping Profile", + * }) + * .then(({ shipping_profile }) => { + * console.log(shipping_profile) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations.ts b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations.ts index 8a6f9f4b61..baf371bbf7 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations.ts @@ -27,6 +27,26 @@ * schema: * $ref: "#/components/schemas/AdminCreateStockLocation" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.stockLocation.create({ + * name: "Main Warehouse", + * address_id: "addr_123", + * }) + * .then(({ stock_location }) => { + * console.log(stock_location) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id].ts index 5651dccfc4..5a906db2c8 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id].ts @@ -33,6 +33,25 @@ * schema: * $ref: "#/components/schemas/AdminUpdateStockLocation" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.stockLocation.update("sloc_123", { + * name: "European Warehouse", + * }) + * .then(({ stock_location }) => { + * console.log(stock_location) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-providers.ts b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-providers.ts index bb17709e7e..34bd703ea4 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-providers.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-providers.ts @@ -50,6 +50,26 @@ * title: remove * description: A fulfillment provider's ID. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.stockLocation.updateFulfillmentProviders("sloc_123", { + * add: ["fp_manual_manual"], + * remove: ["fp_shipstation_shipstation"], + * }) + * .then(({ stock_location }) => { + * console.log(stock_location) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-sets.ts b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-sets.ts index 91a07cf7c9..32fb6828af 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-sets.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_fulfillment-sets.ts @@ -47,6 +47,26 @@ * title: type * description: The fulfillment set's type. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.stockLocation.createFulfillmentSet("sloc_123", { + * name: "Shipping", + * type: "shipping", + * }) + * .then(({ stock_location }) => { + * console.log(stock_location) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_sales-channels.ts b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_sales-channels.ts index 6cd61feb33..526035c133 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_sales-channels.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_stock-locations_[id]_sales-channels.ts @@ -50,6 +50,26 @@ * title: remove * description: A sales channel's ID. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.stockLocation.updateSalesChannels("sloc_123", { + * add: ["sc_123"], + * remove: ["sc_456"], + * }) + * .then(({ stock_location }) => { + * console.log(stock_location) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_stores_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_stores_[id].ts index 000857aa9b..5d7d9410b1 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_stores_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_stores_[id].ts @@ -33,6 +33,25 @@ * schema: * $ref: "#/components/schemas/AdminUpdateStore" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.store.update("store_123", { + * name: "My Store", + * }) + * .then(({ store }) => { + * console.log(store) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_tax-rates.ts b/www/utils/generated/oas-output/operations/admin/post_admin_tax-rates.ts index f32cc7de6b..4e2565fb0f 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_tax-rates.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_tax-rates.ts @@ -27,6 +27,28 @@ * schema: * $ref: "#/components/schemas/AdminCreateTaxRate" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.taxRate.create({ + * name: "VAT", + * tax_region_id: "txreg_123", + * code: "VAT", + * rate: 2, // 2% + * }) + * .then(({ tax_rate }) => { + * console.log(tax_rate) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_tax-rates_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_tax-rates_[id].ts index 4f64bd9252..90ecf4ad13 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_tax-rates_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_tax-rates_[id].ts @@ -33,6 +33,26 @@ * schema: * $ref: "#/components/schemas/AdminUpdateTaxRate" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.taxRate.update("txrat_123", { + * name: "VAT", + * code: "VAT", + * }) + * .then(({ tax_rate }) => { + * console.log(tax_rate) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_tax-regions.ts b/www/utils/generated/oas-output/operations/admin/post_admin_tax-regions.ts index 7e3ab3f300..fbae3caf57 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_tax-regions.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_tax-regions.ts @@ -27,6 +27,32 @@ * schema: * $ref: "#/components/schemas/AdminCreateTaxRegion" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.taxRegion.create({ + * country_code: "us", + * province_code: "ca", + * default_tax_rate: { + * code: "VAT", + * name: "VAT", + * rate: 20, // 20% + * is_combinable: true, + * }, + * }) + * .then(({ tax_region }) => { + * console.log(tax_region) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_uploads.ts b/www/utils/generated/oas-output/operations/admin/post_admin_uploads.ts index 3af7dc7141..605eeaf208 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_uploads.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_uploads.ts @@ -54,6 +54,35 @@ * title: FileList * description: The files to upload. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.upload.create( + * { + * files: [ + * // file uploaded as a base64 string + * { + * name: "test.txt", + * content: "test", // Should be the base64 content of the file + * }, + * // file uploaded as a File object + * new File(["test"], "test.txt", { type: "text/plain" }) + * ], + * } + * ) + * .then(({ files }) => { + * console.log(files) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_users_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_users_[id].ts index 8c06c01174..b7a502ee7a 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_users_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_users_[id].ts @@ -29,6 +29,26 @@ * schema: * $ref: "#/components/schemas/AdminUpdateUser" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.user.update("user_123", { + * first_name: "John", + * last_name: "Doe", + * }) + * .then(({ user }) => { + * console.log(user) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider].ts b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider].ts index 244ac9552e..5e2e49e8f0 100644 --- a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider].ts +++ b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider].ts @@ -33,15 +33,38 @@ * * For the Google and GitHub authentication providers, you can pass `callback_url` to indicate the URL in the frontend that the user should be redirected to after completing their authentication. This will override the provider's `callbackUrl` configurations in `medusa-config.ts`. * x-codeSamples: - * - lang: Shell - * label: EmailPass Provider - * source: |- - * curl -X POST '{backend_url}/auth/user/emailpass' \ - * -H 'Content-Type: application/json' \ - * --data-raw '{ - * "email": "admin@medusa-test.com", - * "password": "supersecret" - * }' + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * const result = await sdk.auth.login( + * "user", + * "emailpass", + * { + * email: "user@gmail.com", + * password: "supersecret" + * } + * ) + * + * if (typeof result !== "string") { + * alert("Authentication requires additional steps") + * // replace with the redirect logic of your application + * window.location.href = result.location + * return + * } + * + * // user is now authenticated + * // all subsequent requests will use the token in the header + * const { user } = await sdk.admin.user.me() * - lang: Bash * label: Google Provider * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_callback.ts b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_callback.ts index 9b8bba7c5e..9779385b07 100644 --- a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_callback.ts +++ b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_callback.ts @@ -22,12 +22,74 @@ * type: string * example: "google" * x-codeSamples: - * - lang: Shell + * - lang: JavaScript * label: Google Provider - * source: curl -X POST '{backend_url}/auth/user/google/callback?code=123' - * - lang: Bash + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * await sdk.auth.callback( + * "user", + * "google", + * { + * code: "123", + * state: "456" + * } + * ) + * + * // all subsequent requests will use the token in the header + * sdk.admin.invite.accept( + * { + * email: "user@gmail.com", + * first_name: "John", + * last_name: "Smith", + * invite_token: "12345..." + * }, + * ) + * .then(({ user }) => { + * console.log(user) + * }) + * - lang: TypeScript * label: GitHub Provider - * source: curl -X POST '{backend_url}/auth/user/github/callback?code=123' + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * const authToken = await sdk.auth.callback( + * "user", + * "google", + * { + * code: "123", + * state: "456" + * } + * ) + * + * // all subsequent requests will use the token in the header + * sdk.admin.invite.accept( + * { + * email: "user@gmail.com", + * first_name: "John", + * last_name: "Smith", + * invite_token: "12345..." + * }, + * ) + * .then(({ user }) => { + * console.log(user) + * }) * tags: * - Auth * responses: diff --git a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_register.ts b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_register.ts index 71971f57db..389674af41 100644 --- a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_register.ts +++ b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_register.ts @@ -26,6 +26,33 @@ * email: "admin@medusa-test.com" * password: "supersecret" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * const token = await sdk.auth.register("user", "emailpass", { + * email: "user@gmail.com", + * password: "supersecret" + * }) + * + * // all subsequent requests will use the token in the header + * const { user } = await sdk.admin.invite.accept( + * { + * email: "user@gmail.com", + * first_name: "John", + * last_name: "Smith", + * invite_token: "12345..." + * }, + * ) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_reset-password.ts b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_reset-password.ts index 39c9d30bc9..12d1e43377 100644 --- a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_reset-password.ts +++ b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_reset-password.ts @@ -32,6 +32,29 @@ * description: The user's identifier for the selected auth provider. For example, for the `emailpass` auth provider, the value is the user's email. * example: "admin@medusa-test.com" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.auth.resetPassword( + * "user", + * "emailpass", + * { + * identifier: "user@gmail.com" + * } + * ) + * .then(() => { + * // user receives token + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_update.ts b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_update.ts index 971e18a1cd..f2fef22345 100644 --- a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_update.ts +++ b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_update.ts @@ -27,6 +27,30 @@ * email: "admin@medusa-test.com" * password: "supersecret" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.auth.updateProvider( + * "user", + * "emailpass", + * { + * password: "supersecret" + * }, + * token + * ) + * .then(() => { + * // password updated + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_auth_token_refresh.ts b/www/utils/generated/oas-output/operations/admin/post_auth_token_refresh.ts index 2a8a2d8540..bda5830118 100644 --- a/www/utils/generated/oas-output/operations/admin/post_auth_token_refresh.ts +++ b/www/utils/generated/oas-output/operations/admin/post_auth_token_refresh.ts @@ -8,6 +8,23 @@ * description: Learn about third-party authentication flow. * x-authenticated: true * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * const token = await sdk.auth.refresh() + * + * // all subsequent requests will use the token in the header + * const { user } = await sdk.admin.user.me() * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/auth/delete_auth_session.ts b/www/utils/generated/oas-output/operations/auth/delete_auth_session.ts index 0ec6dd5b24..835de53855 100644 --- a/www/utils/generated/oas-output/operations/auth/delete_auth_session.ts +++ b/www/utils/generated/oas-output/operations/auth/delete_auth_session.ts @@ -5,12 +5,31 @@ * description: Delete Session * x-authenticated: false * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * await sdk.auth.logout() + * + * // user is now logged out + * // you can't send any requests that require authentication * - lang: Shell * label: cURL * source: curl -X DELETE '{backend_url}/auth/session' * tags: * - Session * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/auth/get_auth_[actor_type]_[auth_provider].ts b/www/utils/generated/oas-output/operations/auth/get_auth_[actor_type]_[auth_provider].ts index 6066bb3478..3809f0dd65 100644 --- a/www/utils/generated/oas-output/operations/auth/get_auth_[actor_type]_[auth_provider].ts +++ b/www/utils/generated/oas-output/operations/auth/get_auth_[actor_type]_[auth_provider].ts @@ -24,6 +24,8 @@ * tags: * - "[actor_type]" * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/auth/get_auth_[actor_type]_[auth_provider]_callback.ts b/www/utils/generated/oas-output/operations/auth/get_auth_[actor_type]_[auth_provider]_callback.ts index e845b9cb41..365e20cfd0 100644 --- a/www/utils/generated/oas-output/operations/auth/get_auth_[actor_type]_[auth_provider]_callback.ts +++ b/www/utils/generated/oas-output/operations/auth/get_auth_[actor_type]_[auth_provider]_callback.ts @@ -18,12 +18,41 @@ * schema: * type: string * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * await sdk.auth.callback( + * "customer", + * "google", + * { + * code: "123", + * state: "456" + * } + * ) + * + * // all subsequent requests will use the token in the header + * const { customer } = await sdk.store.customer.create({ + * email: "customer@gmail.com", + * password: "supersecret" + * }) * - lang: Shell * label: cURL * source: curl '{backend_url}/auth/{actor_type}/{auth_provider}/callback' * tags: * - "[actor_type]" * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider].ts b/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider].ts index 8e9b20d7ac..4d38602834 100644 --- a/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider].ts +++ b/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider].ts @@ -18,12 +18,46 @@ * schema: * type: string * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * const result = await sdk.auth.login( + * "customer", + * "emailpass", + * { + * email: "customer@gmail.com", + * password: "supersecret" + * } + * ) + * + * if (typeof result !== "string") { + * alert("Authentication requires additional steps") + * // replace with the redirect logic of your application + * window.location.href = result.location + * return + * } + * + * // customer is now authenticated + * // all subsequent requests will use the token in the header + * const { customer } = await sdk.store.customer.retrieve() * - lang: Shell * label: cURL * source: curl -X POST '{backend_url}/auth/{actor_type}/{auth_provider}' * tags: * - "[actor_type]" * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_callback.ts b/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_callback.ts index caae23a2fd..49393bf84f 100644 --- a/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_callback.ts +++ b/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_callback.ts @@ -24,6 +24,8 @@ * tags: * - "[actor_type]" * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_register.ts b/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_register.ts index f0ecf6afd7..64db4eded1 100644 --- a/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_register.ts +++ b/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_register.ts @@ -18,12 +18,41 @@ * schema: * type: string * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * await sdk.auth.register( + * "customer", + * "emailpass", + * { + * email: "customer@gmail.com", + * password: "supersecret" + * } + * ) + * + * // all subsequent requests will use the token in the header + * const { customer } = await sdk.store.customer.create({ + * email: "customer@gmail.com", + * password: "supersecret" + * }) * - lang: Shell * label: cURL * source: curl -X POST '{backend_url}/auth/{actor_type}/{auth_provider}/register' * tags: * - "[actor_type]" * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_reset-password.ts b/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_reset-password.ts index b7c5df0384..752b17a139 100644 --- a/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_reset-password.ts +++ b/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_reset-password.ts @@ -18,12 +18,37 @@ * schema: * type: string * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.auth.resetPassword( + * "customer", + * "emailpass", + * { + * identifier: "customer@gmail.com" + * } + * ) + * .then(() => { + * // user receives token + * }) * - lang: Shell * label: cURL * source: curl -X POST '{backend_url}/auth/{actor_type}/{auth_provider}/reset-password' * tags: * - "[actor_type]" * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_update.ts b/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_update.ts index 9f854c1759..87f4ead240 100644 --- a/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_update.ts +++ b/www/utils/generated/oas-output/operations/auth/post_auth_[actor_type]_[auth_provider]_update.ts @@ -18,12 +18,38 @@ * schema: * type: string * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.auth.updateProvider( + * "customer", + * "emailpass", + * { + * password: "supersecret" + * }, + * token + * ) + * .then(() => { + * // password updated + * }) * - lang: Shell * label: cURL * source: curl -X POST '{backend_url}/auth/{actor_type}/{auth_provider}/update' * tags: * - "[actor_type]" * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/auth/post_auth_session.ts b/www/utils/generated/oas-output/operations/auth/post_auth_session.ts index f4320d1395..50c03562c0 100644 --- a/www/utils/generated/oas-output/operations/auth/post_auth_session.ts +++ b/www/utils/generated/oas-output/operations/auth/post_auth_session.ts @@ -11,6 +11,8 @@ * tags: * - Session * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/auth/post_auth_token_refresh.ts b/www/utils/generated/oas-output/operations/auth/post_auth_token_refresh.ts index c7641f599c..7ac342867f 100644 --- a/www/utils/generated/oas-output/operations/auth/post_auth_token_refresh.ts +++ b/www/utils/generated/oas-output/operations/auth/post_auth_token_refresh.ts @@ -5,12 +5,31 @@ * description: Create a token. * x-authenticated: false * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * const token = await sdk.auth.refresh() + * + * // all subsequent requests will use the token in the header + * const { customer } = await sdk.store.customer.retrieve() * - lang: Shell * label: cURL * source: curl -X POST '{backend_url}/auth/token/refresh' * tags: * - Token * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/hooks/post_hooks_payment_[provider].ts b/www/utils/generated/oas-output/operations/hooks/post_hooks_payment_[provider].ts index c3a92ed694..ee0134c83a 100644 --- a/www/utils/generated/oas-output/operations/hooks/post_hooks_payment_[provider].ts +++ b/www/utils/generated/oas-output/operations/hooks/post_hooks_payment_[provider].ts @@ -18,6 +18,8 @@ * tags: * - Payment * responses: + * "200": + * description: OK * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/store/delete_auth_session.ts b/www/utils/generated/oas-output/operations/store/delete_auth_session.ts index 16b1473b5a..46c753d753 100644 --- a/www/utils/generated/oas-output/operations/store/delete_auth_session.ts +++ b/www/utils/generated/oas-output/operations/store/delete_auth_session.ts @@ -5,6 +5,27 @@ * description: Deletes the cookie session ID previously set for authentication. * x-authenticated: true * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * await sdk.auth.logout() + * + * // customer is now logged out + * // you can't send any requests that require authentication * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/delete_store_carts_[id]_line-items_[line_id].ts b/www/utils/generated/oas-output/operations/store/delete_store_carts_[id]_line-items_[line_id].ts index b0233f0e03..5366fc7cb8 100644 --- a/www/utils/generated/oas-output/operations/store/delete_store_carts_[id]_line-items_[line_id].ts +++ b/www/utils/generated/oas-output/operations/store/delete_store_carts_[id]_line-items_[line_id].ts @@ -42,6 +42,30 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.cart.deleteLineItem( + * "cart_123", + * "li_123" + * ) + * .then(({ deleted, parent: cart }) => { + * console.log(deleted, cart) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/delete_store_carts_[id]_promotions.ts b/www/utils/generated/oas-output/operations/store/delete_store_carts_[id]_promotions.ts index 2236afa5a7..147ebf818e 100644 --- a/www/utils/generated/oas-output/operations/store/delete_store_carts_[id]_promotions.ts +++ b/www/utils/generated/oas-output/operations/store/delete_store_carts_[id]_promotions.ts @@ -65,6 +65,11 @@ * "500": * $ref: "#/components/responses/500_error" * x-workflow: updateCartPromotionsWorkflow + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreCartRemovePromotion" * */ diff --git a/www/utils/generated/oas-output/operations/store/delete_store_customers_me_addresses_[address_id].ts b/www/utils/generated/oas-output/operations/store/delete_store_customers_me_addresses_[address_id].ts index 7b4f1a3525..11e6ffde7f 100644 --- a/www/utils/generated/oas-output/operations/store/delete_store_customers_me_addresses_[address_id].ts +++ b/www/utils/generated/oas-output/operations/store/delete_store_customers_me_addresses_[address_id].ts @@ -39,6 +39,27 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.customer.deleteAddress("caddr_123") + * .then(({ deleted, parent: customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_carts_[id].ts b/www/utils/generated/oas-output/operations/store/get_store_carts_[id].ts index 060fe78204..00f6f24859 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_carts_[id].ts +++ b/www/utils/generated/oas-output/operations/store/get_store_carts_[id].ts @@ -32,6 +32,27 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.cart.retrieve("cart_123") + * .then(({ cart }) => { + * console.log(cart) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_collections.ts b/www/utils/generated/oas-output/operations/store/get_store_collections.ts index 9d1788e0c2..d8511ac41d 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_collections.ts +++ b/www/utils/generated/oas-output/operations/store/get_store_collections.ts @@ -575,6 +575,27 @@ * type: object * title: $or * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.collection.list() + * .then(({ collections, count, limit, offset }) => { + * console.log(collections) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_collections_[id].ts b/www/utils/generated/oas-output/operations/store/get_store_collections_[id].ts index e467d71a3a..e32d2c4d0e 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_collections_[id].ts +++ b/www/utils/generated/oas-output/operations/store/get_store_collections_[id].ts @@ -35,6 +35,27 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.collection.retrieve("pcol_123") + * .then(({ collection }) => { + * console.log(collection) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_customers_me.ts b/www/utils/generated/oas-output/operations/store/get_store_customers_me.ts index 1a4d434dae..7c26d7ae86 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_customers_me.ts +++ b/www/utils/generated/oas-output/operations/store/get_store_customers_me.ts @@ -33,6 +33,27 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.customer.retrieve() + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_customers_me_addresses.ts b/www/utils/generated/oas-output/operations/store/get_store_customers_me_addresses.ts index ff18582f13..1cf70571a9 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_customers_me_addresses.ts +++ b/www/utils/generated/oas-output/operations/store/get_store_customers_me_addresses.ts @@ -114,6 +114,27 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.customer.listAddress() + * .then(({ addresses, count, offset, limit }) => { + * console.log(addresses) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_customers_me_addresses_[address_id].ts b/www/utils/generated/oas-output/operations/store/get_store_customers_me_addresses_[address_id].ts index 6c1bfa6d4a..4b7ccab367 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_customers_me_addresses_[address_id].ts +++ b/www/utils/generated/oas-output/operations/store/get_store_customers_me_addresses_[address_id].ts @@ -36,6 +36,29 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.customer.retrieveAddress( + * "caddr_123" + * ) + * .then(({ address }) => { + * console.log(address) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_orders.ts b/www/utils/generated/oas-output/operations/store/get_store_orders.ts index f3454aa2bf..2e0a6ae789 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_orders.ts +++ b/www/utils/generated/oas-output/operations/store/get_store_orders.ts @@ -122,6 +122,27 @@ * - draft * - archived * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.order.list() + * .then(({ orders, count, offset, limit }) => { + * console.log(orders) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_orders_[id].ts b/www/utils/generated/oas-output/operations/store/get_store_orders_[id].ts index c8d7cf0a06..fd9e70bc4a 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_orders_[id].ts +++ b/www/utils/generated/oas-output/operations/store/get_store_orders_[id].ts @@ -32,6 +32,27 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.order.retrieve("order_123") + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_payment-providers.ts b/www/utils/generated/oas-output/operations/store/get_store_payment-providers.ts index f08d0eac3b..f8c67cea3a 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_payment-providers.ts +++ b/www/utils/generated/oas-output/operations/store/get_store_payment-providers.ts @@ -65,6 +65,29 @@ * title: region_id * description: Filter by a region ID. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.payment.listPaymentProviders({ + * region_id: "reg_123" + * }) + * .then(({ payment_providers, count, offset, limit }) => { + * console.log(payment_providers) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_product-categories.ts b/www/utils/generated/oas-output/operations/store/get_store_product-categories.ts index 0bcc124b61..8e895b5d33 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_product-categories.ts +++ b/www/utils/generated/oas-output/operations/store/get_store_product-categories.ts @@ -637,6 +637,27 @@ * title: name * description: A product category name. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.category.list() + * .then(({ product_categories, count, offset, limit }) => { + * console.log(product_categories) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_product-categories_[id].ts b/www/utils/generated/oas-output/operations/store/get_store_product-categories_[id].ts index 4d6f25172e..2bd74d6fe3 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_product-categories_[id].ts +++ b/www/utils/generated/oas-output/operations/store/get_store_product-categories_[id].ts @@ -57,6 +57,27 @@ * pass `*category_children` to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example, * `fields=category_children.id,category_children.name`. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.category.retrieve("pcat_123") + * .then(({ product_category }) => { + * console.log(product_category) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_products.ts b/www/utils/generated/oas-output/operations/store/get_store_products.ts index f0282f8901..7a5f6ea2ef 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_products.ts +++ b/www/utils/generated/oas-output/operations/store/get_store_products.ts @@ -729,6 +729,27 @@ * title: cart_id * description: The product's cart id. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.product.list() + * .then(({ products, count, offset, limit }) => { + * console.log(products) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_products_[id].ts b/www/utils/generated/oas-output/operations/store/get_store_products_[id].ts index 651c5882dc..d40ed906cb 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_products_[id].ts +++ b/www/utils/generated/oas-output/operations/store/get_store_products_[id].ts @@ -100,6 +100,27 @@ * externalDocs: * url: "#pagination" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.product.retrieve("prod_123") + * .then(({ product }) => { + * console.log(product) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_regions.ts b/www/utils/generated/oas-output/operations/store/get_store_regions.ts index d3677f883d..e0de1e58c9 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_regions.ts +++ b/www/utils/generated/oas-output/operations/store/get_store_regions.ts @@ -127,6 +127,27 @@ * type: object * title: $or * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.region.list() + * .then(({ regions, count, limit, offset }) => { + * console.log(regions) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/get_store_regions_[id].ts b/www/utils/generated/oas-output/operations/store/get_store_regions_[id].ts index 444ad54be9..932300e8d2 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_regions_[id].ts +++ b/www/utils/generated/oas-output/operations/store/get_store_regions_[id].ts @@ -32,6 +32,27 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.region.retrieve("reg_123") + * .then(({ region }) => { + * console.log(region) + * }) * - lang: Shell * label: cURL * source: curl '{backend_url}/store/regions/{id}' diff --git a/www/utils/generated/oas-output/operations/store/get_store_shipping-options.ts b/www/utils/generated/oas-output/operations/store/get_store_shipping-options.ts index c4c2b358e5..70cf589a19 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_shipping-options.ts +++ b/www/utils/generated/oas-output/operations/store/get_store_shipping-options.ts @@ -96,6 +96,29 @@ * title: is_return * description: Whether the shipping option can be used for returns. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.fulfillment.listCartOptions({ + * cart_id: "cart_123" + * }) + * .then(({ shipping_options }) => { + * console.log(shipping_options) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider].ts b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider].ts index 3a18da4834..2ce181b300 100644 --- a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider].ts +++ b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider].ts @@ -33,15 +33,42 @@ * * For the Google and GitHub authentication providers, you can pass `callback_url` to indicate the URL in the frontend that the customer should be redirected to after completing their authentication. This will override the provider's `callbackUrl` configurations in `medusa-config.ts`. * x-codeSamples: - * - lang: Shell - * label: EmailPass Provider - * source: |- - * curl -X POST '{backend_url}/auth/customer/emailpass' \ - * -H 'Content-Type: application/json' \ - * --data-raw '{ - * "email": "customer@gmail.com", - * "password": "supersecret" - * }' + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * const result = await sdk.auth.login( + * "customer", + * "emailpass", + * { + * email: "customer@gmail.com", + * password: "supersecret" + * } + * ) + * + * if (typeof result !== "string") { + * alert("Authentication requires additional steps") + * // replace with the redirect logic of your application + * window.location.href = result.location + * return + * } + * + * // customer is now authenticated + * // all subsequent requests will use the token in the header + * const { customer } = await sdk.store.customer.retrieve() * - lang: Bash * label: Google Provider * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_callback.ts b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_callback.ts index cef1aebc6f..2943ce1465 100644 --- a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_callback.ts +++ b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_callback.ts @@ -21,12 +21,68 @@ * type: string * example: "google" * x-codeSamples: - * - lang: Shell + * - lang: JavaScript * label: Google Provider - * source: curl -X POST '{backend_url}/auth/customer/google/callback?code=123' - * - lang: Bash + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * await sdk.auth.callback( + * "customer", + * "google", + * { + * code: "123", + * state: "456" + * } + * ) + * + * // all subsequent requests will use the token in the header + * const { customer } = await sdk.store.customer.create({ + * email: "customer@gmail.com", + * password: "supersecret" + * }) + * - lang: TypeScript * label: GitHub Provider - * source: curl -X POST '{backend_url}/auth/customer/github/callback?code=123' + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * await sdk.auth.callback( + * "customer", + * "github", + * { + * code: "123", + * state: "456" + * } + * ) + * + * // all subsequent requests will use the token in the header + * const { customer } = await sdk.store.customer.create({ + * email: "customer@gmail.com", + * password: "supersecret" + * }) * tags: * - Auth * responses: diff --git a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_register.ts b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_register.ts index b4abc05761..e372dea003 100644 --- a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_register.ts +++ b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_register.ts @@ -26,6 +26,37 @@ * email: "customer@gmail.com" * password: "supersecret" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * await sdk.auth.register( + * "customer", + * "emailpass", + * { + * email: "customer@gmail.com", + * password: "supersecret" + * } + * ) + * + * // all subsequent requests will use the token in the header + * const { customer } = await sdk.store.customer.create({ + * email: "customer@gmail.com", + * password: "supersecret" + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_reset-password.ts b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_reset-password.ts index 123c033693..a89e49bcc8 100644 --- a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_reset-password.ts +++ b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_reset-password.ts @@ -32,6 +32,33 @@ * description: The customer's identifier for the selected auth provider. For example, for the `emailpass` auth provider, the value is the customer's email. * example: "customer@gmail.com" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.auth.resetPassword( + * "customer", + * "emailpass", + * { + * identifier: "customer@gmail.com" + * } + * ) + * .then(() => { + * // user receives token + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_update.ts b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_update.ts index e83c52d75d..ab3b2496f2 100644 --- a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_update.ts +++ b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_update.ts @@ -27,6 +27,34 @@ * email: "customer@gmail.com" * password: "supersecret" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.auth.updateProvider( + * "customer", + * "emailpass", + * { + * password: "supersecret" + * }, + * token + * ) + * .then(() => { + * // password updated + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_auth_token_refresh.ts b/www/utils/generated/oas-output/operations/store/post_auth_token_refresh.ts index 698fbe9c18..2da9c75463 100644 --- a/www/utils/generated/oas-output/operations/store/post_auth_token_refresh.ts +++ b/www/utils/generated/oas-output/operations/store/post_auth_token_refresh.ts @@ -8,6 +8,27 @@ * description: "Storefront development: Implement third-party (social) login." * x-authenticated: true * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * const token = await sdk.auth.refresh() + * + * // all subsequent requests will use the token in the header + * const { customer } = await sdk.store.customer.retrieve() * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts.ts b/www/utils/generated/oas-output/operations/store/post_store_carts.ts index 6c2a188b6d..432f5ff6f0 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts.ts @@ -39,6 +39,29 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The cart's details. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.cart.create({ + * region_id: "reg_123" + * }) + * .then(({ cart }) => { + * console.log(cart) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id].ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id].ts index 0a1bc2499f..7564b4b3ad 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id].ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id].ts @@ -47,6 +47,29 @@ * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * description: The properties to update in the cart item. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.cart.update("cart_123", { + * region_id: "reg_123" + * }) + * .then(({ cart }) => { + * console.log(cart) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_complete.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_complete.ts index dabcbf9170..8f117519df 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_complete.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_complete.ts @@ -35,6 +35,33 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.cart.complete("cart_123") + * .then((data) => { + * if(data.type === "cart") { + * // an error occurred + * console.log(data.error, data.cart) + * } else { + * // order placed successfully + * console.log(data.order) + * } + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts index 07183e4418..cf1c947ea8 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts @@ -38,6 +38,27 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.cart.transferCart("cart_123") + * .then(({ cart }) => { + * console.log(cart) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_line-items.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_line-items.ts index 21ccddd7ac..e8a7781277 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_line-items.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_line-items.ts @@ -41,6 +41,30 @@ * schema: * $ref: "#/components/schemas/StoreAddCartLineItem" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.cart.createLineItem("cart_123", { + * variant_id: "variant_123", + * quantity: 1 + * }) + * .then(({ cart }) => { + * console.log(cart) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_line-items_[line_id].ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_line-items_[line_id].ts index fbdecbf1cb..04587b36a8 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_line-items_[line_id].ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_line-items_[line_id].ts @@ -47,6 +47,33 @@ * schema: * $ref: "#/components/schemas/StoreUpdateCartLineItem" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.cart.updateLineItem( + * "cart_123", + * "li_123", + * { + * quantity: 1 + * } + * ) + * .then(({ cart }) => { + * console.log(cart) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts index 952b36fe28..1553c31eac 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts @@ -55,6 +55,32 @@ * url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping#data-request-body-parameter * description: Learn more about the data parameter. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.cart.addShippingMethod("cart_123", { + * option_id: "so_123", + * data: { + * // custom data for fulfillment provider. + * } + * }) + * .then(({ cart }) => { + * console.log(cart) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_customers.ts b/www/utils/generated/oas-output/operations/store/post_store_customers.ts index 2bdf14bf3e..44449f545c 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_customers.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_customers.ts @@ -34,6 +34,40 @@ * schema: * $ref: "#/components/schemas/StoreCreateCustomer" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * const token = await sdk.auth.register("customer", "emailpass", { + * "email": "customer@gmail.com", + * "password": "supersecret" + * }) + * + * sdk.store.customer.create( + * { + * "email": "customer@gmail.com" + * }, + * {}, + * { + * Authorization: `Bearer ${token}` + * } + * ) + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_customers_me.ts b/www/utils/generated/oas-output/operations/store/post_store_customers_me.ts index 2205f77991..3888a1876d 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_customers_me.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_customers_me.ts @@ -37,6 +37,29 @@ * schema: * $ref: "#/components/schemas/StoreUpdateCustomer" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.customer.update({ + * first_name: "John" + * }) + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses.ts b/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses.ts index 9539a9c9c7..7a8073ae13 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses.ts @@ -95,6 +95,29 @@ * type: object * description: Holds custom key-value pairs. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.customer.createAddress({ + * country_code: "us" + * }) + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses_[address_id].ts b/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses_[address_id].ts index 453fe38d54..1257bd0c54 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses_[address_id].ts +++ b/www/utils/generated/oas-output/operations/store/post_store_customers_me_addresses_[address_id].ts @@ -101,6 +101,32 @@ * type: object * description: Holds custom key-value pairs. * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.customer.updateAddress( + * "caddr_123", + * { + * country_code: "us" + * } + * ) + * .then(({ customer }) => { + * console.log(customer) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_accept.ts b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_accept.ts index bdc4f81034..237a29fdde 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_accept.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_accept.ts @@ -42,6 +42,35 @@ * schema: * $ref: "#/components/schemas/StoreAcceptOrderTransfer" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.order.acceptTransfer( + * "order_123", + * { + * token: "transfer_token" + * }, + * { + * Authorization: `Bearer ${token}` + * } + * ) + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_cancel.ts b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_cancel.ts index 8d23d8e98e..98ab95c0c1 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_cancel.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_cancel.ts @@ -35,6 +35,33 @@ * externalDocs: * url: "#select-fields-and-relations" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.order.cancelTransfer( + * "order_123", + * {}, + * { + * Authorization: `Bearer ${token}` + * } + * ) + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_decline.ts b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_decline.ts index 007be77f56..a6c33c8605 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_decline.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_decline.ts @@ -40,6 +40,35 @@ * schema: * $ref: "#/components/schemas/StoreDeclineOrderTransferRequest" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.order.declineTransfer( + * "order_123", + * { + * token: "transfer_token" + * }, + * { + * Authorization: `Bearer ${token}` + * } + * ) + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_request.ts b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_request.ts index 299f161b9a..1536f4574a 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_request.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_request.ts @@ -41,6 +41,36 @@ * schema: * $ref: "#/components/schemas/StoreRequestOrderTransfer" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.order.requestTransfer( + * "order_123", + * { + * description: "I want to transfer this order to my friend." + * }, + * {}, + * { + * Authorization: `Bearer ${token}` + * } + * ) + * .then(({ order }) => { + * console.log(order) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_payment-collections.ts b/www/utils/generated/oas-output/operations/store/post_store_payment-collections.ts index daade2aa49..82206b62cf 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_payment-collections.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_payment-collections.ts @@ -34,6 +34,35 @@ * schema: * $ref: "#/components/schemas/StoreCreatePaymentCollection" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.payment.initiatePaymentSession( + * cart, // assuming you already have the cart object. + * { + * provider_id: "pp_stripe_stripe", + * data: { + * // any data relevant for the provider. + * } + * } + * ) + * .then(({ payment_collection }) => { + * console.log(payment_collection) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/store/post_store_shipping-options_[id]_calculate.ts b/www/utils/generated/oas-output/operations/store/post_store_shipping-options_[id]_calculate.ts index 13009e57e2..8fd6c95bf0 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_shipping-options_[id]_calculate.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_shipping-options_[id]_calculate.ts @@ -52,6 +52,29 @@ * externalDocs: * url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * let MEDUSA_BACKEND_URL = "http://localhost:9000" + * + * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) { + * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL + * } + * + * export const sdk = new Medusa({ + * baseUrl: MEDUSA_BACKEND_URL, + * debug: process.env.NODE_ENV === "development", + * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY, + * }) + * + * sdk.store.fulfillment.calculate("so_123", { + * cart_id: "cart_123" + * }) + * .then(({ shipping_option }) => { + * console.log(shipping_option) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/schemas/AdminAddDraftOrderItems.ts b/www/utils/generated/oas-output/schemas/AdminAddDraftOrderItems.ts new file mode 100644 index 0000000000..1bde9d61e6 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminAddDraftOrderItems.ts @@ -0,0 +1,49 @@ +/** + * @schema AdminAddDraftOrderItems + * type: object + * description: The details of the items to add to a draft order. + * x-schemaName: AdminAddDraftOrderItems + * properties: + * items: + * type: array + * description: The items to add to the draft order. + * items: + * type: object + * description: The item's details + * required: + * - quantity + * properties: + * quantity: + * type: number + * title: quantity + * description: The item's quantity. + * variant_id: + * type: string + * title: variant_id + * description: The ID of the variant to add to the draft order. + * title: + * type: string + * title: title + * description: The item's title. + * unit_price: + * type: number + * title: unit_price + * description: The item's unit price. + * compare_at_unit_price: + * type: number + * title: compare_at_unit_price + * description: The original price of the item before a promotion or sale. + * internal_note: + * type: string + * title: internal_note + * description: A note viewed only by admin users about the item. + * allow_backorder: + * type: boolean + * title: allow_backorder + * description: Whether the item can be purchased if it's out of stock. + * metadata: + * type: object + * description: The item's metadata, can hold custom key-value pairs. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminAddDraftOrderPromotions.ts b/www/utils/generated/oas-output/schemas/AdminAddDraftOrderPromotions.ts new file mode 100644 index 0000000000..0fee63eaba --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminAddDraftOrderPromotions.ts @@ -0,0 +1,18 @@ +/** + * @schema AdminAddDraftOrderPromotions + * type: object + * description: The details of the promotions to add to a draft order. + * x-schemaName: AdminAddDraftOrderPromotions + * required: + * - promo_codes + * properties: + * promo_codes: + * type: array + * description: The list promotion codes to add to the draft order. + * items: + * type: string + * title: promo_codes + * description: A promotion's code. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminAddDraftOrderShippingMethod.ts b/www/utils/generated/oas-output/schemas/AdminAddDraftOrderShippingMethod.ts new file mode 100644 index 0000000000..82393aa95b --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminAddDraftOrderShippingMethod.ts @@ -0,0 +1,30 @@ +/** + * @schema AdminAddDraftOrderShippingMethod + * type: object + * description: The details of the shipping method to add to a draft order. + * x-schemaName: AdminAddDraftOrderShippingMethod + * required: + * - shipping_option_id + * properties: + * shipping_option_id: + * type: string + * title: shipping_option_id + * description: The ID of the shipping option that this method is created from. + * custom_amount: + * type: number + * title: custom_amount + * description: A custom amount to be charged for this shipping method. If not provided, the shipping option's amount will be used. + * description: + * type: string + * title: description + * description: The shipping method's description. + * internal_note: + * type: string + * title: internal_note + * description: A note viewed only by admin users about the shipping method. + * metadata: + * type: object + * description: The shipping method's metadata, can hold custom key-value pairs. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminCreateOrderCreditLines.ts b/www/utils/generated/oas-output/schemas/AdminCreateOrderCreditLines.ts new file mode 100644 index 0000000000..63fbd3427a --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminCreateOrderCreditLines.ts @@ -0,0 +1,31 @@ +/** + * @schema AdminCreateOrderCreditLines + * type: object + * description: The details of a credit line to add to an order. + * x-schemaName: AdminCreateOrderCreditLines + * required: + * - amount + * - reference + * - reference_id + * properties: + * amount: + * type: number + * title: amount + * description: The amount of the credit line. + * example: 100 + * reference: + * type: string + * title: reference + * description: The name of the table that the credit line is referencing. + * example: order + * reference_id: + * type: string + * title: reference_id + * description: The ID of a record in the table that the credit line is referencing. + * example: order_123 + * metadata: + * type: object + * description: The credit line's metadata, can hold custom key-value pairs. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminDraftOrder.ts b/www/utils/generated/oas-output/schemas/AdminDraftOrder.ts index c2d2085ed0..f18491807b 100644 --- a/www/utils/generated/oas-output/schemas/AdminDraftOrder.ts +++ b/www/utils/generated/oas-output/schemas/AdminDraftOrder.ts @@ -243,6 +243,13 @@ * type: number * title: original_shipping_tax_total * description: The tax total of the draft order's shipping excluding promotions. + * region: + * $ref: "#/components/schemas/AdminRegion" + * credit_lines: + * type: array + * description: The draft order's credit lines. + * items: + * $ref: "#/components/schemas/OrderCreditLine" * */ diff --git a/www/utils/generated/oas-output/schemas/AdminDraftOrderPreview.ts b/www/utils/generated/oas-output/schemas/AdminDraftOrderPreview.ts new file mode 100644 index 0000000000..f305c14690 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminDraftOrderPreview.ts @@ -0,0 +1,634 @@ +/** + * @schema AdminDraftOrderPreview + * type: object + * description: The draft order preview's details. + * x-schemaName: AdminDraftOrderPreview + * required: + * - return_requested_total + * - order_change + * - status + * - currency_code + * - id + * - version + * - region_id + * - customer_id + * - sales_channel_id + * - email + * - payment_collections + * - payment_status + * - fulfillment_status + * - summary + * - created_at + * - updated_at + * - original_item_total + * - original_item_subtotal + * - original_item_tax_total + * - item_total + * - item_subtotal + * - item_tax_total + * - original_total + * - original_subtotal + * - original_tax_total + * - total + * - subtotal + * - tax_total + * - discount_total + * - discount_tax_total + * - gift_card_total + * - gift_card_tax_total + * - shipping_total + * - shipping_subtotal + * - shipping_tax_total + * - original_shipping_total + * - original_shipping_subtotal + * - original_shipping_tax_total + * properties: + * return_requested_total: + * type: number + * title: return_requested_total + * description: The total of the requested return. + * order_change: + * $ref: "#/components/schemas/AdminOrderChange" + * items: + * type: array + * description: The order's items. + * items: + * allOf: + * - type: object + * description: An order's item. + * x-schemaName: BaseOrderLineItem + * required: + * - id + * - title + * - subtitle + * - thumbnail + * - variant_id + * - product_id + * - product_title + * - product_description + * - product_subtitle + * - product_type + * - product_collection + * - product_handle + * - variant_sku + * - variant_barcode + * - variant_title + * - variant_option_values + * - requires_shipping + * - is_discountable + * - is_tax_inclusive + * - unit_price + * - quantity + * - detail + * - created_at + * - updated_at + * - metadata + * - original_total + * - original_subtotal + * - original_tax_total + * - item_total + * - item_subtotal + * - item_tax_total + * - total + * - subtotal + * - tax_total + * - discount_total + * - discount_tax_total + * - refundable_total + * - refundable_total_per_unit + * properties: + * id: + * type: string + * title: id + * description: The item's ID. + * title: + * type: string + * title: title + * description: The item's title. + * subtitle: + * type: string + * title: subtitle + * description: The item's subtitle. + * thumbnail: + * type: string + * title: thumbnail + * description: The URL of the item's thumbnail. + * variant: + * $ref: "#/components/schemas/BaseProductVariant" + * variant_id: + * type: string + * title: variant_id + * description: The ID of the associated variant. + * product: + * $ref: "#/components/schemas/AdminProduct" + * product_id: + * type: string + * title: product_id + * description: The ID of the associated product. + * product_title: + * type: string + * title: product_title + * description: The title of the item's product. + * product_description: + * type: string + * title: product_description + * description: The description of the item's product. + * product_subtitle: + * type: string + * title: product_subtitle + * description: The subtitle of the item's product. + * product_type: + * type: string + * title: product_type + * description: The ID of type of the item's product. + * product_collection: + * type: string + * title: product_collection + * description: The ID of collection of the item's product. + * product_handle: + * type: string + * title: product_handle + * description: The handle of the item's product. + * variant_sku: + * type: string + * title: variant_sku + * description: The SKU of the item's variant. + * variant_barcode: + * type: string + * title: variant_barcode + * description: The barcode of the item's variant. + * variant_title: + * type: string + * title: variant_title + * description: The title of the item's variant. + * variant_option_values: + * type: object + * description: The option values of the item's variant as key-value pairs. The key is the title of an option, and the value is the option's value. + * requires_shipping: + * type: boolean + * title: requires_shipping + * description: Whether the item requires shipping. + * is_discountable: + * type: boolean + * title: is_discountable + * description: Whether the item is discountable. + * is_tax_inclusive: + * type: boolean + * title: is_tax_inclusive + * description: Whether the item's price includes taxes. + * compare_at_unit_price: + * type: number + * title: compare_at_unit_price + * description: The original price of the item before a promotion or sale. + * unit_price: + * type: number + * title: unit_price + * description: The item's unit price. + * quantity: + * type: number + * title: quantity + * description: The item's quantity. + * tax_lines: + * type: array + * description: The item's tax lines. + * items: + * $ref: "#/components/schemas/BaseOrderLineItemTaxLine" + * adjustments: + * type: array + * description: The item's adjustments. + * items: + * $ref: "#/components/schemas/BaseOrderLineItemAdjustment" + * detail: + * $ref: "#/components/schemas/BaseOrderItemDetail" + * created_at: + * type: string + * format: date-time + * title: created_at + * description: The date the item was created. + * updated_at: + * type: string + * format: date-time + * title: updated_at + * description: The date the item was updated. + * metadata: + * type: object + * description: The item's metadata, can hold custom key-value pairs. + * original_total: + * type: number + * title: original_total + * description: The item's total including taxes, excluding promotions. + * original_subtotal: + * type: number + * title: original_subtotal + * description: The item's total excluding taxes, including promotions. + * original_tax_total: + * type: number + * title: original_tax_total + * description: The tax total of the item excluding promotions. + * item_total: + * type: number + * title: item_total + * description: The item's total for a single unit including taxes and promotions. + * item_subtotal: + * type: number + * title: item_subtotal + * description: The item's total for a single unit excluding taxes, including promotions. + * item_tax_total: + * type: number + * title: item_tax_total + * description: The tax total for a single unit of the item including promotions. + * total: + * type: number + * title: total + * description: The item's total including taxes and promotions. + * subtotal: + * type: number + * title: subtotal + * description: The item's total excluding taxes, including promotions. + * tax_total: + * type: number + * title: tax_total + * description: The tax total of the item including promotions. + * discount_total: + * type: number + * title: discount_total + * description: The total of the item's discount / promotion. + * discount_tax_total: + * type: number + * title: discount_tax_total + * description: The tax total of the item's discount / promotion + * refundable_total: + * type: number + * title: refundable_total + * description: The total refundable amount of the item's total. + * refundable_total_per_unit: + * type: number + * title: refundable_total_per_unit + * description: The total refundable amount of the item's total for a single unit. + * - type: object + * description: An order's item. + * properties: + * actions: + * type: array + * description: The actions applied on an item. + * items: + * type: object + * description: The action's details. + * x-schemaName: BaseOrderChangeAction + * shipping_methods: + * type: array + * description: The order's shipping methods. + * items: + * allOf: + * - type: object + * description: The shipping method's details. + * x-schemaName: BaseOrderShippingMethod + * required: + * - id + * - order_id + * - name + * - amount + * - is_tax_inclusive + * - shipping_option_id + * - data + * - metadata + * - original_total + * - original_subtotal + * - original_tax_total + * - total + * - subtotal + * - tax_total + * - discount_total + * - discount_tax_total + * - created_at + * - updated_at + * properties: + * id: + * type: string + * title: id + * description: The shipping method's ID. + * order_id: + * type: string + * title: order_id + * description: The ID of the order this shipping method belongs to. + * name: + * type: string + * title: name + * description: The shipping method's name. + * description: + * type: string + * title: description + * description: The shipping method's description. + * amount: + * type: number + * title: amount + * description: The shipping method's amount. + * is_tax_inclusive: + * type: boolean + * title: is_tax_inclusive + * description: Whether the shipping method's amount is tax inclusive. + * shipping_option_id: + * type: string + * title: shipping_option_id + * description: The ID of the shipping option this method was created from. + * data: + * type: object + * description: The data relevant for the fulfillment provider to process this shipment. + * externalDocs: + * url: https://docs.medusajs.com/v2/resources/commerce-modules/order/concepts#data-property + * metadata: + * type: object + * description: The shipping method's metadata, can hold custom key-value pairs. + * tax_lines: + * type: array + * description: The shipping method's tax lines. + * items: + * $ref: "#/components/schemas/BaseOrderShippingMethodTaxLine" + * adjustments: + * type: array + * description: The shipping method's adjustments. + * items: + * $ref: "#/components/schemas/BaseOrderShippingMethodAdjustment" + * original_total: + * oneOf: + * - type: string + * title: original_total + * description: The shipping method's total including taxes, excluding promotions. + * - type: number + * title: original_total + * description: The shipping method's total including taxes, excluding promotions. + * original_subtotal: + * oneOf: + * - type: string + * title: original_subtotal + * description: The shipping method's total excluding taxes, including promotions. + * - type: number + * title: original_subtotal + * description: The shipping method's total excluding taxes, including promotions. + * original_tax_total: + * oneOf: + * - type: string + * title: original_tax_total + * description: The tax total of the shipping method excluding promotions. + * - type: number + * title: original_tax_total + * description: The tax total of the shipping method excluding promotions. + * total: + * oneOf: + * - type: string + * title: total + * description: The shipping method's total including taxes and promotions. + * - type: number + * title: total + * description: The shipping method's total including taxes and promotions. + * subtotal: + * oneOf: + * - type: string + * title: subtotal + * description: The shipping method's total excluding taxes, including promotions. + * - type: number + * title: subtotal + * description: The shipping method's total excluding taxes, including promotions. + * tax_total: + * oneOf: + * - type: string + * title: tax_total + * description: The tax total of the shipping method including promotions. + * - type: number + * title: tax_total + * description: The tax total of the shipping method including promotions. + * discount_total: + * oneOf: + * - type: string + * title: discount_total + * description: The total of the shipping method's promotion. + * - type: number + * title: discount_total + * description: The total of the shipping method's promotion. + * discount_tax_total: + * oneOf: + * - type: string + * title: discount_tax_total + * description: The tax total of the shipping method's promotion. + * - type: number + * title: discount_tax_total + * description: The shipping method's discount tax total. + * created_at: + * type: string + * format: date-time + * title: created_at + * description: The date the shipping method was created. + * updated_at: + * type: string + * format: date-time + * title: updated_at + * description: The date the shipping method was updated. + * - type: object + * description: The shipping method's details. + * properties: + * actions: + * type: array + * description: The actions applied on the shipping method. + * items: + * type: object + * description: The action's details. + * x-schemaName: BaseOrderChangeAction + * currency_code: + * type: string + * title: currency_code + * description: The order's currency code. + * version: + * type: number + * title: version + * description: The order's version when this preview is applied. + * id: + * type: string + * title: id + * description: The order's ID. + * region_id: + * type: string + * title: region_id + * description: The ID of the order's associated region. + * customer_id: + * type: string + * title: customer_id + * description: The ID of the customer that placed the order. + * sales_channel_id: + * type: string + * title: sales_channel_id + * description: The ID of the sales channel that the order was placed in. + * email: + * type: string + * title: email + * description: The email of the customer that placed the order. + * format: email + * display_id: + * type: number + * title: display_id + * description: The order's display ID. + * shipping_address: + * $ref: "#/components/schemas/AdminOrderAddress" + * billing_address: + * $ref: "#/components/schemas/AdminOrderAddress" + * payment_collections: + * type: array + * description: The order's payment collections. + * items: + * $ref: "#/components/schemas/AdminPaymentCollection" + * payment_status: + * type: string + * description: The order's payment status. + * enum: + * - canceled + * - not_paid + * - awaiting + * - authorized + * - partially_authorized + * - captured + * - partially_captured + * - partially_refunded + * - refunded + * - requires_action + * fulfillments: + * type: array + * description: The order's fulfillments. + * items: + * $ref: "#/components/schemas/AdminOrderFulfillment" + * fulfillment_status: + * type: string + * description: The order's fulfillment status. + * enum: + * - canceled + * - not_fulfilled + * - partially_fulfilled + * - fulfilled + * - partially_shipped + * - shipped + * - partially_delivered + * - delivered + * transactions: + * type: array + * description: The order's transactions. + * items: + * $ref: "#/components/schemas/BaseOrderTransaction" + * summary: + * $ref: "#/components/schemas/BaseOrderSummary" + * metadata: + * type: object + * description: The order's metadata, can hold custom key-value pairs. + * created_at: + * type: string + * format: date-time + * title: created_at + * description: The date the order was created. + * updated_at: + * type: string + * format: date-time + * title: updated_at + * description: The date the order was updated. + * original_item_total: + * type: number + * title: original_item_total + * description: The total of the order's items including taxes, excluding promotions. + * original_item_subtotal: + * type: number + * title: original_item_subtotal + * description: The total of the order's items excluding taxes, including promotions. + * original_item_tax_total: + * type: number + * title: original_item_tax_total + * description: The tax total of the order's items excluding promotions. + * item_total: + * type: number + * title: item_total + * description: The total of the order's items including taxes and promotions. + * item_subtotal: + * type: number + * title: item_subtotal + * description: The total of the order's items excluding taxes, including promotions. + * item_tax_total: + * type: number + * title: item_tax_total + * description: The tax total of the order's items including promotions. + * original_total: + * type: number + * title: original_total + * description: The order's total excluding promotions, including taxes. + * original_subtotal: + * type: number + * title: original_subtotal + * description: The order's total excluding taxes, including promotions. + * original_tax_total: + * type: number + * title: original_tax_total + * description: The order's tax total, excluding promotions. + * total: + * type: number + * title: total + * description: The order's total including taxes and promotions. + * subtotal: + * type: number + * title: subtotal + * description: The order's total excluding taxes, including promotions. + * tax_total: + * type: number + * title: tax_total + * description: The order's tax total including promotions. + * discount_total: + * type: number + * title: discount_total + * description: The order's discount or promotions total. + * discount_tax_total: + * type: number + * title: discount_tax_total + * description: The tax total of order's discount or promotion. + * gift_card_total: + * type: number + * title: gift_card_total + * description: The order's gift card total. + * gift_card_tax_total: + * type: number + * title: gift_card_tax_total + * description: The tax total of the order's gift card. + * shipping_total: + * type: number + * title: shipping_total + * description: The order's shipping total including taxes and promotions. + * shipping_subtotal: + * type: number + * title: shipping_subtotal + * description: The order's shipping total excluding taxes, including promotions. + * shipping_tax_total: + * type: number + * title: shipping_tax_total + * description: The tax total of the order's shipping. + * original_shipping_total: + * type: number + * title: original_shipping_total + * description: The order's shipping total including taxes, excluding promotions. + * original_shipping_subtotal: + * type: number + * title: original_shipping_subtotal + * description: The order's shipping total excluding taxes, including promotions. + * original_shipping_tax_total: + * type: number + * title: original_shipping_tax_total + * description: The tax total of the order's shipping excluding promotions. + * customer: + * $ref: "#/components/schemas/AdminCustomer" + * sales_channel: + * $ref: "#/components/schemas/AdminSalesChannel" + * status: + * type: string + * title: status + * description: The order's status. + * region: + * $ref: "#/components/schemas/AdminRegion" + * credit_lines: + * type: array + * description: The order preview's credit lines. + * items: + * $ref: "#/components/schemas/OrderCreditLine" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminDraftOrderPreviewResponse.ts b/www/utils/generated/oas-output/schemas/AdminDraftOrderPreviewResponse.ts new file mode 100644 index 0000000000..26e2b3576c --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminDraftOrderPreviewResponse.ts @@ -0,0 +1,13 @@ +/** + * @schema AdminDraftOrderPreviewResponse + * type: object + * description: The details of the preview on the draft order. + * x-schemaName: AdminDraftOrderPreviewResponse + * required: + * - draft_order_preview + * properties: + * draft_order_preview: + * $ref: "#/components/schemas/AdminDraftOrderPreview" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminOrder.ts b/www/utils/generated/oas-output/schemas/AdminOrder.ts index f4cc044051..155ccb913c 100644 --- a/www/utils/generated/oas-output/schemas/AdminOrder.ts +++ b/www/utils/generated/oas-output/schemas/AdminOrder.ts @@ -242,6 +242,13 @@ * type: string * title: status * description: The order's status. + * region: + * $ref: "#/components/schemas/AdminRegion" + * credit_lines: + * type: array + * description: The order's credit lines. + * items: + * $ref: "#/components/schemas/OrderCreditLine" * */ diff --git a/www/utils/generated/oas-output/schemas/AdminOrderPreview.ts b/www/utils/generated/oas-output/schemas/AdminOrderPreview.ts index a0faea6115..b17213c740 100644 --- a/www/utils/generated/oas-output/schemas/AdminOrderPreview.ts +++ b/www/utils/generated/oas-output/schemas/AdminOrderPreview.ts @@ -622,6 +622,13 @@ * type: string * title: status * description: The order's status. + * region: + * $ref: "#/components/schemas/AdminRegion" + * credit_lines: + * type: array + * description: The order preview's credit lines. + * items: + * $ref: "#/components/schemas/OrderCreditLine" * */ diff --git a/www/utils/generated/oas-output/schemas/AdminPlugin.ts b/www/utils/generated/oas-output/schemas/AdminPlugin.ts new file mode 100644 index 0000000000..98ae468aab --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminPlugin.ts @@ -0,0 +1,15 @@ +/** + * @schema AdminPlugin + * type: object + * description: The plugin's details. + * x-schemaName: AdminPlugin + * required: + * - name + * properties: + * name: + * type: string + * title: name + * description: The plugin's name. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminPluginsListResponse.ts b/www/utils/generated/oas-output/schemas/AdminPluginsListResponse.ts new file mode 100644 index 0000000000..936a07efaf --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminPluginsListResponse.ts @@ -0,0 +1,16 @@ +/** + * @schema AdminPluginsListResponse + * type: object + * description: The list of plugins. + * x-schemaName: AdminPluginsListResponse + * required: + * - plugins + * properties: + * plugins: + * type: array + * description: The list of plugins. + * items: + * $ref: "#/components/schemas/AdminPlugin" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminRemoveDraftOrderPromotions.ts b/www/utils/generated/oas-output/schemas/AdminRemoveDraftOrderPromotions.ts new file mode 100644 index 0000000000..7f977d56ca --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminRemoveDraftOrderPromotions.ts @@ -0,0 +1,18 @@ +/** + * @schema AdminRemoveDraftOrderPromotions + * type: object + * description: The promotion codes to remove from the draft order. + * x-schemaName: AdminRemoveDraftOrderPromotions + * required: + * - promo_codes + * properties: + * promo_codes: + * type: array + * description: The promotion codes to remove from the draft order. + * items: + * type: string + * title: promo_codes + * description: A promotion code to remove from the draft order. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrder.ts b/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrder.ts index 213ae8da5f..34057ddd0a 100644 --- a/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrder.ts +++ b/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrder.ts @@ -108,6 +108,14 @@ * metadata: * type: object * description: The draft order's metadata, can hold custom key-value pairs. + * customer_id: + * type: string + * title: customer_id + * description: The ID of the customer associated with the draft order. + * sales_channel_id: + * type: string + * title: sales_channel_id + * description: The ID of the sales channel associated with the draft order. * */ diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderActionShippingMethod.ts b/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderActionShippingMethod.ts new file mode 100644 index 0000000000..747f278a9f --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderActionShippingMethod.ts @@ -0,0 +1,30 @@ +/** + * @schema AdminUpdateDraftOrderActionShippingMethod + * type: object + * description: The updates to make on a changed shipping method. + * x-schemaName: AdminUpdateDraftOrderActionShippingMethod + * required: + * - shipping_option_id + * properties: + * shipping_option_id: + * type: string + * title: shipping_option_id + * description: The ID of the associated shipping option. + * custom_amount: + * type: number + * title: custom_amount + * description: The custom amount of the shipping method. If not provided, the shipping option's amount will be used. + * description: + * type: string + * title: description + * description: The shipping method's description. + * internal_note: + * type: string + * title: internal_note + * description: A note viewed only by admin users about the shipping method. + * metadata: + * type: object + * description: The shipping method's metadata, can hold custom key-value pairs. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderItem.ts b/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderItem.ts new file mode 100644 index 0000000000..27cff0e692 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderItem.ts @@ -0,0 +1,27 @@ +/** + * @schema AdminUpdateDraftOrderItem + * type: object + * description: The updates to make on a draft order's item. + * x-schemaName: AdminUpdateDraftOrderItem + * required: + * - quantity + * properties: + * quantity: + * type: number + * title: quantity + * description: The item's quantity. + * unit_price: + * type: number + * title: unit_price + * description: The item's unit price. + * compare_at_unit_price: + * type: number + * title: compare_at_unit_price + * description: The original price of the item before a promotion or sale. + * internal_note: + * type: string + * title: internal_note + * description: A note viewed only by admin users about the item. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderShippingMethod.ts b/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderShippingMethod.ts new file mode 100644 index 0000000000..2afc306be4 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminUpdateDraftOrderShippingMethod.ts @@ -0,0 +1,21 @@ +/** + * @schema AdminUpdateDraftOrderShippingMethod + * type: object + * description: The updates to make on a draft order's shipping method. + * x-schemaName: AdminUpdateDraftOrderShippingMethod + * properties: + * shipping_option_id: + * type: string + * title: shipping_option_id + * description: The ID of the associated shipping option. + * custom_amount: + * type: number + * title: custom_amount + * description: The custom amount of the shipping method. If not provided, the shipping option's amount will be used. + * internal_note: + * type: string + * title: internal_note + * description: A note viewed only by admin users about the shipping method. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/Order.ts b/www/utils/generated/oas-output/schemas/Order.ts index e7987dd340..04e77757af 100644 --- a/www/utils/generated/oas-output/schemas/Order.ts +++ b/www/utils/generated/oas-output/schemas/Order.ts @@ -99,6 +99,80 @@ * summary: * type: object * description: The order's summary. + * properties: + * pending_difference: + * type: number + * title: pending_difference + * description: The remaining amount to be paid or refunded. + * current_order_total: + * type: number + * title: current_order_total + * description: The order's current total. + * original_order_total: + * type: number + * title: original_order_total + * description: The order's total before any changes. + * transaction_total: + * type: number + * title: transaction_total + * description: The total of the transactions (payments and refunds) made on the order. + * paid_total: + * type: number + * title: paid_total + * description: The total paid amount. + * refunded_total: + * type: number + * title: refunded_total + * description: The total refunded amount. + * credit_line_total: + * type: number + * title: credit_line_total + * description: The total credit line amount. + * accounting_total: + * type: number + * title: accounting_total + * description: The total amount for accounting purposes. + * raw_pending_difference: + * type: object + * description: The summary's raw pending difference. + * raw_current_order_total: + * type: object + * description: The summary's raw current order total. + * raw_original_order_total: + * type: object + * description: The summary's raw original order total. + * raw_transaction_total: + * type: object + * description: The summary's raw transaction total. + * raw_paid_total: + * type: object + * description: The summary's raw paid total. + * raw_refunded_total: + * type: object + * description: The summary's raw refunded total. + * raw_credit_line_total: + * type: object + * description: The summary's raw credit line total. + * raw_accounting_total: + * type: object + * description: The summary's raw accounting total. + * required: + * - pending_difference + * - current_order_total + * - original_order_total + * - transaction_total + * - paid_total + * - refunded_total + * - credit_line_total + * - accounting_total + * - raw_pending_difference + * - raw_current_order_total + * - raw_original_order_total + * - raw_transaction_total + * - raw_paid_total + * - raw_refunded_total + * - raw_credit_line_total + * - raw_accounting_total * metadata: * type: object * description: The order's metadata, can hold custom key-value pairs. @@ -218,6 +292,10 @@ * description: The order's credit lines, useful to add additional payment amounts for an order. * items: * $ref: "#/components/schemas/OrderCreditLine" + * is_draft_order: + * type: boolean + * title: is_draft_order + * description: Whether the order is a draft order. * */ diff --git a/www/utils/generated/oas-output/schemas/OrderLineItem.ts b/www/utils/generated/oas-output/schemas/OrderLineItem.ts index 23b8d6a46a..de20c7e7e3 100644 --- a/www/utils/generated/oas-output/schemas/OrderLineItem.ts +++ b/www/utils/generated/oas-output/schemas/OrderLineItem.ts @@ -8,6 +8,7 @@ * - title * - requires_shipping * - is_discountable + * - is_giftcard * - is_tax_inclusive * - unit_price * - quantity @@ -198,6 +199,10 @@ * type: string * title: product_type_id * description: The ID of the associated product's type. + * is_giftcard: + * type: boolean + * title: is_giftcard + * description: Whether the item is a gift card. * */ diff --git a/www/utils/generated/oas-output/schemas/StoreCartRemovePromotion.ts b/www/utils/generated/oas-output/schemas/StoreCartRemovePromotion.ts new file mode 100644 index 0000000000..4935933b0a --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreCartRemovePromotion.ts @@ -0,0 +1,18 @@ +/** + * @schema StoreCartRemovePromotion + * type: object + * description: The promotion code to remove from the cart. + * x-schemaName: StoreCartRemovePromotion + * required: + * - promo_codes + * properties: + * promo_codes: + * type: array + * description: The promotion code to remove from the cart. + * items: + * type: string + * title: promo_codes + * description: A promotion code to remove from the cart. + * +*/ + diff --git a/www/utils/generated/route-examples-output/route-examples.json b/www/utils/generated/route-examples-output/route-examples.json index 009ec1349c..1c646161dd 100644 --- a/www/utils/generated/route-examples-output/route-examples.json +++ b/www/utils/generated/route-examples-output/route-examples.json @@ -87,7 +87,7 @@ "js-sdk": "sdk.admin.claim.removeOutboundItem(\n \"claim_123\", \n \"ordchact_123\",\n)\n.then(({ claim }) => {\n console.log(claim)\n})" }, "POST /admin/claims/{id}/outbound/shipping-method": { - "js-sdk": " * sdk.admin.claim.addOutboundShipping(\n \"claim_123\", \n {\n shipping_option_id: \"so_123\",\n custom_amount: 10\n },\n)\n.then(({ claim }) => {\n console.log(claim)\n})" + "js-sdk": "sdk.admin.claim.addOutboundShipping(\n \"claim_123\", \n {\n shipping_option_id: \"so_123\",\n custom_amount: 10\n },\n)\n.then(({ claim }) => {\n console.log(claim)\n})" }, "POST /admin/claims/{id}/outbound/shipping-method/{actionid}": { "js-sdk": "sdk.admin.claim.updateOutboundShipping(\n \"claim_123\", \n \"ordchact_123\",\n {\n custom_amount: 10\n },\n)\n.then(({ claim }) => {\n console.log(claim)\n})" @@ -159,16 +159,61 @@ "js-sdk": "sdk.admin.customerGroup.batchCustomers(\"cusgroup_123\", {\n add: [\"cus_123\"],\n remove: [\"cus_321\"]\n})\n.then(({ customer_group }) => {\n console.log(customer_group)\n})" }, "GET /admin/draft-orders/{id}": { - "js-sdk": "sdk.admin.draftOrder.retrieve(\"draft_order_123\")\n.then(({ draft_order }) => {\n console.log(draft_order)\n})" + "js-sdk": "sdk.admin.draftOrder.retrieve(\"order_123\")\n.then(({ draft_order }) => {\n console.log(draft_order)\n})" }, "GET /admin/draft-orders": { "js-sdk": "sdk.admin.draftOrder.list()\n.then(({ draft_orders, count, limit, offset }) => {\n console.log(draft_orders)\n})" }, "POST /admin/draft-orders": { - "js-sdk": "sdk.admin.draftOrder.create({\n email: \"test@test.com\",\n items: [\n {\n variant_id: \"variant_123\",\n quantity: 1,\n },\n ],\n region_id: \"region_123\",\n sales_channel_id: \"sales_channel_123\",\n})\n.then(({ draft_order }) => {\n console.log(draft_order)\n})" + "js-sdk": "sdk.admin.draftOrder.create({\n email: \"test@test.com\",\n items: [\n {\n variant_id: \"variant_123\",\n quantity: 1,\n },\n ],\n region_id: \"region_123\",\n sales_channel_id: \"sc_123\",\n})\n.then(({ draft_order }) => {\n console.log(draft_order)\n})" }, "POST /admin/draft-orders/{id}": { - "js-sdk": "sdk.admin.draftOrder.update(\"draft_order_123\", {\n email: \"test@test.com\",\n})\n.then(({ draft_order }) => {\n console.log(draft_order)\n})" + "js-sdk": "sdk.admin.draftOrder.update(\"order_123\", {\n email: \"test@test.com\",\n})\n.then(({ draft_order }) => {\n console.log(draft_order)\n})" + }, + "POST /admin/draft-orders/{id}/convert-to-order": { + "js-sdk": "To convert a draft order to an order:\n\n```ts\nsdk.admin.draftOrder.convertToOrder(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" + }, + "POST /admin/draft-orders/{id}/edit/items": { + "js-sdk": "sdk.admin.draftOrder.addItems(\"order_123\", {\n items: [\n {\n variant_id: \"variant_123\",\n quantity: 1,\n },\n ],\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" + }, + "POST /admin/draft-orders/{id}/edit/items/{actionid}": { + "js-sdk": "sdk.admin.draftOrder.updateActionItem(\"order_123\", \"action_123\", {\n quantity: 2,\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" + }, + "DELETE /admin/draft-orders/{id}/edit/items/{actionid}": { + "js-sdk": "sdk.admin.draftOrder.removeActionItem(\"order_123\", \"action_123\")\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" + }, + "POST /admin/draft-orders/{id}/edit/items/item/{itemid}": { + "js-sdk": "sdk.admin.draftOrder.updateItem(\"order_123\", \"item_123\", {\n quantity: 2,\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" + }, + "POST /admin/draft-orders/{id}/edit/promotions": { + "js-sdk": "sdk.admin.draftOrder.addPromotions(\"order_123\", {\n promo_codes: [\"PROMO_CODE_1\", \"PROMO_CODE_2\"],\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" + }, + "DELETE /admin/draft-orders/{id}/edit/promotions": { + "js-sdk": "sdk.admin.draftOrder.removePromotions(\"order_123\", {\n promo_codes: [\"PROMO_CODE_1\", \"PROMO_CODE_2\"],\n})" + }, + "POST /admin/draft-orders/{id}/edit/shipping-methods": { + "js-sdk": "sdk.admin.draftOrder.addShippingMethod(\"order_123\", {\n shipping_option_id: \"shipping_option_123\",\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" + }, + "POST /admin/draft-orders/{id}/edit/shipping-methods/{actionid}": { + "js-sdk": "sdk.admin.draftOrder.updateShippingMethod(\"order_123\", \"action_123\", {\n shipping_option_id: \"shipping_option_123\",\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" + }, + "DELETE /admin/draft-orders/{id}/edit/shipping-methods/{actionid}": { + "js-sdk": "sdk.admin.draftOrder.removeShippingMethod(\"order_123\", \"action_123\")\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" + }, + "POST /admin/draft-orders/{id}/edit/shipping-methods/method/{methodid}": { + "js-sdk": "sdk.admin.draftOrder.updateShippingMethod(\"order_123\", \"sm_123\", {\n shipping_option_id: \"so_123\",\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" + }, + "POST /admin/draft-orders/{id}/edit": { + "js-sdk": "sdk.admin.draftOrder.beginEdit(\"order_123\")\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" + }, + "DELETE /admin/draft-orders/{id}/edit": { + "js-sdk": "sdk.admin.draftOrder.cancelEdit(\"order_123\")\n.then(({ id, object, deleted }) => {\n console.log(id, object, deleted)\n})" + }, + "POST /admin/draft-orders/{id}/edit/request": { + "js-sdk": "sdk.admin.draftOrder.requestEdit(\"order_123\")\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" + }, + "POST /admin/draft-orders/{id}/edit/confirm": { + "js-sdk": "sdk.admin.draftOrder.confirmEdit(\"order_123\")\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" }, "GET /admin/exchanges": { "js-sdk": "sdk.admin.exchange.list()\n.then(({ exchanges, count, limit, offset }) => {\n console.log(exchanges)\n})" @@ -347,6 +392,9 @@ "GET /admin/orders/{id}/line-items": { "js-sdk": "sdk.admin.order.listLineItems(\"order_123\")\n.then(({ order_items }) => {\n console.log(order_items)\n})" }, + "POST /admin/orders/{orderid}/credit-lines": { + "js-sdk": "sdk.admin.order.createCreditLine(\n \"order_123\",\n {\n amount: 100,\n reference: \"order\",\n reference_id: \"order_123\",\n }\n)\n.then(({ order }) => {\n console.log(order)\n})" + }, "POST /admin/order-edits": { "js-sdk": "sdk.admin.orderEdit.initiateRequest({\n order_id: \"order_123\"\n})\n.then(({ order_change }) => {\n console.log(order_change)\n})" }, @@ -395,6 +443,9 @@ "POST /admin/payment-collections/{id}/mark-as-paid": { "js-sdk": "sdk.admin.paymentCollection.markAsPaid(\"paycol_123\", {\n order_id: \"order_123\"\n})\n.then(({ payment_collection }) => {\n console.log(payment_collection)\n})" }, + "GET /admin/plugins": { + "js-sdk": "sdk.admin.plugin.list()\n.then(({ plugins }) => {\n console.log(plugins)\n})" + }, "GET /admin/price-lists/{id}": { "js-sdk": "sdk.admin.priceList.retrieve(\"plist_123\")\n.then(({ price_list }) => {\n console.log(price_list)\n})" }, @@ -846,19 +897,19 @@ "js-sdk": "sdk.admin.workflowExecution.retrieve(\"wrk_123\")\n.then(({ workflow_execution }) => {\n console.log(workflow_execution)\n})" }, "POST /auth/{actor}/{method}/register": { - "js-sdk": "sdk.auth.register(\n \"customer\",\n \"emailpass\",\n {\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n }\n).then((token) => {\n console.log(token)\n})" + "js-sdk": "await sdk.auth.register(\n \"customer\",\n \"emailpass\",\n {\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n }\n)\n\n// all subsequent requests will use the token in the header\nconst { customer } = await sdk.store.customer.create({\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n})" }, "POST /auth/{actor}/{method}": { - "js-sdk": "sdk.auth.login(\n \"customer\",\n \"emailpass\",\n {\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n }\n).then((token) => {\n console.log(token)\n})" + "js-sdk": "const result = await sdk.auth.login(\n \"customer\",\n \"emailpass\",\n {\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n }\n)\n\nif (typeof result !== \"string\") {\n alert(\"Authentication requires additional steps\")\n // replace with the redirect logic of your application\n window.location.href = result.location\n return\n}\n\n// customer is now authenticated\n// all subsequent requests will use the token in the header\nconst { customer } = await sdk.store.customer.retrieve()" }, "GET /auth/{actor}/{method}/callback": { - "js-sdk": "sdk.auth.callback(\n \"customer\",\n \"google\",\n {\n code: \"123\",\n state: \"456\"\n }\n).then((token) => {\n console.log(token)\n})" + "js-sdk": "await sdk.auth.callback(\n \"customer\",\n \"google\",\n {\n code: \"123\",\n state: \"456\"\n }\n)\n\n// all subsequent requests will use the token in the header\nconst { customer } = await sdk.store.customer.create({\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n})" }, "POST /auth/token/refresh": { - "js-sdk": "sdk.auth.refresh()\n.then((token) => {\n console.log(token)\n})" + "js-sdk": "const token = await sdk.auth.refresh()\n\n// all subsequent requests will use the token in the header\nconst { customer } = await sdk.store.customer.retrieve()" }, "DELETE /auth/session": { - "js-sdk": "sdk.auth.logout()\n.then(() => {\n // user is logged out\n})" + "js-sdk": "await sdk.auth.logout()\n\n// user is now logged out\n// you can't send any requests that require authentication" }, "POST /auth/{actor}/{provider}/reset-password": { "js-sdk": "sdk.auth.resetPassword(\n \"customer\",\n \"emailpass\",\n {\n identifier: \"customer@gmail.com\"\n }\n)\n.then(() => {\n // user receives token\n})" diff --git a/www/utils/packages/docs-generator/src/classes/kinds/oas.ts b/www/utils/packages/docs-generator/src/classes/kinds/oas.ts index 2ce5fd75ba..998ee124cf 100644 --- a/www/utils/packages/docs-generator/src/classes/kinds/oas.ts +++ b/www/utils/packages/docs-generator/src/classes/kinds/oas.ts @@ -615,7 +615,12 @@ class OasKindGenerator extends FunctionKindGenerator { // check if it has a success response of a type other than JSON if (!this.hasResponseType(node, oas)) { // remove response schema by only keeping the default responses - oas.responses = DEFAULT_OAS_RESPONSES + oas.responses = { + ...DEFAULT_OAS_RESPONSES, + [newStatus]: { + description: "OK", + }, + } } } else { // check if response status should be changed @@ -1269,7 +1274,7 @@ class OasKindGenerator extends FunctionKindGenerator { ) } - if (methodName !== "delete" && methodName !== "get") { + if (methodName !== "get") { requestSchema = requestBodyParameterSchema }