From 52a8e90aac95f7dedc1db6f51d148dd44420dccf Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 13 Dec 2022 12:52:58 +0200 Subject: [PATCH] chore(docs): Generated API reference (#2788) --- docs/api/admin-spec3.json | 7393 ++++++++++------- docs/api/admin-spec3.yaml | 3407 ++++++-- .../JavaScript/discounts/postundefined | 1 + .../payment-collections_{id}/deleteundefined | 7 + .../payment-collections_{id}/getundefined | 7 + .../payment-collections_{id}/postundefined | 9 + .../postundefined | 7 + .../JavaScript/payments_{id}/getundefined | 7 + .../payments_{id}_capture/postundefined | 7 + .../payments_{id}_refund/postundefined | 11 + .../publishable-api-key_{id}/postundefined | 9 + .../publishable-api-keys/getundefined | 7 + .../publishable-api-keys/postundefined | 7 + .../getundefined | 7 + .../publishable-api-keys_{id}/deleteundefined | 7 + .../publishable-api-keys_{id}/getundefined | 7 + .../postundefined | 7 + .../deleteundefined | 13 + .../postundefined | 13 + .../Shell/discounts/postundefined | 3 +- .../payment-collections_{id}/deleteundefined | 2 + .../payment-collections_{id}/getundefined | 2 + .../payment-collections_{id}/postundefined | 6 + .../postundefined | 2 + .../Shell/payments_{id}/getundefined | 2 + .../Shell/payments_{id}_capture/postundefined | 2 + .../Shell/payments_{id}_refund/postundefined | 8 + .../publishable-api-key_{id}/postundefined | 6 + .../Shell/publishable-api-keys/getundefined | 2 + .../Shell/publishable-api-keys/postundefined | 3 + .../getundefined | 2 + .../publishable-api-keys_{id}/deleteundefined | 2 + .../publishable-api-keys_{id}/getundefined | 3 + .../postundefined | 3 + .../deleteundefined | 10 + .../postundefined | 10 + docs/api/admin/components/schemas/OAuth.yaml | 1 + .../api/admin/components/schemas/address.yaml | 1 + .../components/schemas/address_fields.yaml | 1 + .../admin/components/schemas/batch_job.yaml | 1 + docs/api/admin/components/schemas/cart.yaml | 1 + .../admin/components/schemas/claim_image.yaml | 1 + .../admin/components/schemas/claim_item.yaml | 1 + .../admin/components/schemas/claim_order.yaml | 1 + .../admin/components/schemas/claim_tag.yaml | 1 + .../api/admin/components/schemas/country.yaml | 1 + .../admin/components/schemas/currency.yaml | 1 + .../schemas/custom_shipping_option.yaml | 1 + .../admin/components/schemas/customer.yaml | 3 +- .../components/schemas/customer_group.yaml | 1 + .../admin/components/schemas/discount.yaml | 1 + .../schemas/discount_condition.yaml | 1 + .../discount_condition_customer_group.yaml | 1 + .../schemas/discount_condition_product.yaml | 1 + ...discount_condition_product_collection.yaml | 1 + .../discount_condition_product_tag.yaml | 1 + .../discount_condition_product_type.yaml | 1 + .../components/schemas/discount_rule.yaml | 1 + .../admin/components/schemas/draft-order.yaml | 1 + docs/api/admin/components/schemas/error.yaml | 1 + .../admin/components/schemas/fulfillment.yaml | 1 + .../components/schemas/fulfillment_item.yaml | 1 + .../schemas/fulfillment_provider.yaml | 1 + .../admin/components/schemas/gift_card.yaml | 1 + .../schemas/gift_card_transaction.yaml | 1 + .../components/schemas/idempotency_key.yaml | 1 + docs/api/admin/components/schemas/image.yaml | 1 + docs/api/admin/components/schemas/invite.yaml | 1 + .../admin/components/schemas/line_item.yaml | 1 + .../schemas/line_item_adjustment.yaml | 1 + .../schemas/line_item_tax_line.yaml | 1 + .../components/schemas/money_amount.yaml | 1 + .../components/schemas/multiple_errors.yaml | 1 + docs/api/admin/components/schemas/note.yaml | 1 + .../components/schemas/notification.yaml | 1 + .../schemas/notification_provider.yaml | 1 + .../schemas/notification_resend.yaml | 1 + docs/api/admin/components/schemas/order.yaml | 1 + .../admin/components/schemas/order_edit.yaml | 1 + .../components/schemas/order_item_change.yaml | 1 + .../api/admin/components/schemas/payment.yaml | 1 + .../schemas/payment_collection.yaml | 12 +- .../components/schemas/payment_provider.yaml | 1 + .../components/schemas/payment_session.yaml | 1 + .../admin/components/schemas/price_list.yaml | 1 + .../api/admin/components/schemas/product.yaml | 1 + .../schemas/product_collection.yaml | 1 + .../components/schemas/product_option.yaml | 1 + .../schemas/product_option_value.yaml | 1 + .../admin/components/schemas/product_tag.yaml | 1 + .../components/schemas/product_tax_rate.yaml | 1 + .../components/schemas/product_type.yaml | 1 + .../schemas/product_type_tax_rate.yaml | 1 + .../components/schemas/product_variant.yaml | 1 + .../product_variant_prices_fields.yaml | 1 + .../schemas/publishable_api_key.yaml | 37 + .../publishable_api_key_sales_channel.yaml | 13 + docs/api/admin/components/schemas/refund.yaml | 1 + docs/api/admin/components/schemas/region.yaml | 1 + docs/api/admin/components/schemas/return.yaml | 1 + .../admin/components/schemas/return_item.yaml | 1 + .../components/schemas/return_reason.yaml | 1 + .../components/schemas/sales_channel.yaml | 1 + .../components/schemas/shipping_method.yaml | 1 + .../schemas/shipping_method_tax_line.yaml | 1 + .../components/schemas/shipping_option.yaml | 1 + .../schemas/shipping_option_requirement.yaml | 1 + .../components/schemas/shipping_profile.yaml | 1 + .../components/schemas/shipping_tax_rate.yaml | 1 + .../admin/components/schemas/staged_job.yaml | 1 + docs/api/admin/components/schemas/store.yaml | 1 + docs/api/admin/components/schemas/swap.yaml | 1 + .../admin/components/schemas/tax_line.yaml | 1 + .../components/schemas/tax_provider.yaml | 1 + .../admin/components/schemas/tax_rate.yaml | 1 + .../components/schemas/tracking_link.yaml | 1 + docs/api/admin/components/schemas/user.yaml | 1 + docs/api/admin/openapi.yaml | 50 +- .../admin/paths/admin_draft-orders_{id}.yaml | 2 + docs/api/admin/paths/apps.yaml | 1 + docs/api/admin/paths/apps_authorizations.yaml | 2 + docs/api/admin/paths/auth.yaml | 2 + docs/api/admin/paths/batch-jobs.yaml | 3 + docs/api/admin/paths/batch-jobs_{id}.yaml | 1 + .../admin/paths/batch-jobs_{id}_cancel.yaml | 1 + .../admin/paths/batch-jobs_{id}_confirm.yaml | 1 + docs/api/admin/paths/collections.yaml | 3 + docs/api/admin/paths/collections_{id}.yaml | 4 + .../collections_{id}_products_batch.yaml | 4 + docs/api/admin/paths/currencies.yaml | 1 + docs/api/admin/paths/currencies_{code}.yaml | 2 + docs/api/admin/paths/customer-groups.yaml | 2 + .../api/admin/paths/customer-groups_{id}.yaml | 4 + .../paths/customer-groups_{id}_customers.yaml | 1 + .../customer-groups_{id}_customers_batch.yaml | 4 + docs/api/admin/paths/customers.yaml | 3 + docs/api/admin/paths/customers_{id}.yaml | 3 + docs/api/admin/paths/discounts.yaml | 4 + .../admin/paths/discounts_code_{code}.yaml | 1 + .../discounts_{discount_id}_conditions.yaml | 2 + ...iscount_id}_conditions_{condition_id}.yaml | 4 + ...t_id}_conditions_{condition_id}_batch.yaml | 4 + docs/api/admin/paths/discounts_{id}.yaml | 4 + .../paths/discounts_{id}_dynamic-codes.yaml | 1 + .../discounts_{id}_dynamic-codes_{code}.yaml | 1 + .../discounts_{id}_regions_{region_id}.yaml | 2 + docs/api/admin/paths/draft-orders.yaml | 3 + docs/api/admin/paths/draft-orders_{id}.yaml | 2 + .../paths/draft-orders_{id}_line-items.yaml | 2 + ...raft-orders_{id}_line-items_{line_id}.yaml | 3 + .../admin/paths/draft-orders_{id}_pay.yaml | 1 + docs/api/admin/paths/gift-cards.yaml | 3 + docs/api/admin/paths/gift-cards_{id}.yaml | 4 + docs/api/admin/paths/invites.yaml | 2 + docs/api/admin/paths/invites_accept.yaml | 1 + docs/api/admin/paths/invites_{invite_id}.yaml | 1 + docs/api/admin/paths/notes.yaml | 3 + docs/api/admin/paths/notes_{id}.yaml | 4 + docs/api/admin/paths/notifications.yaml | 1 + .../paths/notifications_{id}_resend.yaml | 2 + docs/api/admin/paths/order-edits.yaml | 7 +- docs/api/admin/paths/order-edits_{id}.yaml | 4 + .../admin/paths/order-edits_{id}_cancel.yaml | 1 + .../order-edits_{id}_changes_{change_id}.yaml | 1 + .../admin/paths/order-edits_{id}_confirm.yaml | 1 + .../admin/paths/order-edits_{id}_items.yaml | 2 + .../order-edits_{id}_items_{item_id}.yaml | 3 + .../admin/paths/order-edits_{id}_request.yaml | 1 + docs/api/admin/paths/order_{id}_claims.yaml | 2 + .../paths/order_{id}_claims_{claim_id}.yaml | 2 + docs/api/admin/paths/order_{id}_swaps.yaml | 2 + docs/api/admin/paths/orders.yaml | 1 + docs/api/admin/paths/orders_{id}.yaml | 3 + docs/api/admin/paths/orders_{id}_archive.yaml | 1 + docs/api/admin/paths/orders_{id}_cancel.yaml | 1 + docs/api/admin/paths/orders_{id}_capture.yaml | 1 + .../orders_{id}_claims_{claim_id}_cancel.yaml | 1 + ...s_{id}_claims_{claim_id}_fulfillments.yaml | 2 + ..._fulfillments_{fulfillment_id}_cancel.yaml | 1 + ...ders_{id}_claims_{claim_id}_shipments.yaml | 2 + .../api/admin/paths/orders_{id}_complete.yaml | 1 + .../admin/paths/orders_{id}_fulfillment.yaml | 2 + ..._fulfillments_{fulfillment_id}_cancel.yaml | 1 + docs/api/admin/paths/orders_{id}_refund.yaml | 2 + docs/api/admin/paths/orders_{id}_return.yaml | 2 + .../api/admin/paths/orders_{id}_shipment.yaml | 2 + .../paths/orders_{id}_shipping-methods.yaml | 1 + .../orders_{id}_swaps_{swap_id}_cancel.yaml | 1 + ...ers_{id}_swaps_{swap_id}_fulfillments.yaml | 2 + ..._fulfillments_{fulfillment_id}_cancel.yaml | 1 + ..._{id}_swaps_{swap_id}_process-payment.yaml | 1 + ...orders_{id}_swaps_{swap_id}_shipments.yaml | 2 + .../admin/paths/payment-collections_{id}.yaml | 171 + .../payment-collections_{id}_authorize.yaml | 49 + docs/api/admin/paths/payments_{id}.yaml | 48 + .../admin/paths/payments_{id}_capture.yaml | 48 + .../api/admin/paths/payments_{id}_refund.yaml | 66 + docs/api/admin/paths/price-lists.yaml | 3 + docs/api/admin/paths/price-lists_{id}.yaml | 4 + .../paths/price-lists_{id}_prices_batch.yaml | 4 + .../paths/price-lists_{id}_products.yaml | 1 + ...sts_{id}_products_{product_id}_prices.yaml | 1 + ...sts_{id}_variants_{variant_id}_prices.yaml | 1 + docs/api/admin/paths/product-tags.yaml | 1 + docs/api/admin/paths/product-types.yaml | 1 + docs/api/admin/paths/products.yaml | 3 + docs/api/admin/paths/products_tag-usage.yaml | 1 + docs/api/admin/paths/products_types.yaml | 1 + docs/api/admin/paths/products_{id}.yaml | 4 + .../admin/paths/products_{id}_metadata.yaml | 2 + .../admin/paths/products_{id}_options.yaml | 2 + .../products_{id}_options_{option_id}.yaml | 3 + .../admin/paths/products_{id}_variants.yaml | 3 + .../products_{id}_variants_{variant_id}.yaml | 3 + .../admin/paths/publishable-api-key_{id}.yaml | 57 + .../api/admin/paths/publishable-api-keys.yaml | 122 + ...blishable-api-keys_:id_sales-channels.yaml | 44 + .../paths/publishable-api-keys_{id}.yaml | 95 + .../publishable-api-keys_{id}_revoke.yaml | 49 + ...le-api-keys_{id}_sales-channels_batch.yaml | 136 + docs/api/admin/paths/regions.yaml | 3 + docs/api/admin/paths/regions_{id}.yaml | 4 + .../admin/paths/regions_{id}_countries.yaml | 2 + ...regions_{id}_countries_{country_code}.yaml | 1 + .../regions_{id}_fulfillment-options.yaml | 1 + .../regions_{id}_fulfillment-providers.yaml | 2 + ...}_fulfillment-providers_{provider_id}.yaml | 1 + .../paths/regions_{id}_payment-providers.yaml | 2 + ..._{id}_payment-providers_{provider_id}.yaml | 1 + docs/api/admin/paths/return-reasons.yaml | 3 + docs/api/admin/paths/return-reasons_{id}.yaml | 4 + docs/api/admin/paths/returns.yaml | 1 + docs/api/admin/paths/returns_{id}_cancel.yaml | 1 + .../api/admin/paths/returns_{id}_receive.yaml | 2 + docs/api/admin/paths/sales-channels.yaml | 3 + docs/api/admin/paths/sales-channels_{id}.yaml | 4 + .../sales-channels_{id}_products_batch.yaml | 4 + docs/api/admin/paths/shipping-options.yaml | 3 + .../admin/paths/shipping-options_{id}.yaml | 4 + docs/api/admin/paths/shipping-profiles.yaml | 3 + .../admin/paths/shipping-profiles_{id}.yaml | 4 + docs/api/admin/paths/store.yaml | 3 + .../admin/paths/store_currencies_{code}.yaml | 2 + .../admin/paths/store_payment-providers.yaml | 1 + docs/api/admin/paths/store_tax-providers.yaml | 1 + docs/api/admin/paths/swaps.yaml | 1 + docs/api/admin/paths/swaps_{id}.yaml | 1 + docs/api/admin/paths/tax-rates.yaml | 3 + docs/api/admin/paths/tax-rates_{id}.yaml | 4 + .../tax-rates_{id}_product-types_batch.yaml | 4 + .../paths/tax-rates_{id}_products_batch.yaml | 4 + ...tax-rates_{id}_shipping-options_batch.yaml | 4 + docs/api/admin/paths/uploads.yaml | 1 + docs/api/admin/paths/uploads_protected.yaml | 1 + docs/api/admin/paths/users.yaml | 3 + .../api/admin/paths/users_password-token.yaml | 1 + .../api/admin/paths/users_reset-password.yaml | 2 + docs/api/admin/paths/users_{id}.yaml | 4 + docs/api/admin/paths/variants.yaml | 1 + docs/api/store-spec3.json | 1356 ++- docs/api/store-spec3.yaml | 1514 +++- .../orders_batch_customer_token/postundefined | 12 + .../orders_customer_confirm/postundefined | 12 + .../payment-collections_{id}/getundefined | 7 + .../postundefined | 9 + .../postundefined | 29 + .../postundefined | 7 + .../postundefined | 6 + .../postundefined | 7 + .../orders_batch_customer_token/postundefined | 5 + .../orders_customer_confirm/postundefined | 5 + .../payment-collections_{id}/getundefined | 1 + .../postundefined | 1 + .../postundefined | 1 + .../postundefined | 1 + .../postundefined | 1 + .../postundefined | 1 + docs/api/store/components/schemas/OAuth.yaml | 1 + .../api/store/components/schemas/address.yaml | 1 + .../components/schemas/address_fields.yaml | 1 + .../store/components/schemas/batch_job.yaml | 1 + docs/api/store/components/schemas/cart.yaml | 1 + .../store/components/schemas/claim_image.yaml | 1 + .../store/components/schemas/claim_item.yaml | 1 + .../store/components/schemas/claim_order.yaml | 1 + .../store/components/schemas/claim_tag.yaml | 1 + .../api/store/components/schemas/country.yaml | 1 + .../store/components/schemas/currency.yaml | 1 + .../schemas/custom_shipping_option.yaml | 1 + .../store/components/schemas/customer.yaml | 3 +- .../components/schemas/customer_group.yaml | 1 + .../store/components/schemas/discount.yaml | 1 + .../schemas/discount_condition.yaml | 1 + .../discount_condition_customer_group.yaml | 1 + .../schemas/discount_condition_product.yaml | 1 + ...discount_condition_product_collection.yaml | 1 + .../discount_condition_product_tag.yaml | 1 + .../discount_condition_product_type.yaml | 1 + .../components/schemas/discount_rule.yaml | 1 + .../store/components/schemas/draft-order.yaml | 1 + docs/api/store/components/schemas/error.yaml | 1 + .../store/components/schemas/fulfillment.yaml | 1 + .../components/schemas/fulfillment_item.yaml | 1 + .../schemas/fulfillment_provider.yaml | 1 + .../store/components/schemas/gift_card.yaml | 1 + .../schemas/gift_card_transaction.yaml | 1 + .../components/schemas/idempotency_key.yaml | 1 + docs/api/store/components/schemas/image.yaml | 1 + docs/api/store/components/schemas/invite.yaml | 1 + .../store/components/schemas/line_item.yaml | 1 + .../schemas/line_item_adjustment.yaml | 1 + .../schemas/line_item_tax_line.yaml | 1 + .../components/schemas/money_amount.yaml | 1 + .../components/schemas/multiple_errors.yaml | 1 + docs/api/store/components/schemas/note.yaml | 1 + .../components/schemas/notification.yaml | 1 + .../schemas/notification_provider.yaml | 1 + .../schemas/notification_resend.yaml | 1 + docs/api/store/components/schemas/order.yaml | 1 + .../store/components/schemas/order_edit.yaml | 1 + .../components/schemas/order_item_change.yaml | 1 + .../api/store/components/schemas/payment.yaml | 1 + .../schemas/payment_collection.yaml | 12 +- .../components/schemas/payment_provider.yaml | 1 + .../components/schemas/payment_session.yaml | 1 + .../store/components/schemas/price_list.yaml | 1 + .../api/store/components/schemas/product.yaml | 1 + .../schemas/product_collection.yaml | 1 + .../components/schemas/product_option.yaml | 1 + .../schemas/product_option_value.yaml | 1 + .../store/components/schemas/product_tag.yaml | 1 + .../components/schemas/product_tax_rate.yaml | 1 + .../components/schemas/product_type.yaml | 1 + .../schemas/product_type_tax_rate.yaml | 1 + .../components/schemas/product_variant.yaml | 1 + .../product_variant_prices_fields.yaml | 1 + .../schemas/publishable_api_key.yaml | 37 + .../publishable_api_key_sales_channel.yaml | 13 + docs/api/store/components/schemas/refund.yaml | 1 + docs/api/store/components/schemas/region.yaml | 1 + docs/api/store/components/schemas/return.yaml | 1 + .../store/components/schemas/return_item.yaml | 1 + .../components/schemas/return_reason.yaml | 1 + .../components/schemas/sales_channel.yaml | 1 + .../components/schemas/shipping_method.yaml | 1 + .../schemas/shipping_method_tax_line.yaml | 1 + .../components/schemas/shipping_option.yaml | 1 + .../schemas/shipping_option_requirement.yaml | 1 + .../components/schemas/shipping_profile.yaml | 1 + .../components/schemas/shipping_tax_rate.yaml | 1 + .../store/components/schemas/staged_job.yaml | 1 + docs/api/store/components/schemas/store.yaml | 1 + docs/api/store/components/schemas/swap.yaml | 1 + .../store/components/schemas/tax_line.yaml | 1 + .../components/schemas/tax_provider.yaml | 1 + .../store/components/schemas/tax_rate.yaml | 1 + .../components/schemas/tracking_link.yaml | 1 + docs/api/store/components/schemas/user.yaml | 1 + docs/api/store/openapi.yaml | 32 +- docs/api/store/paths/auth.yaml | 2 + docs/api/store/paths/auth_{email}.yaml | 1 + docs/api/store/paths/carts.yaml | 2 + docs/api/store/paths/carts_{id}.yaml | 3 + docs/api/store/paths/carts_{id}_complete.yaml | 1 + .../paths/carts_{id}_discounts_{code}.yaml | 1 + .../store/paths/carts_{id}_line-items.yaml | 1 + .../carts_{id}_line-items_{line_id}.yaml | 2 + .../paths/carts_{id}_payment-session.yaml | 1 + .../paths/carts_{id}_payment-sessions.yaml | 1 + ...s_{id}_payment-sessions_{provider_id}.yaml | 2 + ...ayment-sessions_{provider_id}_refresh.yaml | 1 + .../paths/carts_{id}_shipping-methods.yaml | 1 + docs/api/store/paths/carts_{id}_taxes.yaml | 1 + docs/api/store/paths/collections.yaml | 1 + docs/api/store/paths/collections_{id}.yaml | 1 + docs/api/store/paths/customers.yaml | 3 + docs/api/store/paths/customers_me.yaml | 3 + .../store/paths/customers_me_addresses.yaml | 2 + .../customers_me_addresses_{address_id}.yaml | 2 + docs/api/store/paths/customers_me_orders.yaml | 1 + .../paths/customers_me_payment-methods.yaml | 1 + .../store/paths/customers_password-reset.yaml | 2 + .../store/paths/customers_password-token.yaml | 1 + docs/api/store/paths/gift-cards_{code}.yaml | 1 + docs/api/store/paths/order-edits_{id}.yaml | 1 + .../paths/order-edits_{id}_complete.yaml | 1 + .../store/paths/order-edits_{id}_decline.yaml | 2 + docs/api/store/paths/orders.yaml | 1 + .../paths/orders_batch_customer_token.yaml | 47 + .../store/paths/orders_cart_{cart_id}.yaml | 1 + .../store/paths/orders_customer_confirm.yaml | 45 + docs/api/store/paths/orders_{id}.yaml | 1 + .../store/paths/payment-collections_{id}.yaml | 58 + .../payment-collections_{id}_sessions.yaml | 58 + ...yment-collections_{id}_sessions_batch.yaml | 74 + ...ections_{id}_sessions_batch_authorize.yaml | 59 + ...ollections_{id}_sessions_{session_id}.yaml | 68 + ..._{id}_sessions_{session_id}_authorize.yaml | 55 + docs/api/store/paths/product-types.yaml | 1 + docs/api/store/paths/products.yaml | 1 + docs/api/store/paths/products_search.yaml | 1 + docs/api/store/paths/products_{id}.yaml | 1 + docs/api/store/paths/regions.yaml | 1 + docs/api/store/paths/regions_{id}.yaml | 1 + docs/api/store/paths/return-reasons.yaml | 1 + docs/api/store/paths/return-reasons_{id}.yaml | 1 + docs/api/store/paths/returns.yaml | 2 + docs/api/store/paths/shipping-options.yaml | 1 + .../paths/shipping-options_{cart_id}.yaml | 1 + docs/api/store/paths/swaps.yaml | 2 + docs/api/store/paths/swaps_{cart_id}.yaml | 1 + docs/api/store/paths/variants.yaml | 1 + .../store/paths/variants_{variant_id}.yaml | 1 + 413 files changed, 11540 insertions(+), 4501 deletions(-) create mode 100644 docs/api/admin/code_samples/JavaScript/payment-collections_{id}/deleteundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payment-collections_{id}/getundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payment-collections_{id}/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payments_{id}/getundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payments_{id}_capture/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/payments_{id}_refund/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys/getundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/getundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined create mode 100644 docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined create mode 100644 docs/api/admin/code_samples/Shell/payment-collections_{id}/deleteundefined create mode 100644 docs/api/admin/code_samples/Shell/payment-collections_{id}/getundefined create mode 100644 docs/api/admin/code_samples/Shell/payment-collections_{id}/postundefined create mode 100644 docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/postundefined create mode 100644 docs/api/admin/code_samples/Shell/payments_{id}/getundefined create mode 100644 docs/api/admin/code_samples/Shell/payments_{id}_capture/postundefined create mode 100644 docs/api/admin/code_samples/Shell/payments_{id}_refund/postundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-key_{id}/postundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys/getundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys/postundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/deleteundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/getundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined create mode 100644 docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined create mode 100644 docs/api/admin/components/schemas/publishable_api_key.yaml create mode 100644 docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml create mode 100644 docs/api/admin/paths/payment-collections_{id}.yaml create mode 100644 docs/api/admin/paths/payment-collections_{id}_authorize.yaml create mode 100644 docs/api/admin/paths/payments_{id}.yaml create mode 100644 docs/api/admin/paths/payments_{id}_capture.yaml create mode 100644 docs/api/admin/paths/payments_{id}_refund.yaml create mode 100644 docs/api/admin/paths/publishable-api-key_{id}.yaml create mode 100644 docs/api/admin/paths/publishable-api-keys.yaml create mode 100644 docs/api/admin/paths/publishable-api-keys_:id_sales-channels.yaml create mode 100644 docs/api/admin/paths/publishable-api-keys_{id}.yaml create mode 100644 docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml create mode 100644 docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml create mode 100644 docs/api/store/code_samples/JavaScript/orders_batch_customer_token/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/orders_customer_confirm/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}/getundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined create mode 100644 docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined create mode 100644 docs/api/store/code_samples/Shell/orders_batch_customer_token/postundefined create mode 100644 docs/api/store/code_samples/Shell/orders_customer_confirm/postundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}/getundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/postundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined create mode 100644 docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined create mode 100644 docs/api/store/components/schemas/publishable_api_key.yaml create mode 100644 docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml create mode 100644 docs/api/store/paths/orders_batch_customer_token.yaml create mode 100644 docs/api/store/paths/orders_customer_confirm.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}_sessions.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml create mode 100644 docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index 776f7aef99..cd29c8bbce 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -212,6 +212,7 @@ paths: content: application/json: schema: + type: object required: - application_name - state @@ -253,6 +254,7 @@ paths: content: application/json: schema: + type: object properties: apps: $ref: '#/components/schemas/OAuth' @@ -291,6 +293,7 @@ paths: content: application/json: schema: + type: object properties: apps: type: array @@ -362,6 +365,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -458,6 +462,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -473,6 +478,1541 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/collections/{id}/products/batch': + post: + operationId: PostProductsToCollection + summary: Update Products + description: Updates products associated with a Product Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - product_ids + properties: + product_ids: + description: An array of Product IDs to add to the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/product_collection' + '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' + delete: + operationId: DeleteProductsFromCollection + summary: Remove Product + description: Removes products associated with a Product Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - product_ids + properties: + product_ids: + description: >- + An array of Product IDs to remove from the Product + Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the collection + object: + type: string + description: The type of object the removal was executed on + default: product-collection + removed_products: + description: The IDs of the products removed from the collection + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + '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' + /collections: + post: + operationId: PostCollections + summary: Create a Collection + description: Creates a Product Collection. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided + we will kebab-case the title. + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.create({ + title: 'New Collection' + }) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/collections' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "New Collection" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/product_collection' + '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' + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of collections to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of collections to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: title + description: The title of collections to return. + schema: + type: string + - in: query + name: handle + description: The handle of collections to return. + schema: + type: string + - in: query + name: q + description: a search term to search titles and handles. + schema: + type: string + - in: query + name: discount_condition_id + description: >- + The discount condition id on which to filter the product + collections. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting collections were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.list() + + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/collections' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collections: + type: array + items: + $ref: '#/components/schemas/product_collection' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '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' + '/collections/{id}': + delete: + operationId: DeleteCollectionsCollection + summary: Delete a Collection + description: Deletes a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.delete(collection_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Collection + object: + type: string + description: The type of the object that was deleted. + default: product-collection + deleted: + type: boolean + description: Whether the collection was deleted successfully or not. + default: true + '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' + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Collection + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.retrieve(collection_id) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/product_collection' + '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' + post: + operationId: PostCollectionsCollection + summary: Update a Collection + description: Updates a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided + we will kebab-case the title. + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.update(collection_id, { + title: 'New Collection' + }) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "New Collection" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/product_collection' + '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' + /currencies: + get: + operationId: GetCurrencies + summary: List Currency + description: Retrieves a list of Currency + x-authenticated: true + parameters: + - in: query + name: code + description: Code of the currency to search for. + schema: + type: string + - in: query + name: includes_tax + description: Search for tax inclusive currencies. + schema: + type: boolean + - in: query + name: order + description: order to retrieve products in. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: number + default: '20' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.list() + + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies' \ + + --header 'Authorization: Bearer {api_token}' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currencies: + type: array + items: + $ref: '#/components/schemas/currency' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '/currencies/{code}': + post: + operationId: PostCurrenciesCurrency + summary: Update a Currency + description: Update a Currency + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Currency. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.update(code, { + includes_tax: true + }) + + .then(({ currency }) => { + console.log(currency.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies/{code}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "includes_tax": true + }' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currency: + $ref: '#/components/schemas/currency' + '/customer-groups/{id}/customers/batch': + post: + operationId: PostCustomerGroupsGroupCustomersBatch + summary: Add Customers + description: 'Adds a list of customers, represented by id''s, to a customer group.' + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.addCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/customer_group' + '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' + delete: + operationId: DeleteCustomerGroupsGroupCustomerBatch + summary: Remove Customers + description: 'Removes a list of customers, represented by id''s, from a customer group.' + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to remove + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.removeCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/customer_group' + '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' + /customer-groups: + post: + operationId: PostCustomerGroups + summary: Create a Customer Group + description: Creates a CustomerGroup. + x-authenticated: true + parameters: [] + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.create({ + name: 'VIP' + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customer-groups' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "VIP" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/customer_group' + '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' + requestBody: + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + type: string + description: Name of the customer group + metadata: + type: object + description: Metadata for the customer. + get: + operationId: GetCustomerGroups + summary: List Customer Groups + description: Retrieve a list of customer groups. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching customer group names. + schema: + type: string + - in: query + name: offset + description: How many groups to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: order + description: the field used to order the customer groups. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the customer groups. + schema: + type: string + - in: query + name: id + style: form + explode: false + description: Filter by the customer group ID + schema: + oneOf: + - type: string + description: customer group ID + - type: array + description: multiple customer group IDs + items: + type: string + - type: object + properties: + lt: + type: string + description: filter by IDs less than this ID + gt: + type: string + description: filter by IDs greater than this ID + lte: + type: string + description: filter by IDs less than or equal to this ID + gte: + type: string + description: filter by IDs greater than or equal to this ID + - in: query + name: name + style: form + explode: false + description: Filter by the customer group name + schema: + type: array + description: multiple customer group names + items: + type: string + description: customer group name + - in: query + name: created_at + description: Date comparison for when resulting customer groups were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting customer groups were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: limit + description: Limit the number of customer groups returned. + schema: + type: integer + default: 10 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each customer + groups of the result. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.list() + + .then(({ customer_groups, limit, offset, count }) => { + console.log(customer_groups.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customer-groups' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_groups: + type: array + items: + $ref: '#/components/schemas/customer_group' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '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' + '/customer-groups/{id}': + delete: + operationId: DeleteCustomerGroupsCustomerGroup + summary: Delete a Customer Group + description: Deletes a CustomerGroup. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer Group + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.delete(customer_group_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/customer-groups/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted customer group. + object: + type: string + description: The type of the object that was deleted. + default: customer_group + deleted: + type: boolean + description: >- + Whether the customer group was deleted successfully or + not. + default: true + '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' + get: + operationId: GetCustomerGroupsGroup + summary: Get a Customer Group + description: Retrieves a Customer Group. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer Group. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in the customer + group. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in the customer + group. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.retrieve(customer_group_id) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customer-groups/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/customer_group' + '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' + post: + operationId: PostCustomerGroupsGroup + summary: Update a Customer Group + description: Update a CustomerGroup. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + description: Name of the customer group + type: string + metadata: + description: Metadata for the customer. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.update(customer_group_id, { + name: 'VIP' + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customer-groups/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "VIP" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/customer_group' + '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' + '/customer-groups/{id}/customers': + get: + operationId: GetCustomerGroupsGroupCustomers + summary: List Customers + description: Retrieves a list of customers in a customer group + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.listCustomers(customer_group_id) + + .then(({ customers }) => { + console.log(customers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customers: + type: array + items: + $ref: '#/components/schemas/customer' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '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' '/batch-jobs/{id}/cancel': post: operationId: PostBatchJobsBatchJobCancel @@ -520,6 +2060,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -582,6 +2123,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -607,6 +2149,7 @@ paths: content: application/json: schema: + type: object required: - type - context @@ -685,6 +2228,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -975,6 +2519,7 @@ paths: content: application/json: schema: + type: object properties: batch_jobs: type: array @@ -1048,6 +2593,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -1063,1516 +2609,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}/products/batch': - post: - operationId: PostProductsToCollection - summary: Update Products - description: Updates products associated with a Product Collection - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Collection. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collection: - $ref: '#/components/schemas/product_collection' - '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' - delete: - operationId: DeleteProductsFromCollection - summary: Remove Product - description: Removes products associated with a Product Collection - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Collection. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - product_ids - properties: - product_ids: - description: >- - An array of Product IDs to remove from the Product - Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - id: - type: string - description: The ID of the collection - object: - type: string - description: The type of object the removal was executed on - default: product-collection - removed_products: - description: The IDs of the products removed from the collection - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string - '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' - /collections: - post: - operationId: PostCollections - summary: Create a Collection - description: Creates a Product Collection. - x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - title - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.create({ - title: 'New Collection' - }) - - .then(({ collection }) => { - console.log(collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "title": "New Collection" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collection: - $ref: '#/components/schemas/product_collection' - '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' - get: - operationId: GetCollections - summary: List Collections - description: Retrieve a list of Product Collection. - x-authenticated: true - parameters: - - in: query - name: limit - description: The number of collections to return. - schema: - type: integer - default: 10 - - in: query - name: offset - description: The number of collections to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: title - description: The title of collections to return. - schema: - type: string - - in: query - name: handle - description: The handle of collections to return. - schema: - type: string - - in: query - name: q - description: a search term to search titles and handles. - schema: - type: string - - in: query - name: discount_condition_id - description: >- - The discount condition id on which to filter the product - collections. - schema: - type: string - - in: query - name: created_at - description: Date comparison for when resulting collections were created. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - - in: query - name: updated_at - description: Date comparison for when resulting collections were updated. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - - in: query - name: deleted_at - description: Date comparison for when resulting collections were deleted. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.list() - - .then(({ collections, limit, offset, count }) => { - console.log(collections.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/collections' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collections: - type: array - items: - $ref: '#/components/schemas/product_collection' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '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' - '/collections/{id}': - delete: - operationId: DeleteCollectionsCollection - summary: Delete a Collection - description: Deletes a Product Collection. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Collection. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.delete(collection_id) - - .then(({ id, object, deleted }) => { - console.log(id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - id: - type: string - description: The ID of the deleted Collection - object: - type: string - description: The type of the object that was deleted. - default: product-collection - deleted: - type: boolean - description: Whether the collection was deleted successfully or not. - default: true - '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' - get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product Collection - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.retrieve(collection_id) - - .then(({ collection }) => { - console.log(collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/collections/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collection: - $ref: '#/components/schemas/product_collection' - '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' - post: - operationId: PostCollectionsCollection - summary: Update a Collection - description: Updates a Product Collection. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Collection. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.update(collection_id, { - title: 'New Collection' - }) - - .then(({ collection }) => { - console.log(collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "title": "New Collection" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collection: - $ref: '#/components/schemas/product_collection' - '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' - /currencies: - get: - operationId: GetCurrencies - summary: List Currency - description: Retrieves a list of Currency - x-authenticated: true - parameters: - - in: query - name: code - description: Code of the currency to search for. - schema: - type: string - - in: query - name: includes_tax - description: Search for tax inclusive currencies. - schema: - type: boolean - - in: query - name: order - description: order to retrieve products in. - schema: - type: string - - in: query - name: offset - description: How many products to skip in the result. - schema: - type: number - default: '0' - - in: query - name: limit - description: Limit the number of products returned. - schema: - type: number - default: '20' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.list() - - .then(({ currencies, count, offset, limit }) => { - console.log(currencies.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies' \ - - --header 'Authorization: Bearer {api_token}' - tags: - - Currency - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - currencies: - type: array - items: - $ref: '#/components/schemas/currency' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '/currencies/{code}': - post: - operationId: PostCurrenciesCurrency - summary: Update a Currency - description: Update a Currency - x-authenticated: true - parameters: - - in: path - name: code - required: true - description: The code of the Currency. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - includes_tax: - type: boolean - description: '[EXPERIMENTAL] Tax included in prices of currency.' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.update(code, { - includes_tax: true - }) - - .then(({ currency }) => { - console.log(currency.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies/{code}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "includes_tax": true - }' - tags: - - Currency - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - currency: - $ref: '#/components/schemas/currency' - '/customer-groups/{id}/customers/batch': - post: - operationId: PostCustomerGroupsGroupCustomersBatch - summary: Add Customers - description: 'Adds a list of customers, represented by id''s, to a customer group.' - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the customer group. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to add - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.addCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] - }) - - .then(({ customer_group }) => { - console.log(customer_group.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "customer_ids": [ - { - "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" - } - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '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' - delete: - operationId: DeleteCustomerGroupsGroupCustomerBatch - summary: Remove Customers - description: 'Removes a list of customers, represented by id''s, from a customer group.' - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the customer group. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to remove - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.removeCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] - }) - - .then(({ customer_group }) => { - console.log(customer_group.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "customer_ids": [ - { - "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" - } - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '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' - /customer-groups: - post: - operationId: PostCustomerGroups - summary: Create a Customer Group - description: Creates a CustomerGroup. - x-authenticated: true - parameters: [] - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.create({ - name: 'VIP' - }) - - .then(({ customer_group }) => { - console.log(customer_group.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/customer-groups' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "name": "VIP" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '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' - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - type: string - description: Name of the customer group - metadata: - type: object - description: Metadata for the customer. - get: - operationId: GetCustomerGroups - summary: List Customer Groups - description: Retrieve a list of customer groups. - x-authenticated: true - parameters: - - in: query - name: q - description: Query used for searching customer group names. - schema: - type: string - - in: query - name: offset - description: How many groups to skip in the result. - schema: - type: integer - default: 0 - - in: query - name: order - description: the field used to order the customer groups. - schema: - type: string - - in: query - name: discount_condition_id - description: The discount condition id on which to filter the customer groups. - schema: - type: string - - in: query - name: id - style: form - explode: false - description: Filter by the customer group ID - schema: - oneOf: - - type: string - description: customer group ID - - type: array - description: multiple customer group IDs - items: - type: string - - type: object - properties: - lt: - type: string - description: filter by IDs less than this ID - gt: - type: string - description: filter by IDs greater than this ID - lte: - type: string - description: filter by IDs less than or equal to this ID - gte: - type: string - description: filter by IDs greater than or equal to this ID - - in: query - name: name - style: form - explode: false - description: Filter by the customer group name - schema: - type: array - description: multiple customer group names - items: - type: string - description: customer group name - - in: query - name: created_at - description: Date comparison for when resulting customer groups were created. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - - in: query - name: updated_at - description: Date comparison for when resulting customer groups were updated. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - - in: query - name: limit - description: Limit the number of customer groups returned. - schema: - type: integer - default: 10 - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each customer - groups of the result. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.list() - - .then(({ customer_groups, limit, offset, count }) => { - console.log(customer_groups.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/customer-groups' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer_groups: - type: array - items: - $ref: '#/components/schemas/customer_group' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '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' - '/customer-groups/{id}': - delete: - operationId: DeleteCustomerGroupsCustomerGroup - summary: Delete a Customer Group - description: Deletes a CustomerGroup. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Customer Group - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.delete(customer_group_id) - - .then(({ id, object, deleted }) => { - console.log(id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - id: - type: string - description: The ID of the deleted customer group. - object: - type: string - description: The type of the object that was deleted. - default: customer_group - deleted: - type: boolean - description: >- - Whether the customer group was deleted successfully or - not. - default: true - '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' - get: - operationId: GetCustomerGroupsGroup - summary: Get a Customer Group - description: Retrieves a Customer Group. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Customer Group. - schema: - type: string - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in the customer - group. - schema: - type: string - - in: query - name: fields - description: >- - (Comma separated) Which fields should be included in the customer - group. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.retrieve(customer_group_id) - - .then(({ customer_group }) => { - console.log(customer_group.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/customer-groups/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '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' - post: - operationId: PostCustomerGroupsGroup - summary: Update a Customer Group - description: Update a CustomerGroup. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the customer group. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - name: - description: Name of the customer group - type: string - metadata: - description: Metadata for the customer. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.update(customer_group_id, { - name: 'VIP' - }) - - .then(({ customer_group }) => { - console.log(customer_group.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/customer-groups/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "name": "VIP" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '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' - '/customer-groups/{id}/customers': - get: - operationId: GetCustomerGroupsGroupCustomers - summary: List Customers - description: Retrieves a list of customers in a customer group - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the customer group. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.listCustomers(customer_group_id) - - .then(({ customers }) => { - console.log(customers.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customers: - type: array - items: - $ref: '#/components/schemas/customer' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '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' /customers: post: operationId: PostCustomers @@ -2583,6 +2619,7 @@ paths: content: application/json: schema: + type: object required: - email - first_name @@ -2659,6 +2696,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2736,6 +2774,7 @@ paths: content: application/json: schema: + type: object properties: customers: type: array @@ -2819,6 +2858,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2860,6 +2900,7 @@ paths: content: application/json: schema: + type: object properties: email: type: string @@ -2935,6 +2976,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -3003,6 +3045,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3072,6 +3115,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3124,6 +3168,7 @@ paths: content: application/json: schema: + type: object required: - resources properties: @@ -3181,6 +3226,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3232,6 +3278,7 @@ paths: content: application/json: schema: + type: object required: - resources properties: @@ -3289,6 +3336,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3338,6 +3386,7 @@ paths: content: application/json: schema: + type: object required: - operator properties: @@ -3424,6 +3473,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3462,9 +3512,11 @@ paths: content: application/json: schema: + type: object required: - code - rule + - regions properties: code: type: string @@ -3618,6 +3670,7 @@ paths: value: 10, allocation: AllocationType.ITEM }, + regions: ['reg_XXXXXXXX'], is_dynamic: false, is_disabled: false }) @@ -3641,7 +3694,8 @@ paths: "type": "fixed", "value": 10, "allocation": "item" - } + }, + "regions": ['reg_XXXXXXXX'] }' security: - api_token: [] @@ -3654,6 +3708,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3766,6 +3821,7 @@ paths: content: application/json: schema: + type: object properties: discounts: type: array @@ -3851,6 +3907,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3950,6 +4007,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -4042,6 +4100,7 @@ paths: content: application/json: schema: + type: object properties: discount_condition: $ref: '#/components/schemas/discount_condition' @@ -4096,6 +4155,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -4177,6 +4237,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4239,6 +4300,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -4319,6 +4381,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4366,6 +4429,7 @@ paths: content: application/json: schema: + type: object properties: code: type: string @@ -4523,6 +4587,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4591,6 +4656,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4663,6 +4729,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4688,6 +4755,7 @@ paths: content: application/json: schema: + type: object required: - email - items @@ -4851,6 +4919,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -4925,6 +4994,7 @@ paths: content: application/json: schema: + type: object properties: draft_orders: type: array @@ -4968,6 +5038,7 @@ paths: content: application/json: schema: + type: object required: - quantity properties: @@ -5033,6 +5104,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5095,6 +5167,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -5165,6 +5238,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5234,6 +5308,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5271,6 +5346,7 @@ paths: content: application/json: schema: + type: object properties: unit_price: description: The potential custom price of the item. @@ -5329,6 +5405,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5391,6 +5468,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/draft-order' @@ -5423,6 +5501,7 @@ paths: content: application/json: schema: + type: object properties: region_id: type: string @@ -5509,6 +5588,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5536,6 +5616,7 @@ paths: content: application/json: schema: + type: object required: - region_id properties: @@ -5605,6 +5686,7 @@ paths: content: application/json: schema: + type: object properties: gift_card: $ref: '#/components/schemas/gift_card' @@ -5677,6 +5759,7 @@ paths: content: application/json: schema: + type: object properties: gift_cards: type: array @@ -5750,6 +5833,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -5820,6 +5904,7 @@ paths: content: application/json: schema: + type: object properties: gift_card: $ref: '#/components/schemas/gift_card' @@ -5853,6 +5938,7 @@ paths: content: application/json: schema: + type: object properties: balance: type: integer @@ -5920,6 +6006,7 @@ paths: content: application/json: schema: + type: object properties: gift_card: $ref: '#/components/schemas/gift_card' @@ -5944,6 +6031,7 @@ paths: content: application/json: schema: + type: object required: - token - user @@ -6044,6 +6132,7 @@ paths: content: application/json: schema: + type: object required: - user - role @@ -6155,6 +6244,7 @@ paths: content: application/json: schema: + type: object properties: invites: type: array @@ -6219,6 +6309,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -6313,6 +6404,7 @@ paths: content: application/json: schema: + type: object required: - resource_id - resource_type @@ -6373,6 +6465,7 @@ paths: content: application/json: schema: + type: object properties: note: $ref: '#/components/schemas/note' @@ -6443,6 +6536,7 @@ paths: content: application/json: schema: + type: object properties: notes: type: array @@ -6516,6 +6610,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -6586,6 +6681,7 @@ paths: content: application/json: schema: + type: object properties: note: $ref: '#/components/schemas/note' @@ -6617,6 +6713,7 @@ paths: content: application/json: schema: + type: object required: - value properties: @@ -6665,6 +6762,7 @@ paths: content: application/json: schema: + type: object properties: note: $ref: '#/components/schemas/note' @@ -6775,6 +6873,7 @@ paths: content: application/json: schema: + type: object properties: notifications: type: array @@ -6811,6 +6910,7 @@ paths: content: application/json: schema: + type: object properties: to: description: >- @@ -6851,6 +6951,7 @@ paths: content: application/json: schema: + type: object properties: notification: $ref: '#/components/schemas/notification' @@ -6882,6 +6983,7 @@ paths: content: application/json: schema: + type: object required: - variant_id - quantity @@ -6940,6 +7042,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7001,6 +7104,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7058,6 +7162,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7078,6 +7183,7 @@ paths: content: application/json: schema: + type: object required: - order_id properties: @@ -7126,6 +7232,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7143,8 +7250,8 @@ paths: $ref: '#/components/responses/500_error' get: operationId: GetOrderEdits - summary: List an OrderEdit - description: List a OrderEdit. + summary: List OrderEdits + description: List OrderEdits. x-authenticated: true parameters: - in: query @@ -7212,6 +7319,7 @@ paths: content: application/json: schema: + type: object properties: order_edits: type: array @@ -7289,6 +7397,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7326,6 +7435,7 @@ paths: content: application/json: schema: + type: object required: - quantity properties: @@ -7372,6 +7482,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7441,6 +7552,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -7501,6 +7613,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -7570,6 +7683,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7601,6 +7715,7 @@ paths: content: application/json: schema: + type: object properties: internal_note: description: An optional note to create or update for the order edit. @@ -7646,6 +7761,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7707,6 +7823,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7778,6 +7895,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -7865,6 +7983,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -7934,6 +8053,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8010,6 +8130,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8086,6 +8207,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8155,6 +8277,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8220,6 +8343,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8289,6 +8413,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8351,6 +8476,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8413,6 +8539,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8451,6 +8578,7 @@ paths: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -8505,6 +8633,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8537,6 +8666,7 @@ paths: content: application/json: schema: + type: object required: - type - claim_items @@ -8710,6 +8840,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8744,6 +8875,7 @@ paths: content: application/json: schema: + type: object required: - items properties: @@ -8823,6 +8955,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8855,6 +8988,7 @@ paths: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -8913,6 +9047,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8951,6 +9086,7 @@ paths: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -9010,6 +9146,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9044,6 +9181,7 @@ paths: content: application/json: schema: + type: object required: - return_items properties: @@ -9174,6 +9312,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9212,6 +9351,7 @@ paths: content: application/json: schema: + type: object properties: metadata: description: >- @@ -9258,6 +9398,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9296,6 +9437,7 @@ paths: content: application/json: schema: + type: object properties: metadata: description: >- @@ -9342,6 +9484,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9404,6 +9547,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9435,6 +9579,7 @@ paths: content: application/json: schema: + type: object properties: email: description: the email for the order @@ -9541,6 +9686,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9810,6 +9956,7 @@ paths: content: application/json: schema: + type: object properties: orders: type: array @@ -9893,6 +10040,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9925,6 +10073,7 @@ paths: content: application/json: schema: + type: object required: - amount - reason @@ -9987,6 +10136,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -10021,6 +10171,7 @@ paths: content: application/json: schema: + type: object required: - items properties: @@ -10128,6 +10279,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -10166,6 +10318,7 @@ paths: content: application/json: schema: + type: object properties: claim_items: description: The Claim Items that the Claim will consist of. @@ -10297,6 +10450,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -10312,6 +10466,506 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/payment-collections/{id}': + delete: + operationId: DeletePaymentCollectionsPaymentCollection + summary: Delete a Payment Collection + description: Deletes a Payment Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.paymentCollections.delete(payment_collection_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/payment-collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Payment Collection. + object: + type: string + description: The type of the object that was deleted. + format: payment_collection + deleted: + type: boolean + description: Whether or not the Payment Collection was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/payment-collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + post: + operationId: PostPaymentCollectionsPaymentCollection + summary: Updates a PaymentCollection + description: Updates a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + description: + description: >- + An optional description to create or update the payment + collection. + type: string + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.paymentCollections.update(payment_collection_id, { + description: "Description of payCol" + }) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payment-collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "description": "Description of payCol" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payment-collections/{id}/authorize': + post: + operationId: PostPaymentCollectionsPaymentCollectionAuthorize + summary: Set the status of PaymentCollection as Authorized + description: Sets the status of PaymentCollection as Authorized. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.paymentCollections.markAsAuthorized(payment_collection_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payments/{id}/capture': + post: + operationId: PostPaymentsPaymentCapture + summary: Capture a Payment + description: Captures a Payment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.payments.capturePayment(payment_id) + + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payments/{id}/capture' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment: + $ref: '#/components/schemas/payment' + '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' + '/payments/{id}': + get: + operationId: GetPaymentsPayment + summary: Get Payment details + description: Retrieves the Payment details + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.payments.retrieve(payment_id) + + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/payments/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment: + $ref: '#/components/schemas/payment' + '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' + '/payments/{id}/refund': + post: + operationId: PostPaymentsPaymentRefunds + summary: Create a Refund + description: Issues a Refund. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.payments.refundPayment(payment_id, { + amount: 1000, + reason: 'return', + note: 'Do not like it', + }) + + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payments/pay_123/refund' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "amount": 1000, + "reason": "return", + "note": "Do not like it" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + refund: + $ref: '#/components/schemas/refund' + '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' '/price-lists/{id}/prices/batch': post: operationId: PostPriceListsPriceListPricesBatch @@ -10329,6 +10983,7 @@ paths: content: application/json: schema: + type: object properties: prices: description: The prices to update or add. @@ -10426,6 +11081,7 @@ paths: content: application/json: schema: + type: object properties: price_list: $ref: '#/components/schemas/price_list' @@ -10459,6 +11115,7 @@ paths: content: application/json: schema: + type: object properties: price_ids: description: The price id's of the Money Amounts to delete. @@ -10511,6 +11168,7 @@ paths: content: application/json: schema: + type: object properties: ids: type: array @@ -10547,6 +11205,7 @@ paths: content: application/json: schema: + type: object required: - name - description @@ -10690,6 +11349,7 @@ paths: content: application/json: schema: + type: object properties: price_list: $ref: '#/components/schemas/price_list' @@ -10885,6 +11545,7 @@ paths: content: application/json: schema: + type: object properties: price_lists: type: array @@ -10958,6 +11619,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -11028,6 +11690,7 @@ paths: content: application/json: schema: + type: object properties: price_list: $ref: '#/components/schemas/price_list' @@ -11059,6 +11722,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Price List @@ -11180,6 +11844,7 @@ paths: content: application/json: schema: + type: object properties: price_list: $ref: '#/components/schemas/price_list' @@ -11252,6 +11917,7 @@ paths: content: application/json: schema: + type: object properties: ids: type: array @@ -11335,6 +12001,7 @@ paths: content: application/json: schema: + type: object properties: ids: type: array @@ -11574,6 +12241,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -11730,6 +12398,7 @@ paths: content: application/json: schema: + type: object properties: product_tags: $ref: '#/components/schemas/product_tag' @@ -11884,6 +12553,7 @@ paths: content: application/json: schema: + type: object properties: product_types: $ref: '#/components/schemas/product_type' @@ -11925,6 +12595,7 @@ paths: content: application/json: schema: + type: object required: - title properties: @@ -11975,6 +12646,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -12000,6 +12672,7 @@ paths: content: application/json: schema: + type: object required: - title properties: @@ -12281,6 +12954,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -12532,6 +13206,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -12577,6 +13252,7 @@ paths: content: application/json: schema: + type: object required: - title - prices @@ -12754,6 +13430,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -12822,6 +13499,7 @@ paths: content: application/json: schema: + type: object properties: variants: type: array @@ -12905,6 +13583,7 @@ paths: content: application/json: schema: + type: object properties: option_id: type: string @@ -12953,6 +13632,7 @@ paths: content: application/json: schema: + type: object required: - title properties: @@ -13001,6 +13681,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -13063,6 +13744,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -13133,6 +13815,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -13164,6 +13847,7 @@ paths: content: application/json: schema: + type: object properties: title: description: The title of the Product @@ -13425,6 +14109,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -13493,6 +14178,7 @@ paths: content: application/json: schema: + type: object properties: variant_id: type: string @@ -13541,6 +14227,7 @@ paths: content: application/json: schema: + type: object required: - prices properties: @@ -13709,6 +14396,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -13764,6 +14452,7 @@ paths: content: application/json: schema: + type: object properties: tags: type: array @@ -13831,6 +14520,7 @@ paths: content: application/json: schema: + type: object properties: types: type: array @@ -13865,6 +14555,7 @@ paths: content: application/json: schema: + type: object required: - key - value @@ -13920,6 +14611,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -13935,6 +14627,679 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/publishable-api-keys/{id}/sales-channels/batch': + post: + operationId: PostPublishableApiKeySalesChannelsChannelsBatch + summary: Add sales channel to a publishable api key scope + description: Assign a batch of sales channels to a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: >- + The IDs of the sales channels to add to the publishable api + key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.addSalesChannels(publishableApiKeyId, + { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) + + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Key + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' + delete: + operationId: DeletePublishableApiKeySalesChannelsChannelsBatch + summary: Remove sales channel from a publishable api key scope + description: Remove a batch of sales channels from a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: >- + The IDs of the sales channels to delete from the publishable + api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.removeSalesChannels(publishableApiKeyId, + { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) + + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Key + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' + /publishable-api-keys: + post: + operationId: PostPublishableApiKeys + summary: Create a PublishableApiKey + description: Creates a PublishableApiKey. + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + description: A title for the publishable api key + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.create() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys' \ + + --header 'Authorization: Bearer {api_token}' + + -d '{ "created_by": "user_123" }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' + get: + operationId: GetPublishableApiKeys + summary: List PublishableApiKeys + description: List PublishableApiKeys. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching publishable api keys by title. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.list() + .then(({ publishable_api_keys }) => { + console.log(publishable_api_keys) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKeys + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_keys: + type: array + $ref: '#/components/schemas/publishable_api_key' + '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' + '/publishable-api-keys/{id}': + delete: + operationId: DeletePublishableApiKeysPublishableApiKey + summary: Delete a PublishableApiKey + description: Deletes a PublishableApiKeys + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKeys to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.delete(key_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/publishable-api-key/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted PublishableApiKey. + object: + type: string + description: The type of the object that was deleted. + format: publishable_api_key + deleted: + type: boolean + description: Whether the PublishableApiKeys was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetPublishableApiKeysPublishableApiKey + summary: Get a Publishable API Key + description: Retrieve the Publishable Api Key. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.retrieve(pubKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123' \ + + --header 'Authorization: Bearer {api_token}' + + -d '{ "created_by": "user_123" }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' + '/publishable-api-keys/:id/sales-channels': + get: + operationId: GetPublishableApiKeySalesChannels + summary: List PublishableApiKey's SalesChannels + description: List PublishableApiKey's SalesChannels + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.listSalesChannels() + .then(({ sales_channels, limit, offset, count }) => { + console.log(sales_channels) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys/pk_123/sales-channels' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKeySalesChannels + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + sales_channels: + type: array + items: + $ref: '#/components/schemas/sales_channel' + '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' + '/publishable-api-keys/{id}/revoke': + post: + operationId: PostPublishableApiKeysPublishableApiKeyRevoke + summary: Revoke a PublishableApiKey + description: Revokes a PublishableApiKey. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.revoke() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123/revoke' + \ + + --header 'Authorization: Bearer {api_token}' + + -d '{ "created_by": "user_123", "revoked_by": "user_123" }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' + '/publishable-api-key/{id}': + post: + operationId: PostPublishableApiKysPublishableApiKey + summary: Updates a PublishableApiKey + description: Updates a PublishableApiKey. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + title: + description: A title to update for the key. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.update(publishable_key_id, { + title: "new title" + }) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-key/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "updated title" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' '/regions/{id}/countries': post: operationId: PostRegionsRegionCountries @@ -13952,6 +15317,7 @@ paths: content: application/json: schema: + type: object required: - country_code properties: @@ -14004,6 +15370,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14036,6 +15403,7 @@ paths: content: application/json: schema: + type: object required: - provider_id properties: @@ -14084,6 +15452,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14116,6 +15485,7 @@ paths: content: application/json: schema: + type: object required: - provider_id properties: @@ -14164,6 +15534,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14189,6 +15560,7 @@ paths: content: application/json: schema: + type: object required: - name - currency_code @@ -14302,6 +15674,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14395,6 +15768,7 @@ paths: content: application/json: schema: + type: object properties: regions: type: array @@ -14468,6 +15842,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -14538,6 +15913,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14569,6 +15945,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Region @@ -14667,6 +16044,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14729,6 +16107,7 @@ paths: content: application/json: schema: + type: object properties: fulfillment_options: type: array @@ -14812,6 +16191,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14881,6 +16261,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14950,6 +16331,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14965,39 +16347,91 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /return-reasons: + /shipping-options: post: - operationId: PostReturnReasons - summary: Create a Return Reason - description: Creates a Return Reason + operationId: PostShippingOptions + summary: Create Shipping Option + description: Creates a Shipping Option x-authenticated: true requestBody: content: application/json: schema: + type: object required: - - label - - value + - name + - region_id + - provider_id + - data + - price_type properties: - label: - description: The label to display to the Customer. + name: + description: The name of the Shipping Option type: string - value: + region_id: description: >- - The value that the Return Reason will be identified by. Must - be unique. + The ID of the Region in which the Shipping Option will be + available. type: string - parent_return_reason_id: - description: The ID of the parent return reason. + provider_id: + description: >- + The ID of the Fulfillment Provider that handles the Shipping + Option. type: string - description: - description: An optional description to for the Reason. + profile_id: + description: >- + The ID of the Shipping Profile to add the Shipping Option + to. + type: number + data: + description: >- + The data needed for the Fulfillment Provider to handle + shipping with this Shipping Option. + type: object + price_type: + description: The type of the Shipping Option price. type: string + enum: + - flat_rate + - calculated + amount: + description: The amount to charge for the Shipping Option. + type: integer + requirements: + description: >- + The requirements that must be satisfied for the Shipping + Option to be available. + type: array + items: + required: + - type + - amount + properties: + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + is_return: + description: Whether the Shipping Option defines a return shipment. + type: boolean + default: false + admin_only: + description: 'If true, the option can be used for draft orders' + type: boolean + default: false metadata: description: >- An optional set of key-value pairs with additional information. type: object + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -15009,42 +16443,50 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.create({ - label: 'Damaged', - value: 'damaged' + medusa.admin.shippingOptions.create({ + name: 'PostFake', + region_id: "saasf", + provider_id: "manual", + data: { + }, + price_type: 'flat_rate' }) - .then(({ return_reason }) => { - console.log(return_reason.id); + .then(({ shipping_option }) => { + console.log(shipping_option.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/return-reasons' \ + 'https://medusa-url.com/admin/shipping-options' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "label": "Damaged", - "value": "damaged" + "name": "PostFake", + "region_id": "afasf", + "provider_id": "manual", + "data": {}, + "price_type": "flat_rate" }' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Shipping Option responses: '200': description: OK content: application/json: schema: + type: object properties: - return_reason: - $ref: '#/components/schemas/return_reason' + shipping_option: + $ref: '#/components/schemas/shipping_option' '400': $ref: '#/components/responses/400_error' '401': @@ -15058,10 +16500,26 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetReturnReasons - summary: List Return Reasons - description: Retrieves a list of Return Reasons. + operationId: GetShippingOptions + summary: List Shipping Options + description: Retrieves a list of Shipping Options. x-authenticated: true + parameters: + - in: query + name: region_id + schema: + type: string + description: Region ID to fetch options from + - in: query + name: is_return + schema: + type: boolean + description: Flag for fetching return options only + - in: query + name: admin_only + schema: + type: boolean + description: Flag for fetching admin specific options x-codeSamples: - lang: JavaScript label: JS Client @@ -15073,34 +16531,38 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.list() + medusa.admin.shippingOptions.list() - .then(({ return_reasons }) => { - console.log(return_reasons.length); + .then(({ shipping_options, count }) => { + console.log(shipping_options.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/return-reasons' \ + 'https://medusa-url.com/admin/shipping-options' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Shipping Option responses: '200': description: OK content: application/json: schema: + type: object properties: - return_reasons: + shipping_options: type: array items: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/shipping_option' + count: + type: integer + description: The total number of items available '400': $ref: '#/components/responses/400_error' '401': @@ -15113,17 +16575,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/return-reasons/{id}': + '/shipping-options/{id}': delete: - operationId: DeleteReturnReason - summary: Delete a Return Reason - description: Deletes a return reason. + operationId: DeleteShippingOptionsOption + summary: Delete a Shipping Option + description: Deletes a Shipping Option. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the return reason + description: The ID of the Shipping Option. schema: type: string x-codeSamples: @@ -15137,7 +16599,7 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.delete(return_reason_id) + medusa.admin.shippingOptions.delete(option_id) .then(({ id, object, deleted }) => { console.log(id); @@ -15146,28 +16608,29 @@ paths: label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/return-reasons/{id}' \ + 'https://medusa-url.com/admin/shipping-options/{option_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Shipping Option responses: '200': description: OK content: application/json: schema: + type: object properties: id: type: string - description: The ID of the deleted return reason + description: The ID of the deleted Shipping Option. object: type: string description: The type of the object that was deleted. - default: return_reason + default: shipping-option deleted: type: boolean description: Whether or not the items were deleted. @@ -15185,15 +16648,15 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetReturnReasonsReason - summary: Get a Return Reason - description: Retrieves a Return Reason. + operationId: GetShippingOptionsOption + summary: Get a Shipping Option + description: Retrieves a Shipping Option. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Return Reason. + description: The ID of the Shipping Option. schema: type: string x-codeSamples: @@ -15207,32 +16670,33 @@ paths: // must be previously logged in or use api token - medusa.admin.returnReasons.retrieve(return_reason_id) + medusa.admin.shippingOptions.retrieve(option_id) - .then(({ return_reason }) => { - console.log(return_reason.id); + .then(({ shipping_option }) => { + console.log(shipping_option.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/return-reasons/{id}' \ + 'https://medusa-url.com/admin/shipping-options/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Return Reason + - Shipping Option responses: '200': description: OK content: application/json: schema: + type: object properties: - return_reason: - $ref: '#/components/schemas/return_reason' + shipping_option: + $ref: '#/components/schemas/shipping_option' '400': $ref: '#/components/responses/400_error' '401': @@ -15246,272 +16710,64 @@ paths: '500': $ref: '#/components/responses/500_error' post: - operationId: PostReturnReasonsReason - summary: Update a Return Reason - description: Updates a Return Reason + operationId: PostShippingOptionsOption + summary: Update Shipping Option + description: Updates a Shipping Option x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Return Reason. + description: The ID of the Shipping Option. schema: type: string requestBody: content: application/json: schema: + type: object + required: + - requirements properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - description: - description: An optional description to for the Reason. + name: + description: The name of the Shipping Option type: string + amount: + description: The amount to charge for the Shipping Option. + type: integer + admin_only: + description: 'If true, the option can be used for draft orders' + type: boolean metadata: description: >- An optional set of key-value pairs with additional information. type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.returnReasons.update(return_reason_id, { - label: 'Damaged' - }) - - .then(({ return_reason }) => { - console.log(return_reason.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/return-reasons/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "label": "Damaged" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - return_reason: - $ref: '#/components/schemas/return_reason' - '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' - '/returns/{id}/cancel': - post: - operationId: PostReturnsReturnCancel - summary: Cancel a Return - description: Registers a Return as canceled. - parameters: - - in: path - name: id - required: true - description: The ID of the Return. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.returns.cancel(return_id) - - .then(({ order }) => { - console.log(order.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/returns/{id}/cancel' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Return - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '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' - /returns: - get: - operationId: GetReturns - summary: List Returns - description: Retrieves a list of Returns - parameters: - - in: query - name: limit - description: The upper limit for the amount of responses returned. - schema: - type: number - default: '50' - - in: query - name: offset - description: The offset of the list returned. - schema: - type: number - default: '0' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.returns.list() - - .then(({ returns, limit, offset, count }) => { - console.log(returns.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET 'https://medusa-url.com/admin/returns' - \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Return - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - returns: - type: array - items: - $ref: '#/components/schemas/return' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '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' - '/returns/{id}/receive': - post: - operationId: PostReturnsReturnReceive - summary: Receive a Return - description: >- - Registers a Return as received. Updates statuses on Orders and Swaps - accordingly. - parameters: - - in: path - name: id - required: true - description: The ID of the Return. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - items - properties: - items: - description: The Line Items that have been received. + requirements: + description: >- + The requirements that must be satisfied for the Shipping + Option to be available. type: array items: required: - - item_id - - quantity + - type + - amount properties: - item_id: - description: The ID of the Line Item. + id: + description: The ID of the requirement type: string - quantity: - description: The quantity of the Line Item. + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. type: integer - refund: - description: The amount to refund. - type: number + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean x-codeSamples: - lang: JavaScript label: JS Client @@ -15523,33 +16779,35 @@ paths: // must be previously logged in or use api token - medusa.admin.returns.receive(return_id, { - items: [ + medusa.admin.shippingOptions.update(option_id, { + name: 'PostFake', + requirements: [ { - item_id, - quantity: 1 + id, + type: 'max_subtotal', + amount: 1000 } ] }) - .then((data) => { - console.log(data.return.id); + .then(({ shipping_option }) => { + console.log(shipping_option.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/returns/{id}/receive' \ + 'https://medusa-url.com/admin/shipping-options/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "items": [ + "requirements": [ { - "item_id": "asafg", - "quantity": 1 + "type": "max_subtotal", + "amount": 1000 } ] }' @@ -15557,16 +16815,361 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Return + - Shipping Option responses: '200': description: OK content: application/json: schema: + type: object properties: - return: - $ref: '#/components/schemas/return' + shipping_option: + $ref: '#/components/schemas/shipping_option' + '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' + /shipping-profiles: + post: + operationId: PostShippingProfiles + summary: Create a Shipping Profile + description: Creates a Shipping Profile + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + description: The name of the Shipping Profile + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.create({ + name: 'Large Products' + }) + + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/shipping-profiles' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Large Products" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/shipping_profile' + '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' + get: + operationId: GetShippingProfiles + summary: List Shipping Profiles + description: Retrieves a list of Shipping Profile. + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.list() + + .then(({ shipping_profiles }) => { + console.log(shipping_profiles.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profiles: + type: array + items: + $ref: '#/components/schemas/shipping_profile' + '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' + '/shipping-profiles/{id}': + delete: + operationId: DeleteShippingProfilesProfile + summary: Delete a Shipping Profile + description: Deletes a Shipping Profile. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.delete(profile_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Shipping Profile. + object: + type: string + description: The type of the object that was deleted. + default: shipping_profile + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + '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' + get: + operationId: GetShippingProfilesProfile + summary: Get a Shipping Profile + description: Retrieves a Shipping Profile. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.retrieve(profile_id) + + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/shipping_profile' + '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' + post: + operationId: PostShippingProfilesProfile + summary: Update a Shipping Profile + description: Updates a Shipping Profile + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + description: The name of the Shipping Profile + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.update(shipping_profile_id, { + name: 'Large Products' + }) + + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/shipping-profiles/{id} \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Large Products" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/shipping_profile' '400': $ref: '#/components/responses/400_error' '401': @@ -15596,6 +17199,7 @@ paths: content: application/json: schema: + type: object required: - product_ids properties: @@ -15660,6 +17264,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -15691,6 +17296,7 @@ paths: content: application/json: schema: + type: object required: - product_ids properties: @@ -15755,6 +17361,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -15780,6 +17387,7 @@ paths: content: application/json: schema: + type: object required: - name properties: @@ -15835,6 +17443,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -16007,6 +17616,7 @@ paths: content: application/json: schema: + type: object properties: sales_channels: type: array @@ -16080,6 +17690,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -16150,6 +17761,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -16181,6 +17793,7 @@ paths: content: application/json: schema: + type: object properties: name: type: string @@ -16233,6 +17846,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -16248,90 +17862,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /shipping-options: + '/returns/{id}/cancel': post: - operationId: PostShippingOptions - summary: Create Shipping Option - description: Creates a Shipping Option - x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - name - - region_id - - provider_id - - data - - price_type - properties: - name: - description: The name of the Shipping Option - type: string - region_id: - description: >- - The ID of the Region in which the Shipping Option will be - available. - type: string - provider_id: - description: >- - The ID of the Fulfillment Provider that handles the Shipping - Option. - type: string - profile_id: - description: >- - The ID of the Shipping Profile to add the Shipping Option - to. - type: number - data: - description: >- - The data needed for the Fulfillment Provider to handle - shipping with this Shipping Option. - type: object - price_type: - description: The type of the Shipping Option price. - type: string - enum: - - flat_rate - - calculated - amount: - description: The amount to charge for the Shipping Option. - type: integer - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. - type: array - items: - required: - - type - - amount - properties: - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - is_return: - description: Whether the Shipping Option defines a return shipment. - type: boolean - default: false - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - default: false - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + operationId: PostReturnsReturnCancel + summary: Cancel a Return + description: Registers a Return as canceled. + parameters: + - in: path + name: id + required: true + description: The ID of the Return. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -16343,49 +17885,33 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingOptions.create({ - name: 'PostFake', - region_id: "saasf", - provider_id: "manual", - data: { - }, - price_type: 'flat_rate' - }) + medusa.admin.returns.cancel(return_id) - .then(({ shipping_option }) => { - console.log(shipping_option.id); + .then(({ order }) => { + console.log(order.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/shipping-options' \ + 'https://medusa-url.com/admin/returns/{id}/cancel' \ - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "name": "PostFake", - "region_id": "afasf", - "provider_id": "manual", - "data": {}, - "price_type": "flat_rate" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Return responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' + order: + $ref: '#/components/schemas/order' '400': $ref: '#/components/responses/400_error' '401': @@ -16398,27 +17924,24 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /returns: get: - operationId: GetShippingOptions - summary: List Shipping Options - description: Retrieves a list of Shipping Options. - x-authenticated: true + operationId: GetReturns + summary: List Returns + description: Retrieves a list of Returns parameters: - in: query - name: region_id + name: limit + description: The upper limit for the amount of responses returned. schema: - type: string - description: Region ID to fetch options from + type: number + default: '50' - in: query - name: is_return + name: offset + description: The offset of the list returned. schema: - type: boolean - description: Flag for fetching return options only - - in: query - name: admin_only - schema: - type: boolean - description: Flag for fetching admin specific options + type: number + default: '0' x-codeSamples: - lang: JavaScript label: JS Client @@ -16430,37 +17953,44 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingOptions.list() + medusa.admin.returns.list() - .then(({ shipping_options, count }) => { - console.log(shipping_options.length); + .then(({ returns, limit, offset, count }) => { + console.log(returns.length); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-options' \ + curl --location --request GET 'https://medusa-url.com/admin/returns' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Return responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_options: + returns: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/return' count: type: integer description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -16473,196 +18003,45 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/shipping-options/{id}': - delete: - operationId: DeleteShippingOptionsOption - summary: Delete a Shipping Option - description: Deletes a Shipping Option. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Option. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingOptions.delete(option_id) - - .then(({ id, object, deleted }) => { - console.log(id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/shipping-options/{option_id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Option - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - id: - type: string - description: The ID of the deleted Shipping Option. - object: - type: string - description: The type of the object that was deleted. - default: shipping-option - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true - '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' - get: - operationId: GetShippingOptionsOption - summary: Get a Shipping Option - description: Retrieves a Shipping Option. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Option. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingOptions.retrieve(option_id) - - .then(({ shipping_option }) => { - console.log(shipping_option.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-options/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Option - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' - '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' + '/returns/{id}/receive': post: - operationId: PostShippingOptionsOption - summary: Update Shipping Option - description: Updates a Shipping Option - x-authenticated: true + operationId: PostReturnsReturnReceive + summary: Receive a Return + description: >- + Registers a Return as received. Updates statuses on Orders and Swaps + accordingly. parameters: - in: path name: id required: true - description: The ID of the Shipping Option. + description: The ID of the Return. schema: type: string requestBody: content: application/json: schema: + type: object required: - - requirements + - items properties: - name: - description: The name of the Shipping Option - type: string - amount: - description: The amount to charge for the Shipping Option. - type: integer - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. + items: + description: The Line Items that have been received. type: array items: required: - - type - - amount + - item_id + - quantity properties: - id: - description: The ID of the requirement + item_id: + description: The ID of the Line Item. type: string - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. + quantity: + description: The quantity of the Line Item. type: integer - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + refund: + description: The amount to refund. + type: number x-codeSamples: - lang: JavaScript label: JS Client @@ -16674,35 +18053,33 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingOptions.update(option_id, { - name: 'PostFake', - requirements: [ + medusa.admin.returns.receive(return_id, { + items: [ { - id, - type: 'max_subtotal', - amount: 1000 + item_id, + quantity: 1 } ] }) - .then(({ shipping_option }) => { - console.log(shipping_option.id); + .then((data) => { + console.log(data.return.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/shipping-options/{id}' \ + 'https://medusa-url.com/admin/returns/{id}/receive' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "requirements": [ + "items": [ { - "type": "max_subtotal", - "amount": 1000 + "item_id": "asafg", + "quantity": 1 } ] }' @@ -16710,16 +18087,17 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Shipping Option + - Return responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' + return: + $ref: '#/components/schemas/return' '400': $ref: '#/components/responses/400_error' '401': @@ -16732,22 +18110,40 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /shipping-profiles: + /return-reasons: post: - operationId: PostShippingProfiles - summary: Create a Shipping Profile - description: Creates a Shipping Profile + operationId: PostReturnReasons + summary: Create a Return Reason + description: Creates a Return Reason x-authenticated: true requestBody: content: application/json: schema: + type: object required: - - name + - label + - value properties: - name: - description: The name of the Shipping Profile + label: + description: The label to display to the Customer. type: string + value: + description: >- + The value that the Return Reason will be identified by. Must + be unique. + type: string + parent_return_reason_id: + description: The ID of the parent return reason. + type: string + description: + description: An optional description to for the Reason. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -16759,40 +18155,43 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.create({ - name: 'Large Products' + medusa.admin.returnReasons.create({ + label: 'Damaged', + value: 'damaged' }) - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); + .then(({ return_reason }) => { + console.log(return_reason.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/shipping-profiles' \ + 'https://medusa-url.com/admin/return-reasons' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "Large Products" + "label": "Damaged", + "value": "damaged" }' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' + return_reason: + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -16806,9 +18205,9 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetShippingProfiles - summary: List Shipping Profiles - description: Retrieves a list of Shipping Profile. + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. x-authenticated: true x-codeSamples: - lang: JavaScript @@ -16821,34 +18220,35 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.list() + medusa.admin.returnReasons.list() - .then(({ shipping_profiles }) => { - console.log(shipping_profiles.length); + .then(({ return_reasons }) => { + console.log(return_reasons.length); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles' \ + 'https://medusa-url.com/admin/return-reasons' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_profiles: + return_reasons: type: array items: - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -16861,17 +18261,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/shipping-profiles/{id}': + '/return-reasons/{id}': delete: - operationId: DeleteShippingProfilesProfile - summary: Delete a Shipping Profile - description: Deletes a Shipping Profile. + operationId: DeleteReturnReason + summary: Delete a Return Reason + description: Deletes a return reason. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Shipping Profile. + description: The ID of the return reason schema: type: string x-codeSamples: @@ -16885,7 +18285,7 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.delete(profile_id) + medusa.admin.returnReasons.delete(return_reason_id) .then(({ id, object, deleted }) => { console.log(id); @@ -16894,28 +18294,29 @@ paths: label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + 'https://medusa-url.com/admin/return-reasons/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK content: application/json: schema: + type: object properties: id: type: string - description: The ID of the deleted Shipping Profile. + description: The ID of the deleted return reason object: type: string description: The type of the object that was deleted. - default: shipping_profile + default: return_reason deleted: type: boolean description: Whether or not the items were deleted. @@ -16933,15 +18334,15 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetShippingProfilesProfile - summary: Get a Shipping Profile - description: Retrieves a Shipping Profile. + operationId: GetReturnReasonsReason + summary: Get a Return Reason + description: Retrieves a Return Reason. x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Shipping Profile. + description: The ID of the Return Reason. schema: type: string x-codeSamples: @@ -16955,32 +18356,33 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.retrieve(profile_id) + medusa.admin.returnReasons.retrieve(return_reason_id) - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); + .then(({ return_reason }) => { + console.log(return_reason.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + 'https://medusa-url.com/admin/return-reasons/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' + return_reason: + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -16994,24 +18396,39 @@ paths: '500': $ref: '#/components/responses/500_error' post: - operationId: PostShippingProfilesProfile - summary: Update a Shipping Profile - description: Updates a Shipping Profile + operationId: PostReturnReasonsReason + summary: Update a Return Reason + description: Updates a Return Reason + x-authenticated: true parameters: - in: path name: id required: true - description: The ID of the Shipping Profile. + description: The ID of the Return Reason. schema: type: string requestBody: content: application/json: schema: + type: object properties: - name: - description: The name of the Shipping Profile + label: + description: The label to display to the Customer. type: string + value: + description: >- + The value that the Return Reason will be identified by. Must + be unique. + type: string + description: + description: An optional description to for the Reason. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object x-codeSamples: - lang: JavaScript label: JS Client @@ -17023,40 +18440,41 @@ paths: // must be previously logged in or use api token - medusa.admin.shippingProfiles.update(shipping_profile_id, { - name: 'Large Products' + medusa.admin.returnReasons.update(return_reason_id, { + label: 'Damaged' }) - .then(({ shipping_profile }) => { - console.log(shipping_profile.id); + .then(({ return_reason }) => { + console.log(return_reason.id); }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/shipping-profiles/{id} \ + 'https://medusa-url.com/admin/return-reasons/{id}' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "Large Products" + "label": "Damaged" }' security: - api_token: [] - cookie_auth: [] tags: - - Shipping Profile + - Return Reason responses: '200': description: OK content: application/json: schema: + type: object properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' + return_reason: + $ref: '#/components/schemas/return_reason' '400': $ref: '#/components/responses/400_error' '401': @@ -17119,6 +18537,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17183,6 +18602,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17236,6 +18656,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17260,6 +18681,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Store @@ -17337,6 +18759,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17392,6 +18815,7 @@ paths: content: application/json: schema: + type: object properties: payment_providers: type: array @@ -17449,6 +18873,7 @@ paths: content: application/json: schema: + type: object properties: tax_providers: type: array @@ -17513,6 +18938,7 @@ paths: content: application/json: schema: + type: object properties: swap: $ref: '#/components/schemas/swap' @@ -17579,6 +19005,7 @@ paths: content: application/json: schema: + type: object properties: swaps: type: array @@ -17640,6 +19067,7 @@ paths: content: application/json: schema: + type: object required: - product_types properties: @@ -17696,6 +19124,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17745,6 +19174,7 @@ paths: content: application/json: schema: + type: object required: - product_types properties: @@ -17801,6 +19231,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17851,6 +19282,7 @@ paths: content: application/json: schema: + type: object required: - products properties: @@ -17905,6 +19337,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17954,6 +19387,7 @@ paths: content: application/json: schema: + type: object required: - products properties: @@ -18010,6 +19444,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18060,6 +19495,7 @@ paths: content: application/json: schema: + type: object required: - shipping_options properties: @@ -18117,6 +19553,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18166,6 +19603,7 @@ paths: content: application/json: schema: + type: object required: - shipping_options properties: @@ -18223,6 +19661,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18267,6 +19706,7 @@ paths: content: application/json: schema: + type: object required: - code - name @@ -18349,6 +19789,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18477,6 +19918,7 @@ paths: content: application/json: schema: + type: object properties: tax_rates: type: array @@ -18550,6 +19992,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -18638,6 +20081,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18687,6 +20131,7 @@ paths: content: application/json: schema: + type: object properties: code: type: string @@ -18761,6 +20206,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18776,695 +20222,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /uploads/protected: - post: - operationId: PostUploadsProtected - summary: Upload files with acl or in a non-public bucket - description: >- - Uploads at least one file to the specific fileservice that is installed - in Medusa. - x-authenticated: true - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - files: - type: string - format: binary - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.uploads.createProtected(file) - - .then(({ uploads }) => { - console.log(uploads.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/uploads/protected' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: image/jpeg' \ - - --form 'files=@""' \ - - --form 'files=@""' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Upload - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - uploads: - type: array - items: - type: object - properties: - url: - type: string - description: The URL of the uploaded file. - format: uri - '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' - /uploads: - post: - operationId: PostUploads - summary: Upload files - description: >- - Uploads at least one file to the specific fileservice that is installed - in Medusa. - x-authenticated: true - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - files: - type: string - format: binary - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.uploads.create(file) - - .then(({ uploads }) => { - console.log(uploads.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/uploads' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: image/jpeg' \ - - --form 'files=@""' \ - - --form 'files=@""' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Upload - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - uploads: - type: array - items: - type: object - properties: - url: - type: string - description: The URL of the uploaded file. - format: uri - '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' - /users: - post: - operationId: PostUsers - summary: Create a User - description: Creates a User - x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - email - - password - properties: - email: - description: The Users email. - type: string - format: email - first_name: - description: The name of the User. - type: string - last_name: - description: The name of the User. - type: string - role: - description: Userrole assigned to the user. - type: string - enum: - - admin - - member - - developer - password: - description: The Users password. - type: string - format: password - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.users.create({ - email: 'user@example.com', - password: 'supersecret' - }) - - .then(({ user }) => { - console.log(user.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST 'https://medusa-url.com/admin/users' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "email": "user@example.com", - "password": "supersecret" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - User - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - user: - $ref: '#/components/schemas/user' - '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' - get: - operationId: GetUsers - summary: List Users - description: Retrieves all users. - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.users.list() - - .then(({ users }) => { - console.log(users.length); - }); - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/users' \ - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - User - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - users: - type: array - items: - $ref: '#/components/schemas/user' - '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' - '/users/{id}': - delete: - operationId: DeleteUsersUser - summary: Delete a User - description: Deletes a User - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the User. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.users.delete(user_id) - - .then(({ id, object, deleted }) => { - console.log(id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/users/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - User - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - id: - type: string - description: The ID of the deleted user. - object: - type: string - description: The type of the object that was deleted. - default: user - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true - '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' - get: - operationId: GetUsersUser - summary: Get a User - description: Retrieves a User. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the User. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.users.retrieve(user_id) - - .then(({ user }) => { - console.log(user.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/users/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - User - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - user: - $ref: '#/components/schemas/user' - '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' - post: - operationId: PostUsersUser - summary: Update a User - description: Updates a User - parameters: - - in: path - name: id - required: true - description: The ID of the User. - schema: - type: string - x-authenticated: true - requestBody: - content: - application/json: - schema: - properties: - first_name: - description: The name of the User. - type: string - last_name: - description: The name of the User. - type: string - role: - description: Userrole assigned to the user. - type: string - enum: - - admin - - member - - developer - api_token: - description: The api token of the User. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.users.update(user_id, { - first_name: 'Marcellus' - }) - - .then(({ user }) => { - console.log(user.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/users/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "first_name": "Marcellus" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - User - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - user: - $ref: '#/components/schemas/user' - '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' - /users/password-token: - post: - operationId: PostUsersUserPasswordToken - summary: Request Password Reset - description: Generates a password token for a User with a given email. - x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - email - properties: - email: - description: The Users email. - type: string - format: email - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.users.sendResetPasswordToken({ - email: 'user@example.com' - }) - - .then(() => { - // successful - }) - - .catch(() => { - // error occurred - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/users/password-token' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "email": "user@example.com" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - User - responses: - '204': - 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' - /users/reset-password: - post: - operationId: PostUsersUserPassword - summary: Reset Password - description: Sets the password for a User given the correct token. - x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - token - - password - properties: - email: - description: The Users email. - type: string - format: email - token: - description: The token generated from the 'password-token' endpoint. - type: string - password: - description: The Users new password. - type: string - format: password - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.users.resetPassword({ - token: 'supersecrettoken', - password: 'supersecret' - }) - - .then(({ user }) => { - console.log(user.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/users/reset-password' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "token": "supersecrettoken", - "password": "supersecret" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - User - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - user: - $ref: '#/components/schemas/user' - '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' /variants: get: operationId: GetVariants @@ -19597,6 +20354,7 @@ paths: content: application/json: schema: + type: object properties: variants: type: array @@ -19623,6 +20381,707 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /uploads/protected: + post: + operationId: PostUploadsProtected + summary: Upload files with acl or in a non-public bucket + description: >- + Uploads at least one file to the specific fileservice that is installed + in Medusa. + x-authenticated: true + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: string + format: binary + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.uploads.createProtected(file) + + .then(({ uploads }) => { + console.log(uploads.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/uploads/protected' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: image/jpeg' \ + + --form 'files=@""' \ + + --form 'files=@""' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + uploads: + type: array + items: + type: object + properties: + url: + type: string + description: The URL of the uploaded file. + format: uri + '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' + /uploads: + post: + operationId: PostUploads + summary: Upload files + description: >- + Uploads at least one file to the specific fileservice that is installed + in Medusa. + x-authenticated: true + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: string + format: binary + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.uploads.create(file) + + .then(({ uploads }) => { + console.log(uploads.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/uploads' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: image/jpeg' \ + + --form 'files=@""' \ + + --form 'files=@""' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + uploads: + type: array + items: + type: object + properties: + url: + type: string + description: The URL of the uploaded file. + format: uri + '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' + /users: + post: + operationId: PostUsers + summary: Create a User + description: Creates a User + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - password + properties: + email: + description: The Users email. + type: string + format: email + first_name: + description: The name of the User. + type: string + last_name: + description: The name of the User. + type: string + role: + description: Userrole assigned to the user. + type: string + enum: + - admin + - member + - developer + password: + description: The Users password. + type: string + format: password + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.create({ + email: 'user@example.com', + password: 'supersecret' + }) + + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST 'https://medusa-url.com/admin/users' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + user: + $ref: '#/components/schemas/user' + '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' + get: + operationId: GetUsers + summary: List Users + description: Retrieves all users. + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.list() + + .then(({ users }) => { + console.log(users.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/users' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + users: + type: array + items: + $ref: '#/components/schemas/user' + '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' + '/users/{id}': + delete: + operationId: DeleteUsersUser + summary: Delete a User + description: Deletes a User + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.delete(user_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/users/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted user. + object: + type: string + description: The type of the object that was deleted. + default: user + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + '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' + get: + operationId: GetUsersUser + summary: Get a User + description: Retrieves a User. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.retrieve(user_id) + + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/users/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + user: + $ref: '#/components/schemas/user' + '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' + post: + operationId: PostUsersUser + summary: Update a User + description: Updates a User + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + properties: + first_name: + description: The name of the User. + type: string + last_name: + description: The name of the User. + type: string + role: + description: Userrole assigned to the user. + type: string + enum: + - admin + - member + - developer + api_token: + description: The api token of the User. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.update(user_id, { + first_name: 'Marcellus' + }) + + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/users/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "first_name": "Marcellus" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + user: + $ref: '#/components/schemas/user' + '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' + /users/password-token: + post: + operationId: PostUsersUserPasswordToken + summary: Request Password Reset + description: Generates a password token for a User with a given email. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - email + properties: + email: + description: The Users email. + type: string + format: email + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.sendResetPasswordToken({ + email: 'user@example.com' + }) + + .then(() => { + // successful + }) + + .catch(() => { + // error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/users/password-token' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '204': + 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' + /users/reset-password: + post: + operationId: PostUsersUserPassword + summary: Reset Password + description: Sets the password for a User given the correct token. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - token + - password + properties: + email: + description: The Users email. + type: string + format: email + token: + description: The token generated from the 'password-token' endpoint. + type: string + password: + description: The Users new password. + type: string + format: password + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.resetPassword({ + token: 'supersecrettoken', + password: 'supersecret' + }) + + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/users/reset-password' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "token": "supersecrettoken", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + user: + $ref: '#/components/schemas/user' + '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' components: responses: default_error: @@ -19901,6 +21360,7 @@ components: title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address + type: object properties: company: type: string @@ -19955,6 +21415,7 @@ components: title: Address description: An address. x-resourceId: address + type: object properties: id: type: string @@ -20038,6 +21499,7 @@ components: title: Batch Job description: A Batch Job. x-resourceId: batch_job + type: object required: - type properties: @@ -20180,6 +21642,7 @@ components: title: Cart description: Represents a user cart x-resourceId: cart + type: object properties: id: type: string @@ -20357,6 +21820,7 @@ components: title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image + type: object required: - claim_item_id - url @@ -20400,6 +21864,7 @@ components: Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item + type: object required: - claim_order_id - item_id @@ -20487,6 +21952,7 @@ components: order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order + type: object required: - type - order_id @@ -20608,6 +22074,7 @@ components: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag + type: object required: - value properties: @@ -20640,6 +22107,7 @@ components: title: Country description: Country details x-resourceId: country + type: object required: - iso_2 - iso_3 @@ -20694,6 +22162,7 @@ components: title: Currency description: Currency x-resourceId: currency + type: object required: - code - symbol @@ -20729,6 +22198,7 @@ components: can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option + type: object required: - price - shipping_option_id @@ -20787,6 +22257,7 @@ components: title: Customer Group description: Represents a customer group x-resourceId: customer_group + type: object required: - name properties: @@ -20834,6 +22305,7 @@ components: title: Customer description: Represents a customer x-resourceId: customer + type: object required: - email properties: @@ -20851,7 +22323,7 @@ components: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string @@ -20907,6 +22379,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group + type: object required: - customer_group_id - condition_id @@ -20942,6 +22415,7 @@ components: title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection + type: object required: - product_collection_id - condition_id @@ -20977,6 +22451,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag + type: object required: - product_tag_id - condition_id @@ -21012,6 +22487,7 @@ components: title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product + type: object required: - product_type_id - condition_id @@ -21047,6 +22523,7 @@ components: title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product + type: object required: - product_id - condition_id @@ -21082,6 +22559,7 @@ components: title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition + type: object required: - type - operator @@ -21179,6 +22657,7 @@ components: Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule + type: object required: - type - value @@ -21246,6 +22725,7 @@ components: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount + type: object required: - code - is_dynamic @@ -21338,6 +22818,7 @@ components: title: DraftOrder description: Represents a draft order x-resourceId: draft-order + type: object properties: id: type: string @@ -21412,6 +22893,7 @@ components: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item + type: object required: - fulfillment_id - item_id @@ -21443,6 +22925,7 @@ components: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider + type: object properties: id: description: The id of the fulfillment provider as given by the plugin. @@ -21466,6 +22949,7 @@ components: these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment + type: object required: - provider_id properties: @@ -21581,6 +23065,7 @@ components: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction + type: object required: - gift_card_id - amount @@ -21627,6 +23112,7 @@ components: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card + type: object required: - code - value @@ -21698,6 +23184,7 @@ components: Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key + type: object required: - idempotency_key properties: @@ -21752,6 +23239,7 @@ components: title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image + type: object required: - url properties: @@ -21784,6 +23272,7 @@ components: title: Invite description: Represents an invite x-resourceId: invite + type: object required: - user_email properties: @@ -21835,6 +23324,7 @@ components: title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment + type: object required: - item_id - description @@ -21875,6 +23365,7 @@ components: title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line + type: object required: - item_id - rate @@ -21925,6 +23416,7 @@ components: Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item + type: object required: - title - unit_price @@ -22119,6 +23611,7 @@ components: region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount + type: object required: - currency_code - amount @@ -22202,6 +23695,7 @@ components: resources to allow users to describe additional information in relation to these. x-resourceId: note + type: object required: - value - resource_type @@ -22253,6 +23747,7 @@ components: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider + type: object required: - id properties: @@ -22275,6 +23770,7 @@ components: used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification + type: object required: - resource_type - resource_id @@ -22342,6 +23838,7 @@ components: title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend + type: object properties: id: description: The notification resend's ID @@ -22405,6 +23902,7 @@ components: title: OAuth description: Represent an OAuth app x-resourceId: OAuth + type: object required: - id - display_name @@ -22438,6 +23936,7 @@ components: title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit + type: object required: - order_id - order @@ -22566,6 +24065,7 @@ components: title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change + type: object required: - type - order_edit_id @@ -22623,6 +24123,7 @@ components: title: Order description: Represents an order x-resourceId: order + type: object required: - customer_id - email @@ -22901,6 +24402,7 @@ components: title: Payment Collection description: Payment Collection x-resourceId: payment_collection + type: object required: - type - status @@ -22926,12 +24428,7 @@ components: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -22941,12 +24438,6 @@ components: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID @@ -22998,6 +24489,7 @@ components: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider + type: object required: - id properties: @@ -23022,6 +24514,7 @@ components: Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session + type: object required: - cart_id - provider_id @@ -23095,6 +24588,7 @@ components: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment + type: object required: - amount - currency_code @@ -23192,6 +24686,7 @@ components: Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list + type: object required: - name - description @@ -23268,6 +24763,7 @@ components: title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection + type: object required: - title properties: @@ -23317,6 +24813,7 @@ components: Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value + type: object required: - value - option_id @@ -23375,6 +24872,7 @@ components: variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option + type: object required: - title - product_id @@ -23422,6 +24920,7 @@ components: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag + type: object required: - value properties: @@ -23456,6 +24955,7 @@ components: Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate + type: object required: - product_id - rate_id @@ -23493,6 +24993,7 @@ components: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate + type: object required: - product_type_id - rate_id @@ -23530,6 +25031,7 @@ components: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type + type: object required: - value properties: @@ -23566,6 +25068,7 @@ components: Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant + type: object required: - title - product_id @@ -23719,6 +25222,7 @@ components: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields + type: object properties: original_price: type: number @@ -23762,6 +25266,7 @@ components: such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product + type: object required: - title - profile_id @@ -23952,6 +25457,62 @@ components: description: An optional key-value map with additional details example: car: white + publishable_api_key_sales_channel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + x-resourceId: publishable_api_key_sales_channel + type: object + properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_api_key: + title: Publishable API key + description: >- + Publishable API key defines scopes (i.e. resources) that are available + within a request. + x-resourceId: publishable_api_key + type: object + properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: >- + A user object. Available if the relation `created_by_user` is + expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: >- + A user object. Available if the relation `revoked_by_user` is + expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time refund: title: Refund description: >- @@ -23959,6 +25520,7 @@ components: a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund + type: object required: - order_id - amount @@ -24025,6 +25587,7 @@ components: Region can consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region + type: object required: - name - currency_code @@ -24129,6 +25692,7 @@ components: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item + type: object required: - return_id - item_id @@ -24187,6 +25751,7 @@ components: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason + type: object required: - value - label @@ -24241,6 +25806,7 @@ components: to send back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return + type: object required: - refund_amount properties: @@ -24341,6 +25907,7 @@ components: title: Sales Channel description: A Sales Channel x-resourceId: sales_channel + type: object required: - name properties: @@ -24376,6 +25943,7 @@ components: title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line + type: object required: - shipping_method_id - rate @@ -24425,6 +25993,7 @@ components: contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method + type: object required: - shipping_option_id - price @@ -24509,6 +26078,7 @@ components: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement + type: object required: - shipping_option_id - type @@ -24557,6 +26127,7 @@ components: Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option + type: object required: - name - region_id @@ -24663,6 +26234,7 @@ components: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile + type: object required: - name - type @@ -24726,6 +26298,7 @@ components: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate + type: object required: - shipping_option_id - rate_id @@ -24761,6 +26334,7 @@ components: title: Staged Job description: A staged job resource x-resourceId: staged_job + type: object required: - event_name properties: @@ -24780,6 +26354,7 @@ components: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' x-resourceId: store + type: object properties: id: type: string @@ -24847,6 +26422,7 @@ components: Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap + type: object required: - fulfillment_status - payment_status @@ -24994,6 +26570,7 @@ components: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line + type: object required: - rate - name @@ -25031,6 +26608,7 @@ components: title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider + type: object properties: id: description: The id of the tax provider as given by the plugin. @@ -25049,6 +26627,7 @@ components: A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item + type: object required: - name - region_id @@ -25132,6 +26711,7 @@ components: Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link + type: object required: - tracking_number - fulfillment_id @@ -25185,6 +26765,7 @@ components: title: User description: Represents a User who can manage store settings. x-resourceId: user + type: object required: - email properties: @@ -25228,6 +26809,7 @@ components: multiple_errors: title: Multiple Errors x-resourceId: multiple_errors + type: object properties: errors: type: array @@ -25242,6 +26824,7 @@ components: error: title: Response Error x-resourceId: error + type: object properties: code: type: string diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index 776f7aef99..2f6475989b 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -212,6 +212,7 @@ paths: content: application/json: schema: + type: object required: - application_name - state @@ -253,6 +254,7 @@ paths: content: application/json: schema: + type: object properties: apps: $ref: '#/components/schemas/OAuth' @@ -291,6 +293,7 @@ paths: content: application/json: schema: + type: object properties: apps: type: array @@ -362,6 +365,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -458,6 +462,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -473,6 +478,151 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /currencies: + get: + operationId: GetCurrencies + summary: List Currency + description: Retrieves a list of Currency + x-authenticated: true + parameters: + - in: query + name: code + description: Code of the currency to search for. + schema: + type: string + - in: query + name: includes_tax + description: Search for tax inclusive currencies. + schema: + type: boolean + - in: query + name: order + description: order to retrieve products in. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: number + default: '20' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.list() + + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies' \ + + --header 'Authorization: Bearer {api_token}' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currencies: + type: array + items: + $ref: '#/components/schemas/currency' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '/currencies/{code}': + post: + operationId: PostCurrenciesCurrency + summary: Update a Currency + description: Update a Currency + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Currency. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.update(code, { + includes_tax: true + }) + + .then(({ currency }) => { + console.log(currency.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies/{code}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "includes_tax": true + }' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currency: + $ref: '#/components/schemas/currency' '/batch-jobs/{id}/cancel': post: operationId: PostBatchJobsBatchJobCancel @@ -520,6 +670,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -582,6 +733,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -607,6 +759,7 @@ paths: content: application/json: schema: + type: object required: - type - context @@ -685,6 +838,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -975,6 +1129,7 @@ paths: content: application/json: schema: + type: object properties: batch_jobs: type: array @@ -1048,6 +1203,7 @@ paths: content: application/json: schema: + type: object properties: batch_job: $ref: '#/components/schemas/batch_job' @@ -1063,764 +1219,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}/products/batch': - post: - operationId: PostProductsToCollection - summary: Update Products - description: Updates products associated with a Product Collection - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Collection. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collection: - $ref: '#/components/schemas/product_collection' - '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' - delete: - operationId: DeleteProductsFromCollection - summary: Remove Product - description: Removes products associated with a Product Collection - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Collection. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - product_ids - properties: - product_ids: - description: >- - An array of Product IDs to remove from the Product - Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - id: - type: string - description: The ID of the collection - object: - type: string - description: The type of object the removal was executed on - default: product-collection - removed_products: - description: The IDs of the products removed from the collection - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string - '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' - /collections: - post: - operationId: PostCollections - summary: Create a Collection - description: Creates a Product Collection. - x-authenticated: true - requestBody: - content: - application/json: - schema: - required: - - title - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.create({ - title: 'New Collection' - }) - - .then(({ collection }) => { - console.log(collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "title": "New Collection" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collection: - $ref: '#/components/schemas/product_collection' - '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' - get: - operationId: GetCollections - summary: List Collections - description: Retrieve a list of Product Collection. - x-authenticated: true - parameters: - - in: query - name: limit - description: The number of collections to return. - schema: - type: integer - default: 10 - - in: query - name: offset - description: The number of collections to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: title - description: The title of collections to return. - schema: - type: string - - in: query - name: handle - description: The handle of collections to return. - schema: - type: string - - in: query - name: q - description: a search term to search titles and handles. - schema: - type: string - - in: query - name: discount_condition_id - description: >- - The discount condition id on which to filter the product - collections. - schema: - type: string - - in: query - name: created_at - description: Date comparison for when resulting collections were created. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - - in: query - name: updated_at - description: Date comparison for when resulting collections were updated. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - - in: query - name: deleted_at - description: Date comparison for when resulting collections were deleted. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.list() - - .then(({ collections, limit, offset, count }) => { - console.log(collections.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/collections' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collections: - type: array - items: - $ref: '#/components/schemas/product_collection' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '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' - '/collections/{id}': - delete: - operationId: DeleteCollectionsCollection - summary: Delete a Collection - description: Deletes a Product Collection. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Collection. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.delete(collection_id) - - .then(({ id, object, deleted }) => { - console.log(id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - id: - type: string - description: The ID of the deleted Collection - object: - type: string - description: The type of the object that was deleted. - default: product-collection - deleted: - type: boolean - description: Whether the collection was deleted successfully or not. - default: true - '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' - get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product Collection - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.retrieve(collection_id) - - .then(({ collection }) => { - console.log(collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/collections/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collection: - $ref: '#/components/schemas/product_collection' - '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' - post: - operationId: PostCollectionsCollection - summary: Update a Collection - description: Updates a Product Collection. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Collection. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.update(collection_id, { - title: 'New Collection' - }) - - .then(({ collection }) => { - console.log(collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "title": "New Collection" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collection: - $ref: '#/components/schemas/product_collection' - '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' - /currencies: - get: - operationId: GetCurrencies - summary: List Currency - description: Retrieves a list of Currency - x-authenticated: true - parameters: - - in: query - name: code - description: Code of the currency to search for. - schema: - type: string - - in: query - name: includes_tax - description: Search for tax inclusive currencies. - schema: - type: boolean - - in: query - name: order - description: order to retrieve products in. - schema: - type: string - - in: query - name: offset - description: How many products to skip in the result. - schema: - type: number - default: '0' - - in: query - name: limit - description: Limit the number of products returned. - schema: - type: number - default: '20' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.list() - - .then(({ currencies, count, offset, limit }) => { - console.log(currencies.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies' \ - - --header 'Authorization: Bearer {api_token}' - tags: - - Currency - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - currencies: - type: array - items: - $ref: '#/components/schemas/currency' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '/currencies/{code}': - post: - operationId: PostCurrenciesCurrency - summary: Update a Currency - description: Update a Currency - x-authenticated: true - parameters: - - in: path - name: code - required: true - description: The code of the Currency. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - includes_tax: - type: boolean - description: '[EXPERIMENTAL] Tax included in prices of currency.' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.update(code, { - includes_tax: true - }) - - .then(({ currency }) => { - console.log(currency.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies/{code}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "includes_tax": true - }' - tags: - - Currency - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - currency: - $ref: '#/components/schemas/currency' '/customer-groups/{id}/customers/batch': post: operationId: PostCustomerGroupsGroupCustomersBatch @@ -1838,6 +1236,7 @@ paths: content: application/json: schema: + type: object required: - customer_ids properties: @@ -1902,6 +1301,7 @@ paths: content: application/json: schema: + type: object properties: customer_group: $ref: '#/components/schemas/customer_group' @@ -1933,6 +1333,7 @@ paths: content: application/json: schema: + type: object required: - customer_ids properties: @@ -1997,6 +1398,7 @@ paths: content: application/json: schema: + type: object properties: customer_group: $ref: '#/components/schemas/customer_group' @@ -2061,6 +1463,7 @@ paths: content: application/json: schema: + type: object properties: customer_group: $ref: '#/components/schemas/customer_group' @@ -2246,6 +1649,7 @@ paths: content: application/json: schema: + type: object properties: customer_groups: type: array @@ -2319,6 +1723,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -2405,6 +1810,7 @@ paths: content: application/json: schema: + type: object properties: customer_group: $ref: '#/components/schemas/customer_group' @@ -2436,6 +1842,7 @@ paths: content: application/json: schema: + type: object properties: name: description: Name of the customer group @@ -2485,6 +1892,7 @@ paths: content: application/json: schema: + type: object properties: customer_group: $ref: '#/components/schemas/customer_group' @@ -2547,6 +1955,7 @@ paths: content: application/json: schema: + type: object properties: customers: type: array @@ -2573,6 +1982,633 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/collections/{id}/products/batch': + post: + operationId: PostProductsToCollection + summary: Update Products + description: Updates products associated with a Product Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - product_ids + properties: + product_ids: + description: An array of Product IDs to add to the Product Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/product_collection' + '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' + delete: + operationId: DeleteProductsFromCollection + summary: Remove Product + description: Removes products associated with a Product Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - product_ids + properties: + product_ids: + description: >- + An array of Product IDs to remove from the Product + Collection. + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the collection + object: + type: string + description: The type of object the removal was executed on + default: product-collection + removed_products: + description: The IDs of the products removed from the collection + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + '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' + /collections: + post: + operationId: PostCollections + summary: Create a Collection + description: Creates a Product Collection. + x-authenticated: true + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided + we will kebab-case the title. + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.create({ + title: 'New Collection' + }) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/collections' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "New Collection" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/product_collection' + '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' + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of collections to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of collections to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: title + description: The title of collections to return. + schema: + type: string + - in: query + name: handle + description: The handle of collections to return. + schema: + type: string + - in: query + name: q + description: a search term to search titles and handles. + schema: + type: string + - in: query + name: discount_condition_id + description: >- + The discount condition id on which to filter the product + collections. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting collections were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.list() + + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/collections' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collections: + type: array + items: + $ref: '#/components/schemas/product_collection' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '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' + '/collections/{id}': + delete: + operationId: DeleteCollectionsCollection + summary: Delete a Collection + description: Deletes a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.delete(collection_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Collection + object: + type: string + description: The type of the object that was deleted. + default: product-collection + deleted: + type: boolean + description: Whether the collection was deleted successfully or not. + default: true + '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' + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Collection + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.retrieve(collection_id) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/product_collection' + '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' + post: + operationId: PostCollectionsCollection + summary: Update a Collection + description: Updates a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + title: + type: string + description: The title to identify the Collection by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided + we will kebab-case the title. + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.update(collection_id, { + title: 'New Collection' + }) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "New Collection" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/product_collection' + '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' /customers: post: operationId: PostCustomers @@ -2583,6 +2619,7 @@ paths: content: application/json: schema: + type: object required: - email - first_name @@ -2659,6 +2696,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2736,6 +2774,7 @@ paths: content: application/json: schema: + type: object properties: customers: type: array @@ -2819,6 +2858,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2860,6 +2900,7 @@ paths: content: application/json: schema: + type: object properties: email: type: string @@ -2935,6 +2976,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -3003,6 +3045,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3072,6 +3115,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3124,6 +3168,7 @@ paths: content: application/json: schema: + type: object required: - resources properties: @@ -3181,6 +3226,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3232,6 +3278,7 @@ paths: content: application/json: schema: + type: object required: - resources properties: @@ -3289,6 +3336,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3338,6 +3386,7 @@ paths: content: application/json: schema: + type: object required: - operator properties: @@ -3424,6 +3473,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3462,9 +3512,11 @@ paths: content: application/json: schema: + type: object required: - code - rule + - regions properties: code: type: string @@ -3618,6 +3670,7 @@ paths: value: 10, allocation: AllocationType.ITEM }, + regions: ['reg_XXXXXXXX'], is_dynamic: false, is_disabled: false }) @@ -3641,7 +3694,8 @@ paths: "type": "fixed", "value": 10, "allocation": "item" - } + }, + "regions": ['reg_XXXXXXXX'] }' security: - api_token: [] @@ -3654,6 +3708,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3766,6 +3821,7 @@ paths: content: application/json: schema: + type: object properties: discounts: type: array @@ -3851,6 +3907,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -3950,6 +4007,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -4042,6 +4100,7 @@ paths: content: application/json: schema: + type: object properties: discount_condition: $ref: '#/components/schemas/discount_condition' @@ -4096,6 +4155,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -4177,6 +4237,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4239,6 +4300,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -4319,6 +4381,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4366,6 +4429,7 @@ paths: content: application/json: schema: + type: object properties: code: type: string @@ -4523,6 +4587,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4591,6 +4656,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4663,6 +4729,7 @@ paths: content: application/json: schema: + type: object properties: discount: $ref: '#/components/schemas/discount' @@ -4688,6 +4755,7 @@ paths: content: application/json: schema: + type: object required: - email - items @@ -4851,6 +4919,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -4925,6 +4994,7 @@ paths: content: application/json: schema: + type: object properties: draft_orders: type: array @@ -4968,6 +5038,7 @@ paths: content: application/json: schema: + type: object required: - quantity properties: @@ -5033,6 +5104,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5095,6 +5167,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -5165,6 +5238,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5234,6 +5308,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5271,6 +5346,7 @@ paths: content: application/json: schema: + type: object properties: unit_price: description: The potential custom price of the item. @@ -5329,6 +5405,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5391,6 +5468,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/draft-order' @@ -5423,6 +5501,7 @@ paths: content: application/json: schema: + type: object properties: region_id: type: string @@ -5509,6 +5588,7 @@ paths: content: application/json: schema: + type: object properties: draft_order: $ref: '#/components/schemas/draft-order' @@ -5536,6 +5616,7 @@ paths: content: application/json: schema: + type: object required: - region_id properties: @@ -5605,6 +5686,7 @@ paths: content: application/json: schema: + type: object properties: gift_card: $ref: '#/components/schemas/gift_card' @@ -5677,6 +5759,7 @@ paths: content: application/json: schema: + type: object properties: gift_cards: type: array @@ -5750,6 +5833,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -5820,6 +5904,7 @@ paths: content: application/json: schema: + type: object properties: gift_card: $ref: '#/components/schemas/gift_card' @@ -5853,6 +5938,7 @@ paths: content: application/json: schema: + type: object properties: balance: type: integer @@ -5920,6 +6006,7 @@ paths: content: application/json: schema: + type: object properties: gift_card: $ref: '#/components/schemas/gift_card' @@ -5944,6 +6031,7 @@ paths: content: application/json: schema: + type: object required: - token - user @@ -6044,6 +6132,7 @@ paths: content: application/json: schema: + type: object required: - user - role @@ -6155,6 +6244,7 @@ paths: content: application/json: schema: + type: object properties: invites: type: array @@ -6219,6 +6309,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -6313,6 +6404,7 @@ paths: content: application/json: schema: + type: object required: - resource_id - resource_type @@ -6373,6 +6465,7 @@ paths: content: application/json: schema: + type: object properties: note: $ref: '#/components/schemas/note' @@ -6443,6 +6536,7 @@ paths: content: application/json: schema: + type: object properties: notes: type: array @@ -6516,6 +6610,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -6586,6 +6681,7 @@ paths: content: application/json: schema: + type: object properties: note: $ref: '#/components/schemas/note' @@ -6617,6 +6713,7 @@ paths: content: application/json: schema: + type: object required: - value properties: @@ -6665,6 +6762,7 @@ paths: content: application/json: schema: + type: object properties: note: $ref: '#/components/schemas/note' @@ -6775,6 +6873,7 @@ paths: content: application/json: schema: + type: object properties: notifications: type: array @@ -6811,6 +6910,7 @@ paths: content: application/json: schema: + type: object properties: to: description: >- @@ -6851,6 +6951,7 @@ paths: content: application/json: schema: + type: object properties: notification: $ref: '#/components/schemas/notification' @@ -6882,6 +6983,7 @@ paths: content: application/json: schema: + type: object required: - variant_id - quantity @@ -6940,6 +7042,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7001,6 +7104,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7058,6 +7162,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7078,6 +7183,7 @@ paths: content: application/json: schema: + type: object required: - order_id properties: @@ -7126,6 +7232,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7143,8 +7250,8 @@ paths: $ref: '#/components/responses/500_error' get: operationId: GetOrderEdits - summary: List an OrderEdit - description: List a OrderEdit. + summary: List OrderEdits + description: List OrderEdits. x-authenticated: true parameters: - in: query @@ -7212,6 +7319,7 @@ paths: content: application/json: schema: + type: object properties: order_edits: type: array @@ -7289,6 +7397,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7326,6 +7435,7 @@ paths: content: application/json: schema: + type: object required: - quantity properties: @@ -7372,6 +7482,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7441,6 +7552,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -7501,6 +7613,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -7570,6 +7683,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7601,6 +7715,7 @@ paths: content: application/json: schema: + type: object properties: internal_note: description: An optional note to create or update for the order edit. @@ -7646,6 +7761,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7707,6 +7823,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -7778,6 +7895,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -7865,6 +7983,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -7934,6 +8053,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8010,6 +8130,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8086,6 +8207,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8155,6 +8277,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8220,6 +8343,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8289,6 +8413,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8351,6 +8476,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8413,6 +8539,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8451,6 +8578,7 @@ paths: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -8505,6 +8633,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8537,6 +8666,7 @@ paths: content: application/json: schema: + type: object required: - type - claim_items @@ -8710,6 +8840,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8744,6 +8875,7 @@ paths: content: application/json: schema: + type: object required: - items properties: @@ -8823,6 +8955,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8855,6 +8988,7 @@ paths: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -8913,6 +9047,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -8951,6 +9086,7 @@ paths: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -9010,6 +9146,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9044,6 +9181,7 @@ paths: content: application/json: schema: + type: object required: - return_items properties: @@ -9174,6 +9312,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9212,6 +9351,7 @@ paths: content: application/json: schema: + type: object properties: metadata: description: >- @@ -9258,6 +9398,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9296,6 +9437,7 @@ paths: content: application/json: schema: + type: object properties: metadata: description: >- @@ -9342,6 +9484,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9404,6 +9547,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9435,6 +9579,7 @@ paths: content: application/json: schema: + type: object properties: email: description: the email for the order @@ -9541,6 +9686,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9810,6 +9956,7 @@ paths: content: application/json: schema: + type: object properties: orders: type: array @@ -9893,6 +10040,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -9925,6 +10073,7 @@ paths: content: application/json: schema: + type: object required: - amount - reason @@ -9987,6 +10136,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -10021,6 +10171,7 @@ paths: content: application/json: schema: + type: object required: - items properties: @@ -10128,6 +10279,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -10166,6 +10318,7 @@ paths: content: application/json: schema: + type: object properties: claim_items: description: The Claim Items that the Claim will consist of. @@ -10297,6 +10450,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -10312,6 +10466,506 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/payment-collections/{id}': + delete: + operationId: DeletePaymentCollectionsPaymentCollection + summary: Delete a Payment Collection + description: Deletes a Payment Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.paymentCollections.delete(payment_collection_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/payment-collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Payment Collection. + object: + type: string + description: The type of the object that was deleted. + format: payment_collection + deleted: + type: boolean + description: Whether or not the Payment Collection was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/payment-collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + post: + operationId: PostPaymentCollectionsPaymentCollection + summary: Updates a PaymentCollection + description: Updates a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + description: + description: >- + An optional description to create or update the payment + collection. + type: string + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.paymentCollections.update(payment_collection_id, { + description: "Description of payCol" + }) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payment-collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "description": "Description of payCol" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payment-collections/{id}/authorize': + post: + operationId: PostPaymentCollectionsPaymentCollectionAuthorize + summary: Set the status of PaymentCollection as Authorized + description: Sets the status of PaymentCollection as Authorized. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.paymentCollections.markAsAuthorized(payment_collection_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payments/{id}/capture': + post: + operationId: PostPaymentsPaymentCapture + summary: Capture a Payment + description: Captures a Payment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.payments.capturePayment(payment_id) + + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payments/{id}/capture' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment: + $ref: '#/components/schemas/payment' + '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' + '/payments/{id}': + get: + operationId: GetPaymentsPayment + summary: Get Payment details + description: Retrieves the Payment details + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.payments.retrieve(payment_id) + + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/payments/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment: + $ref: '#/components/schemas/payment' + '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' + '/payments/{id}/refund': + post: + operationId: PostPaymentsPaymentRefunds + summary: Create a Refund + description: Issues a Refund. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.payments.refundPayment(payment_id, { + amount: 1000, + reason: 'return', + note: 'Do not like it', + }) + + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payments/pay_123/refund' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "amount": 1000, + "reason": "return", + "note": "Do not like it" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + refund: + $ref: '#/components/schemas/refund' + '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' '/price-lists/{id}/prices/batch': post: operationId: PostPriceListsPriceListPricesBatch @@ -10329,6 +10983,7 @@ paths: content: application/json: schema: + type: object properties: prices: description: The prices to update or add. @@ -10426,6 +11081,7 @@ paths: content: application/json: schema: + type: object properties: price_list: $ref: '#/components/schemas/price_list' @@ -10459,6 +11115,7 @@ paths: content: application/json: schema: + type: object properties: price_ids: description: The price id's of the Money Amounts to delete. @@ -10511,6 +11168,7 @@ paths: content: application/json: schema: + type: object properties: ids: type: array @@ -10547,6 +11205,7 @@ paths: content: application/json: schema: + type: object required: - name - description @@ -10690,6 +11349,7 @@ paths: content: application/json: schema: + type: object properties: price_list: $ref: '#/components/schemas/price_list' @@ -10885,6 +11545,7 @@ paths: content: application/json: schema: + type: object properties: price_lists: type: array @@ -10958,6 +11619,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -11028,6 +11690,7 @@ paths: content: application/json: schema: + type: object properties: price_list: $ref: '#/components/schemas/price_list' @@ -11059,6 +11722,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Price List @@ -11180,6 +11844,7 @@ paths: content: application/json: schema: + type: object properties: price_list: $ref: '#/components/schemas/price_list' @@ -11252,6 +11917,7 @@ paths: content: application/json: schema: + type: object properties: ids: type: array @@ -11335,6 +12001,7 @@ paths: content: application/json: schema: + type: object properties: ids: type: array @@ -11574,6 +12241,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -11730,6 +12398,7 @@ paths: content: application/json: schema: + type: object properties: product_tags: $ref: '#/components/schemas/product_tag' @@ -11884,6 +12553,7 @@ paths: content: application/json: schema: + type: object properties: product_types: $ref: '#/components/schemas/product_type' @@ -11925,6 +12595,7 @@ paths: content: application/json: schema: + type: object required: - title properties: @@ -11975,6 +12646,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -12000,6 +12672,7 @@ paths: content: application/json: schema: + type: object required: - title properties: @@ -12281,6 +12954,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -12532,6 +13206,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -12577,6 +13252,7 @@ paths: content: application/json: schema: + type: object required: - title - prices @@ -12754,6 +13430,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -12822,6 +13499,7 @@ paths: content: application/json: schema: + type: object properties: variants: type: array @@ -12905,6 +13583,7 @@ paths: content: application/json: schema: + type: object properties: option_id: type: string @@ -12953,6 +13632,7 @@ paths: content: application/json: schema: + type: object required: - title properties: @@ -13001,6 +13681,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -13063,6 +13744,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -13133,6 +13815,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -13164,6 +13847,7 @@ paths: content: application/json: schema: + type: object properties: title: description: The title of the Product @@ -13425,6 +14109,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -13493,6 +14178,7 @@ paths: content: application/json: schema: + type: object properties: variant_id: type: string @@ -13541,6 +14227,7 @@ paths: content: application/json: schema: + type: object required: - prices properties: @@ -13709,6 +14396,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -13764,6 +14452,7 @@ paths: content: application/json: schema: + type: object properties: tags: type: array @@ -13831,6 +14520,7 @@ paths: content: application/json: schema: + type: object properties: types: type: array @@ -13865,6 +14555,7 @@ paths: content: application/json: schema: + type: object required: - key - value @@ -13920,6 +14611,7 @@ paths: content: application/json: schema: + type: object properties: product: $ref: '#/components/schemas/product' @@ -13935,6 +14627,679 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/publishable-api-keys/{id}/sales-channels/batch': + post: + operationId: PostPublishableApiKeySalesChannelsChannelsBatch + summary: Add sales channel to a publishable api key scope + description: Assign a batch of sales channels to a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: >- + The IDs of the sales channels to add to the publishable api + key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.addSalesChannels(publishableApiKeyId, + { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) + + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Key + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' + delete: + operationId: DeletePublishableApiKeySalesChannelsChannelsBatch + summary: Remove sales channel from a publishable api key scope + description: Remove a batch of sales channels from a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: >- + The IDs of the sales channels to delete from the publishable + api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.removeSalesChannels(publishableApiKeyId, + { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) + + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Key + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' + /publishable-api-keys: + post: + operationId: PostPublishableApiKeys + summary: Create a PublishableApiKey + description: Creates a PublishableApiKey. + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + description: A title for the publishable api key + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.create() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys' \ + + --header 'Authorization: Bearer {api_token}' + + -d '{ "created_by": "user_123" }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' + get: + operationId: GetPublishableApiKeys + summary: List PublishableApiKeys + description: List PublishableApiKeys. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching publishable api keys by title. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.list() + .then(({ publishable_api_keys }) => { + console.log(publishable_api_keys) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKeys + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_keys: + type: array + $ref: '#/components/schemas/publishable_api_key' + '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' + '/publishable-api-keys/{id}': + delete: + operationId: DeletePublishableApiKeysPublishableApiKey + summary: Delete a PublishableApiKey + description: Deletes a PublishableApiKeys + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKeys to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.delete(key_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/publishable-api-key/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted PublishableApiKey. + object: + type: string + description: The type of the object that was deleted. + format: publishable_api_key + deleted: + type: boolean + description: Whether the PublishableApiKeys was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetPublishableApiKeysPublishableApiKey + summary: Get a Publishable API Key + description: Retrieve the Publishable Api Key. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.retrieve(pubKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123' \ + + --header 'Authorization: Bearer {api_token}' + + -d '{ "created_by": "user_123" }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' + '/publishable-api-keys/:id/sales-channels': + get: + operationId: GetPublishableApiKeySalesChannels + summary: List PublishableApiKey's SalesChannels + description: List PublishableApiKey's SalesChannels + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.listSalesChannels() + .then(({ sales_channels, limit, offset, count }) => { + console.log(sales_channels) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys/pk_123/sales-channels' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKeySalesChannels + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + sales_channels: + type: array + items: + $ref: '#/components/schemas/sales_channel' + '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' + '/publishable-api-keys/{id}/revoke': + post: + operationId: PostPublishableApiKeysPublishableApiKeyRevoke + summary: Revoke a PublishableApiKey + description: Revokes a PublishableApiKey. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.revoke() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123/revoke' + \ + + --header 'Authorization: Bearer {api_token}' + + -d '{ "created_by": "user_123", "revoked_by": "user_123" }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' + '/publishable-api-key/{id}': + post: + operationId: PostPublishableApiKysPublishableApiKey + summary: Updates a PublishableApiKey + description: Updates a PublishableApiKey. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + title: + description: A title to update for the key. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKey.update(publishable_key_id, { + title: "new title" + }) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-key/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "updated title" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: '#/components/schemas/publishable_api_key' + '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' '/regions/{id}/countries': post: operationId: PostRegionsRegionCountries @@ -13952,6 +15317,7 @@ paths: content: application/json: schema: + type: object required: - country_code properties: @@ -14004,6 +15370,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14036,6 +15403,7 @@ paths: content: application/json: schema: + type: object required: - provider_id properties: @@ -14084,6 +15452,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14116,6 +15485,7 @@ paths: content: application/json: schema: + type: object required: - provider_id properties: @@ -14164,6 +15534,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14189,6 +15560,7 @@ paths: content: application/json: schema: + type: object required: - name - currency_code @@ -14302,6 +15674,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14395,6 +15768,7 @@ paths: content: application/json: schema: + type: object properties: regions: type: array @@ -14468,6 +15842,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -14538,6 +15913,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14569,6 +15945,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Region @@ -14667,6 +16044,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14729,6 +16107,7 @@ paths: content: application/json: schema: + type: object properties: fulfillment_options: type: array @@ -14812,6 +16191,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14881,6 +16261,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14950,6 +16331,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -14975,6 +16357,7 @@ paths: content: application/json: schema: + type: object required: - label - value @@ -15042,6 +16425,7 @@ paths: content: application/json: schema: + type: object properties: return_reason: $ref: '#/components/schemas/return_reason' @@ -15096,6 +16480,7 @@ paths: content: application/json: schema: + type: object properties: return_reasons: type: array @@ -15160,6 +16545,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -15230,6 +16616,7 @@ paths: content: application/json: schema: + type: object properties: return_reason: $ref: '#/components/schemas/return_reason' @@ -15261,6 +16648,7 @@ paths: content: application/json: schema: + type: object properties: label: description: The label to display to the Customer. @@ -15320,6 +16708,7 @@ paths: content: application/json: schema: + type: object properties: return_reason: $ref: '#/components/schemas/return_reason' @@ -15381,6 +16770,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -15448,6 +16838,7 @@ paths: content: application/json: schema: + type: object properties: returns: type: array @@ -15492,6 +16883,7 @@ paths: content: application/json: schema: + type: object required: - items properties: @@ -15564,6 +16956,7 @@ paths: content: application/json: schema: + type: object properties: return: $ref: '#/components/schemas/return' @@ -15596,6 +16989,7 @@ paths: content: application/json: schema: + type: object required: - product_ids properties: @@ -15660,6 +17054,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -15691,6 +17086,7 @@ paths: content: application/json: schema: + type: object required: - product_ids properties: @@ -15755,6 +17151,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -15780,6 +17177,7 @@ paths: content: application/json: schema: + type: object required: - name properties: @@ -15835,6 +17233,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -16007,6 +17406,7 @@ paths: content: application/json: schema: + type: object properties: sales_channels: type: array @@ -16080,6 +17480,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -16150,6 +17551,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -16181,6 +17583,7 @@ paths: content: application/json: schema: + type: object properties: name: type: string @@ -16233,6 +17636,7 @@ paths: content: application/json: schema: + type: object properties: sales_channel: $ref: '#/components/schemas/sales_channel' @@ -16258,6 +17662,7 @@ paths: content: application/json: schema: + type: object required: - name - region_id @@ -16383,6 +17788,7 @@ paths: content: application/json: schema: + type: object properties: shipping_option: $ref: '#/components/schemas/shipping_option' @@ -16453,6 +17859,7 @@ paths: content: application/json: schema: + type: object properties: shipping_options: type: array @@ -16520,6 +17927,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -16590,6 +17998,7 @@ paths: content: application/json: schema: + type: object properties: shipping_option: $ref: '#/components/schemas/shipping_option' @@ -16621,6 +18030,7 @@ paths: content: application/json: schema: + type: object required: - requirements properties: @@ -16717,6 +18127,7 @@ paths: content: application/json: schema: + type: object properties: shipping_option: $ref: '#/components/schemas/shipping_option' @@ -16742,6 +18153,7 @@ paths: content: application/json: schema: + type: object required: - name properties: @@ -16790,6 +18202,7 @@ paths: content: application/json: schema: + type: object properties: shipping_profile: $ref: '#/components/schemas/shipping_profile' @@ -16844,6 +18257,7 @@ paths: content: application/json: schema: + type: object properties: shipping_profiles: type: array @@ -16908,6 +18322,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -16978,6 +18393,7 @@ paths: content: application/json: schema: + type: object properties: shipping_profile: $ref: '#/components/schemas/shipping_profile' @@ -17008,6 +18424,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Shipping Profile @@ -17054,6 +18471,7 @@ paths: content: application/json: schema: + type: object properties: shipping_profile: $ref: '#/components/schemas/shipping_profile' @@ -17119,6 +18537,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17183,6 +18602,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17236,6 +18656,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17260,6 +18681,7 @@ paths: content: application/json: schema: + type: object properties: name: description: The name of the Store @@ -17337,6 +18759,7 @@ paths: content: application/json: schema: + type: object properties: store: $ref: '#/components/schemas/store' @@ -17392,6 +18815,7 @@ paths: content: application/json: schema: + type: object properties: payment_providers: type: array @@ -17449,6 +18873,7 @@ paths: content: application/json: schema: + type: object properties: tax_providers: type: array @@ -17466,145 +18891,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/swaps/{id}': - get: - operationId: GetSwapsSwap - summary: Get a Swap - description: Retrieves a Swap. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Swap. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.swaps.retrieve(swap_id) - - .then(({ swap }) => { - console.log(swap.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/swaps/{id}' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Swap - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - swap: - $ref: '#/components/schemas/swap' - '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' - /swaps: - get: - operationId: GetSwaps - summary: List Swaps - description: Retrieves a list of Swaps. - parameters: - - in: query - name: limit - description: The upper limit for the amount of responses returned. - schema: - type: number - default: '50' - - in: query - name: offset - description: The offset of the list returned. - schema: - type: number - default: '0' - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.swaps.list() - - .then(({ swaps }) => { - console.log(swaps.length); - }); - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/swaps' \ - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Swap - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - swaps: - type: array - items: - $ref: '#/components/schemas/swap' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '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' '/tax-rates/{id}/product-types/batch': post: operationId: PostTaxRatesTaxRateProductTypes @@ -17640,6 +18926,7 @@ paths: content: application/json: schema: + type: object required: - product_types properties: @@ -17696,6 +18983,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17745,6 +19033,7 @@ paths: content: application/json: schema: + type: object required: - product_types properties: @@ -17801,6 +19090,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17851,6 +19141,7 @@ paths: content: application/json: schema: + type: object required: - products properties: @@ -17905,6 +19196,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -17954,6 +19246,7 @@ paths: content: application/json: schema: + type: object required: - products properties: @@ -18010,6 +19303,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18060,6 +19354,7 @@ paths: content: application/json: schema: + type: object required: - shipping_options properties: @@ -18117,6 +19412,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18166,6 +19462,7 @@ paths: content: application/json: schema: + type: object required: - shipping_options properties: @@ -18223,6 +19520,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18267,6 +19565,7 @@ paths: content: application/json: schema: + type: object required: - code - name @@ -18349,6 +19648,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18477,6 +19777,7 @@ paths: content: application/json: schema: + type: object properties: tax_rates: type: array @@ -18550,6 +19851,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -18638,6 +19940,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18687,6 +19990,7 @@ paths: content: application/json: schema: + type: object properties: code: type: string @@ -18761,6 +20065,7 @@ paths: content: application/json: schema: + type: object properties: tax_rate: $ref: '#/components/schemas/tax_rate' @@ -18776,6 +20081,147 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/swaps/{id}': + get: + operationId: GetSwapsSwap + summary: Get a Swap + description: Retrieves a Swap. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Swap. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.swaps.retrieve(swap_id) + + .then(({ swap }) => { + console.log(swap.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/swaps/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + swap: + $ref: '#/components/schemas/swap' + '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' + /swaps: + get: + operationId: GetSwaps + summary: List Swaps + description: Retrieves a list of Swaps. + parameters: + - in: query + name: limit + description: The upper limit for the amount of responses returned. + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.swaps.list() + + .then(({ swaps }) => { + console.log(swaps.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/swaps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + swaps: + type: array + items: + $ref: '#/components/schemas/swap' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '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' /uploads/protected: post: operationId: PostUploadsProtected @@ -18833,6 +20279,7 @@ paths: content: application/json: schema: + type: object properties: uploads: type: array @@ -18912,6 +20359,7 @@ paths: content: application/json: schema: + type: object properties: uploads: type: array @@ -18944,6 +20392,7 @@ paths: content: application/json: schema: + type: object required: - email - password @@ -19013,6 +20462,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19065,6 +20515,7 @@ paths: content: application/json: schema: + type: object properties: users: type: array @@ -19129,6 +20580,7 @@ paths: content: application/json: schema: + type: object properties: id: type: string @@ -19199,6 +20651,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19230,6 +20683,7 @@ paths: content: application/json: schema: + type: object properties: first_name: description: The name of the User. @@ -19294,6 +20748,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19319,6 +20774,7 @@ paths: content: application/json: schema: + type: object required: - email properties: @@ -19391,6 +20847,7 @@ paths: content: application/json: schema: + type: object required: - token - password @@ -19450,6 +20907,7 @@ paths: content: application/json: schema: + type: object properties: user: $ref: '#/components/schemas/user' @@ -19597,6 +21055,7 @@ paths: content: application/json: schema: + type: object properties: variants: type: array @@ -19901,6 +21360,7 @@ components: title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address + type: object properties: company: type: string @@ -19955,6 +21415,7 @@ components: title: Address description: An address. x-resourceId: address + type: object properties: id: type: string @@ -20038,6 +21499,7 @@ components: title: Batch Job description: A Batch Job. x-resourceId: batch_job + type: object required: - type properties: @@ -20180,6 +21642,7 @@ components: title: Cart description: Represents a user cart x-resourceId: cart + type: object properties: id: type: string @@ -20357,6 +21820,7 @@ components: title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image + type: object required: - claim_item_id - url @@ -20400,6 +21864,7 @@ components: Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item + type: object required: - claim_order_id - item_id @@ -20487,6 +21952,7 @@ components: order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order + type: object required: - type - order_id @@ -20608,6 +22074,7 @@ components: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag + type: object required: - value properties: @@ -20640,6 +22107,7 @@ components: title: Country description: Country details x-resourceId: country + type: object required: - iso_2 - iso_3 @@ -20694,6 +22162,7 @@ components: title: Currency description: Currency x-resourceId: currency + type: object required: - code - symbol @@ -20729,6 +22198,7 @@ components: can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option + type: object required: - price - shipping_option_id @@ -20787,6 +22257,7 @@ components: title: Customer Group description: Represents a customer group x-resourceId: customer_group + type: object required: - name properties: @@ -20834,6 +22305,7 @@ components: title: Customer description: Represents a customer x-resourceId: customer + type: object required: - email properties: @@ -20851,7 +22323,7 @@ components: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string @@ -20907,6 +22379,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group + type: object required: - customer_group_id - condition_id @@ -20942,6 +22415,7 @@ components: title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection + type: object required: - product_collection_id - condition_id @@ -20977,6 +22451,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag + type: object required: - product_tag_id - condition_id @@ -21012,6 +22487,7 @@ components: title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product + type: object required: - product_type_id - condition_id @@ -21047,6 +22523,7 @@ components: title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product + type: object required: - product_id - condition_id @@ -21082,6 +22559,7 @@ components: title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition + type: object required: - type - operator @@ -21179,6 +22657,7 @@ components: Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule + type: object required: - type - value @@ -21246,6 +22725,7 @@ components: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount + type: object required: - code - is_dynamic @@ -21338,6 +22818,7 @@ components: title: DraftOrder description: Represents a draft order x-resourceId: draft-order + type: object properties: id: type: string @@ -21412,6 +22893,7 @@ components: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item + type: object required: - fulfillment_id - item_id @@ -21443,6 +22925,7 @@ components: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider + type: object properties: id: description: The id of the fulfillment provider as given by the plugin. @@ -21466,6 +22949,7 @@ components: these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment + type: object required: - provider_id properties: @@ -21581,6 +23065,7 @@ components: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction + type: object required: - gift_card_id - amount @@ -21627,6 +23112,7 @@ components: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card + type: object required: - code - value @@ -21698,6 +23184,7 @@ components: Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key + type: object required: - idempotency_key properties: @@ -21752,6 +23239,7 @@ components: title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image + type: object required: - url properties: @@ -21784,6 +23272,7 @@ components: title: Invite description: Represents an invite x-resourceId: invite + type: object required: - user_email properties: @@ -21835,6 +23324,7 @@ components: title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment + type: object required: - item_id - description @@ -21875,6 +23365,7 @@ components: title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line + type: object required: - item_id - rate @@ -21925,6 +23416,7 @@ components: Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item + type: object required: - title - unit_price @@ -22119,6 +23611,7 @@ components: region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount + type: object required: - currency_code - amount @@ -22202,6 +23695,7 @@ components: resources to allow users to describe additional information in relation to these. x-resourceId: note + type: object required: - value - resource_type @@ -22253,6 +23747,7 @@ components: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider + type: object required: - id properties: @@ -22275,6 +23770,7 @@ components: used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification + type: object required: - resource_type - resource_id @@ -22342,6 +23838,7 @@ components: title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend + type: object properties: id: description: The notification resend's ID @@ -22405,6 +23902,7 @@ components: title: OAuth description: Represent an OAuth app x-resourceId: OAuth + type: object required: - id - display_name @@ -22438,6 +23936,7 @@ components: title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit + type: object required: - order_id - order @@ -22566,6 +24065,7 @@ components: title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change + type: object required: - type - order_edit_id @@ -22623,6 +24123,7 @@ components: title: Order description: Represents an order x-resourceId: order + type: object required: - customer_id - email @@ -22901,6 +24402,7 @@ components: title: Payment Collection description: Payment Collection x-resourceId: payment_collection + type: object required: - type - status @@ -22926,12 +24428,7 @@ components: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -22941,12 +24438,6 @@ components: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID @@ -22998,6 +24489,7 @@ components: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider + type: object required: - id properties: @@ -23022,6 +24514,7 @@ components: Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session + type: object required: - cart_id - provider_id @@ -23095,6 +24588,7 @@ components: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment + type: object required: - amount - currency_code @@ -23192,6 +24686,7 @@ components: Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list + type: object required: - name - description @@ -23268,6 +24763,7 @@ components: title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection + type: object required: - title properties: @@ -23317,6 +24813,7 @@ components: Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value + type: object required: - value - option_id @@ -23375,6 +24872,7 @@ components: variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option + type: object required: - title - product_id @@ -23422,6 +24920,7 @@ components: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag + type: object required: - value properties: @@ -23456,6 +24955,7 @@ components: Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate + type: object required: - product_id - rate_id @@ -23493,6 +24993,7 @@ components: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate + type: object required: - product_type_id - rate_id @@ -23530,6 +25031,7 @@ components: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type + type: object required: - value properties: @@ -23566,6 +25068,7 @@ components: Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant + type: object required: - title - product_id @@ -23719,6 +25222,7 @@ components: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields + type: object properties: original_price: type: number @@ -23762,6 +25266,7 @@ components: such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product + type: object required: - title - profile_id @@ -23952,6 +25457,62 @@ components: description: An optional key-value map with additional details example: car: white + publishable_api_key_sales_channel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + x-resourceId: publishable_api_key_sales_channel + type: object + properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_api_key: + title: Publishable API key + description: >- + Publishable API key defines scopes (i.e. resources) that are available + within a request. + x-resourceId: publishable_api_key + type: object + properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: >- + A user object. Available if the relation `created_by_user` is + expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: >- + A user object. Available if the relation `revoked_by_user` is + expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time refund: title: Refund description: >- @@ -23959,6 +25520,7 @@ components: a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund + type: object required: - order_id - amount @@ -24025,6 +25587,7 @@ components: Region can consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region + type: object required: - name - currency_code @@ -24129,6 +25692,7 @@ components: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item + type: object required: - return_id - item_id @@ -24187,6 +25751,7 @@ components: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason + type: object required: - value - label @@ -24241,6 +25806,7 @@ components: to send back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return + type: object required: - refund_amount properties: @@ -24341,6 +25907,7 @@ components: title: Sales Channel description: A Sales Channel x-resourceId: sales_channel + type: object required: - name properties: @@ -24376,6 +25943,7 @@ components: title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line + type: object required: - shipping_method_id - rate @@ -24425,6 +25993,7 @@ components: contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method + type: object required: - shipping_option_id - price @@ -24509,6 +26078,7 @@ components: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement + type: object required: - shipping_option_id - type @@ -24557,6 +26127,7 @@ components: Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option + type: object required: - name - region_id @@ -24663,6 +26234,7 @@ components: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile + type: object required: - name - type @@ -24726,6 +26298,7 @@ components: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate + type: object required: - shipping_option_id - rate_id @@ -24761,6 +26334,7 @@ components: title: Staged Job description: A staged job resource x-resourceId: staged_job + type: object required: - event_name properties: @@ -24780,6 +26354,7 @@ components: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' x-resourceId: store + type: object properties: id: type: string @@ -24847,6 +26422,7 @@ components: Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap + type: object required: - fulfillment_status - payment_status @@ -24994,6 +26570,7 @@ components: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line + type: object required: - rate - name @@ -25031,6 +26608,7 @@ components: title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider + type: object properties: id: description: The id of the tax provider as given by the plugin. @@ -25049,6 +26627,7 @@ components: A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item + type: object required: - name - region_id @@ -25132,6 +26711,7 @@ components: Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link + type: object required: - tracking_number - fulfillment_id @@ -25185,6 +26765,7 @@ components: title: User description: Represents a User who can manage store settings. x-resourceId: user + type: object required: - email properties: @@ -25228,6 +26809,7 @@ components: multiple_errors: title: Multiple Errors x-resourceId: multiple_errors + type: object properties: errors: type: array @@ -25242,6 +26824,7 @@ components: error: title: Response Error x-resourceId: error + type: object properties: code: type: string diff --git a/docs/api/admin/code_samples/JavaScript/discounts/postundefined b/docs/api/admin/code_samples/JavaScript/discounts/postundefined index f1c7752ee9..fdb9dae2a3 100644 --- a/docs/api/admin/code_samples/JavaScript/discounts/postundefined +++ b/docs/api/admin/code_samples/JavaScript/discounts/postundefined @@ -9,6 +9,7 @@ medusa.admin.discounts.create({ value: 10, allocation: AllocationType.ITEM }, + regions: ['reg_XXXXXXXX'], is_dynamic: false, is_disabled: false }) diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/deleteundefined new file mode 100644 index 0000000000..ea5b7cb00a --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/deleteundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.paymentCollections.delete(payment_collection_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/getundefined new file mode 100644 index 0000000000..828a767d01 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/postundefined new file mode 100644 index 0000000000..d91153b57c --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/postundefined @@ -0,0 +1,9 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.paymentCollections.update(payment_collection_id, { + description: "Description of payCol" +}) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/postundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/postundefined new file mode 100644 index 0000000000..e485af9bb7 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.paymentCollections.markAsAuthorized(payment_collection_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/payments_{id}/getundefined new file mode 100644 index 0000000000..cad6523dcc --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payments_{id}/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.payments.retrieve(payment_id) +.then(({ payment }) => { + console.log(payment.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}_capture/postundefined b/docs/api/admin/code_samples/JavaScript/payments_{id}_capture/postundefined new file mode 100644 index 0000000000..1fa9f7aac8 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payments_{id}_capture/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.payments.capturePayment(payment_id) +.then(({ payment }) => { + console.log(payment.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}_refund/postundefined b/docs/api/admin/code_samples/JavaScript/payments_{id}_refund/postundefined new file mode 100644 index 0000000000..ead604e865 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/payments_{id}_refund/postundefined @@ -0,0 +1,11 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.payments.refundPayment(payment_id, { + amount: 1000, + reason: 'return', + note: 'Do not like it', +}) +.then(({ payment }) => { + console.log(payment.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/postundefined new file mode 100644 index 0000000000..5559f00ea4 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/postundefined @@ -0,0 +1,9 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKey.update(publishable_key_id, { + title: "new title" +}) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys/getundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys/getundefined new file mode 100644 index 0000000000..893936cf51 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKeys.list() + .then(({ publishable_api_keys }) => { + console.log(publishable_api_keys) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys/postundefined new file mode 100644 index 0000000000..7daeb2fc03 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKey.create() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined new file mode 100644 index 0000000000..b7039a418b --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKeys.listSalesChannels() + .then(({ sales_channels, limit, offset, count }) => { + console.log(sales_channels) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined new file mode 100644 index 0000000000..1b290cbee8 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKey.delete(key_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/getundefined new file mode 100644 index 0000000000..875ac03a4b --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKey.retrieve(pubKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined new file mode 100644 index 0000000000..f3bd1513b7 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKey.revoke() + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined new file mode 100644 index 0000000000..84e874b3a2 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined @@ -0,0 +1,13 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKeys.removeSalesChannels(publishableApiKeyId, { + sales_channel_ids: [ + { + id: channel_id + } + ] +}) +.then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined new file mode 100644 index 0000000000..a74d1ede9f --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined @@ -0,0 +1,13 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.publishableApiKeys.addSalesChannels(publishableApiKeyId, { + sales_channel_ids: [ + { + id: channel_id + } + ] +}) +.then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); +}); diff --git a/docs/api/admin/code_samples/Shell/discounts/postundefined b/docs/api/admin/code_samples/Shell/discounts/postundefined index acfcb88663..d0cb7fb00c 100644 --- a/docs/api/admin/code_samples/Shell/discounts/postundefined +++ b/docs/api/admin/code_samples/Shell/discounts/postundefined @@ -7,5 +7,6 @@ curl --location --request POST 'https://medusa-url.com/admin/discounts' \ "type": "fixed", "value": 10, "allocation": "item" - } + }, + "regions": ['reg_XXXXXXXX'] }' diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}/deleteundefined new file mode 100644 index 0000000000..d3e5e0f82f --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payment-collections_{id}/deleteundefined @@ -0,0 +1,2 @@ +curl --location --request DELETE 'https://medusa-url.com/admin/payment-collections/{id}' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/getundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}/getundefined new file mode 100644 index 0000000000..9aeebfd8fa --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payment-collections_{id}/getundefined @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/admin/payment-collections/{id}' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/postundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}/postundefined new file mode 100644 index 0000000000..4428893266 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payment-collections_{id}/postundefined @@ -0,0 +1,6 @@ +curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "description": "Description of payCol" +}' diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/postundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/postundefined new file mode 100644 index 0000000000..3fcd7013dc --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/postundefined @@ -0,0 +1,2 @@ +curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/payments_{id}/getundefined b/docs/api/admin/code_samples/Shell/payments_{id}/getundefined new file mode 100644 index 0000000000..4b52cbf845 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payments_{id}/getundefined @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/admin/payments/{id}' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/payments_{id}_capture/postundefined b/docs/api/admin/code_samples/Shell/payments_{id}_capture/postundefined new file mode 100644 index 0000000000..a73c22dc9b --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payments_{id}_capture/postundefined @@ -0,0 +1,2 @@ +curl --location --request POST 'https://medusa-url.com/admin/payments/{id}/capture' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/payments_{id}_refund/postundefined b/docs/api/admin/code_samples/Shell/payments_{id}_refund/postundefined new file mode 100644 index 0000000000..4667ba8b25 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/payments_{id}_refund/postundefined @@ -0,0 +1,8 @@ +curl --location --request POST 'https://medusa-url.com/admin/payments/pay_123/refund' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "amount": 1000, + "reason": "return", + "note": "Do not like it" +}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-key_{id}/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-key_{id}/postundefined new file mode 100644 index 0000000000..c52824266e --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-key_{id}/postundefined @@ -0,0 +1,6 @@ +curl --location --request POST 'https://medusa-url.com/admin/publishable-api-key/{id}' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "title": "updated title" +}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys/getundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys/getundefined new file mode 100644 index 0000000000..919cda1ff0 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys/getundefined @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys/postundefined new file mode 100644 index 0000000000..87b05f49be --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys/postundefined @@ -0,0 +1,3 @@ +curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys' \ +--header 'Authorization: Bearer {api_token}' +-d '{ "created_by": "user_123" }' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined new file mode 100644 index 0000000000..f3845038b6 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/pk_123/sales-channels' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/deleteundefined new file mode 100644 index 0000000000..41922603be --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/deleteundefined @@ -0,0 +1,2 @@ +curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-key/{id}' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/getundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/getundefined new file mode 100644 index 0000000000..3a3f1a00ed --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/getundefined @@ -0,0 +1,3 @@ +curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123' \ +--header 'Authorization: Bearer {api_token}' +-d '{ "created_by": "user_123" }' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined new file mode 100644 index 0000000000..f742a92ad3 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined @@ -0,0 +1,3 @@ +curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/pubkey_123/revoke' \ +--header 'Authorization: Bearer {api_token}' +-d '{ "created_by": "user_123", "revoked_by": "user_123" }' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined new file mode 100644 index 0000000000..390c392a78 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined @@ -0,0 +1,10 @@ +curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] +}' diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined new file mode 100644 index 0000000000..6c7fc9369f --- /dev/null +++ b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined @@ -0,0 +1,10 @@ +curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/afasf/batch' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] +}' diff --git a/docs/api/admin/components/schemas/OAuth.yaml b/docs/api/admin/components/schemas/OAuth.yaml index a9afba0974..6b6cb8b660 100644 --- a/docs/api/admin/components/schemas/OAuth.yaml +++ b/docs/api/admin/components/schemas/OAuth.yaml @@ -1,6 +1,7 @@ title: OAuth description: Represent an OAuth app x-resourceId: OAuth +type: object required: - id - display_name diff --git a/docs/api/admin/components/schemas/address.yaml b/docs/api/admin/components/schemas/address.yaml index ff413792f1..d39d1760ae 100644 --- a/docs/api/admin/components/schemas/address.yaml +++ b/docs/api/admin/components/schemas/address.yaml @@ -1,6 +1,7 @@ title: Address description: An address. x-resourceId: address +type: object properties: id: type: string diff --git a/docs/api/admin/components/schemas/address_fields.yaml b/docs/api/admin/components/schemas/address_fields.yaml index 110810299c..303b9d5ca9 100644 --- a/docs/api/admin/components/schemas/address_fields.yaml +++ b/docs/api/admin/components/schemas/address_fields.yaml @@ -1,6 +1,7 @@ title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address +type: object properties: company: type: string diff --git a/docs/api/admin/components/schemas/batch_job.yaml b/docs/api/admin/components/schemas/batch_job.yaml index dcb63d5f55..c06c261ba5 100644 --- a/docs/api/admin/components/schemas/batch_job.yaml +++ b/docs/api/admin/components/schemas/batch_job.yaml @@ -1,6 +1,7 @@ title: Batch Job description: A Batch Job. x-resourceId: batch_job +type: object required: - type properties: diff --git a/docs/api/admin/components/schemas/cart.yaml b/docs/api/admin/components/schemas/cart.yaml index 0881621115..de1d520a2d 100644 --- a/docs/api/admin/components/schemas/cart.yaml +++ b/docs/api/admin/components/schemas/cart.yaml @@ -1,6 +1,7 @@ title: Cart description: Represents a user cart x-resourceId: cart +type: object properties: id: type: string diff --git a/docs/api/admin/components/schemas/claim_image.yaml b/docs/api/admin/components/schemas/claim_image.yaml index 5b2d04e74b..783d89c06d 100644 --- a/docs/api/admin/components/schemas/claim_image.yaml +++ b/docs/api/admin/components/schemas/claim_image.yaml @@ -1,6 +1,7 @@ title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image +type: object required: - claim_item_id - url diff --git a/docs/api/admin/components/schemas/claim_item.yaml b/docs/api/admin/components/schemas/claim_item.yaml index ccec3c8ebf..cb7e85c9dd 100644 --- a/docs/api/admin/components/schemas/claim_item.yaml +++ b/docs/api/admin/components/schemas/claim_item.yaml @@ -3,6 +3,7 @@ description: >- Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item +type: object required: - claim_order_id - item_id diff --git a/docs/api/admin/components/schemas/claim_order.yaml b/docs/api/admin/components/schemas/claim_order.yaml index 1d26758cec..ed55db009d 100644 --- a/docs/api/admin/components/schemas/claim_order.yaml +++ b/docs/api/admin/components/schemas/claim_order.yaml @@ -4,6 +4,7 @@ description: >- consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order +type: object required: - type - order_id diff --git a/docs/api/admin/components/schemas/claim_tag.yaml b/docs/api/admin/components/schemas/claim_tag.yaml index bf7b96a3db..46a23e4da8 100644 --- a/docs/api/admin/components/schemas/claim_tag.yaml +++ b/docs/api/admin/components/schemas/claim_tag.yaml @@ -3,6 +3,7 @@ description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag +type: object required: - value properties: diff --git a/docs/api/admin/components/schemas/country.yaml b/docs/api/admin/components/schemas/country.yaml index 8bd271c77c..d8a7a18e36 100644 --- a/docs/api/admin/components/schemas/country.yaml +++ b/docs/api/admin/components/schemas/country.yaml @@ -1,6 +1,7 @@ title: Country description: Country details x-resourceId: country +type: object required: - iso_2 - iso_3 diff --git a/docs/api/admin/components/schemas/currency.yaml b/docs/api/admin/components/schemas/currency.yaml index acdf451c75..be164ffa9e 100644 --- a/docs/api/admin/components/schemas/currency.yaml +++ b/docs/api/admin/components/schemas/currency.yaml @@ -1,6 +1,7 @@ title: Currency description: Currency x-resourceId: currency +type: object required: - code - symbol diff --git a/docs/api/admin/components/schemas/custom_shipping_option.yaml b/docs/api/admin/components/schemas/custom_shipping_option.yaml index 9e93606075..40ff8c8229 100644 --- a/docs/api/admin/components/schemas/custom_shipping_option.yaml +++ b/docs/api/admin/components/schemas/custom_shipping_option.yaml @@ -4,6 +4,7 @@ description: >- attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option +type: object required: - price - shipping_option_id diff --git a/docs/api/admin/components/schemas/customer.yaml b/docs/api/admin/components/schemas/customer.yaml index e3df6d690b..aa0e83a77c 100644 --- a/docs/api/admin/components/schemas/customer.yaml +++ b/docs/api/admin/components/schemas/customer.yaml @@ -1,6 +1,7 @@ title: Customer description: Represents a customer x-resourceId: customer +type: object required: - email properties: @@ -18,7 +19,7 @@ properties: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string diff --git a/docs/api/admin/components/schemas/customer_group.yaml b/docs/api/admin/components/schemas/customer_group.yaml index d99e3a5923..0d4769c7ad 100644 --- a/docs/api/admin/components/schemas/customer_group.yaml +++ b/docs/api/admin/components/schemas/customer_group.yaml @@ -1,6 +1,7 @@ title: Customer Group description: Represents a customer group x-resourceId: customer_group +type: object required: - name properties: diff --git a/docs/api/admin/components/schemas/discount.yaml b/docs/api/admin/components/schemas/discount.yaml index 48f090532a..1950a503cb 100644 --- a/docs/api/admin/components/schemas/discount.yaml +++ b/docs/api/admin/components/schemas/discount.yaml @@ -1,6 +1,7 @@ title: Discount description: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount +type: object required: - code - is_dynamic diff --git a/docs/api/admin/components/schemas/discount_condition.yaml b/docs/api/admin/components/schemas/discount_condition.yaml index 57a0dea0b9..794e839eb3 100644 --- a/docs/api/admin/components/schemas/discount_condition.yaml +++ b/docs/api/admin/components/schemas/discount_condition.yaml @@ -1,6 +1,7 @@ title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition +type: object required: - type - operator diff --git a/docs/api/admin/components/schemas/discount_condition_customer_group.yaml b/docs/api/admin/components/schemas/discount_condition_customer_group.yaml index ad6527d260..51867349ad 100644 --- a/docs/api/admin/components/schemas/discount_condition_customer_group.yaml +++ b/docs/api/admin/components/schemas/discount_condition_customer_group.yaml @@ -1,6 +1,7 @@ title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group +type: object required: - customer_group_id - condition_id diff --git a/docs/api/admin/components/schemas/discount_condition_product.yaml b/docs/api/admin/components/schemas/discount_condition_product.yaml index 77f4fa6b9e..b88eac53c2 100644 --- a/docs/api/admin/components/schemas/discount_condition_product.yaml +++ b/docs/api/admin/components/schemas/discount_condition_product.yaml @@ -1,6 +1,7 @@ title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product +type: object required: - product_id - condition_id diff --git a/docs/api/admin/components/schemas/discount_condition_product_collection.yaml b/docs/api/admin/components/schemas/discount_condition_product_collection.yaml index 43c7548e34..bc0065ef9f 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_collection.yaml +++ b/docs/api/admin/components/schemas/discount_condition_product_collection.yaml @@ -1,6 +1,7 @@ title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection +type: object required: - product_collection_id - condition_id diff --git a/docs/api/admin/components/schemas/discount_condition_product_tag.yaml b/docs/api/admin/components/schemas/discount_condition_product_tag.yaml index ed3a8b2e79..d3ba121f43 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_tag.yaml +++ b/docs/api/admin/components/schemas/discount_condition_product_tag.yaml @@ -1,6 +1,7 @@ title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag +type: object required: - product_tag_id - condition_id diff --git a/docs/api/admin/components/schemas/discount_condition_product_type.yaml b/docs/api/admin/components/schemas/discount_condition_product_type.yaml index 3125b2119c..03a6393c44 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_type.yaml +++ b/docs/api/admin/components/schemas/discount_condition_product_type.yaml @@ -1,6 +1,7 @@ title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product +type: object required: - product_type_id - condition_id diff --git a/docs/api/admin/components/schemas/discount_rule.yaml b/docs/api/admin/components/schemas/discount_rule.yaml index 328171368f..ab6ab1a80e 100644 --- a/docs/api/admin/components/schemas/discount_rule.yaml +++ b/docs/api/admin/components/schemas/discount_rule.yaml @@ -3,6 +3,7 @@ description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule +type: object required: - type - value diff --git a/docs/api/admin/components/schemas/draft-order.yaml b/docs/api/admin/components/schemas/draft-order.yaml index 12152dc3e0..1c96c22bc7 100644 --- a/docs/api/admin/components/schemas/draft-order.yaml +++ b/docs/api/admin/components/schemas/draft-order.yaml @@ -1,6 +1,7 @@ title: DraftOrder description: Represents a draft order x-resourceId: draft-order +type: object properties: id: type: string diff --git a/docs/api/admin/components/schemas/error.yaml b/docs/api/admin/components/schemas/error.yaml index c8baa14163..cad9495918 100644 --- a/docs/api/admin/components/schemas/error.yaml +++ b/docs/api/admin/components/schemas/error.yaml @@ -1,5 +1,6 @@ title: Response Error x-resourceId: error +type: object properties: code: type: string diff --git a/docs/api/admin/components/schemas/fulfillment.yaml b/docs/api/admin/components/schemas/fulfillment.yaml index 0ea09f97e5..d6ee5c6960 100644 --- a/docs/api/admin/components/schemas/fulfillment.yaml +++ b/docs/api/admin/components/schemas/fulfillment.yaml @@ -8,6 +8,7 @@ description: >- webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment +type: object required: - provider_id properties: diff --git a/docs/api/admin/components/schemas/fulfillment_item.yaml b/docs/api/admin/components/schemas/fulfillment_item.yaml index 29fe0f87b9..f233f45f68 100644 --- a/docs/api/admin/components/schemas/fulfillment_item.yaml +++ b/docs/api/admin/components/schemas/fulfillment_item.yaml @@ -3,6 +3,7 @@ description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item +type: object required: - fulfillment_id - item_id diff --git a/docs/api/admin/components/schemas/fulfillment_provider.yaml b/docs/api/admin/components/schemas/fulfillment_provider.yaml index d6fdd8ce64..584c933111 100644 --- a/docs/api/admin/components/schemas/fulfillment_provider.yaml +++ b/docs/api/admin/components/schemas/fulfillment_provider.yaml @@ -1,6 +1,7 @@ title: Fulfillment Provider description: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider +type: object properties: id: description: The id of the fulfillment provider as given by the plugin. diff --git a/docs/api/admin/components/schemas/gift_card.yaml b/docs/api/admin/components/schemas/gift_card.yaml index 713a2a39fc..054f93319f 100644 --- a/docs/api/admin/components/schemas/gift_card.yaml +++ b/docs/api/admin/components/schemas/gift_card.yaml @@ -3,6 +3,7 @@ description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card +type: object required: - code - value diff --git a/docs/api/admin/components/schemas/gift_card_transaction.yaml b/docs/api/admin/components/schemas/gift_card_transaction.yaml index 0d923b3653..fb16341851 100644 --- a/docs/api/admin/components/schemas/gift_card_transaction.yaml +++ b/docs/api/admin/components/schemas/gift_card_transaction.yaml @@ -3,6 +3,7 @@ description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction +type: object required: - gift_card_id - amount diff --git a/docs/api/admin/components/schemas/idempotency_key.yaml b/docs/api/admin/components/schemas/idempotency_key.yaml index ac4f6b63b7..9bff9c0f90 100644 --- a/docs/api/admin/components/schemas/idempotency_key.yaml +++ b/docs/api/admin/components/schemas/idempotency_key.yaml @@ -3,6 +3,7 @@ description: >- Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key +type: object required: - idempotency_key properties: diff --git a/docs/api/admin/components/schemas/image.yaml b/docs/api/admin/components/schemas/image.yaml index 24bf973e75..61bc475c32 100644 --- a/docs/api/admin/components/schemas/image.yaml +++ b/docs/api/admin/components/schemas/image.yaml @@ -1,6 +1,7 @@ title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image +type: object required: - url properties: diff --git a/docs/api/admin/components/schemas/invite.yaml b/docs/api/admin/components/schemas/invite.yaml index 492a71eeb2..aac3ce0b7f 100644 --- a/docs/api/admin/components/schemas/invite.yaml +++ b/docs/api/admin/components/schemas/invite.yaml @@ -1,6 +1,7 @@ title: Invite description: Represents an invite x-resourceId: invite +type: object required: - user_email properties: diff --git a/docs/api/admin/components/schemas/line_item.yaml b/docs/api/admin/components/schemas/line_item.yaml index cdb06694a9..ae9ed1eaa0 100644 --- a/docs/api/admin/components/schemas/line_item.yaml +++ b/docs/api/admin/components/schemas/line_item.yaml @@ -5,6 +5,7 @@ description: >- order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item +type: object required: - title - unit_price diff --git a/docs/api/admin/components/schemas/line_item_adjustment.yaml b/docs/api/admin/components/schemas/line_item_adjustment.yaml index 8ae889c8dc..677f69388a 100644 --- a/docs/api/admin/components/schemas/line_item_adjustment.yaml +++ b/docs/api/admin/components/schemas/line_item_adjustment.yaml @@ -1,6 +1,7 @@ title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment +type: object required: - item_id - description diff --git a/docs/api/admin/components/schemas/line_item_tax_line.yaml b/docs/api/admin/components/schemas/line_item_tax_line.yaml index 9320de67e3..b149f62d42 100644 --- a/docs/api/admin/components/schemas/line_item_tax_line.yaml +++ b/docs/api/admin/components/schemas/line_item_tax_line.yaml @@ -1,6 +1,7 @@ title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line +type: object required: - item_id - rate diff --git a/docs/api/admin/components/schemas/money_amount.yaml b/docs/api/admin/components/schemas/money_amount.yaml index f54d7e4a7a..929194a759 100644 --- a/docs/api/admin/components/schemas/money_amount.yaml +++ b/docs/api/admin/components/schemas/money_amount.yaml @@ -6,6 +6,7 @@ description: >- pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount +type: object required: - currency_code - amount diff --git a/docs/api/admin/components/schemas/multiple_errors.yaml b/docs/api/admin/components/schemas/multiple_errors.yaml index 579282df2f..0327c94e70 100644 --- a/docs/api/admin/components/schemas/multiple_errors.yaml +++ b/docs/api/admin/components/schemas/multiple_errors.yaml @@ -1,5 +1,6 @@ title: Multiple Errors x-resourceId: multiple_errors +type: object properties: errors: type: array diff --git a/docs/api/admin/components/schemas/note.yaml b/docs/api/admin/components/schemas/note.yaml index 9333e49472..16f1e9fe50 100644 --- a/docs/api/admin/components/schemas/note.yaml +++ b/docs/api/admin/components/schemas/note.yaml @@ -3,6 +3,7 @@ description: >- Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. x-resourceId: note +type: object required: - value - resource_type diff --git a/docs/api/admin/components/schemas/notification.yaml b/docs/api/admin/components/schemas/notification.yaml index 559d58d79a..9db10fe27a 100644 --- a/docs/api/admin/components/schemas/notification.yaml +++ b/docs/api/admin/components/schemas/notification.yaml @@ -5,6 +5,7 @@ description: >- chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification +type: object required: - resource_type - resource_id diff --git a/docs/api/admin/components/schemas/notification_provider.yaml b/docs/api/admin/components/schemas/notification_provider.yaml index 6ac490109f..dacf80d189 100644 --- a/docs/api/admin/components/schemas/notification_provider.yaml +++ b/docs/api/admin/components/schemas/notification_provider.yaml @@ -1,6 +1,7 @@ title: Notification Provider description: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider +type: object required: - id properties: diff --git a/docs/api/admin/components/schemas/notification_resend.yaml b/docs/api/admin/components/schemas/notification_resend.yaml index c5cfe4431f..2b15999aa6 100644 --- a/docs/api/admin/components/schemas/notification_resend.yaml +++ b/docs/api/admin/components/schemas/notification_resend.yaml @@ -1,6 +1,7 @@ title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend +type: object properties: id: description: The notification resend's ID diff --git a/docs/api/admin/components/schemas/order.yaml b/docs/api/admin/components/schemas/order.yaml index 7371e85df9..464edc17fb 100644 --- a/docs/api/admin/components/schemas/order.yaml +++ b/docs/api/admin/components/schemas/order.yaml @@ -1,6 +1,7 @@ title: Order description: Represents an order x-resourceId: order +type: object required: - customer_id - email diff --git a/docs/api/admin/components/schemas/order_edit.yaml b/docs/api/admin/components/schemas/order_edit.yaml index 44e4a3f779..5574c2b6f2 100644 --- a/docs/api/admin/components/schemas/order_edit.yaml +++ b/docs/api/admin/components/schemas/order_edit.yaml @@ -1,6 +1,7 @@ title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit +type: object required: - order_id - order diff --git a/docs/api/admin/components/schemas/order_item_change.yaml b/docs/api/admin/components/schemas/order_item_change.yaml index 70d61c83c3..9bc3b3a826 100644 --- a/docs/api/admin/components/schemas/order_item_change.yaml +++ b/docs/api/admin/components/schemas/order_item_change.yaml @@ -1,6 +1,7 @@ title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change +type: object required: - type - order_edit_id diff --git a/docs/api/admin/components/schemas/payment.yaml b/docs/api/admin/components/schemas/payment.yaml index 92294bd2e6..384e04b16c 100644 --- a/docs/api/admin/components/schemas/payment.yaml +++ b/docs/api/admin/components/schemas/payment.yaml @@ -3,6 +3,7 @@ description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment +type: object required: - amount - currency_code diff --git a/docs/api/admin/components/schemas/payment_collection.yaml b/docs/api/admin/components/schemas/payment_collection.yaml index 315c62b475..3f5663b39a 100644 --- a/docs/api/admin/components/schemas/payment_collection.yaml +++ b/docs/api/admin/components/schemas/payment_collection.yaml @@ -1,6 +1,7 @@ title: Payment Collection description: Payment Collection x-resourceId: payment_collection +type: object required: - type - status @@ -26,12 +27,7 @@ properties: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -41,12 +37,6 @@ properties: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID diff --git a/docs/api/admin/components/schemas/payment_provider.yaml b/docs/api/admin/components/schemas/payment_provider.yaml index 7f39ed6355..081a6b7462 100644 --- a/docs/api/admin/components/schemas/payment_provider.yaml +++ b/docs/api/admin/components/schemas/payment_provider.yaml @@ -1,6 +1,7 @@ title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider +type: object required: - id properties: diff --git a/docs/api/admin/components/schemas/payment_session.yaml b/docs/api/admin/components/schemas/payment_session.yaml index c9f52a749b..ca8c513a26 100644 --- a/docs/api/admin/components/schemas/payment_session.yaml +++ b/docs/api/admin/components/schemas/payment_session.yaml @@ -7,6 +7,7 @@ description: >- get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session +type: object required: - cart_id - provider_id diff --git a/docs/api/admin/components/schemas/price_list.yaml b/docs/api/admin/components/schemas/price_list.yaml index bae4d3936a..b774028314 100644 --- a/docs/api/admin/components/schemas/price_list.yaml +++ b/docs/api/admin/components/schemas/price_list.yaml @@ -3,6 +3,7 @@ description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list +type: object required: - name - description diff --git a/docs/api/admin/components/schemas/product.yaml b/docs/api/admin/components/schemas/product.yaml index 41bf53f444..e0116cc51d 100644 --- a/docs/api/admin/components/schemas/product.yaml +++ b/docs/api/admin/components/schemas/product.yaml @@ -4,6 +4,7 @@ description: >- as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product +type: object required: - title - profile_id diff --git a/docs/api/admin/components/schemas/product_collection.yaml b/docs/api/admin/components/schemas/product_collection.yaml index 711acc6c10..a3fd98cefb 100644 --- a/docs/api/admin/components/schemas/product_collection.yaml +++ b/docs/api/admin/components/schemas/product_collection.yaml @@ -1,6 +1,7 @@ title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection +type: object required: - title properties: diff --git a/docs/api/admin/components/schemas/product_option.yaml b/docs/api/admin/components/schemas/product_option.yaml index 66fd46f4fd..aaaf0d58c1 100644 --- a/docs/api/admin/components/schemas/product_option.yaml +++ b/docs/api/admin/components/schemas/product_option.yaml @@ -4,6 +4,7 @@ description: >- a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option +type: object required: - title - product_id diff --git a/docs/api/admin/components/schemas/product_option_value.yaml b/docs/api/admin/components/schemas/product_option_value.yaml index 3b8606ea53..407e69a536 100644 --- a/docs/api/admin/components/schemas/product_option_value.yaml +++ b/docs/api/admin/components/schemas/product_option_value.yaml @@ -3,6 +3,7 @@ description: >- A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value +type: object required: - value - option_id diff --git a/docs/api/admin/components/schemas/product_tag.yaml b/docs/api/admin/components/schemas/product_tag.yaml index cdfa21d4ad..8240386ddf 100644 --- a/docs/api/admin/components/schemas/product_tag.yaml +++ b/docs/api/admin/components/schemas/product_tag.yaml @@ -1,6 +1,7 @@ title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag +type: object required: - value properties: diff --git a/docs/api/admin/components/schemas/product_tax_rate.yaml b/docs/api/admin/components/schemas/product_tax_rate.yaml index f72e8896a8..db175e899d 100644 --- a/docs/api/admin/components/schemas/product_tax_rate.yaml +++ b/docs/api/admin/components/schemas/product_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate +type: object required: - product_id - rate_id diff --git a/docs/api/admin/components/schemas/product_type.yaml b/docs/api/admin/components/schemas/product_type.yaml index e2be2bf920..b6e06d4190 100644 --- a/docs/api/admin/components/schemas/product_type.yaml +++ b/docs/api/admin/components/schemas/product_type.yaml @@ -1,6 +1,7 @@ title: Product Type description: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type +type: object required: - value properties: diff --git a/docs/api/admin/components/schemas/product_type_tax_rate.yaml b/docs/api/admin/components/schemas/product_type_tax_rate.yaml index 5bc7d5c302..48445a6b80 100644 --- a/docs/api/admin/components/schemas/product_type_tax_rate.yaml +++ b/docs/api/admin/components/schemas/product_type_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate +type: object required: - product_type_id - rate_id diff --git a/docs/api/admin/components/schemas/product_variant.yaml b/docs/api/admin/components/schemas/product_variant.yaml index aa7386d615..a0cb2eacc9 100644 --- a/docs/api/admin/components/schemas/product_variant.yaml +++ b/docs/api/admin/components/schemas/product_variant.yaml @@ -4,6 +4,7 @@ description: >- configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant +type: object required: - title - product_id diff --git a/docs/api/admin/components/schemas/product_variant_prices_fields.yaml b/docs/api/admin/components/schemas/product_variant_prices_fields.yaml index aefca848a0..aee4659828 100644 --- a/docs/api/admin/components/schemas/product_variant_prices_fields.yaml +++ b/docs/api/admin/components/schemas/product_variant_prices_fields.yaml @@ -1,6 +1,7 @@ title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields +type: object properties: original_price: type: number diff --git a/docs/api/admin/components/schemas/publishable_api_key.yaml b/docs/api/admin/components/schemas/publishable_api_key.yaml new file mode 100644 index 0000000000..061b34b8c8 --- /dev/null +++ b/docs/api/admin/components/schemas/publishable_api_key.yaml @@ -0,0 +1,37 @@ +title: Publishable API key +description: >- + Publishable API key defines scopes (i.e. resources) that are available within + a request. +x-resourceId: publishable_api_key +type: object +properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: A user object. Available if the relation `created_by_user` is expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: A user object. Available if the relation `revoked_by_user` is expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time diff --git a/docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml b/docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml new file mode 100644 index 0000000000..d0ab55c29a --- /dev/null +++ b/docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml @@ -0,0 +1,13 @@ +title: Publishable API key sales channel +description: Holds mapping between Publishable API keys and Sales Channels +x-resourceId: publishable_api_key_sales_channel +type: object +properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 diff --git a/docs/api/admin/components/schemas/refund.yaml b/docs/api/admin/components/schemas/refund.yaml index c1fc4cfc0f..fae6a881f3 100644 --- a/docs/api/admin/components/schemas/refund.yaml +++ b/docs/api/admin/components/schemas/refund.yaml @@ -4,6 +4,7 @@ description: >- given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund +type: object required: - order_id - amount diff --git a/docs/api/admin/components/schemas/region.yaml b/docs/api/admin/components/schemas/region.yaml index a2561dc892..15b245b470 100644 --- a/docs/api/admin/components/schemas/region.yaml +++ b/docs/api/admin/components/schemas/region.yaml @@ -5,6 +5,7 @@ description: >- consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region +type: object required: - name - currency_code diff --git a/docs/api/admin/components/schemas/return.yaml b/docs/api/admin/components/schemas/return.yaml index a475900106..7ba545dcdc 100644 --- a/docs/api/admin/components/schemas/return.yaml +++ b/docs/api/admin/components/schemas/return.yaml @@ -4,6 +4,7 @@ description: >- back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return +type: object required: - refund_amount properties: diff --git a/docs/api/admin/components/schemas/return_item.yaml b/docs/api/admin/components/schemas/return_item.yaml index 3c45a35003..4ecc64bc8d 100644 --- a/docs/api/admin/components/schemas/return_item.yaml +++ b/docs/api/admin/components/schemas/return_item.yaml @@ -3,6 +3,7 @@ description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item +type: object required: - return_id - item_id diff --git a/docs/api/admin/components/schemas/return_reason.yaml b/docs/api/admin/components/schemas/return_reason.yaml index 7873cfc3f2..2e4d4d83ef 100644 --- a/docs/api/admin/components/schemas/return_reason.yaml +++ b/docs/api/admin/components/schemas/return_reason.yaml @@ -3,6 +3,7 @@ description: >- A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason +type: object required: - value - label diff --git a/docs/api/admin/components/schemas/sales_channel.yaml b/docs/api/admin/components/schemas/sales_channel.yaml index 0523299105..7c4e1f2920 100644 --- a/docs/api/admin/components/schemas/sales_channel.yaml +++ b/docs/api/admin/components/schemas/sales_channel.yaml @@ -1,6 +1,7 @@ title: Sales Channel description: A Sales Channel x-resourceId: sales_channel +type: object required: - name properties: diff --git a/docs/api/admin/components/schemas/shipping_method.yaml b/docs/api/admin/components/schemas/shipping_method.yaml index d6a9601277..4ac18c8e93 100644 --- a/docs/api/admin/components/schemas/shipping_method.yaml +++ b/docs/api/admin/components/schemas/shipping_method.yaml @@ -5,6 +5,7 @@ description: >- details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method +type: object required: - shipping_option_id - price diff --git a/docs/api/admin/components/schemas/shipping_method_tax_line.yaml b/docs/api/admin/components/schemas/shipping_method_tax_line.yaml index cce7e8fddf..3387bfbfe2 100644 --- a/docs/api/admin/components/schemas/shipping_method_tax_line.yaml +++ b/docs/api/admin/components/schemas/shipping_method_tax_line.yaml @@ -1,6 +1,7 @@ title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line +type: object required: - shipping_method_id - rate diff --git a/docs/api/admin/components/schemas/shipping_option.yaml b/docs/api/admin/components/schemas/shipping_option.yaml index 108dbc5f14..a0e1c6538a 100644 --- a/docs/api/admin/components/schemas/shipping_option.yaml +++ b/docs/api/admin/components/schemas/shipping_option.yaml @@ -7,6 +7,7 @@ description: >- distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option +type: object required: - name - region_id diff --git a/docs/api/admin/components/schemas/shipping_option_requirement.yaml b/docs/api/admin/components/schemas/shipping_option_requirement.yaml index 559d21de44..57d9719312 100644 --- a/docs/api/admin/components/schemas/shipping_option_requirement.yaml +++ b/docs/api/admin/components/schemas/shipping_option_requirement.yaml @@ -3,6 +3,7 @@ description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement +type: object required: - shipping_option_id - type diff --git a/docs/api/admin/components/schemas/shipping_profile.yaml b/docs/api/admin/components/schemas/shipping_profile.yaml index cb55e4f134..ba479ece92 100644 --- a/docs/api/admin/components/schemas/shipping_profile.yaml +++ b/docs/api/admin/components/schemas/shipping_profile.yaml @@ -3,6 +3,7 @@ description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile +type: object required: - name - type diff --git a/docs/api/admin/components/schemas/shipping_tax_rate.yaml b/docs/api/admin/components/schemas/shipping_tax_rate.yaml index ddf13f172a..30058a09af 100644 --- a/docs/api/admin/components/schemas/shipping_tax_rate.yaml +++ b/docs/api/admin/components/schemas/shipping_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate +type: object required: - shipping_option_id - rate_id diff --git a/docs/api/admin/components/schemas/staged_job.yaml b/docs/api/admin/components/schemas/staged_job.yaml index 95fd6aaf34..055ceaee0e 100644 --- a/docs/api/admin/components/schemas/staged_job.yaml +++ b/docs/api/admin/components/schemas/staged_job.yaml @@ -1,6 +1,7 @@ title: Staged Job description: A staged job resource x-resourceId: staged_job +type: object required: - event_name properties: diff --git a/docs/api/admin/components/schemas/store.yaml b/docs/api/admin/components/schemas/store.yaml index 09844ff155..98b90e81f4 100644 --- a/docs/api/admin/components/schemas/store.yaml +++ b/docs/api/admin/components/schemas/store.yaml @@ -1,6 +1,7 @@ title: Store description: Holds settings for the Store, such as name, currencies, etc. x-resourceId: store +type: object properties: id: type: string diff --git a/docs/api/admin/components/schemas/swap.yaml b/docs/api/admin/components/schemas/swap.yaml index e9f0397f64..31694ff199 100644 --- a/docs/api/admin/components/schemas/swap.yaml +++ b/docs/api/admin/components/schemas/swap.yaml @@ -8,6 +8,7 @@ description: >- amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap +type: object required: - fulfillment_status - payment_status diff --git a/docs/api/admin/components/schemas/tax_line.yaml b/docs/api/admin/components/schemas/tax_line.yaml index 491a7e0c00..3faaf02eb7 100644 --- a/docs/api/admin/components/schemas/tax_line.yaml +++ b/docs/api/admin/components/schemas/tax_line.yaml @@ -1,6 +1,7 @@ title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line +type: object required: - rate - name diff --git a/docs/api/admin/components/schemas/tax_provider.yaml b/docs/api/admin/components/schemas/tax_provider.yaml index 267d162eae..7f53c424a5 100644 --- a/docs/api/admin/components/schemas/tax_provider.yaml +++ b/docs/api/admin/components/schemas/tax_provider.yaml @@ -1,6 +1,7 @@ title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider +type: object properties: id: description: The id of the tax provider as given by the plugin. diff --git a/docs/api/admin/components/schemas/tax_rate.yaml b/docs/api/admin/components/schemas/tax_rate.yaml index 29f7e0e0a9..cbe718652e 100644 --- a/docs/api/admin/components/schemas/tax_rate.yaml +++ b/docs/api/admin/components/schemas/tax_rate.yaml @@ -3,6 +3,7 @@ description: >- A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item +type: object required: - name - region_id diff --git a/docs/api/admin/components/schemas/tracking_link.yaml b/docs/api/admin/components/schemas/tracking_link.yaml index 2a79689722..25867d8a97 100644 --- a/docs/api/admin/components/schemas/tracking_link.yaml +++ b/docs/api/admin/components/schemas/tracking_link.yaml @@ -4,6 +4,7 @@ description: >- Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link +type: object required: - tracking_number - fulfillment_id diff --git a/docs/api/admin/components/schemas/user.yaml b/docs/api/admin/components/schemas/user.yaml index 5083be44de..042cd46cb2 100644 --- a/docs/api/admin/components/schemas/user.yaml +++ b/docs/api/admin/components/schemas/user.yaml @@ -1,6 +1,7 @@ title: User description: Represents a User who can manage store settings. x-resourceId: user +type: object required: - email properties: diff --git a/docs/api/admin/openapi.yaml b/docs/api/admin/openapi.yaml index 380a1c21d2..bbafc38b93 100644 --- a/docs/api/admin/openapi.yaml +++ b/docs/api/admin/openapi.yaml @@ -208,6 +208,10 @@ paths: $ref: paths/apps.yaml /auth: $ref: paths/auth.yaml + /currencies: + $ref: paths/currencies.yaml + /currencies/{code}: + $ref: paths/currencies_{code}.yaml /batch-jobs/{id}/cancel: $ref: paths/batch-jobs_{id}_cancel.yaml /batch-jobs/{id}/confirm: @@ -216,16 +220,6 @@ paths: $ref: paths/batch-jobs.yaml /batch-jobs/{id}: $ref: paths/batch-jobs_{id}.yaml - /collections/{id}/products/batch: - $ref: paths/collections_{id}_products_batch.yaml - /collections: - $ref: paths/collections.yaml - /collections/{id}: - $ref: paths/collections_{id}.yaml - /currencies: - $ref: paths/currencies.yaml - /currencies/{code}: - $ref: paths/currencies_{code}.yaml /customer-groups/{id}/customers/batch: $ref: paths/customer-groups_{id}_customers_batch.yaml /customer-groups: @@ -234,6 +228,12 @@ paths: $ref: paths/customer-groups_{id}.yaml /customer-groups/{id}/customers: $ref: paths/customer-groups_{id}_customers.yaml + /collections/{id}/products/batch: + $ref: paths/collections_{id}_products_batch.yaml + /collections: + $ref: paths/collections.yaml + /collections/{id}: + $ref: paths/collections_{id}.yaml /customers: $ref: paths/customers.yaml /customers/{id}: @@ -354,6 +354,16 @@ paths: $ref: paths/orders_{id}_return.yaml /order/{id}/claims/{claim_id}: $ref: paths/order_{id}_claims_{claim_id}.yaml + /payment-collections/{id}: + $ref: paths/payment-collections_{id}.yaml + /payment-collections/{id}/authorize: + $ref: paths/payment-collections_{id}_authorize.yaml + /payments/{id}/capture: + $ref: paths/payments_{id}_capture.yaml + /payments/{id}: + $ref: paths/payments_{id}.yaml + /payments/{id}/refund: + $ref: paths/payments_{id}_refund.yaml /price-lists/{id}/prices/batch: $ref: paths/price-lists_{id}_prices_batch.yaml /price-lists: @@ -388,6 +398,18 @@ paths: $ref: paths/products_types.yaml /products/{id}/metadata: $ref: paths/products_{id}_metadata.yaml + /publishable-api-keys/{id}/sales-channels/batch: + $ref: paths/publishable-api-keys_{id}_sales-channels_batch.yaml + /publishable-api-keys: + $ref: paths/publishable-api-keys.yaml + /publishable-api-keys/{id}: + $ref: paths/publishable-api-keys_{id}.yaml + /publishable-api-keys/:id/sales-channels: + $ref: paths/publishable-api-keys_:id_sales-channels.yaml + /publishable-api-keys/{id}/revoke: + $ref: paths/publishable-api-keys_{id}_revoke.yaml + /publishable-api-key/{id}: + $ref: paths/publishable-api-key_{id}.yaml /regions/{id}/countries: $ref: paths/regions_{id}_countries.yaml /regions/{id}/fulfillment-providers: @@ -438,10 +460,6 @@ paths: $ref: paths/store_payment-providers.yaml /store/tax-providers: $ref: paths/store_tax-providers.yaml - /swaps/{id}: - $ref: paths/swaps_{id}.yaml - /swaps: - $ref: paths/swaps.yaml /tax-rates/{id}/product-types/batch: $ref: paths/tax-rates_{id}_product-types_batch.yaml /tax-rates/{id}/products/batch: @@ -452,6 +470,10 @@ paths: $ref: paths/tax-rates.yaml /tax-rates/{id}: $ref: paths/tax-rates_{id}.yaml + /swaps/{id}: + $ref: paths/swaps_{id}.yaml + /swaps: + $ref: paths/swaps.yaml /uploads/protected: $ref: paths/uploads_protected.yaml /uploads: diff --git a/docs/api/admin/paths/admin_draft-orders_{id}.yaml b/docs/api/admin/paths/admin_draft-orders_{id}.yaml index fdf0874807..09630a97d9 100644 --- a/docs/api/admin/paths/admin_draft-orders_{id}.yaml +++ b/docs/api/admin/paths/admin_draft-orders_{id}.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object properties: region_id: type: string @@ -78,6 +79,7 @@ post: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml diff --git a/docs/api/admin/paths/apps.yaml b/docs/api/admin/paths/apps.yaml index e4e1cf78db..a2ae650530 100644 --- a/docs/api/admin/paths/apps.yaml +++ b/docs/api/admin/paths/apps.yaml @@ -19,6 +19,7 @@ get: content: application/json: schema: + type: object properties: apps: type: array diff --git a/docs/api/admin/paths/apps_authorizations.yaml b/docs/api/admin/paths/apps_authorizations.yaml index b5b1f1772b..083b1c4d48 100644 --- a/docs/api/admin/paths/apps_authorizations.yaml +++ b/docs/api/admin/paths/apps_authorizations.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - application_name - state @@ -37,6 +38,7 @@ post: content: application/json: schema: + type: object properties: apps: $ref: ../components/schemas/OAuth.yaml diff --git a/docs/api/admin/paths/auth.yaml b/docs/api/admin/paths/auth.yaml index 1229c1a738..d9eb880401 100644 --- a/docs/api/admin/paths/auth.yaml +++ b/docs/api/admin/paths/auth.yaml @@ -36,6 +36,7 @@ post: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml @@ -110,6 +111,7 @@ get: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml diff --git a/docs/api/admin/paths/batch-jobs.yaml b/docs/api/admin/paths/batch-jobs.yaml index 83c55f8e0d..fb7b06064c 100644 --- a/docs/api/admin/paths/batch-jobs.yaml +++ b/docs/api/admin/paths/batch-jobs.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - type - context @@ -62,6 +63,7 @@ post: content: application/json: schema: + type: object properties: batch_job: $ref: ../components/schemas/batch_job.yaml @@ -338,6 +340,7 @@ get: content: application/json: schema: + type: object properties: batch_jobs: type: array diff --git a/docs/api/admin/paths/batch-jobs_{id}.yaml b/docs/api/admin/paths/batch-jobs_{id}.yaml index 242cce28b2..2278e04dfb 100644 --- a/docs/api/admin/paths/batch-jobs_{id}.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}.yaml @@ -30,6 +30,7 @@ get: content: application/json: schema: + type: object properties: batch_job: $ref: ../components/schemas/batch_job.yaml diff --git a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml b/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml index c926de3499..cddbde3b9e 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: batch_job: $ref: ../components/schemas/batch_job.yaml diff --git a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml b/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml index 901b48f0fc..ed31dff4fe 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: batch_job: $ref: ../components/schemas/batch_job.yaml diff --git a/docs/api/admin/paths/collections.yaml b/docs/api/admin/paths/collections.yaml index fea044f02c..3dd991bf7c 100644 --- a/docs/api/admin/paths/collections.yaml +++ b/docs/api/admin/paths/collections.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - title properties: @@ -43,6 +44,7 @@ post: content: application/json: schema: + type: object properties: collection: $ref: ../components/schemas/product_collection.yaml @@ -182,6 +184,7 @@ get: content: application/json: schema: + type: object properties: collections: type: array diff --git a/docs/api/admin/paths/collections_{id}.yaml b/docs/api/admin/paths/collections_{id}.yaml index b451c8f195..2b75a31ee1 100644 --- a/docs/api/admin/paths/collections_{id}.yaml +++ b/docs/api/admin/paths/collections_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: collection: $ref: ../components/schemas/product_collection.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: title: type: string @@ -151,6 +154,7 @@ post: content: application/json: schema: + type: object properties: collection: $ref: ../components/schemas/product_collection.yaml diff --git a/docs/api/admin/paths/collections_{id}_products_batch.yaml b/docs/api/admin/paths/collections_{id}_products_batch.yaml index fb60ca2ada..50cda5b52b 100644 --- a/docs/api/admin/paths/collections_{id}_products_batch.yaml +++ b/docs/api/admin/paths/collections_{id}_products_batch.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - product_ids properties: @@ -39,6 +40,7 @@ post: content: application/json: schema: + type: object properties: collection: $ref: ../components/schemas/product_collection.yaml @@ -70,6 +72,7 @@ delete: content: application/json: schema: + type: object required: - product_ids properties: @@ -95,6 +98,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string diff --git a/docs/api/admin/paths/currencies.yaml b/docs/api/admin/paths/currencies.yaml index 340ac8d423..b707270a89 100644 --- a/docs/api/admin/paths/currencies.yaml +++ b/docs/api/admin/paths/currencies.yaml @@ -48,6 +48,7 @@ get: content: application/json: schema: + type: object properties: currencies: type: array diff --git a/docs/api/admin/paths/currencies_{code}.yaml b/docs/api/admin/paths/currencies_{code}.yaml index 73e2a1c5ef..70d8229a93 100644 --- a/docs/api/admin/paths/currencies_{code}.yaml +++ b/docs/api/admin/paths/currencies_{code}.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object properties: includes_tax: type: boolean @@ -35,6 +36,7 @@ post: content: application/json: schema: + type: object properties: currency: $ref: ../components/schemas/currency.yaml diff --git a/docs/api/admin/paths/customer-groups.yaml b/docs/api/admin/paths/customer-groups.yaml index decf0c12e7..9d9787b29c 100644 --- a/docs/api/admin/paths/customer-groups.yaml +++ b/docs/api/admin/paths/customer-groups.yaml @@ -24,6 +24,7 @@ post: content: application/json: schema: + type: object properties: customer_group: $ref: ../components/schemas/customer_group.yaml @@ -195,6 +196,7 @@ get: content: application/json: schema: + type: object properties: customer_groups: type: array diff --git a/docs/api/admin/paths/customer-groups_{id}.yaml b/docs/api/admin/paths/customer-groups_{id}.yaml index 85994c41a8..2d0b5c1fca 100644 --- a/docs/api/admin/paths/customer-groups_{id}.yaml +++ b/docs/api/admin/paths/customer-groups_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -96,6 +97,7 @@ get: content: application/json: schema: + type: object properties: customer_group: $ref: ../components/schemas/customer_group.yaml @@ -127,6 +129,7 @@ post: content: application/json: schema: + type: object properties: name: description: Name of the customer group @@ -154,6 +157,7 @@ post: content: application/json: schema: + type: object properties: customer_group: $ref: ../components/schemas/customer_group.yaml diff --git a/docs/api/admin/paths/customer-groups_{id}_customers.yaml b/docs/api/admin/paths/customer-groups_{id}_customers.yaml index 73bc73eeec..602adf0ae9 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers.yaml +++ b/docs/api/admin/paths/customer-groups_{id}_customers.yaml @@ -30,6 +30,7 @@ get: content: application/json: schema: + type: object properties: customers: type: array diff --git a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml b/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml index 7ca164800d..a45e279435 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml +++ b/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - customer_ids properties: @@ -49,6 +50,7 @@ post: content: application/json: schema: + type: object properties: customer_group: $ref: ../components/schemas/customer_group.yaml @@ -80,6 +82,7 @@ delete: content: application/json: schema: + type: object required: - customer_ids properties: @@ -115,6 +118,7 @@ delete: content: application/json: schema: + type: object properties: customer_group: $ref: ../components/schemas/customer_group.yaml diff --git a/docs/api/admin/paths/customers.yaml b/docs/api/admin/paths/customers.yaml index f1b84cdc12..0b67b4bc8e 100644 --- a/docs/api/admin/paths/customers.yaml +++ b/docs/api/admin/paths/customers.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - email - first_name @@ -55,6 +56,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -118,6 +120,7 @@ get: content: application/json: schema: + type: object properties: customers: type: array diff --git a/docs/api/admin/paths/customers_{id}.yaml b/docs/api/admin/paths/customers_{id}.yaml index 8548c8c2d8..4b729d7f9f 100644 --- a/docs/api/admin/paths/customers_{id}.yaml +++ b/docs/api/admin/paths/customers_{id}.yaml @@ -40,6 +40,7 @@ get: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -81,6 +82,7 @@ post: content: application/json: schema: + type: object properties: email: type: string @@ -134,6 +136,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/admin/paths/discounts.yaml b/docs/api/admin/paths/discounts.yaml index 7736ff86a0..da81dcaf2e 100644 --- a/docs/api/admin/paths/discounts.yaml +++ b/docs/api/admin/paths/discounts.yaml @@ -20,9 +20,11 @@ post: content: application/json: schema: + type: object required: - code - rule + - regions properties: code: type: string @@ -173,6 +175,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml @@ -270,6 +273,7 @@ get: content: application/json: schema: + type: object properties: discounts: type: array diff --git a/docs/api/admin/paths/discounts_code_{code}.yaml b/docs/api/admin/paths/discounts_code_{code}.yaml index fef2a953ae..b290e9417a 100644 --- a/docs/api/admin/paths/discounts_code_{code}.yaml +++ b/docs/api/admin/paths/discounts_code_{code}.yaml @@ -40,6 +40,7 @@ get: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml index 0ae38f9b4c..377c96c705 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml @@ -31,6 +31,7 @@ post: content: application/json: schema: + type: object required: - operator properties: @@ -94,6 +95,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml index 42d750029e..af581bd4e3 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml @@ -48,6 +48,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -127,6 +128,7 @@ get: content: application/json: schema: + type: object properties: discount_condition: $ref: ../components/schemas/discount_condition.yaml @@ -181,6 +183,7 @@ post: content: application/json: schema: + type: object properties: products: type: array @@ -237,6 +240,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml index a59cec2e06..dcfb03cc4c 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml @@ -34,6 +34,7 @@ post: content: application/json: schema: + type: object required: - resources properties: @@ -69,6 +70,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml @@ -120,6 +122,7 @@ delete: content: application/json: schema: + type: object required: - resources properties: @@ -155,6 +158,7 @@ delete: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{id}.yaml b/docs/api/admin/paths/discounts_{id}.yaml index fbc5fc8706..571033e59e 100644 --- a/docs/api/admin/paths/discounts_{id}.yaml +++ b/docs/api/admin/paths/discounts_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -96,6 +97,7 @@ get: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml @@ -143,6 +145,7 @@ post: content: application/json: schema: + type: object properties: code: type: string @@ -276,6 +279,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml b/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml index 8db1733a2a..4b1fccd709 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml +++ b/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml @@ -32,6 +32,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml b/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml index 8bdab12854..a6203c3997 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml +++ b/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml b/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml index 947a646e7d..85dc282dc2 100644 --- a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml +++ b/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml @@ -37,6 +37,7 @@ post: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml @@ -92,6 +93,7 @@ delete: content: application/json: schema: + type: object properties: discount: $ref: ../components/schemas/discount.yaml diff --git a/docs/api/admin/paths/draft-orders.yaml b/docs/api/admin/paths/draft-orders.yaml index cc40a8a99f..b15bf56296 100644 --- a/docs/api/admin/paths/draft-orders.yaml +++ b/docs/api/admin/paths/draft-orders.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - email - items @@ -126,6 +127,7 @@ post: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml @@ -186,6 +188,7 @@ get: content: application/json: schema: + type: object properties: draft_orders: type: array diff --git a/docs/api/admin/paths/draft-orders_{id}.yaml b/docs/api/admin/paths/draft-orders_{id}.yaml index 2f718cf637..76c2c7d7fe 100644 --- a/docs/api/admin/paths/draft-orders_{id}.yaml +++ b/docs/api/admin/paths/draft-orders_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml b/docs/api/admin/paths/draft-orders_{id}_line-items.yaml index 2707975fbf..e0bbd3de00 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_line-items.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - quantity properties: @@ -55,6 +56,7 @@ post: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml b/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml index 7b2fc095b4..d91330afa7 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml @@ -75,6 +76,7 @@ post: content: application/json: schema: + type: object properties: unit_price: description: The potential custom price of the item. @@ -112,6 +114,7 @@ post: content: application/json: schema: + type: object properties: draft_order: $ref: ../components/schemas/draft-order.yaml diff --git a/docs/api/admin/paths/draft-orders_{id}_pay.yaml b/docs/api/admin/paths/draft-orders_{id}_pay.yaml index 1f3bc92499..9865df7c71 100644 --- a/docs/api/admin/paths/draft-orders_{id}_pay.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_pay.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/draft-order.yaml diff --git a/docs/api/admin/paths/gift-cards.yaml b/docs/api/admin/paths/gift-cards.yaml index 57a3bd6bd5..9b7b83be5e 100644 --- a/docs/api/admin/paths/gift-cards.yaml +++ b/docs/api/admin/paths/gift-cards.yaml @@ -9,6 +9,7 @@ post: content: application/json: schema: + type: object required: - region_id properties: @@ -52,6 +53,7 @@ post: content: application/json: schema: + type: object properties: gift_card: $ref: ../components/schemas/gift_card.yaml @@ -110,6 +112,7 @@ get: content: application/json: schema: + type: object properties: gift_cards: type: array diff --git a/docs/api/admin/paths/gift-cards_{id}.yaml b/docs/api/admin/paths/gift-cards_{id}.yaml index 9e62fdd10b..f607e44f74 100644 --- a/docs/api/admin/paths/gift-cards_{id}.yaml +++ b/docs/api/admin/paths/gift-cards_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: gift_card: $ref: ../components/schemas/gift_card.yaml @@ -119,6 +121,7 @@ post: content: application/json: schema: + type: object properties: balance: type: integer @@ -160,6 +163,7 @@ post: content: application/json: schema: + type: object properties: gift_card: $ref: ../components/schemas/gift_card.yaml diff --git a/docs/api/admin/paths/invites.yaml b/docs/api/admin/paths/invites.yaml index 6fdabbd5a6..ef4a2f8449 100644 --- a/docs/api/admin/paths/invites.yaml +++ b/docs/api/admin/paths/invites.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - user - role @@ -76,6 +77,7 @@ get: content: application/json: schema: + type: object properties: invites: type: array diff --git a/docs/api/admin/paths/invites_accept.yaml b/docs/api/admin/paths/invites_accept.yaml index 96aed875ed..ec434b2eac 100644 --- a/docs/api/admin/paths/invites_accept.yaml +++ b/docs/api/admin/paths/invites_accept.yaml @@ -6,6 +6,7 @@ post: content: application/json: schema: + type: object required: - token - user diff --git a/docs/api/admin/paths/invites_{invite_id}.yaml b/docs/api/admin/paths/invites_{invite_id}.yaml index a94acd41ca..3c05c78304 100644 --- a/docs/api/admin/paths/invites_{invite_id}.yaml +++ b/docs/api/admin/paths/invites_{invite_id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string diff --git a/docs/api/admin/paths/notes.yaml b/docs/api/admin/paths/notes.yaml index 9e6a5a63d1..38e4dfed12 100644 --- a/docs/api/admin/paths/notes.yaml +++ b/docs/api/admin/paths/notes.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - resource_id - resource_type @@ -41,6 +42,7 @@ post: content: application/json: schema: + type: object properties: note: $ref: ../components/schemas/note.yaml @@ -99,6 +101,7 @@ get: content: application/json: schema: + type: object properties: notes: type: array diff --git a/docs/api/admin/paths/notes_{id}.yaml b/docs/api/admin/paths/notes_{id}.yaml index f3796469a5..6df867754a 100644 --- a/docs/api/admin/paths/notes_{id}.yaml +++ b/docs/api/admin/paths/notes_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: note: $ref: ../components/schemas/note.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object required: - value properties: @@ -143,6 +146,7 @@ post: content: application/json: schema: + type: object properties: note: $ref: ../components/schemas/note.yaml diff --git a/docs/api/admin/paths/notifications.yaml b/docs/api/admin/paths/notifications.yaml index 222f094118..5eef45e280 100644 --- a/docs/api/admin/paths/notifications.yaml +++ b/docs/api/admin/paths/notifications.yaml @@ -77,6 +77,7 @@ get: content: application/json: schema: + type: object properties: notifications: type: array diff --git a/docs/api/admin/paths/notifications_{id}_resend.yaml b/docs/api/admin/paths/notifications_{id}_resend.yaml index 5f01ec27a8..1a782230ef 100644 --- a/docs/api/admin/paths/notifications_{id}_resend.yaml +++ b/docs/api/admin/paths/notifications_{id}_resend.yaml @@ -16,6 +16,7 @@ post: content: application/json: schema: + type: object properties: to: description: >- @@ -42,6 +43,7 @@ post: content: application/json: schema: + type: object properties: notification: $ref: ../components/schemas/notification.yaml diff --git a/docs/api/admin/paths/order-edits.yaml b/docs/api/admin/paths/order-edits.yaml index f4d402d052..d0fd4c5836 100644 --- a/docs/api/admin/paths/order-edits.yaml +++ b/docs/api/admin/paths/order-edits.yaml @@ -6,6 +6,7 @@ post: content: application/json: schema: + type: object required: - order_id properties: @@ -36,6 +37,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml @@ -53,8 +55,8 @@ post: $ref: ../components/responses/500_error.yaml get: operationId: GetOrderEdits - summary: List an OrderEdit - description: List a OrderEdit. + summary: List OrderEdits + description: List OrderEdits. x-authenticated: true parameters: - in: query @@ -109,6 +111,7 @@ get: content: application/json: schema: + type: object properties: order_edits: type: array diff --git a/docs/api/admin/paths/order-edits_{id}.yaml b/docs/api/admin/paths/order-edits_{id}.yaml index 9c2972214b..5c4b92f53e 100644 --- a/docs/api/admin/paths/order-edits_{id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: internal_note: description: An optional note to create or update for the order edit. @@ -141,6 +144,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order-edits_{id}_cancel.yaml b/docs/api/admin/paths/order-edits_{id}_cancel.yaml index f69e665d76..ac8584dc54 100644 --- a/docs/api/admin/paths/order-edits_{id}_cancel.yaml +++ b/docs/api/admin/paths/order-edits_{id}_cancel.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml b/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml index 4baa154fbd..a564f649b3 100644 --- a/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string diff --git a/docs/api/admin/paths/order-edits_{id}_confirm.yaml b/docs/api/admin/paths/order-edits_{id}_confirm.yaml index fad1889432..5614450bda 100644 --- a/docs/api/admin/paths/order-edits_{id}_confirm.yaml +++ b/docs/api/admin/paths/order-edits_{id}_confirm.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order-edits_{id}_items.yaml b/docs/api/admin/paths/order-edits_{id}_items.yaml index a97910d3ce..aa105f7af6 100644 --- a/docs/api/admin/paths/order-edits_{id}_items.yaml +++ b/docs/api/admin/paths/order-edits_{id}_items.yaml @@ -13,6 +13,7 @@ post: content: application/json: schema: + type: object required: - variant_id - quantity @@ -49,6 +50,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml b/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml index 41ec464d8e..4cc271b53b 100644 --- a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml @@ -37,6 +37,7 @@ delete: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml @@ -74,6 +75,7 @@ post: content: application/json: schema: + type: object required: - quantity properties: @@ -101,6 +103,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order-edits_{id}_request.yaml b/docs/api/admin/paths/order-edits_{id}_request.yaml index 0b3d55e61d..145cc617b6 100644 --- a/docs/api/admin/paths/order-edits_{id}_request.yaml +++ b/docs/api/admin/paths/order-edits_{id}_request.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/admin/paths/order_{id}_claims.yaml b/docs/api/admin/paths/order_{id}_claims.yaml index b79ed91b77..b337301ed5 100644 --- a/docs/api/admin/paths/order_{id}_claims.yaml +++ b/docs/api/admin/paths/order_{id}_claims.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - type - claim_items @@ -151,6 +152,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml b/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml index 4758acdbca..4378a9fcc9 100644 --- a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml +++ b/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml @@ -20,6 +20,7 @@ post: content: application/json: schema: + type: object properties: claim_items: description: The Claim Items that the Claim will consist of. @@ -127,6 +128,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/order_{id}_swaps.yaml b/docs/api/admin/paths/order_{id}_swaps.yaml index 804e1246e6..01dcb5f09e 100644 --- a/docs/api/admin/paths/order_{id}_swaps.yaml +++ b/docs/api/admin/paths/order_{id}_swaps.yaml @@ -16,6 +16,7 @@ post: content: application/json: schema: + type: object required: - return_items properties: @@ -114,6 +115,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders.yaml b/docs/api/admin/paths/orders.yaml index ac44f54eac..435a893e15 100644 --- a/docs/api/admin/paths/orders.yaml +++ b/docs/api/admin/paths/orders.yaml @@ -237,6 +237,7 @@ get: content: application/json: schema: + type: object properties: orders: type: array diff --git a/docs/api/admin/paths/orders_{id}.yaml b/docs/api/admin/paths/orders_{id}.yaml index 2747c45139..98e4b6e24e 100644 --- a/docs/api/admin/paths/orders_{id}.yaml +++ b/docs/api/admin/paths/orders_{id}.yaml @@ -30,6 +30,7 @@ get: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml @@ -61,6 +62,7 @@ post: content: application/json: schema: + type: object properties: email: description: the email for the order @@ -145,6 +147,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_archive.yaml b/docs/api/admin/paths/orders_{id}_archive.yaml index d7db746b47..0975e57931 100644 --- a/docs/api/admin/paths/orders_{id}_archive.yaml +++ b/docs/api/admin/paths/orders_{id}_archive.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_cancel.yaml index 9ea8b6874f..edb1c6636c 100644 --- a/docs/api/admin/paths/orders_{id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_cancel.yaml @@ -33,6 +33,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_capture.yaml b/docs/api/admin/paths/orders_{id}_capture.yaml index c0d6b1bfdd..a9ced207e1 100644 --- a/docs/api/admin/paths/orders_{id}_capture.yaml +++ b/docs/api/admin/paths/orders_{id}_capture.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml index b068c03eec..2016427c17 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml @@ -38,6 +38,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml index f21eb98770..99c746a51d 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml @@ -20,6 +20,7 @@ post: content: application/json: schema: + type: object properties: metadata: description: >- @@ -53,6 +54,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml index da5e1c7c39..af476dc33a 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -44,6 +44,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml index 0f9956d11b..41690eaf23 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml @@ -20,6 +20,7 @@ post: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -53,6 +54,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_complete.yaml b/docs/api/admin/paths/orders_{id}_complete.yaml index 20e28f2977..b5b778944f 100644 --- a/docs/api/admin/paths/orders_{id}_complete.yaml +++ b/docs/api/admin/paths/orders_{id}_complete.yaml @@ -30,6 +30,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_fulfillment.yaml b/docs/api/admin/paths/orders_{id}_fulfillment.yaml index 78e29e7bbd..79a007905c 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillment.yaml +++ b/docs/api/admin/paths/orders_{id}_fulfillment.yaml @@ -16,6 +16,7 @@ post: content: application/json: schema: + type: object required: - items properties: @@ -63,6 +64,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml index e99f295435..af2e69f609 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -38,6 +38,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_refund.yaml b/docs/api/admin/paths/orders_{id}_refund.yaml index 36123185ee..78cc3ae1fc 100644 --- a/docs/api/admin/paths/orders_{id}_refund.yaml +++ b/docs/api/admin/paths/orders_{id}_refund.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - amount - reason @@ -52,6 +53,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_return.yaml b/docs/api/admin/paths/orders_{id}_return.yaml index 1ba5cc3679..cc705d9908 100644 --- a/docs/api/admin/paths/orders_{id}_return.yaml +++ b/docs/api/admin/paths/orders_{id}_return.yaml @@ -16,6 +16,7 @@ post: content: application/json: schema: + type: object required: - items properties: @@ -89,6 +90,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_shipment.yaml b/docs/api/admin/paths/orders_{id}_shipment.yaml index 90765fd1d3..30c6c49b3b 100644 --- a/docs/api/admin/paths/orders_{id}_shipment.yaml +++ b/docs/api/admin/paths/orders_{id}_shipment.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -50,6 +51,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml index 9cb4847881..5383f21bb6 100644 --- a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml +++ b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml @@ -32,6 +32,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml index 811f4aab28..4df3ddca51 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml @@ -37,6 +37,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml index e5e138769a..5fa53506cb 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml @@ -20,6 +20,7 @@ post: content: application/json: schema: + type: object properties: metadata: description: >- @@ -53,6 +54,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml index 6c29cfdaea..1e2101fa3c 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -44,6 +44,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml index 4196fd1332..2124ae886c 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml @@ -41,6 +41,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml index 119e94fe6f..302533759c 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml @@ -20,6 +20,7 @@ post: content: application/json: schema: + type: object required: - fulfillment_id properties: @@ -58,6 +59,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/payment-collections_{id}.yaml b/docs/api/admin/paths/payment-collections_{id}.yaml new file mode 100644 index 0000000000..23ef45ecb0 --- /dev/null +++ b/docs/api/admin/paths/payment-collections_{id}.yaml @@ -0,0 +1,171 @@ +delete: + operationId: DeletePaymentCollectionsPaymentCollection + summary: Delete a Payment Collection + description: Deletes a Payment Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payment-collections_{id}/deleteundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}/deleteundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Payment Collection. + object: + type: string + description: The type of the object that was deleted. + format: payment_collection + deleted: + type: boolean + description: Whether or not the Payment Collection was deleted. + default: true + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml +get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payment-collections_{id}/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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 +post: + operationId: PostPaymentCollectionsPaymentCollection + summary: Updates a PaymentCollection + description: Updates a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + description: + description: >- + An optional description to create or update the payment + collection. + type: string + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payment-collections_{id}/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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/docs/api/admin/paths/payment-collections_{id}_authorize.yaml b/docs/api/admin/paths/payment-collections_{id}_authorize.yaml new file mode 100644 index 0000000000..f70e0629ef --- /dev/null +++ b/docs/api/admin/paths/payment-collections_{id}_authorize.yaml @@ -0,0 +1,49 @@ +post: + operationId: PostPaymentCollectionsPaymentCollectionAuthorize + summary: Set the status of PaymentCollection as Authorized + description: Sets the status of PaymentCollection as Authorized. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_authorize/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}_authorize/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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/docs/api/admin/paths/payments_{id}.yaml b/docs/api/admin/paths/payments_{id}.yaml new file mode 100644 index 0000000000..298c23a4dd --- /dev/null +++ b/docs/api/admin/paths/payments_{id}.yaml @@ -0,0 +1,48 @@ +get: + operationId: GetPaymentsPayment + summary: Get Payment details + description: Retrieves the Payment details + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payments_{id}/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payments_{id}/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment: + $ref: ../components/schemas/payment.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/docs/api/admin/paths/payments_{id}_capture.yaml b/docs/api/admin/paths/payments_{id}_capture.yaml new file mode 100644 index 0000000000..1a2f9a6ffd --- /dev/null +++ b/docs/api/admin/paths/payments_{id}_capture.yaml @@ -0,0 +1,48 @@ +post: + operationId: PostPaymentsPaymentCapture + summary: Capture a Payment + description: Captures a Payment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payments_{id}_capture/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payments_{id}_capture/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment: + $ref: ../components/schemas/payment.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/docs/api/admin/paths/payments_{id}_refund.yaml b/docs/api/admin/paths/payments_{id}_refund.yaml new file mode 100644 index 0000000000..c25d1eef1e --- /dev/null +++ b/docs/api/admin/paths/payments_{id}_refund.yaml @@ -0,0 +1,66 @@ +post: + operationId: PostPaymentsPaymentRefunds + summary: Create a Refund + description: Issues a Refund. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payments_{id}_refund/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payments_{id}_refund/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + refund: + $ref: ../components/schemas/refund.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/docs/api/admin/paths/price-lists.yaml b/docs/api/admin/paths/price-lists.yaml index a5391de1b3..6d69d0c6b5 100644 --- a/docs/api/admin/paths/price-lists.yaml +++ b/docs/api/admin/paths/price-lists.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - name - description @@ -105,6 +106,7 @@ post: content: application/json: schema: + type: object properties: price_list: $ref: ../components/schemas/price_list.yaml @@ -286,6 +288,7 @@ get: content: application/json: schema: + type: object properties: price_lists: type: array diff --git a/docs/api/admin/paths/price-lists_{id}.yaml b/docs/api/admin/paths/price-lists_{id}.yaml index 4ebe281cba..e5d440d8a7 100644 --- a/docs/api/admin/paths/price-lists_{id}.yaml +++ b/docs/api/admin/paths/price-lists_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: price_list: $ref: ../components/schemas/price_list.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: name: description: The name of the Price List @@ -213,6 +216,7 @@ post: content: application/json: schema: + type: object properties: price_list: $ref: ../components/schemas/price_list.yaml diff --git a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml b/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml index ec179e95ea..8cd6653167 100644 --- a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml +++ b/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object properties: prices: description: The prices to update or add. @@ -76,6 +77,7 @@ post: content: application/json: schema: + type: object properties: price_list: $ref: ../components/schemas/price_list.yaml @@ -109,6 +111,7 @@ delete: content: application/json: schema: + type: object properties: price_ids: description: The price id's of the Money Amounts to delete. @@ -136,6 +139,7 @@ delete: content: application/json: schema: + type: object properties: ids: type: array diff --git a/docs/api/admin/paths/price-lists_{id}_products.yaml b/docs/api/admin/paths/price-lists_{id}_products.yaml index ffe4f413fb..8ab10beb00 100644 --- a/docs/api/admin/paths/price-lists_{id}_products.yaml +++ b/docs/api/admin/paths/price-lists_{id}_products.yaml @@ -196,6 +196,7 @@ get: content: application/json: schema: + type: object properties: products: type: array diff --git a/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml b/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml index 564f03dce6..84dd0b1799 100644 --- a/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml +++ b/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml @@ -40,6 +40,7 @@ delete: content: application/json: schema: + type: object properties: ids: type: array diff --git a/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml b/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml index 91e4102a21..a4420e961f 100644 --- a/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml +++ b/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml @@ -40,6 +40,7 @@ delete: content: application/json: schema: + type: object properties: ids: type: array diff --git a/docs/api/admin/paths/product-tags.yaml b/docs/api/admin/paths/product-tags.yaml index fcc8bcad35..af33fea80e 100644 --- a/docs/api/admin/paths/product-tags.yaml +++ b/docs/api/admin/paths/product-tags.yaml @@ -113,6 +113,7 @@ get: content: application/json: schema: + type: object properties: product_tags: $ref: ../components/schemas/product_tag.yaml diff --git a/docs/api/admin/paths/product-types.yaml b/docs/api/admin/paths/product-types.yaml index 8de545f6f4..00a5779158 100644 --- a/docs/api/admin/paths/product-types.yaml +++ b/docs/api/admin/paths/product-types.yaml @@ -113,6 +113,7 @@ get: content: application/json: schema: + type: object properties: product_types: $ref: ../components/schemas/product_type.yaml diff --git a/docs/api/admin/paths/products.yaml b/docs/api/admin/paths/products.yaml index cc2ad51a46..9501af2435 100644 --- a/docs/api/admin/paths/products.yaml +++ b/docs/api/admin/paths/products.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - title properties: @@ -261,6 +262,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml @@ -498,6 +500,7 @@ get: content: application/json: schema: + type: object properties: products: type: array diff --git a/docs/api/admin/paths/products_tag-usage.yaml b/docs/api/admin/paths/products_tag-usage.yaml index 26a83cf4ce..19e7537a29 100644 --- a/docs/api/admin/paths/products_tag-usage.yaml +++ b/docs/api/admin/paths/products_tag-usage.yaml @@ -23,6 +23,7 @@ get: content: application/json: schema: + type: object properties: tags: type: array diff --git a/docs/api/admin/paths/products_types.yaml b/docs/api/admin/paths/products_types.yaml index 9aa1316d58..0e66866033 100644 --- a/docs/api/admin/paths/products_types.yaml +++ b/docs/api/admin/paths/products_types.yaml @@ -24,6 +24,7 @@ get: content: application/json: schema: + type: object properties: types: type: array diff --git a/docs/api/admin/paths/products_{id}.yaml b/docs/api/admin/paths/products_{id}.yaml index 78f4c9ba05..8f5a1fb944 100644 --- a/docs/api/admin/paths/products_{id}.yaml +++ b/docs/api/admin/paths/products_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: title: description: The title of the Product @@ -352,6 +355,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml diff --git a/docs/api/admin/paths/products_{id}_metadata.yaml b/docs/api/admin/paths/products_{id}_metadata.yaml index fe651b87fd..a12924da0e 100644 --- a/docs/api/admin/paths/products_{id}_metadata.yaml +++ b/docs/api/admin/paths/products_{id}_metadata.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - key - value @@ -44,6 +45,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml diff --git a/docs/api/admin/paths/products_{id}_options.yaml b/docs/api/admin/paths/products_{id}_options.yaml index 8d0b52ad5e..1759a58c75 100644 --- a/docs/api/admin/paths/products_{id}_options.yaml +++ b/docs/api/admin/paths/products_{id}_options.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - title properties: @@ -40,6 +41,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml diff --git a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml b/docs/api/admin/paths/products_{id}_options_{option_id}.yaml index 55147cbb1c..f508f113c0 100644 --- a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml +++ b/docs/api/admin/paths/products_{id}_options_{option_id}.yaml @@ -41,6 +41,7 @@ delete: content: application/json: schema: + type: object properties: option_id: type: string @@ -89,6 +90,7 @@ post: content: application/json: schema: + type: object required: - title properties: @@ -116,6 +118,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml diff --git a/docs/api/admin/paths/products_{id}_variants.yaml b/docs/api/admin/paths/products_{id}_variants.yaml index 86c6a29dc4..63efd59531 100644 --- a/docs/api/admin/paths/products_{id}_variants.yaml +++ b/docs/api/admin/paths/products_{id}_variants.yaml @@ -16,6 +16,7 @@ post: content: application/json: schema: + type: object required: - title - prices @@ -139,6 +140,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml @@ -204,6 +206,7 @@ get: content: application/json: schema: + type: object properties: variants: type: array diff --git a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml b/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml index 8757dcb49f..e72e74992b 100644 --- a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml +++ b/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: variant_id: type: string @@ -86,6 +87,7 @@ post: content: application/json: schema: + type: object required: - prices properties: @@ -208,6 +210,7 @@ post: content: application/json: schema: + type: object properties: product: $ref: ../components/schemas/product.yaml diff --git a/docs/api/admin/paths/publishable-api-key_{id}.yaml b/docs/api/admin/paths/publishable-api-key_{id}.yaml new file mode 100644 index 0000000000..9708176000 --- /dev/null +++ b/docs/api/admin/paths/publishable-api-key_{id}.yaml @@ -0,0 +1,57 @@ +post: + operationId: PostPublishableApiKysPublishableApiKey + summary: Updates a PublishableApiKey + description: Updates a PublishableApiKey. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + title: + description: A title to update for the key. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/publishable-api-key_{id}/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-key_{id}/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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/docs/api/admin/paths/publishable-api-keys.yaml b/docs/api/admin/paths/publishable-api-keys.yaml new file mode 100644 index 0000000000..c99c88912c --- /dev/null +++ b/docs/api/admin/paths/publishable-api-keys.yaml @@ -0,0 +1,122 @@ +post: + operationId: PostPublishableApiKeys + summary: Create a PublishableApiKey + description: Creates a PublishableApiKey. + requestBody: + content: + application/json: + schema: + type: object + required: + - title + properties: + title: + description: A title for the publishable api key + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/publishable-api-keys/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-keys/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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 +get: + operationId: GetPublishableApiKeys + summary: List PublishableApiKeys + description: List PublishableApiKeys. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching publishable api keys by title. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/publishable-api-keys/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-keys/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKeys + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_keys: + type: array + $ref: ../components/schemas/publishable_api_key.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/docs/api/admin/paths/publishable-api-keys_:id_sales-channels.yaml b/docs/api/admin/paths/publishable-api-keys_:id_sales-channels.yaml new file mode 100644 index 0000000000..669ea97dc5 --- /dev/null +++ b/docs/api/admin/paths/publishable-api-keys_:id_sales-channels.yaml @@ -0,0 +1,44 @@ +get: + operationId: GetPublishableApiKeySalesChannels + summary: List PublishableApiKey's SalesChannels + description: List PublishableApiKey's SalesChannels + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/publishable-api-keys_:id_sales-channels/getundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/publishable-api-keys_:id_sales-channels/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKeySalesChannels + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + sales_channels: + type: array + items: + $ref: ../components/schemas/sales_channel.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/docs/api/admin/paths/publishable-api-keys_{id}.yaml b/docs/api/admin/paths/publishable-api-keys_{id}.yaml new file mode 100644 index 0000000000..d4352511a2 --- /dev/null +++ b/docs/api/admin/paths/publishable-api-keys_{id}.yaml @@ -0,0 +1,95 @@ +delete: + operationId: DeletePublishableApiKeysPublishableApiKey + summary: Delete a PublishableApiKey + description: Deletes a PublishableApiKeys + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKeys to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-keys_{id}/deleteundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted PublishableApiKey. + object: + type: string + description: The type of the object that was deleted. + format: publishable_api_key + deleted: + type: boolean + description: Whether the PublishableApiKeys was deleted. + default: true + '400': + $ref: ../components/responses/400_error.yaml +get: + operationId: GetPublishableApiKeysPublishableApiKey + summary: Get a Publishable API Key + description: Retrieve the Publishable Api Key. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/publishable-api-keys_{id}/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-keys_{id}/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml new file mode 100644 index 0000000000..f97a61a77a --- /dev/null +++ b/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml @@ -0,0 +1,49 @@ +post: + operationId: PostPublishableApiKeysPublishableApiKeyRevoke + summary: Revoke a PublishableApiKey + description: Revokes a PublishableApiKey. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml new file mode 100644 index 0000000000..15a34f324d --- /dev/null +++ b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml @@ -0,0 +1,136 @@ +post: + operationId: PostPublishableApiKeySalesChannelsChannelsBatch + summary: Add sales channel to a publishable api key scope + description: Assign a batch of sales channels to a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: The IDs of the sales channels to add to the publishable api key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Key + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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 +delete: + operationId: DeletePublishableApiKeySalesChannelsChannelsBatch + summary: Remove sales channel from a publishable api key scope + description: Remove a batch of sales channels from a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - sales_channel_ids + properties: + sales_channel_ids: + description: >- + The IDs of the sales channels to delete from the publishable api + key + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the sales channel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Publishable Api Key + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + publishable_api_key: + $ref: ../components/schemas/publishable_api_key.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/docs/api/admin/paths/regions.yaml b/docs/api/admin/paths/regions.yaml index ba35a4e700..08eb2548f9 100644 --- a/docs/api/admin/paths/regions.yaml +++ b/docs/api/admin/paths/regions.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - name - currency_code @@ -76,6 +77,7 @@ post: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml @@ -155,6 +157,7 @@ get: content: application/json: schema: + type: object properties: regions: type: array diff --git a/docs/api/admin/paths/regions_{id}.yaml b/docs/api/admin/paths/regions_{id}.yaml index a9c29b02a3..a029d709ab 100644 --- a/docs/api/admin/paths/regions_{id}.yaml +++ b/docs/api/admin/paths/regions_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: name: description: The name of the Region @@ -193,6 +196,7 @@ post: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_countries.yaml b/docs/api/admin/paths/regions_{id}_countries.yaml index b2404bfd9e..a319e40210 100644 --- a/docs/api/admin/paths/regions_{id}_countries.yaml +++ b/docs/api/admin/paths/regions_{id}_countries.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - country_code properties: @@ -44,6 +45,7 @@ post: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml b/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml index c6da1963bc..95ea1544cb 100644 --- a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml +++ b/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml @@ -41,6 +41,7 @@ delete: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml index 0ce08fc6fc..04966fcc77 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml @@ -31,6 +31,7 @@ get: content: application/json: schema: + type: object properties: fulfillment_options: type: array diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml index 129611bdcf..805220e108 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - provider_id properties: @@ -41,6 +42,7 @@ post: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml index 57446c4ae7..45bc96c7bf 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_payment-providers.yaml b/docs/api/admin/paths/regions_{id}_payment-providers.yaml index 44b68388af..04fbd3e380 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers.yaml +++ b/docs/api/admin/paths/regions_{id}_payment-providers.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - provider_id properties: @@ -41,6 +42,7 @@ post: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml b/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml index 4f56d83cb1..c9f71b3f23 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml @@ -38,6 +38,7 @@ delete: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/admin/paths/return-reasons.yaml b/docs/api/admin/paths/return-reasons.yaml index ca2841f809..3174ac1317 100644 --- a/docs/api/admin/paths/return-reasons.yaml +++ b/docs/api/admin/paths/return-reasons.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - label - value @@ -48,6 +49,7 @@ post: content: application/json: schema: + type: object properties: return_reason: $ref: ../components/schemas/return_reason.yaml @@ -88,6 +90,7 @@ get: content: application/json: schema: + type: object properties: return_reasons: type: array diff --git a/docs/api/admin/paths/return-reasons_{id}.yaml b/docs/api/admin/paths/return-reasons_{id}.yaml index 8852d9e2bd..14657da2d4 100644 --- a/docs/api/admin/paths/return-reasons_{id}.yaml +++ b/docs/api/admin/paths/return-reasons_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: return_reason: $ref: ../components/schemas/return_reason.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: label: description: The label to display to the Customer. @@ -152,6 +155,7 @@ post: content: application/json: schema: + type: object properties: return_reason: $ref: ../components/schemas/return_reason.yaml diff --git a/docs/api/admin/paths/returns.yaml b/docs/api/admin/paths/returns.yaml index c77387d735..f290bd7af5 100644 --- a/docs/api/admin/paths/returns.yaml +++ b/docs/api/admin/paths/returns.yaml @@ -35,6 +35,7 @@ get: content: application/json: schema: + type: object properties: returns: type: array diff --git a/docs/api/admin/paths/returns_{id}_cancel.yaml b/docs/api/admin/paths/returns_{id}_cancel.yaml index 0ca536a9a7..5960e68332 100644 --- a/docs/api/admin/paths/returns_{id}_cancel.yaml +++ b/docs/api/admin/paths/returns_{id}_cancel.yaml @@ -29,6 +29,7 @@ post: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/admin/paths/returns_{id}_receive.yaml b/docs/api/admin/paths/returns_{id}_receive.yaml index 0c6986d3f1..10e260fbed 100644 --- a/docs/api/admin/paths/returns_{id}_receive.yaml +++ b/docs/api/admin/paths/returns_{id}_receive.yaml @@ -15,6 +15,7 @@ post: content: application/json: schema: + type: object required: - items properties: @@ -55,6 +56,7 @@ post: content: application/json: schema: + type: object properties: return: $ref: ../components/schemas/return.yaml diff --git a/docs/api/admin/paths/sales-channels.yaml b/docs/api/admin/paths/sales-channels.yaml index 63108a0618..a3f067eb41 100644 --- a/docs/api/admin/paths/sales-channels.yaml +++ b/docs/api/admin/paths/sales-channels.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - name properties: @@ -39,6 +40,7 @@ post: content: application/json: schema: + type: object properties: sales_channel: $ref: ../components/schemas/sales_channel.yaml @@ -197,6 +199,7 @@ get: content: application/json: schema: + type: object properties: sales_channels: type: array diff --git a/docs/api/admin/paths/sales-channels_{id}.yaml b/docs/api/admin/paths/sales-channels_{id}.yaml index e5e5b9d514..f4f09ece87 100644 --- a/docs/api/admin/paths/sales-channels_{id}.yaml +++ b/docs/api/admin/paths/sales-channels_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: sales_channel: $ref: ../components/schemas/sales_channel.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: name: type: string @@ -147,6 +150,7 @@ post: content: application/json: schema: + type: object properties: sales_channel: $ref: ../components/schemas/sales_channel.yaml diff --git a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml b/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml index 46e364527f..c703ac2dc5 100644 --- a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml +++ b/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml @@ -14,6 +14,7 @@ post: content: application/json: schema: + type: object required: - product_ids properties: @@ -49,6 +50,7 @@ post: content: application/json: schema: + type: object properties: sales_channel: $ref: ../components/schemas/sales_channel.yaml @@ -80,6 +82,7 @@ delete: content: application/json: schema: + type: object required: - product_ids properties: @@ -116,6 +119,7 @@ delete: content: application/json: schema: + type: object properties: sales_channel: $ref: ../components/schemas/sales_channel.yaml diff --git a/docs/api/admin/paths/shipping-options.yaml b/docs/api/admin/paths/shipping-options.yaml index 46d0c773df..e8b543375a 100644 --- a/docs/api/admin/paths/shipping-options.yaml +++ b/docs/api/admin/paths/shipping-options.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - name - region_id @@ -97,6 +98,7 @@ post: content: application/json: schema: + type: object properties: shipping_option: $ref: ../components/schemas/shipping_option.yaml @@ -153,6 +155,7 @@ get: content: application/json: schema: + type: object properties: shipping_options: type: array diff --git a/docs/api/admin/paths/shipping-options_{id}.yaml b/docs/api/admin/paths/shipping-options_{id}.yaml index b744a44e86..71b9682338 100644 --- a/docs/api/admin/paths/shipping-options_{id}.yaml +++ b/docs/api/admin/paths/shipping-options_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: shipping_option: $ref: ../components/schemas/shipping_option.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object required: - requirements properties: @@ -177,6 +180,7 @@ post: content: application/json: schema: + type: object properties: shipping_option: $ref: ../components/schemas/shipping_option.yaml diff --git a/docs/api/admin/paths/shipping-profiles.yaml b/docs/api/admin/paths/shipping-profiles.yaml index e55229bf45..4352be2379 100644 --- a/docs/api/admin/paths/shipping-profiles.yaml +++ b/docs/api/admin/paths/shipping-profiles.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - name properties: @@ -33,6 +34,7 @@ post: content: application/json: schema: + type: object properties: shipping_profile: $ref: ../components/schemas/shipping_profile.yaml @@ -73,6 +75,7 @@ get: content: application/json: schema: + type: object properties: shipping_profiles: type: array diff --git a/docs/api/admin/paths/shipping-profiles_{id}.yaml b/docs/api/admin/paths/shipping-profiles_{id}.yaml index 4777f1df22..319dae965b 100644 --- a/docs/api/admin/paths/shipping-profiles_{id}.yaml +++ b/docs/api/admin/paths/shipping-profiles_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: shipping_profile: $ref: ../components/schemas/shipping_profile.yaml @@ -116,6 +118,7 @@ post: content: application/json: schema: + type: object properties: name: description: The name of the Shipping Profile @@ -140,6 +143,7 @@ post: content: application/json: schema: + type: object properties: shipping_profile: $ref: ../components/schemas/shipping_profile.yaml diff --git a/docs/api/admin/paths/store.yaml b/docs/api/admin/paths/store.yaml index 149a3c7284..73000bd2ef 100644 --- a/docs/api/admin/paths/store.yaml +++ b/docs/api/admin/paths/store.yaml @@ -23,6 +23,7 @@ get: content: application/json: schema: + type: object properties: store: $ref: ../components/schemas/store.yaml @@ -47,6 +48,7 @@ post: content: application/json: schema: + type: object properties: name: description: The name of the Store @@ -100,6 +102,7 @@ post: content: application/json: schema: + type: object properties: store: $ref: ../components/schemas/store.yaml diff --git a/docs/api/admin/paths/store_currencies_{code}.yaml b/docs/api/admin/paths/store_currencies_{code}.yaml index 721be4211e..5d7f1b006c 100644 --- a/docs/api/admin/paths/store_currencies_{code}.yaml +++ b/docs/api/admin/paths/store_currencies_{code}.yaml @@ -33,6 +33,7 @@ post: content: application/json: schema: + type: object properties: store: $ref: ../components/schemas/store.yaml @@ -83,6 +84,7 @@ delete: content: application/json: schema: + type: object properties: store: $ref: ../components/schemas/store.yaml diff --git a/docs/api/admin/paths/store_payment-providers.yaml b/docs/api/admin/paths/store_payment-providers.yaml index afd483d40c..f44208295c 100644 --- a/docs/api/admin/paths/store_payment-providers.yaml +++ b/docs/api/admin/paths/store_payment-providers.yaml @@ -23,6 +23,7 @@ get: content: application/json: schema: + type: object properties: payment_providers: type: array diff --git a/docs/api/admin/paths/store_tax-providers.yaml b/docs/api/admin/paths/store_tax-providers.yaml index b4fda4e5b4..1dc2ca9346 100644 --- a/docs/api/admin/paths/store_tax-providers.yaml +++ b/docs/api/admin/paths/store_tax-providers.yaml @@ -23,6 +23,7 @@ get: content: application/json: schema: + type: object properties: tax_providers: type: array diff --git a/docs/api/admin/paths/swaps.yaml b/docs/api/admin/paths/swaps.yaml index 9b3112d577..eef8025b2e 100644 --- a/docs/api/admin/paths/swaps.yaml +++ b/docs/api/admin/paths/swaps.yaml @@ -36,6 +36,7 @@ get: content: application/json: schema: + type: object properties: swaps: type: array diff --git a/docs/api/admin/paths/swaps_{id}.yaml b/docs/api/admin/paths/swaps_{id}.yaml index 699120057d..ce9c635afb 100644 --- a/docs/api/admin/paths/swaps_{id}.yaml +++ b/docs/api/admin/paths/swaps_{id}.yaml @@ -30,6 +30,7 @@ get: content: application/json: schema: + type: object properties: swap: $ref: ../components/schemas/swap.yaml diff --git a/docs/api/admin/paths/tax-rates.yaml b/docs/api/admin/paths/tax-rates.yaml index f0ebc9d6eb..089b0007df 100644 --- a/docs/api/admin/paths/tax-rates.yaml +++ b/docs/api/admin/paths/tax-rates.yaml @@ -26,6 +26,7 @@ post: content: application/json: schema: + type: object required: - code - name @@ -78,6 +79,7 @@ post: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml @@ -192,6 +194,7 @@ get: content: application/json: schema: + type: object properties: tax_rates: type: array diff --git a/docs/api/admin/paths/tax-rates_{id}.yaml b/docs/api/admin/paths/tax-rates_{id}.yaml index 0e5410eb63..ad00d6371a 100644 --- a/docs/api/admin/paths/tax-rates_{id}.yaml +++ b/docs/api/admin/paths/tax-rates_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -104,6 +105,7 @@ get: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml @@ -153,6 +155,7 @@ post: content: application/json: schema: + type: object properties: code: type: string @@ -201,6 +204,7 @@ post: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml diff --git a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml index 23b9f1294e..29b787caf5 100644 --- a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml @@ -32,6 +32,7 @@ post: content: application/json: schema: + type: object required: - product_types properties: @@ -61,6 +62,7 @@ post: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml @@ -110,6 +112,7 @@ delete: content: application/json: schema: + type: object required: - product_types properties: @@ -142,6 +145,7 @@ delete: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml diff --git a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml index 8a15b2f072..db4f16f995 100644 --- a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml @@ -32,6 +32,7 @@ post: content: application/json: schema: + type: object required: - products properties: @@ -60,6 +61,7 @@ post: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml @@ -109,6 +111,7 @@ delete: content: application/json: schema: + type: object required: - products properties: @@ -138,6 +141,7 @@ delete: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml diff --git a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml index fd37d0577b..5cbe03173b 100644 --- a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml @@ -32,6 +32,7 @@ post: content: application/json: schema: + type: object required: - shipping_options properties: @@ -62,6 +63,7 @@ post: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml @@ -111,6 +113,7 @@ delete: content: application/json: schema: + type: object required: - shipping_options properties: @@ -143,6 +146,7 @@ delete: content: application/json: schema: + type: object properties: tax_rate: $ref: ../components/schemas/tax_rate.yaml diff --git a/docs/api/admin/paths/uploads.yaml b/docs/api/admin/paths/uploads.yaml index 56e781fdf8..a926680735 100644 --- a/docs/api/admin/paths/uploads.yaml +++ b/docs/api/admin/paths/uploads.yaml @@ -34,6 +34,7 @@ post: content: application/json: schema: + type: object properties: uploads: type: array diff --git a/docs/api/admin/paths/uploads_protected.yaml b/docs/api/admin/paths/uploads_protected.yaml index 5099c3e215..15a1bc164c 100644 --- a/docs/api/admin/paths/uploads_protected.yaml +++ b/docs/api/admin/paths/uploads_protected.yaml @@ -34,6 +34,7 @@ post: content: application/json: schema: + type: object properties: uploads: type: array diff --git a/docs/api/admin/paths/users.yaml b/docs/api/admin/paths/users.yaml index 51b9dd2694..71a4ce1f42 100644 --- a/docs/api/admin/paths/users.yaml +++ b/docs/api/admin/paths/users.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - email - password @@ -52,6 +53,7 @@ post: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml @@ -92,6 +94,7 @@ get: content: application/json: schema: + type: object properties: users: type: array diff --git a/docs/api/admin/paths/users_password-token.yaml b/docs/api/admin/paths/users_password-token.yaml index 6b438d3770..d1f0912af2 100644 --- a/docs/api/admin/paths/users_password-token.yaml +++ b/docs/api/admin/paths/users_password-token.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - email properties: diff --git a/docs/api/admin/paths/users_reset-password.yaml b/docs/api/admin/paths/users_reset-password.yaml index 28cc8b68e4..ac2a00085c 100644 --- a/docs/api/admin/paths/users_reset-password.yaml +++ b/docs/api/admin/paths/users_reset-password.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - token - password @@ -42,6 +43,7 @@ post: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml diff --git a/docs/api/admin/paths/users_{id}.yaml b/docs/api/admin/paths/users_{id}.yaml index 29896f5747..c702e5d767 100644 --- a/docs/api/admin/paths/users_{id}.yaml +++ b/docs/api/admin/paths/users_{id}.yaml @@ -30,6 +30,7 @@ delete: content: application/json: schema: + type: object properties: id: type: string @@ -86,6 +87,7 @@ get: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml @@ -117,6 +119,7 @@ post: content: application/json: schema: + type: object properties: first_name: description: The name of the User. @@ -157,6 +160,7 @@ post: content: application/json: schema: + type: object properties: user: $ref: ../components/schemas/user.yaml diff --git a/docs/api/admin/paths/variants.yaml b/docs/api/admin/paths/variants.yaml index 0eb69611a8..82985adaf9 100644 --- a/docs/api/admin/paths/variants.yaml +++ b/docs/api/admin/paths/variants.yaml @@ -113,6 +113,7 @@ get: content: application/json: schema: + type: object properties: variants: type: array diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 7433eef331..3e72e4310e 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -187,6 +187,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -285,6 +286,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -338,6 +340,7 @@ paths: content: application/json: schema: + type: object properties: exists: type: boolean @@ -399,6 +402,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -458,6 +462,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -520,6 +525,7 @@ paths: content: application/json: schema: + type: object properties: type: type: string @@ -579,6 +585,7 @@ paths: content: application/json: schema: + type: object properties: region_id: type: string @@ -648,6 +655,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -661,92 +669,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/line-items': - post: - operationId: PostCartsCartLineItems - summary: Add a Line Item - description: >- - Generates a Line Item with a given Product Variant and adds it to the - Cart - parameters: - - in: path - name: id - required: true - description: The id of the Cart to add the Line Item to. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.lineItems.create(cart_id, { - variant_id, - quantity: 1 - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/line-items' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "variant_id": "{variant_id}", - "quantity": 1 - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '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' - requestBody: - content: - application/json: - schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - type: string - description: >- - The id of the Product Variant to generate the Line Item - from. - quantity: - type: integer - description: The quantity of the Product Variant to add to the Line Item. - metadata: - type: object - description: >- - An optional key-value map with additional details about the - Line Item. '/carts/{id}/payment-sessions': post: operationId: PostCartsCartPaymentSessions @@ -788,6 +710,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -846,6 +769,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -904,6 +828,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -969,6 +894,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1042,6 +968,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1108,6 +1035,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1171,6 +1099,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1199,6 +1128,7 @@ paths: content: application/json: schema: + type: object properties: region_id: type: string @@ -1295,6 +1225,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1357,6 +1288,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1419,6 +1351,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1443,16 +1376,16 @@ paths: provider_id: type: string description: The ID of the Payment Provider. - '/collections/{id}': + '/gift-cards/{code}': get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unqiue code. parameters: - in: path - name: id + name: code required: true - description: The id of the Product Collection + description: The unique Gift Card code. schema: type: string x-codeSamples: @@ -1464,142 +1397,28 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.collections.retrieve(collection_id) + medusa.giftCards.retrieve(code) - .then(({ collection }) => { - console.log(collection.id); + .then(({ gift_card }) => { + console.log(gift_card.id); }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/store/collections/{id}' + 'https://medusa-url.com/store/gift-cards/{code}' tags: - - Collection + - Gift Card responses: '200': description: OK content: application/json: schema: + type: object properties: - collection: - $ref: '#/components/schemas/product_collection' - '400': - $ref: '#/components/responses/400_error' - '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' - /collections: - get: - operationId: GetCollections - summary: List Collections - description: Retrieve a list of Product Collection. - parameters: - - in: query - name: offset - description: >- - The number of collections to skip before starting to collect the - collections set - schema: - type: integer - default: 0 - - in: query - name: limit - description: The number of collections to return - schema: - type: integer - default: 10 - - in: query - name: created_at - description: Date comparison for when resulting collections were created. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - - in: query - name: updated_at - description: Date comparison for when resulting collections were updated. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.collections.list() - - .then(({ collections, limit, offset, count }) => { - console.log(collections.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/collections' - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - collections: - type: array - items: - $ref: '#/components/schemas/product_collection' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + gift_card: + $ref: '#/components/schemas/gift_card' '400': $ref: '#/components/responses/400_error' '404': @@ -1620,6 +1439,7 @@ paths: content: application/json: schema: + type: object required: - address properties: @@ -1695,6 +1515,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1719,6 +1540,7 @@ paths: content: application/json: schema: + type: object required: - first_name - last_name @@ -1783,6 +1605,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1797,6 +1620,7 @@ paths: content: application/json: schema: + type: object properties: code: type: string @@ -1861,6 +1685,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1935,6 +1760,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1991,6 +1817,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2015,6 +1842,7 @@ paths: content: application/json: schema: + type: object properties: first_name: description: The Customer's first name. @@ -2082,6 +1910,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2139,6 +1968,7 @@ paths: content: application/json: schema: + type: object properties: payment_methods: type: array @@ -2370,6 +2200,7 @@ paths: content: application/json: schema: + type: object properties: orders: type: array @@ -2408,6 +2239,7 @@ paths: content: application/json: schema: + type: object required: - email properties: @@ -2474,6 +2306,7 @@ paths: content: application/json: schema: + type: object required: - email - password @@ -2529,6 +2362,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2544,58 +2378,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/gift-cards/{code}': - get: - operationId: GetGiftCardsCode - summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. - parameters: - - in: path - name: code - required: true - description: The unique Gift Card code. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.giftCards.retrieve(code) - - .then(({ gift_card }) => { - console.log(gift_card.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/gift-cards/{code}' - tags: - - Gift Card - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - gift_card: - $ref: '#/components/schemas/gift_card' - '400': - $ref: '#/components/responses/400_error' - '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' '/order-edits/{id}/complete': post: operationId: PostOrderEditsOrderEditComplete @@ -2634,6 +2416,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2661,6 +2444,7 @@ paths: content: application/json: schema: + type: object properties: declined_reason: type: string @@ -2691,6 +2475,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2741,6 +2526,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2756,6 +2542,76 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /orders/customer/confirm: + post: + operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept + summary: Verify a claim to orders + description: >- + Verifies the claim order token provided to the customer upon request of + order ownership + requestBody: + content: + application/json: + schema: + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.orders.confirmRequest( + token, + ) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/orders/customer/confirm' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "token": "{token}", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + 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' '/orders/cart/{cart_id}': get: operationId: GetOrdersOrderCartId @@ -2797,6 +2653,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -2849,6 +2706,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -2924,6 +2782,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -2937,6 +2796,719 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /orders/batch/customer/token: + post: + operationId: PostOrdersCustomerOrderClaim + summary: Claim orders for signed in account + description: >- + Sends an email to emails registered to orders provided with link to + transfer order ownership + requestBody: + content: + application/json: + schema: + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.orders.claimOrders({ + display_ids, + }) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/batch/customer/token' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "display_ids": ["id"], + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + 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' + '/collections/{id}': + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. + parameters: + - in: path + name: id + required: true + description: The id of the Product Collection + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.collections.retrieve(collection_id) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/collections/{id}' + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/product_collection' + '400': + $ref: '#/components/responses/400_error' + '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' + /collections: + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. + parameters: + - in: query + name: offset + description: >- + The number of collections to skip before starting to collect the + collections set + schema: + type: integer + default: 0 + - in: query + name: limit + description: The number of collections to return + schema: + type: integer + default: 10 + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.collections.list() + + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/collections' + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collections: + type: array + items: + $ref: '#/components/schemas/product_collection' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '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' + '/payment-collections/{id}/sessions/batch/authorize': + post: + operationId: PostPaymentCollectionsSessionsBatchAuthorize + summary: Authorize Payment Sessions of a Payment Collection + description: Authorizes Payment Sessions of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + session_ids: + description: List of Payment Session IDs to authorize. + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.authorize(payment_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payment-collections/{id}/sessions/{session_id}/authorize': + post: + operationId: PostPaymentCollectionsSessionsSessionAuthorize + summary: Authorize a Payment Session of a Payment Collection + description: Authorizes a Payment Session of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + - in: path + name: session_id + required: true + description: The ID of the Payment Session. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.authorize(payment_id, session_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_session: + $ref: '#/components/schemas/payment_session' + '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' + '/payment-collections/{id}': + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/payment-collections/{id}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payment-collections/{id}/sessions/batch': + post: + operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch + summary: Manage Multiple Payment Sessions from Payment Collections + description: Manages Multiple Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + sessions: + description: >- + An array of payment sessions related to the Payment + Collection. If the session_id is not provided, existing + sessions not present will be deleted and the provided ones + will be created. + type: array + items: + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding two new sessions + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 5000, + }, + { + provider_id: "manual", + amount: 5000, + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + + // Updating one session and removing the other + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 10000, + session_id: "ps_123456" + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payment-collections/{id}/sessions': + post: + operationId: PostPaymentCollectionsSessions + summary: Manage Payment Sessions from Payment Collections + description: Manages Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding a payment session + + medusa.paymentCollections.managePaymentSession(payment_id, { + provider_id: "stripe" }) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payment-collections/{id}/sessions/{session_id}': + post: + operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the + Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The id of the PaymentCollection. + schema: + type: string + - in: path + name: session_id + required: true + description: The id of the Payment Session to be refreshed. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + - customer_id + properties: + provider_id: + description: The Payment Provider id. + type: string + customer_id: + description: The Customer id. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.paymentCollections.refreshPaymentSession(payment_collection_id, + session_id, payload) + + .then(({ payment_session }) => { + console.log(payment_session.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_session: + $ref: '#/components/schemas/payment_session' + '400': + $ref: '#/components/responses/400_error' + '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' /product-types: get: operationId: GetProductTypes @@ -3067,6 +3639,7 @@ paths: content: application/json: schema: + type: object properties: product_types: $ref: '#/components/schemas/product_type' @@ -3154,6 +3727,7 @@ paths: content: application/json: schema: + type: object properties: product: allOf: @@ -3354,6 +3928,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -3441,6 +4016,7 @@ paths: content: application/json: schema: + type: object properties: hits: type: array @@ -3496,6 +4072,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -3597,6 +4174,7 @@ paths: content: application/json: schema: + type: object properties: regions: type: array @@ -3651,6 +4229,7 @@ paths: content: application/json: schema: + type: object properties: return_reason: $ref: '#/components/schemas/return_reason' @@ -3696,6 +4275,7 @@ paths: content: application/json: schema: + type: object properties: return_reasons: type: array @@ -3720,6 +4300,7 @@ paths: content: application/json: schema: + type: object required: - order_id - items @@ -3808,6 +4389,7 @@ paths: content: application/json: schema: + type: object properties: return: $ref: '#/components/schemas/return' @@ -3871,6 +4453,7 @@ paths: content: application/json: schema: + type: object properties: shipping_options: type: array @@ -3925,6 +4508,7 @@ paths: content: application/json: schema: + type: object properties: shipping_options: type: array @@ -3951,6 +4535,7 @@ paths: content: application/json: schema: + type: object required: - order_id - return_items @@ -4057,6 +4642,7 @@ paths: content: application/json: schema: + type: object properties: swap: $ref: '#/components/schemas/swap' @@ -4109,6 +4695,7 @@ paths: content: application/json: schema: + type: object properties: swap: $ref: '#/components/schemas/swap' @@ -4168,6 +4755,7 @@ paths: content: application/json: schema: + type: object properties: variant: allOf: @@ -4264,6 +4852,7 @@ paths: content: application/json: schema: + type: object properties: variants: type: array @@ -4281,6 +4870,93 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/carts/{id}/line-items': + post: + operationId: PostCartsCartLineItems + summary: Add a Line Item + description: >- + Generates a Line Item with a given Product Variant and adds it to the + Cart + parameters: + - in: path + name: id + required: true + description: The id of the Cart to add the Line Item to. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.lineItems.create(cart_id, { + variant_id, + quantity: 1 + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/line-items' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "variant_id": "{variant_id}", + "quantity": 1 + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/cart' + '400': + $ref: '#/components/responses/400_error' + '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' + requestBody: + content: + application/json: + schema: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + type: string + description: >- + The id of the Product Variant to generate the Line Item + from. + quantity: + type: integer + description: The quantity of the Product Variant to add to the Line Item. + metadata: + type: object + description: >- + An optional key-value map with additional details about the + Line Item. components: responses: default_error: @@ -4486,6 +5162,7 @@ components: title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address + type: object properties: company: type: string @@ -4540,6 +5217,7 @@ components: title: Address description: An address. x-resourceId: address + type: object properties: id: type: string @@ -4623,6 +5301,7 @@ components: title: Batch Job description: A Batch Job. x-resourceId: batch_job + type: object required: - type properties: @@ -4765,6 +5444,7 @@ components: title: Cart description: Represents a user cart x-resourceId: cart + type: object properties: id: type: string @@ -4942,6 +5622,7 @@ components: title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image + type: object required: - claim_item_id - url @@ -4985,6 +5666,7 @@ components: Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item + type: object required: - claim_order_id - item_id @@ -5072,6 +5754,7 @@ components: order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order + type: object required: - type - order_id @@ -5193,6 +5876,7 @@ components: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag + type: object required: - value properties: @@ -5225,6 +5909,7 @@ components: title: Country description: Country details x-resourceId: country + type: object required: - iso_2 - iso_3 @@ -5279,6 +5964,7 @@ components: title: Currency description: Currency x-resourceId: currency + type: object required: - code - symbol @@ -5314,6 +6000,7 @@ components: can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option + type: object required: - price - shipping_option_id @@ -5372,6 +6059,7 @@ components: title: Customer Group description: Represents a customer group x-resourceId: customer_group + type: object required: - name properties: @@ -5419,6 +6107,7 @@ components: title: Customer description: Represents a customer x-resourceId: customer + type: object required: - email properties: @@ -5436,7 +6125,7 @@ components: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string @@ -5492,6 +6181,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group + type: object required: - customer_group_id - condition_id @@ -5527,6 +6217,7 @@ components: title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection + type: object required: - product_collection_id - condition_id @@ -5562,6 +6253,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag + type: object required: - product_tag_id - condition_id @@ -5597,6 +6289,7 @@ components: title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product + type: object required: - product_type_id - condition_id @@ -5632,6 +6325,7 @@ components: title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product + type: object required: - product_id - condition_id @@ -5667,6 +6361,7 @@ components: title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition + type: object required: - type - operator @@ -5764,6 +6459,7 @@ components: Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule + type: object required: - type - value @@ -5831,6 +6527,7 @@ components: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount + type: object required: - code - is_dynamic @@ -5923,6 +6620,7 @@ components: title: DraftOrder description: Represents a draft order x-resourceId: draft-order + type: object properties: id: type: string @@ -5997,6 +6695,7 @@ components: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item + type: object required: - fulfillment_id - item_id @@ -6028,6 +6727,7 @@ components: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider + type: object properties: id: description: The id of the fulfillment provider as given by the plugin. @@ -6051,6 +6751,7 @@ components: these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment + type: object required: - provider_id properties: @@ -6166,6 +6867,7 @@ components: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction + type: object required: - gift_card_id - amount @@ -6212,6 +6914,7 @@ components: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card + type: object required: - code - value @@ -6283,6 +6986,7 @@ components: Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key + type: object required: - idempotency_key properties: @@ -6337,6 +7041,7 @@ components: title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image + type: object required: - url properties: @@ -6369,6 +7074,7 @@ components: title: Invite description: Represents an invite x-resourceId: invite + type: object required: - user_email properties: @@ -6420,6 +7126,7 @@ components: title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment + type: object required: - item_id - description @@ -6460,6 +7167,7 @@ components: title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line + type: object required: - item_id - rate @@ -6510,6 +7218,7 @@ components: Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item + type: object required: - title - unit_price @@ -6704,6 +7413,7 @@ components: region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount + type: object required: - currency_code - amount @@ -6787,6 +7497,7 @@ components: resources to allow users to describe additional information in relation to these. x-resourceId: note + type: object required: - value - resource_type @@ -6838,6 +7549,7 @@ components: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider + type: object required: - id properties: @@ -6860,6 +7572,7 @@ components: used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification + type: object required: - resource_type - resource_id @@ -6927,6 +7640,7 @@ components: title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend + type: object properties: id: description: The notification resend's ID @@ -6990,6 +7704,7 @@ components: title: OAuth description: Represent an OAuth app x-resourceId: OAuth + type: object required: - id - display_name @@ -7023,6 +7738,7 @@ components: title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit + type: object required: - order_id - order @@ -7151,6 +7867,7 @@ components: title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change + type: object required: - type - order_edit_id @@ -7208,6 +7925,7 @@ components: title: Order description: Represents an order x-resourceId: order + type: object required: - customer_id - email @@ -7486,6 +8204,7 @@ components: title: Payment Collection description: Payment Collection x-resourceId: payment_collection + type: object required: - type - status @@ -7511,12 +8230,7 @@ components: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -7526,12 +8240,6 @@ components: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID @@ -7583,6 +8291,7 @@ components: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider + type: object required: - id properties: @@ -7607,6 +8316,7 @@ components: Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session + type: object required: - cart_id - provider_id @@ -7680,6 +8390,7 @@ components: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment + type: object required: - amount - currency_code @@ -7777,6 +8488,7 @@ components: Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list + type: object required: - name - description @@ -7853,6 +8565,7 @@ components: title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection + type: object required: - title properties: @@ -7902,6 +8615,7 @@ components: Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value + type: object required: - value - option_id @@ -7960,6 +8674,7 @@ components: variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option + type: object required: - title - product_id @@ -8007,6 +8722,7 @@ components: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag + type: object required: - value properties: @@ -8041,6 +8757,7 @@ components: Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate + type: object required: - product_id - rate_id @@ -8078,6 +8795,7 @@ components: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate + type: object required: - product_type_id - rate_id @@ -8115,6 +8833,7 @@ components: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type + type: object required: - value properties: @@ -8151,6 +8870,7 @@ components: Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant + type: object required: - title - product_id @@ -8304,6 +9024,7 @@ components: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields + type: object properties: original_price: type: number @@ -8347,6 +9068,7 @@ components: such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product + type: object required: - title - profile_id @@ -8537,6 +9259,62 @@ components: description: An optional key-value map with additional details example: car: white + publishable_api_key_sales_channel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + x-resourceId: publishable_api_key_sales_channel + type: object + properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_api_key: + title: Publishable API key + description: >- + Publishable API key defines scopes (i.e. resources) that are available + within a request. + x-resourceId: publishable_api_key + type: object + properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: >- + A user object. Available if the relation `created_by_user` is + expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: >- + A user object. Available if the relation `revoked_by_user` is + expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time refund: title: Refund description: >- @@ -8544,6 +9322,7 @@ components: a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund + type: object required: - order_id - amount @@ -8610,6 +9389,7 @@ components: Region can consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region + type: object required: - name - currency_code @@ -8714,6 +9494,7 @@ components: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item + type: object required: - return_id - item_id @@ -8772,6 +9553,7 @@ components: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason + type: object required: - value - label @@ -8826,6 +9608,7 @@ components: to send back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return + type: object required: - refund_amount properties: @@ -8926,6 +9709,7 @@ components: title: Sales Channel description: A Sales Channel x-resourceId: sales_channel + type: object required: - name properties: @@ -8961,6 +9745,7 @@ components: title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line + type: object required: - shipping_method_id - rate @@ -9010,6 +9795,7 @@ components: contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method + type: object required: - shipping_option_id - price @@ -9094,6 +9880,7 @@ components: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement + type: object required: - shipping_option_id - type @@ -9142,6 +9929,7 @@ components: Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option + type: object required: - name - region_id @@ -9248,6 +10036,7 @@ components: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile + type: object required: - name - type @@ -9311,6 +10100,7 @@ components: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate + type: object required: - shipping_option_id - rate_id @@ -9346,6 +10136,7 @@ components: title: Staged Job description: A staged job resource x-resourceId: staged_job + type: object required: - event_name properties: @@ -9365,6 +10156,7 @@ components: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' x-resourceId: store + type: object properties: id: type: string @@ -9432,6 +10224,7 @@ components: Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap + type: object required: - fulfillment_status - payment_status @@ -9579,6 +10372,7 @@ components: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line + type: object required: - rate - name @@ -9616,6 +10410,7 @@ components: title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider + type: object properties: id: description: The id of the tax provider as given by the plugin. @@ -9634,6 +10429,7 @@ components: A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item + type: object required: - name - region_id @@ -9717,6 +10513,7 @@ components: Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link + type: object required: - tracking_number - fulfillment_id @@ -9770,6 +10567,7 @@ components: title: User description: Represents a User who can manage store settings. x-resourceId: user + type: object required: - email properties: @@ -9813,6 +10611,7 @@ components: multiple_errors: title: Multiple Errors x-resourceId: multiple_errors + type: object properties: errors: type: array @@ -9827,6 +10626,7 @@ components: error: title: Response Error x-resourceId: error + type: object properties: code: type: string diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 7433eef331..44c93cf522 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -145,213 +145,6 @@ tags: servers: - url: 'https://api.medusa-commerce.com/store' paths: - /auth: - post: - operationId: PostAuth - summary: Customer Login - description: >- - Logs a Customer in and authorizes them to view their details. Successful - authentication will set a session cookie in the Customer's browser. - parameters: [] - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.auth.authenticate({ - email: 'user@example.com', - password: 'user@example.com' - }) - - .then(({ customer }) => { - console.log(customer.id); - }); - - lang: Shell - label: cURL - source: | - curl --location --request POST 'https://medusa-url.com/store/auth' \ - --header 'Content-Type: application/json' \ - --data-raw '{ - "email": "user@example.com", - "password": "supersecret" - }' - tags: - - Auth - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/incorrect_credentials' - '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' - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - password - properties: - email: - type: string - description: The Customer's email. - password: - type: string - description: The Customer's password. - delete: - operationId: DeleteAuth - summary: Customer Log out - description: Destroys a Customer's authenticated session. - x-authenticated: true - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request DELETE 'https://medusa-url.com/store/auth' - \ - - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] - tags: - - Auth - 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' - get: - operationId: GetAuth - summary: Get Current Customer - description: Gets the currently logged in Customer. - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged - - medusa.auth.getSession() - - .then(({ customer }) => { - console.log(customer.id); - }); - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/store/auth' \ - --header 'Cookie: connect.sid={sid}' - security: - - cookie_auth: [] - tags: - - Auth - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - '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' - '/auth/{email}': - get: - operationId: GetAuthEmail - summary: Check if email exists - description: Checks if a Customer with the given email has signed up. - parameters: - - in: path - name: email - schema: - type: string - format: email - required: true - description: The email to check if exists. - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.auth.exists('user@example.com') - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/auth/user@example.com' \ - - --header 'Cookie: connect.sid={sid}' - tags: - - Auth - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - exists: - type: boolean - description: Whether email exists or not. - '400': - $ref: '#/components/responses/400_error' - '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' '/carts/{id}/shipping-methods': post: operationId: PostCartsCartShippingMethod @@ -399,6 +192,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -458,6 +252,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -520,6 +315,7 @@ paths: content: application/json: schema: + type: object properties: type: type: string @@ -579,6 +375,7 @@ paths: content: application/json: schema: + type: object properties: region_id: type: string @@ -648,6 +445,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -661,92 +459,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/line-items': - post: - operationId: PostCartsCartLineItems - summary: Add a Line Item - description: >- - Generates a Line Item with a given Product Variant and adds it to the - Cart - parameters: - - in: path - name: id - required: true - description: The id of the Cart to add the Line Item to. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.lineItems.create(cart_id, { - variant_id, - quantity: 1 - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/line-items' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "variant_id": "{variant_id}", - "quantity": 1 - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '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' - requestBody: - content: - application/json: - schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - type: string - description: >- - The id of the Product Variant to generate the Line Item - from. - quantity: - type: integer - description: The quantity of the Product Variant to add to the Line Item. - metadata: - type: object - description: >- - An optional key-value map with additional details about the - Line Item. '/carts/{id}/payment-sessions': post: operationId: PostCartsCartPaymentSessions @@ -788,6 +500,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -846,6 +559,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -904,6 +618,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -969,6 +684,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1042,6 +758,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1108,6 +825,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1171,6 +889,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1199,6 +918,7 @@ paths: content: application/json: schema: + type: object properties: region_id: type: string @@ -1295,6 +1015,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1357,6 +1078,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1419,6 +1141,7 @@ paths: content: application/json: schema: + type: object properties: cart: $ref: '#/components/schemas/cart' @@ -1443,6 +1166,59 @@ paths: provider_id: type: string description: The ID of the Payment Provider. + '/gift-cards/{code}': + get: + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unqiue code. + parameters: + - in: path + name: code + required: true + description: The unique Gift Card code. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.giftCards.retrieve(code) + + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/gift-cards/{code}' + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + gift_card: + $ref: '#/components/schemas/gift_card' + '400': + $ref: '#/components/responses/400_error' + '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' '/collections/{id}': get: operationId: GetCollectionsCollection @@ -1482,6 +1258,7 @@ paths: content: application/json: schema: + type: object properties: collection: $ref: '#/components/schemas/product_collection' @@ -1586,6 +1363,7 @@ paths: content: application/json: schema: + type: object properties: collections: type: array @@ -1620,6 +1398,7 @@ paths: content: application/json: schema: + type: object required: - address properties: @@ -1695,6 +1474,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1719,6 +1499,7 @@ paths: content: application/json: schema: + type: object required: - first_name - last_name @@ -1783,6 +1564,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1797,6 +1579,7 @@ paths: content: application/json: schema: + type: object properties: code: type: string @@ -1861,6 +1644,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1935,6 +1719,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -1991,6 +1776,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2015,6 +1801,7 @@ paths: content: application/json: schema: + type: object properties: first_name: description: The Customer's first name. @@ -2082,6 +1869,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2139,6 +1927,7 @@ paths: content: application/json: schema: + type: object properties: payment_methods: type: array @@ -2370,6 +2159,7 @@ paths: content: application/json: schema: + type: object properties: orders: type: array @@ -2408,6 +2198,7 @@ paths: content: application/json: schema: + type: object required: - email properties: @@ -2474,6 +2265,7 @@ paths: content: application/json: schema: + type: object required: - email - password @@ -2529,6 +2321,7 @@ paths: content: application/json: schema: + type: object properties: customer: $ref: '#/components/schemas/customer' @@ -2544,58 +2337,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/gift-cards/{code}': - get: - operationId: GetGiftCardsCode - summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. - parameters: - - in: path - name: code - required: true - description: The unique Gift Card code. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.giftCards.retrieve(code) - - .then(({ gift_card }) => { - console.log(gift_card.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/gift-cards/{code}' - tags: - - Gift Card - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - gift_card: - $ref: '#/components/schemas/gift_card' - '400': - $ref: '#/components/responses/400_error' - '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' '/order-edits/{id}/complete': post: operationId: PostOrderEditsOrderEditComplete @@ -2634,6 +2375,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2661,6 +2403,7 @@ paths: content: application/json: schema: + type: object properties: declined_reason: type: string @@ -2691,6 +2434,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2741,6 +2485,7 @@ paths: content: application/json: schema: + type: object properties: order_edit: $ref: '#/components/schemas/order_edit' @@ -2756,6 +2501,76 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /orders/customer/confirm: + post: + operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept + summary: Verify a claim to orders + description: >- + Verifies the claim order token provided to the customer upon request of + order ownership + requestBody: + content: + application/json: + schema: + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.orders.confirmRequest( + token, + ) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/orders/customer/confirm' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "token": "{token}", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + 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' '/orders/cart/{cart_id}': get: operationId: GetOrdersOrderCartId @@ -2797,6 +2612,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -2849,6 +2665,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -2924,6 +2741,7 @@ paths: content: application/json: schema: + type: object properties: order: $ref: '#/components/schemas/order' @@ -2937,6 +2755,760 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /orders/batch/customer/token: + post: + operationId: PostOrdersCustomerOrderClaim + summary: Claim orders for signed in account + description: >- + Sends an email to emails registered to orders provided with link to + transfer order ownership + requestBody: + content: + application/json: + schema: + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.orders.claimOrders({ + display_ids, + }) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/batch/customer/token' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "display_ids": ["id"], + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + 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' + '/payment-collections/{id}/sessions/batch/authorize': + post: + operationId: PostPaymentCollectionsSessionsBatchAuthorize + summary: Authorize Payment Sessions of a Payment Collection + description: Authorizes Payment Sessions of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + session_ids: + description: List of Payment Session IDs to authorize. + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.authorize(payment_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payment-collections/{id}/sessions/{session_id}/authorize': + post: + operationId: PostPaymentCollectionsSessionsSessionAuthorize + summary: Authorize a Payment Session of a Payment Collection + description: Authorizes a Payment Session of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + - in: path + name: session_id + required: true + description: The ID of the Payment Session. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.authorize(payment_id, session_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_session: + $ref: '#/components/schemas/payment_session' + '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' + '/payment-collections/{id}': + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/payment-collections/{id}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payment-collections/{id}/sessions/batch': + post: + operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch + summary: Manage Multiple Payment Sessions from Payment Collections + description: Manages Multiple Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + sessions: + description: >- + An array of payment sessions related to the Payment + Collection. If the session_id is not provided, existing + sessions not present will be deleted and the provided ones + will be created. + type: array + items: + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding two new sessions + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 5000, + }, + { + provider_id: "manual", + amount: 5000, + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + + // Updating one session and removing the other + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 10000, + session_id: "ps_123456" + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payment-collections/{id}/sessions': + post: + operationId: PostPaymentCollectionsSessions + summary: Manage Payment Sessions from Payment Collections + description: Manages Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding a payment session + + medusa.paymentCollections.managePaymentSession(payment_id, { + provider_id: "stripe" }) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/payment_collection' + '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' + '/payment-collections/{id}/sessions/{session_id}': + post: + operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the + Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The id of the PaymentCollection. + schema: + type: string + - in: path + name: session_id + required: true + description: The id of the Payment Session to be refreshed. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + - customer_id + properties: + provider_id: + description: The Payment Provider id. + type: string + customer_id: + description: The Customer id. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.paymentCollections.refreshPaymentSession(payment_collection_id, + session_id, payload) + + .then(({ payment_session }) => { + console.log(payment_session.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_session: + $ref: '#/components/schemas/payment_session' + '400': + $ref: '#/components/responses/400_error' + '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' + /auth: + post: + operationId: PostAuth + summary: Customer Login + description: >- + Logs a Customer in and authorizes them to view their details. Successful + authentication will set a session cookie in the Customer's browser. + parameters: [] + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.auth.authenticate({ + email: 'user@example.com', + password: 'user@example.com' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer: + $ref: '#/components/schemas/customer' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/incorrect_credentials' + '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' + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - password + properties: + email: + type: string + description: The Customer's email. + password: + type: string + description: The Customer's password. + delete: + operationId: DeleteAuth + summary: Customer Log out + description: Destroys a Customer's authenticated session. + x-authenticated: true + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request DELETE 'https://medusa-url.com/store/auth' + \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Auth + 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' + get: + operationId: GetAuth + summary: Get Current Customer + description: Gets the currently logged in Customer. + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged + + medusa.auth.getSession() + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/auth' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer: + $ref: '#/components/schemas/customer' + '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' + '/auth/{email}': + get: + operationId: GetAuthEmail + summary: Check if email exists + description: Checks if a Customer with the given email has signed up. + parameters: + - in: path + name: email + schema: + type: string + format: email + required: true + description: The email to check if exists. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.auth.exists('user@example.com') + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/auth/user@example.com' \ + + --header 'Cookie: connect.sid={sid}' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + exists: + type: boolean + description: Whether email exists or not. + '400': + $ref: '#/components/responses/400_error' + '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' /product-types: get: operationId: GetProductTypes @@ -3067,6 +3639,7 @@ paths: content: application/json: schema: + type: object properties: product_types: $ref: '#/components/schemas/product_type' @@ -3154,6 +3727,7 @@ paths: content: application/json: schema: + type: object properties: product: allOf: @@ -3354,6 +3928,7 @@ paths: content: application/json: schema: + type: object properties: products: type: array @@ -3441,6 +4016,7 @@ paths: content: application/json: schema: + type: object properties: hits: type: array @@ -3496,6 +4072,7 @@ paths: content: application/json: schema: + type: object properties: region: $ref: '#/components/schemas/region' @@ -3597,6 +4174,7 @@ paths: content: application/json: schema: + type: object properties: regions: type: array @@ -3651,6 +4229,7 @@ paths: content: application/json: schema: + type: object properties: return_reason: $ref: '#/components/schemas/return_reason' @@ -3696,6 +4275,7 @@ paths: content: application/json: schema: + type: object properties: return_reasons: type: array @@ -3720,6 +4300,7 @@ paths: content: application/json: schema: + type: object required: - order_id - items @@ -3808,6 +4389,7 @@ paths: content: application/json: schema: + type: object properties: return: $ref: '#/components/schemas/return' @@ -3871,6 +4453,7 @@ paths: content: application/json: schema: + type: object properties: shipping_options: type: array @@ -3925,6 +4508,7 @@ paths: content: application/json: schema: + type: object properties: shipping_options: type: array @@ -3951,6 +4535,7 @@ paths: content: application/json: schema: + type: object required: - order_id - return_items @@ -4057,6 +4642,7 @@ paths: content: application/json: schema: + type: object properties: swap: $ref: '#/components/schemas/swap' @@ -4109,6 +4695,7 @@ paths: content: application/json: schema: + type: object properties: swap: $ref: '#/components/schemas/swap' @@ -4168,6 +4755,7 @@ paths: content: application/json: schema: + type: object properties: variant: allOf: @@ -4264,6 +4852,7 @@ paths: content: application/json: schema: + type: object properties: variants: type: array @@ -4281,6 +4870,93 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/carts/{id}/line-items': + post: + operationId: PostCartsCartLineItems + summary: Add a Line Item + description: >- + Generates a Line Item with a given Product Variant and adds it to the + Cart + parameters: + - in: path + name: id + required: true + description: The id of the Cart to add the Line Item to. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.lineItems.create(cart_id, { + variant_id, + quantity: 1 + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/line-items' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "variant_id": "{variant_id}", + "quantity": 1 + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/cart' + '400': + $ref: '#/components/responses/400_error' + '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' + requestBody: + content: + application/json: + schema: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + type: string + description: >- + The id of the Product Variant to generate the Line Item + from. + quantity: + type: integer + description: The quantity of the Product Variant to add to the Line Item. + metadata: + type: object + description: >- + An optional key-value map with additional details about the + Line Item. components: responses: default_error: @@ -4486,6 +5162,7 @@ components: title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address + type: object properties: company: type: string @@ -4540,6 +5217,7 @@ components: title: Address description: An address. x-resourceId: address + type: object properties: id: type: string @@ -4623,6 +5301,7 @@ components: title: Batch Job description: A Batch Job. x-resourceId: batch_job + type: object required: - type properties: @@ -4765,6 +5444,7 @@ components: title: Cart description: Represents a user cart x-resourceId: cart + type: object properties: id: type: string @@ -4942,6 +5622,7 @@ components: title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image + type: object required: - claim_item_id - url @@ -4985,6 +5666,7 @@ components: Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item + type: object required: - claim_order_id - item_id @@ -5072,6 +5754,7 @@ components: order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order + type: object required: - type - order_id @@ -5193,6 +5876,7 @@ components: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag + type: object required: - value properties: @@ -5225,6 +5909,7 @@ components: title: Country description: Country details x-resourceId: country + type: object required: - iso_2 - iso_3 @@ -5279,6 +5964,7 @@ components: title: Currency description: Currency x-resourceId: currency + type: object required: - code - symbol @@ -5314,6 +6000,7 @@ components: can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option + type: object required: - price - shipping_option_id @@ -5372,6 +6059,7 @@ components: title: Customer Group description: Represents a customer group x-resourceId: customer_group + type: object required: - name properties: @@ -5419,6 +6107,7 @@ components: title: Customer description: Represents a customer x-resourceId: customer + type: object required: - email properties: @@ -5436,7 +6125,7 @@ components: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string @@ -5492,6 +6181,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group + type: object required: - customer_group_id - condition_id @@ -5527,6 +6217,7 @@ components: title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection + type: object required: - product_collection_id - condition_id @@ -5562,6 +6253,7 @@ components: title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag + type: object required: - product_tag_id - condition_id @@ -5597,6 +6289,7 @@ components: title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product + type: object required: - product_type_id - condition_id @@ -5632,6 +6325,7 @@ components: title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product + type: object required: - product_id - condition_id @@ -5667,6 +6361,7 @@ components: title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition + type: object required: - type - operator @@ -5764,6 +6459,7 @@ components: Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule + type: object required: - type - value @@ -5831,6 +6527,7 @@ components: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount + type: object required: - code - is_dynamic @@ -5923,6 +6620,7 @@ components: title: DraftOrder description: Represents a draft order x-resourceId: draft-order + type: object properties: id: type: string @@ -5997,6 +6695,7 @@ components: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item + type: object required: - fulfillment_id - item_id @@ -6028,6 +6727,7 @@ components: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider + type: object properties: id: description: The id of the fulfillment provider as given by the plugin. @@ -6051,6 +6751,7 @@ components: these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment + type: object required: - provider_id properties: @@ -6166,6 +6867,7 @@ components: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction + type: object required: - gift_card_id - amount @@ -6212,6 +6914,7 @@ components: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card + type: object required: - code - value @@ -6283,6 +6986,7 @@ components: Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key + type: object required: - idempotency_key properties: @@ -6337,6 +7041,7 @@ components: title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image + type: object required: - url properties: @@ -6369,6 +7074,7 @@ components: title: Invite description: Represents an invite x-resourceId: invite + type: object required: - user_email properties: @@ -6420,6 +7126,7 @@ components: title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment + type: object required: - item_id - description @@ -6460,6 +7167,7 @@ components: title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line + type: object required: - item_id - rate @@ -6510,6 +7218,7 @@ components: Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item + type: object required: - title - unit_price @@ -6704,6 +7413,7 @@ components: region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount + type: object required: - currency_code - amount @@ -6787,6 +7497,7 @@ components: resources to allow users to describe additional information in relation to these. x-resourceId: note + type: object required: - value - resource_type @@ -6838,6 +7549,7 @@ components: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider + type: object required: - id properties: @@ -6860,6 +7572,7 @@ components: used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification + type: object required: - resource_type - resource_id @@ -6927,6 +7640,7 @@ components: title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend + type: object properties: id: description: The notification resend's ID @@ -6990,6 +7704,7 @@ components: title: OAuth description: Represent an OAuth app x-resourceId: OAuth + type: object required: - id - display_name @@ -7023,6 +7738,7 @@ components: title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit + type: object required: - order_id - order @@ -7151,6 +7867,7 @@ components: title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change + type: object required: - type - order_edit_id @@ -7208,6 +7925,7 @@ components: title: Order description: Represents an order x-resourceId: order + type: object required: - customer_id - email @@ -7486,6 +8204,7 @@ components: title: Payment Collection description: Payment Collection x-resourceId: payment_collection + type: object required: - type - status @@ -7511,12 +8230,7 @@ components: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -7526,12 +8240,6 @@ components: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID @@ -7583,6 +8291,7 @@ components: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider + type: object required: - id properties: @@ -7607,6 +8316,7 @@ components: Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session + type: object required: - cart_id - provider_id @@ -7680,6 +8390,7 @@ components: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment + type: object required: - amount - currency_code @@ -7777,6 +8488,7 @@ components: Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list + type: object required: - name - description @@ -7853,6 +8565,7 @@ components: title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection + type: object required: - title properties: @@ -7902,6 +8615,7 @@ components: Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value + type: object required: - value - option_id @@ -7960,6 +8674,7 @@ components: variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option + type: object required: - title - product_id @@ -8007,6 +8722,7 @@ components: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag + type: object required: - value properties: @@ -8041,6 +8757,7 @@ components: Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate + type: object required: - product_id - rate_id @@ -8078,6 +8795,7 @@ components: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate + type: object required: - product_type_id - rate_id @@ -8115,6 +8833,7 @@ components: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type + type: object required: - value properties: @@ -8151,6 +8870,7 @@ components: Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant + type: object required: - title - product_id @@ -8304,6 +9024,7 @@ components: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields + type: object properties: original_price: type: number @@ -8347,6 +9068,7 @@ components: such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product + type: object required: - title - profile_id @@ -8537,6 +9259,62 @@ components: description: An optional key-value map with additional details example: car: white + publishable_api_key_sales_channel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + x-resourceId: publishable_api_key_sales_channel + type: object + properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_api_key: + title: Publishable API key + description: >- + Publishable API key defines scopes (i.e. resources) that are available + within a request. + x-resourceId: publishable_api_key + type: object + properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: >- + A user object. Available if the relation `created_by_user` is + expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: >- + A user object. Available if the relation `revoked_by_user` is + expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time refund: title: Refund description: >- @@ -8544,6 +9322,7 @@ components: a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund + type: object required: - order_id - amount @@ -8610,6 +9389,7 @@ components: Region can consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region + type: object required: - name - currency_code @@ -8714,6 +9494,7 @@ components: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item + type: object required: - return_id - item_id @@ -8772,6 +9553,7 @@ components: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason + type: object required: - value - label @@ -8826,6 +9608,7 @@ components: to send back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return + type: object required: - refund_amount properties: @@ -8926,6 +9709,7 @@ components: title: Sales Channel description: A Sales Channel x-resourceId: sales_channel + type: object required: - name properties: @@ -8961,6 +9745,7 @@ components: title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line + type: object required: - shipping_method_id - rate @@ -9010,6 +9795,7 @@ components: contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method + type: object required: - shipping_option_id - price @@ -9094,6 +9880,7 @@ components: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement + type: object required: - shipping_option_id - type @@ -9142,6 +9929,7 @@ components: Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option + type: object required: - name - region_id @@ -9248,6 +10036,7 @@ components: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile + type: object required: - name - type @@ -9311,6 +10100,7 @@ components: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate + type: object required: - shipping_option_id - rate_id @@ -9346,6 +10136,7 @@ components: title: Staged Job description: A staged job resource x-resourceId: staged_job + type: object required: - event_name properties: @@ -9365,6 +10156,7 @@ components: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' x-resourceId: store + type: object properties: id: type: string @@ -9432,6 +10224,7 @@ components: Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap + type: object required: - fulfillment_status - payment_status @@ -9579,6 +10372,7 @@ components: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line + type: object required: - rate - name @@ -9616,6 +10410,7 @@ components: title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider + type: object properties: id: description: The id of the tax provider as given by the plugin. @@ -9634,6 +10429,7 @@ components: A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item + type: object required: - name - region_id @@ -9717,6 +10513,7 @@ components: Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link + type: object required: - tracking_number - fulfillment_id @@ -9770,6 +10567,7 @@ components: title: User description: Represents a User who can manage store settings. x-resourceId: user + type: object required: - email properties: @@ -9813,6 +10611,7 @@ components: multiple_errors: title: Multiple Errors x-resourceId: multiple_errors + type: object properties: errors: type: array @@ -9827,6 +10626,7 @@ components: error: title: Response Error x-resourceId: error + type: object properties: code: type: string diff --git a/docs/api/store/code_samples/JavaScript/orders_batch_customer_token/postundefined b/docs/api/store/code_samples/JavaScript/orders_batch_customer_token/postundefined new file mode 100644 index 0000000000..72554acc41 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/orders_batch_customer_token/postundefined @@ -0,0 +1,12 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.orders.claimOrders({ + display_ids, +}) +.then(() => { + // successful +}) +.catch(() => { + // an error occurred +}); diff --git a/docs/api/store/code_samples/JavaScript/orders_customer_confirm/postundefined b/docs/api/store/code_samples/JavaScript/orders_customer_confirm/postundefined new file mode 100644 index 0000000000..10c39a00a1 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/orders_customer_confirm/postundefined @@ -0,0 +1,12 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.orders.confirmRequest( + token, +) +.then(() => { + // successful +}) +.catch(() => { + // an error occurred +}); diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}/getundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}/getundefined new file mode 100644 index 0000000000..8a6b688942 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}/getundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/postundefined new file mode 100644 index 0000000000..3205e03ec7 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/postundefined @@ -0,0 +1,9 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +// Total amount = 10000 +// Adding a payment session +medusa.paymentCollections.managePaymentSession(payment_id, { provider_id: "stripe" }) +.then(({ payment_collection }) => { + console.log(payment_collection.id); +}); diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined new file mode 100644 index 0000000000..fdc8f51a65 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined @@ -0,0 +1,29 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +// Total amount = 10000 +// Adding two new sessions +medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 5000, + }, + { + provider_id: "manual", + amount: 5000, + }, +]) +.then(({ payment_collection }) => { + console.log(payment_collection.id); +}); +// Updating one session and removing the other +medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 10000, + session_id: "ps_123456" + }, +]) +.then(({ payment_collection }) => { + console.log(payment_collection.id); +}); diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined new file mode 100644 index 0000000000..07a13c56a9 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.paymentCollections.authorize(payment_id) +.then(({ payment_collection }) => { + console.log(payment_collection.id); +}); diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined new file mode 100644 index 0000000000..f160bb1dda --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined @@ -0,0 +1,6 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +medusa.paymentCollections.refreshPaymentSession(payment_collection_id, session_id, payload) +.then(({ payment_session }) => { + console.log(payment_session.id); +}); diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined new file mode 100644 index 0000000000..6ded159b96 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.paymentCollections.authorize(payment_id, session_id) +.then(({ payment_collection }) => { + console.log(payment_collection.id); +}); diff --git a/docs/api/store/code_samples/Shell/orders_batch_customer_token/postundefined b/docs/api/store/code_samples/Shell/orders_batch_customer_token/postundefined new file mode 100644 index 0000000000..21521c3ef5 --- /dev/null +++ b/docs/api/store/code_samples/Shell/orders_batch_customer_token/postundefined @@ -0,0 +1,5 @@ +curl --location --request POST 'https://medusa-url.com/store/batch/customer/token' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "display_ids": ["id"], +}' diff --git a/docs/api/store/code_samples/Shell/orders_customer_confirm/postundefined b/docs/api/store/code_samples/Shell/orders_customer_confirm/postundefined new file mode 100644 index 0000000000..2439ee98c3 --- /dev/null +++ b/docs/api/store/code_samples/Shell/orders_customer_confirm/postundefined @@ -0,0 +1,5 @@ +curl --location --request POST 'https://medusa-url.com/store/orders/customer/confirm' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "token": "{token}", +}' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}/getundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}/getundefined new file mode 100644 index 0000000000..8901cffbad --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}/getundefined @@ -0,0 +1 @@ +curl --location --request GET 'https://medusa-url.com/store/payment-collections/{id}' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/postundefined new file mode 100644 index 0000000000..1d15f4300e --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/postundefined @@ -0,0 +1 @@ +curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined new file mode 100644 index 0000000000..4c5bcbc44b --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined @@ -0,0 +1 @@ +curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined new file mode 100644 index 0000000000..33206c8c19 --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined @@ -0,0 +1 @@ +curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined new file mode 100644 index 0000000000..c307160781 --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined @@ -0,0 +1 @@ +curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined new file mode 100644 index 0000000000..ece1417b0c --- /dev/null +++ b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined @@ -0,0 +1 @@ +curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' diff --git a/docs/api/store/components/schemas/OAuth.yaml b/docs/api/store/components/schemas/OAuth.yaml index a9afba0974..6b6cb8b660 100644 --- a/docs/api/store/components/schemas/OAuth.yaml +++ b/docs/api/store/components/schemas/OAuth.yaml @@ -1,6 +1,7 @@ title: OAuth description: Represent an OAuth app x-resourceId: OAuth +type: object required: - id - display_name diff --git a/docs/api/store/components/schemas/address.yaml b/docs/api/store/components/schemas/address.yaml index ff413792f1..d39d1760ae 100644 --- a/docs/api/store/components/schemas/address.yaml +++ b/docs/api/store/components/schemas/address.yaml @@ -1,6 +1,7 @@ title: Address description: An address. x-resourceId: address +type: object properties: id: type: string diff --git a/docs/api/store/components/schemas/address_fields.yaml b/docs/api/store/components/schemas/address_fields.yaml index 110810299c..303b9d5ca9 100644 --- a/docs/api/store/components/schemas/address_fields.yaml +++ b/docs/api/store/components/schemas/address_fields.yaml @@ -1,6 +1,7 @@ title: Address Fields description: Address fields used when creating/updating an address. x-resourceId: address +type: object properties: company: type: string diff --git a/docs/api/store/components/schemas/batch_job.yaml b/docs/api/store/components/schemas/batch_job.yaml index dcb63d5f55..c06c261ba5 100644 --- a/docs/api/store/components/schemas/batch_job.yaml +++ b/docs/api/store/components/schemas/batch_job.yaml @@ -1,6 +1,7 @@ title: Batch Job description: A Batch Job. x-resourceId: batch_job +type: object required: - type properties: diff --git a/docs/api/store/components/schemas/cart.yaml b/docs/api/store/components/schemas/cart.yaml index 0881621115..de1d520a2d 100644 --- a/docs/api/store/components/schemas/cart.yaml +++ b/docs/api/store/components/schemas/cart.yaml @@ -1,6 +1,7 @@ title: Cart description: Represents a user cart x-resourceId: cart +type: object properties: id: type: string diff --git a/docs/api/store/components/schemas/claim_image.yaml b/docs/api/store/components/schemas/claim_image.yaml index 5b2d04e74b..783d89c06d 100644 --- a/docs/api/store/components/schemas/claim_image.yaml +++ b/docs/api/store/components/schemas/claim_image.yaml @@ -1,6 +1,7 @@ title: Claim Image description: Represents photo documentation of a claim. x-resourceId: claim_image +type: object required: - claim_item_id - url diff --git a/docs/api/store/components/schemas/claim_item.yaml b/docs/api/store/components/schemas/claim_item.yaml index ccec3c8ebf..cb7e85c9dd 100644 --- a/docs/api/store/components/schemas/claim_item.yaml +++ b/docs/api/store/components/schemas/claim_item.yaml @@ -3,6 +3,7 @@ description: >- Represents a claimed item along with information about the reasons for the claim. x-resourceId: claim_item +type: object required: - claim_order_id - item_id diff --git a/docs/api/store/components/schemas/claim_order.yaml b/docs/api/store/components/schemas/claim_order.yaml index 1d26758cec..ed55db009d 100644 --- a/docs/api/store/components/schemas/claim_order.yaml +++ b/docs/api/store/components/schemas/claim_order.yaml @@ -4,6 +4,7 @@ description: >- consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. x-resourceId: claim_order +type: object required: - type - order_id diff --git a/docs/api/store/components/schemas/claim_tag.yaml b/docs/api/store/components/schemas/claim_tag.yaml index bf7b96a3db..46a23e4da8 100644 --- a/docs/api/store/components/schemas/claim_tag.yaml +++ b/docs/api/store/components/schemas/claim_tag.yaml @@ -3,6 +3,7 @@ description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. x-resourceId: claim_tag +type: object required: - value properties: diff --git a/docs/api/store/components/schemas/country.yaml b/docs/api/store/components/schemas/country.yaml index 8bd271c77c..d8a7a18e36 100644 --- a/docs/api/store/components/schemas/country.yaml +++ b/docs/api/store/components/schemas/country.yaml @@ -1,6 +1,7 @@ title: Country description: Country details x-resourceId: country +type: object required: - iso_2 - iso_3 diff --git a/docs/api/store/components/schemas/currency.yaml b/docs/api/store/components/schemas/currency.yaml index acdf451c75..be164ffa9e 100644 --- a/docs/api/store/components/schemas/currency.yaml +++ b/docs/api/store/components/schemas/currency.yaml @@ -1,6 +1,7 @@ title: Currency description: Currency x-resourceId: currency +type: object required: - code - symbol diff --git a/docs/api/store/components/schemas/custom_shipping_option.yaml b/docs/api/store/components/schemas/custom_shipping_option.yaml index 9e93606075..40ff8c8229 100644 --- a/docs/api/store/components/schemas/custom_shipping_option.yaml +++ b/docs/api/store/components/schemas/custom_shipping_option.yaml @@ -4,6 +4,7 @@ description: >- attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option x-resourceId: custom_shipping_option +type: object required: - price - shipping_option_id diff --git a/docs/api/store/components/schemas/customer.yaml b/docs/api/store/components/schemas/customer.yaml index e3df6d690b..aa0e83a77c 100644 --- a/docs/api/store/components/schemas/customer.yaml +++ b/docs/api/store/components/schemas/customer.yaml @@ -1,6 +1,7 @@ title: Customer description: Represents a customer x-resourceId: customer +type: object required: - email properties: @@ -18,7 +19,7 @@ properties: example: Arno last_name: type: string - description: The customer's first name + description: The customer's last name example: Willms billing_address_id: type: string diff --git a/docs/api/store/components/schemas/customer_group.yaml b/docs/api/store/components/schemas/customer_group.yaml index d99e3a5923..0d4769c7ad 100644 --- a/docs/api/store/components/schemas/customer_group.yaml +++ b/docs/api/store/components/schemas/customer_group.yaml @@ -1,6 +1,7 @@ title: Customer Group description: Represents a customer group x-resourceId: customer_group +type: object required: - name properties: diff --git a/docs/api/store/components/schemas/discount.yaml b/docs/api/store/components/schemas/discount.yaml index 48f090532a..1950a503cb 100644 --- a/docs/api/store/components/schemas/discount.yaml +++ b/docs/api/store/components/schemas/discount.yaml @@ -1,6 +1,7 @@ title: Discount description: Represents a discount that can be applied to a cart for promotional purposes. x-resourceId: discount +type: object required: - code - is_dynamic diff --git a/docs/api/store/components/schemas/discount_condition.yaml b/docs/api/store/components/schemas/discount_condition.yaml index 57a0dea0b9..794e839eb3 100644 --- a/docs/api/store/components/schemas/discount_condition.yaml +++ b/docs/api/store/components/schemas/discount_condition.yaml @@ -1,6 +1,7 @@ title: Discount Condition description: Holds rule conditions for when a discount is applicable x-resourceId: discount_condition +type: object required: - type - operator diff --git a/docs/api/store/components/schemas/discount_condition_customer_group.yaml b/docs/api/store/components/schemas/discount_condition_customer_group.yaml index ad6527d260..51867349ad 100644 --- a/docs/api/store/components/schemas/discount_condition_customer_group.yaml +++ b/docs/api/store/components/schemas/discount_condition_customer_group.yaml @@ -1,6 +1,7 @@ title: Product Tag Discount Condition description: Associates a discount condition with a customer group x-resourceId: discount_condition_customer_group +type: object required: - customer_group_id - condition_id diff --git a/docs/api/store/components/schemas/discount_condition_product.yaml b/docs/api/store/components/schemas/discount_condition_product.yaml index 77f4fa6b9e..b88eac53c2 100644 --- a/docs/api/store/components/schemas/discount_condition_product.yaml +++ b/docs/api/store/components/schemas/discount_condition_product.yaml @@ -1,6 +1,7 @@ title: Product Discount Condition description: Associates a discount condition with a product x-resourceId: discount_condition_product +type: object required: - product_id - condition_id diff --git a/docs/api/store/components/schemas/discount_condition_product_collection.yaml b/docs/api/store/components/schemas/discount_condition_product_collection.yaml index 43c7548e34..bc0065ef9f 100644 --- a/docs/api/store/components/schemas/discount_condition_product_collection.yaml +++ b/docs/api/store/components/schemas/discount_condition_product_collection.yaml @@ -1,6 +1,7 @@ title: Product Collection Discount Condition description: Associates a discount condition with a product collection x-resourceId: discount_condition_product_collection +type: object required: - product_collection_id - condition_id diff --git a/docs/api/store/components/schemas/discount_condition_product_tag.yaml b/docs/api/store/components/schemas/discount_condition_product_tag.yaml index ed3a8b2e79..d3ba121f43 100644 --- a/docs/api/store/components/schemas/discount_condition_product_tag.yaml +++ b/docs/api/store/components/schemas/discount_condition_product_tag.yaml @@ -1,6 +1,7 @@ title: Product Tag Discount Condition description: Associates a discount condition with a product tag x-resourceId: discount_condition_product_tag +type: object required: - product_tag_id - condition_id diff --git a/docs/api/store/components/schemas/discount_condition_product_type.yaml b/docs/api/store/components/schemas/discount_condition_product_type.yaml index 3125b2119c..03a6393c44 100644 --- a/docs/api/store/components/schemas/discount_condition_product_type.yaml +++ b/docs/api/store/components/schemas/discount_condition_product_type.yaml @@ -1,6 +1,7 @@ title: Product Type Discount Condition description: Associates a discount condition with a product type x-resourceId: discount_condition_product +type: object required: - product_type_id - condition_id diff --git a/docs/api/store/components/schemas/discount_rule.yaml b/docs/api/store/components/schemas/discount_rule.yaml index 328171368f..ab6ab1a80e 100644 --- a/docs/api/store/components/schemas/discount_rule.yaml +++ b/docs/api/store/components/schemas/discount_rule.yaml @@ -3,6 +3,7 @@ description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. x-resourceId: discount_rule +type: object required: - type - value diff --git a/docs/api/store/components/schemas/draft-order.yaml b/docs/api/store/components/schemas/draft-order.yaml index 12152dc3e0..1c96c22bc7 100644 --- a/docs/api/store/components/schemas/draft-order.yaml +++ b/docs/api/store/components/schemas/draft-order.yaml @@ -1,6 +1,7 @@ title: DraftOrder description: Represents a draft order x-resourceId: draft-order +type: object properties: id: type: string diff --git a/docs/api/store/components/schemas/error.yaml b/docs/api/store/components/schemas/error.yaml index c8baa14163..cad9495918 100644 --- a/docs/api/store/components/schemas/error.yaml +++ b/docs/api/store/components/schemas/error.yaml @@ -1,5 +1,6 @@ title: Response Error x-resourceId: error +type: object properties: code: type: string diff --git a/docs/api/store/components/schemas/fulfillment.yaml b/docs/api/store/components/schemas/fulfillment.yaml index 0ea09f97e5..d6ee5c6960 100644 --- a/docs/api/store/components/schemas/fulfillment.yaml +++ b/docs/api/store/components/schemas/fulfillment.yaml @@ -8,6 +8,7 @@ description: >- webhooks in order to automatically update and synchronize the state of Fulfillments. x-resourceId: fulfillment +type: object required: - provider_id properties: diff --git a/docs/api/store/components/schemas/fulfillment_item.yaml b/docs/api/store/components/schemas/fulfillment_item.yaml index 29fe0f87b9..f233f45f68 100644 --- a/docs/api/store/components/schemas/fulfillment_item.yaml +++ b/docs/api/store/components/schemas/fulfillment_item.yaml @@ -3,6 +3,7 @@ description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. x-resourceId: fulfillment_item +type: object required: - fulfillment_id - item_id diff --git a/docs/api/store/components/schemas/fulfillment_provider.yaml b/docs/api/store/components/schemas/fulfillment_provider.yaml index d6fdd8ce64..584c933111 100644 --- a/docs/api/store/components/schemas/fulfillment_provider.yaml +++ b/docs/api/store/components/schemas/fulfillment_provider.yaml @@ -1,6 +1,7 @@ title: Fulfillment Provider description: Represents a fulfillment provider plugin and holds its installation status. x-resourceId: fulfillment_provider +type: object properties: id: description: The id of the fulfillment provider as given by the plugin. diff --git a/docs/api/store/components/schemas/gift_card.yaml b/docs/api/store/components/schemas/gift_card.yaml index 713a2a39fc..054f93319f 100644 --- a/docs/api/store/components/schemas/gift_card.yaml +++ b/docs/api/store/components/schemas/gift_card.yaml @@ -3,6 +3,7 @@ description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. x-resourceId: gift_card +type: object required: - code - value diff --git a/docs/api/store/components/schemas/gift_card_transaction.yaml b/docs/api/store/components/schemas/gift_card_transaction.yaml index 0d923b3653..fb16341851 100644 --- a/docs/api/store/components/schemas/gift_card_transaction.yaml +++ b/docs/api/store/components/schemas/gift_card_transaction.yaml @@ -3,6 +3,7 @@ description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order x-resourceId: gift_card_transaction +type: object required: - gift_card_id - amount diff --git a/docs/api/store/components/schemas/idempotency_key.yaml b/docs/api/store/components/schemas/idempotency_key.yaml index ac4f6b63b7..9bff9c0f90 100644 --- a/docs/api/store/components/schemas/idempotency_key.yaml +++ b/docs/api/store/components/schemas/idempotency_key.yaml @@ -3,6 +3,7 @@ description: >- Idempotency Key is used to continue a process in case of any failure that might occur. x-resourceId: idempotency_key +type: object required: - idempotency_key properties: diff --git a/docs/api/store/components/schemas/image.yaml b/docs/api/store/components/schemas/image.yaml index 24bf973e75..61bc475c32 100644 --- a/docs/api/store/components/schemas/image.yaml +++ b/docs/api/store/components/schemas/image.yaml @@ -1,6 +1,7 @@ title: Image description: Images holds a reference to a URL at which the image file can be found. x-resourceId: image +type: object required: - url properties: diff --git a/docs/api/store/components/schemas/invite.yaml b/docs/api/store/components/schemas/invite.yaml index 492a71eeb2..aac3ce0b7f 100644 --- a/docs/api/store/components/schemas/invite.yaml +++ b/docs/api/store/components/schemas/invite.yaml @@ -1,6 +1,7 @@ title: Invite description: Represents an invite x-resourceId: invite +type: object required: - user_email properties: diff --git a/docs/api/store/components/schemas/line_item.yaml b/docs/api/store/components/schemas/line_item.yaml index cdb06694a9..ae9ed1eaa0 100644 --- a/docs/api/store/components/schemas/line_item.yaml +++ b/docs/api/store/components/schemas/line_item.yaml @@ -5,6 +5,7 @@ description: >- order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. x-resourceId: line_item +type: object required: - title - unit_price diff --git a/docs/api/store/components/schemas/line_item_adjustment.yaml b/docs/api/store/components/schemas/line_item_adjustment.yaml index 8ae889c8dc..677f69388a 100644 --- a/docs/api/store/components/schemas/line_item_adjustment.yaml +++ b/docs/api/store/components/schemas/line_item_adjustment.yaml @@ -1,6 +1,7 @@ title: Line Item Adjustment description: Represents an Line Item Adjustment x-resourceId: line_item_adjustment +type: object required: - item_id - description diff --git a/docs/api/store/components/schemas/line_item_tax_line.yaml b/docs/api/store/components/schemas/line_item_tax_line.yaml index 9320de67e3..b149f62d42 100644 --- a/docs/api/store/components/schemas/line_item_tax_line.yaml +++ b/docs/api/store/components/schemas/line_item_tax_line.yaml @@ -1,6 +1,7 @@ title: Line Item Tax Line description: Represents an Line Item Tax Line x-resourceId: line_item_tax_line +type: object required: - item_id - rate diff --git a/docs/api/store/components/schemas/money_amount.yaml b/docs/api/store/components/schemas/money_amount.yaml index f54d7e4a7a..929194a759 100644 --- a/docs/api/store/components/schemas/money_amount.yaml +++ b/docs/api/store/components/schemas/money_amount.yaml @@ -6,6 +6,7 @@ description: >- pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. x-resourceId: money_amount +type: object required: - currency_code - amount diff --git a/docs/api/store/components/schemas/multiple_errors.yaml b/docs/api/store/components/schemas/multiple_errors.yaml index 579282df2f..0327c94e70 100644 --- a/docs/api/store/components/schemas/multiple_errors.yaml +++ b/docs/api/store/components/schemas/multiple_errors.yaml @@ -1,5 +1,6 @@ title: Multiple Errors x-resourceId: multiple_errors +type: object properties: errors: type: array diff --git a/docs/api/store/components/schemas/note.yaml b/docs/api/store/components/schemas/note.yaml index 9333e49472..16f1e9fe50 100644 --- a/docs/api/store/components/schemas/note.yaml +++ b/docs/api/store/components/schemas/note.yaml @@ -3,6 +3,7 @@ description: >- Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. x-resourceId: note +type: object required: - value - resource_type diff --git a/docs/api/store/components/schemas/notification.yaml b/docs/api/store/components/schemas/notification.yaml index 559d58d79a..9db10fe27a 100644 --- a/docs/api/store/components/schemas/notification.yaml +++ b/docs/api/store/components/schemas/notification.yaml @@ -5,6 +5,7 @@ description: >- chronological timeline for communications sent to a Customer regarding an Order, and enables resends. x-resourceId: notification +type: object required: - resource_type - resource_id diff --git a/docs/api/store/components/schemas/notification_provider.yaml b/docs/api/store/components/schemas/notification_provider.yaml index 6ac490109f..dacf80d189 100644 --- a/docs/api/store/components/schemas/notification_provider.yaml +++ b/docs/api/store/components/schemas/notification_provider.yaml @@ -1,6 +1,7 @@ title: Notification Provider description: Represents a notification provider plugin and holds its installation status. x-resourceId: notification_provider +type: object required: - id properties: diff --git a/docs/api/store/components/schemas/notification_resend.yaml b/docs/api/store/components/schemas/notification_resend.yaml index c5cfe4431f..2b15999aa6 100644 --- a/docs/api/store/components/schemas/notification_resend.yaml +++ b/docs/api/store/components/schemas/notification_resend.yaml @@ -1,6 +1,7 @@ title: Notification Resend description: A resend of a Notification. x-resourceId: notification_resend +type: object properties: id: description: The notification resend's ID diff --git a/docs/api/store/components/schemas/order.yaml b/docs/api/store/components/schemas/order.yaml index 7371e85df9..464edc17fb 100644 --- a/docs/api/store/components/schemas/order.yaml +++ b/docs/api/store/components/schemas/order.yaml @@ -1,6 +1,7 @@ title: Order description: Represents an order x-resourceId: order +type: object required: - customer_id - email diff --git a/docs/api/store/components/schemas/order_edit.yaml b/docs/api/store/components/schemas/order_edit.yaml index 44e4a3f779..5574c2b6f2 100644 --- a/docs/api/store/components/schemas/order_edit.yaml +++ b/docs/api/store/components/schemas/order_edit.yaml @@ -1,6 +1,7 @@ title: Order Edit description: Order edit keeps track of order items changes. x-resourceId: order_edit +type: object required: - order_id - order diff --git a/docs/api/store/components/schemas/order_item_change.yaml b/docs/api/store/components/schemas/order_item_change.yaml index 70d61c83c3..9bc3b3a826 100644 --- a/docs/api/store/components/schemas/order_item_change.yaml +++ b/docs/api/store/components/schemas/order_item_change.yaml @@ -1,6 +1,7 @@ title: Order Item Change description: Represents an order edit item change x-resourceId: order_item_change +type: object required: - type - order_edit_id diff --git a/docs/api/store/components/schemas/payment.yaml b/docs/api/store/components/schemas/payment.yaml index 92294bd2e6..384e04b16c 100644 --- a/docs/api/store/components/schemas/payment.yaml +++ b/docs/api/store/components/schemas/payment.yaml @@ -3,6 +3,7 @@ description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. x-resourceId: payment +type: object required: - amount - currency_code diff --git a/docs/api/store/components/schemas/payment_collection.yaml b/docs/api/store/components/schemas/payment_collection.yaml index 315c62b475..3f5663b39a 100644 --- a/docs/api/store/components/schemas/payment_collection.yaml +++ b/docs/api/store/components/schemas/payment_collection.yaml @@ -1,6 +1,7 @@ title: Payment Collection description: Payment Collection x-resourceId: payment_collection +type: object required: - type - status @@ -26,12 +27,7 @@ properties: - awaiting - authorized - partially_authorized - - captured - - partially_captured - - refunded - - partially_refunded - canceled - - requires_action description: type: string description: Description of the payment collection @@ -41,12 +37,6 @@ properties: authorized_amount: type: number description: Authorized amount of the payment collection. - captured_amount: - type: number - description: Captured amount of the payment collection. - refunded_amount: - type: number - description: Refunded amount of the payment collection. region_id: type: string description: The region's ID diff --git a/docs/api/store/components/schemas/payment_provider.yaml b/docs/api/store/components/schemas/payment_provider.yaml index 7f39ed6355..081a6b7462 100644 --- a/docs/api/store/components/schemas/payment_provider.yaml +++ b/docs/api/store/components/schemas/payment_provider.yaml @@ -1,6 +1,7 @@ title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. x-resourceId: payment_provider +type: object required: - id properties: diff --git a/docs/api/store/components/schemas/payment_session.yaml b/docs/api/store/components/schemas/payment_session.yaml index c9f52a749b..ca8c513a26 100644 --- a/docs/api/store/components/schemas/payment_session.yaml +++ b/docs/api/store/components/schemas/payment_session.yaml @@ -7,6 +7,7 @@ description: >- get promoted to Payments to indicate that they are authorized for capture/refunds/etc. x-resourceId: payment_session +type: object required: - cart_id - provider_id diff --git a/docs/api/store/components/schemas/price_list.yaml b/docs/api/store/components/schemas/price_list.yaml index bae4d3936a..b774028314 100644 --- a/docs/api/store/components/schemas/price_list.yaml +++ b/docs/api/store/components/schemas/price_list.yaml @@ -3,6 +3,7 @@ description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. x-resourceId: price_list +type: object required: - name - description diff --git a/docs/api/store/components/schemas/product.yaml b/docs/api/store/components/schemas/product.yaml index 41bf53f444..e0116cc51d 100644 --- a/docs/api/store/components/schemas/product.yaml +++ b/docs/api/store/components/schemas/product.yaml @@ -4,6 +4,7 @@ description: >- as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. x-resourceId: product +type: object required: - title - profile_id diff --git a/docs/api/store/components/schemas/product_collection.yaml b/docs/api/store/components/schemas/product_collection.yaml index 711acc6c10..a3fd98cefb 100644 --- a/docs/api/store/components/schemas/product_collection.yaml +++ b/docs/api/store/components/schemas/product_collection.yaml @@ -1,6 +1,7 @@ title: Product Collection description: Product Collections represents a group of Products that are related. x-resourceId: product_collection +type: object required: - title properties: diff --git a/docs/api/store/components/schemas/product_option.yaml b/docs/api/store/components/schemas/product_option.yaml index 66fd46f4fd..aaaf0d58c1 100644 --- a/docs/api/store/components/schemas/product_option.yaml +++ b/docs/api/store/components/schemas/product_option.yaml @@ -4,6 +4,7 @@ description: >- a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. x-resourceId: product_option +type: object required: - title - product_id diff --git a/docs/api/store/components/schemas/product_option_value.yaml b/docs/api/store/components/schemas/product_option_value.yaml index 3b8606ea53..407e69a536 100644 --- a/docs/api/store/components/schemas/product_option_value.yaml +++ b/docs/api/store/components/schemas/product_option_value.yaml @@ -3,6 +3,7 @@ description: >- A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. x-resourceId: product_option_value +type: object required: - value - option_id diff --git a/docs/api/store/components/schemas/product_tag.yaml b/docs/api/store/components/schemas/product_tag.yaml index cdfa21d4ad..8240386ddf 100644 --- a/docs/api/store/components/schemas/product_tag.yaml +++ b/docs/api/store/components/schemas/product_tag.yaml @@ -1,6 +1,7 @@ title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. x-resourceId: product_tag +type: object required: - value properties: diff --git a/docs/api/store/components/schemas/product_tax_rate.yaml b/docs/api/store/components/schemas/product_tax_rate.yaml index f72e8896a8..db175e899d 100644 --- a/docs/api/store/components/schemas/product_tax_rate.yaml +++ b/docs/api/store/components/schemas/product_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a product to indicate that the product is taxed in a certain way x-resourceId: product_tax_rate +type: object required: - product_id - rate_id diff --git a/docs/api/store/components/schemas/product_type.yaml b/docs/api/store/components/schemas/product_type.yaml index e2be2bf920..b6e06d4190 100644 --- a/docs/api/store/components/schemas/product_type.yaml +++ b/docs/api/store/components/schemas/product_type.yaml @@ -1,6 +1,7 @@ title: Product Type description: Product Type can be added to Products for filtering and reporting purposes. x-resourceId: product_type +type: object required: - value properties: diff --git a/docs/api/store/components/schemas/product_type_tax_rate.yaml b/docs/api/store/components/schemas/product_type_tax_rate.yaml index 5bc7d5c302..48445a6b80 100644 --- a/docs/api/store/components/schemas/product_type_tax_rate.yaml +++ b/docs/api/store/components/schemas/product_type_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a product type to indicate that the product type is taxed in a certain way x-resourceId: product_type_tax_rate +type: object required: - product_type_id - rate_id diff --git a/docs/api/store/components/schemas/product_variant.yaml b/docs/api/store/components/schemas/product_variant.yaml index aa7386d615..a0cb2eacc9 100644 --- a/docs/api/store/components/schemas/product_variant.yaml +++ b/docs/api/store/components/schemas/product_variant.yaml @@ -4,6 +4,7 @@ description: >- configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. x-resourceId: product_variant +type: object required: - title - product_id diff --git a/docs/api/store/components/schemas/product_variant_prices_fields.yaml b/docs/api/store/components/schemas/product_variant_prices_fields.yaml index aefca848a0..aee4659828 100644 --- a/docs/api/store/components/schemas/product_variant_prices_fields.yaml +++ b/docs/api/store/components/schemas/product_variant_prices_fields.yaml @@ -1,6 +1,7 @@ title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. x-resourceId: product_variant_prices_fields +type: object properties: original_price: type: number diff --git a/docs/api/store/components/schemas/publishable_api_key.yaml b/docs/api/store/components/schemas/publishable_api_key.yaml new file mode 100644 index 0000000000..061b34b8c8 --- /dev/null +++ b/docs/api/store/components/schemas/publishable_api_key.yaml @@ -0,0 +1,37 @@ +title: Publishable API key +description: >- + Publishable API key defines scopes (i.e. resources) that are available within + a request. +x-resourceId: publishable_api_key +type: object +properties: + id: + type: string + description: The key's ID + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + type: string + description: The unique identifier of the user that created the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: A user object. Available if the relation `created_by_user` is expanded. + type: object + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + revoked_by: + type: string + description: The unique identifier of the user that revoked the key. + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by_user: + description: A user object. Available if the relation `revoked_by_user` is expanded. + type: object + revoked_at: + type: string + description: The date with timezone at which the key was revoked. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time diff --git a/docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml b/docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml new file mode 100644 index 0000000000..d0ab55c29a --- /dev/null +++ b/docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml @@ -0,0 +1,13 @@ +title: Publishable API key sales channel +description: Holds mapping between Publishable API keys and Sales Channels +x-resourceId: publishable_api_key_sales_channel +type: object +properties: + sales_channel_id: + type: string + description: The sales channel's ID + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + type: string + description: The publishable API key's ID + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 diff --git a/docs/api/store/components/schemas/refund.yaml b/docs/api/store/components/schemas/refund.yaml index c1fc4cfc0f..fae6a881f3 100644 --- a/docs/api/store/components/schemas/refund.yaml +++ b/docs/api/store/components/schemas/refund.yaml @@ -4,6 +4,7 @@ description: >- given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. x-resourceId: refund +type: object required: - order_id - amount diff --git a/docs/api/store/components/schemas/region.yaml b/docs/api/store/components/schemas/region.yaml index a2561dc892..15b245b470 100644 --- a/docs/api/store/components/schemas/region.yaml +++ b/docs/api/store/components/schemas/region.yaml @@ -5,6 +5,7 @@ description: >- consist of multiple countries to accomodate common shopping settings across countries. x-resourceId: region +type: object required: - name - currency_code diff --git a/docs/api/store/components/schemas/return.yaml b/docs/api/store/components/schemas/return.yaml index a475900106..7ba545dcdc 100644 --- a/docs/api/store/components/schemas/return.yaml +++ b/docs/api/store/components/schemas/return.yaml @@ -4,6 +4,7 @@ description: >- back, along with how the items will be returned. Returns can be used as part of a Swap. x-resourceId: return +type: object required: - refund_amount properties: diff --git a/docs/api/store/components/schemas/return_item.yaml b/docs/api/store/components/schemas/return_item.yaml index 3c45a35003..4ecc64bc8d 100644 --- a/docs/api/store/components/schemas/return_item.yaml +++ b/docs/api/store/components/schemas/return_item.yaml @@ -3,6 +3,7 @@ description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. x-resourceId: return_item +type: object required: - return_id - item_id diff --git a/docs/api/store/components/schemas/return_reason.yaml b/docs/api/store/components/schemas/return_reason.yaml index 7873cfc3f2..2e4d4d83ef 100644 --- a/docs/api/store/components/schemas/return_reason.yaml +++ b/docs/api/store/components/schemas/return_reason.yaml @@ -3,6 +3,7 @@ description: >- A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. x-resourceId: return_reason +type: object required: - value - label diff --git a/docs/api/store/components/schemas/sales_channel.yaml b/docs/api/store/components/schemas/sales_channel.yaml index 0523299105..7c4e1f2920 100644 --- a/docs/api/store/components/schemas/sales_channel.yaml +++ b/docs/api/store/components/schemas/sales_channel.yaml @@ -1,6 +1,7 @@ title: Sales Channel description: A Sales Channel x-resourceId: sales_channel +type: object required: - name properties: diff --git a/docs/api/store/components/schemas/shipping_method.yaml b/docs/api/store/components/schemas/shipping_method.yaml index d6a9601277..4ac18c8e93 100644 --- a/docs/api/store/components/schemas/shipping_method.yaml +++ b/docs/api/store/components/schemas/shipping_method.yaml @@ -5,6 +5,7 @@ description: >- details, that can be necessary for the Fulfillment Provider to handle the shipment. x-resourceId: shipping_method +type: object required: - shipping_option_id - price diff --git a/docs/api/store/components/schemas/shipping_method_tax_line.yaml b/docs/api/store/components/schemas/shipping_method_tax_line.yaml index cce7e8fddf..3387bfbfe2 100644 --- a/docs/api/store/components/schemas/shipping_method_tax_line.yaml +++ b/docs/api/store/components/schemas/shipping_method_tax_line.yaml @@ -1,6 +1,7 @@ title: Shipping Method Tax Line description: Shipping Method Tax Line x-resourceId: shipping_method_tax_line +type: object required: - shipping_method_id - rate diff --git a/docs/api/store/components/schemas/shipping_option.yaml b/docs/api/store/components/schemas/shipping_option.yaml index 108dbc5f14..a0e1c6538a 100644 --- a/docs/api/store/components/schemas/shipping_option.yaml +++ b/docs/api/store/components/schemas/shipping_option.yaml @@ -7,6 +7,7 @@ description: >- distinction makes it possible to customize individual Shipping Methods with additional information. x-resourceId: shipping_option +type: object required: - name - region_id diff --git a/docs/api/store/components/schemas/shipping_option_requirement.yaml b/docs/api/store/components/schemas/shipping_option_requirement.yaml index 559d21de44..57d9719312 100644 --- a/docs/api/store/components/schemas/shipping_option_requirement.yaml +++ b/docs/api/store/components/schemas/shipping_option_requirement.yaml @@ -3,6 +3,7 @@ description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. x-resourceId: shipping_option_requirement +type: object required: - shipping_option_id - type diff --git a/docs/api/store/components/schemas/shipping_profile.yaml b/docs/api/store/components/schemas/shipping_profile.yaml index cb55e4f134..ba479ece92 100644 --- a/docs/api/store/components/schemas/shipping_profile.yaml +++ b/docs/api/store/components/schemas/shipping_profile.yaml @@ -3,6 +3,7 @@ description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. x-resourceId: shipping_profile +type: object required: - name - type diff --git a/docs/api/store/components/schemas/shipping_tax_rate.yaml b/docs/api/store/components/schemas/shipping_tax_rate.yaml index ddf13f172a..30058a09af 100644 --- a/docs/api/store/components/schemas/shipping_tax_rate.yaml +++ b/docs/api/store/components/schemas/shipping_tax_rate.yaml @@ -3,6 +3,7 @@ description: >- Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way x-resourceId: shipping_tax_rate +type: object required: - shipping_option_id - rate_id diff --git a/docs/api/store/components/schemas/staged_job.yaml b/docs/api/store/components/schemas/staged_job.yaml index 95fd6aaf34..055ceaee0e 100644 --- a/docs/api/store/components/schemas/staged_job.yaml +++ b/docs/api/store/components/schemas/staged_job.yaml @@ -1,6 +1,7 @@ title: Staged Job description: A staged job resource x-resourceId: staged_job +type: object required: - event_name properties: diff --git a/docs/api/store/components/schemas/store.yaml b/docs/api/store/components/schemas/store.yaml index 09844ff155..98b90e81f4 100644 --- a/docs/api/store/components/schemas/store.yaml +++ b/docs/api/store/components/schemas/store.yaml @@ -1,6 +1,7 @@ title: Store description: Holds settings for the Store, such as name, currencies, etc. x-resourceId: store +type: object properties: id: type: string diff --git a/docs/api/store/components/schemas/swap.yaml b/docs/api/store/components/schemas/swap.yaml index e9f0397f64..31694ff199 100644 --- a/docs/api/store/components/schemas/swap.yaml +++ b/docs/api/store/components/schemas/swap.yaml @@ -8,6 +8,7 @@ description: >- amount to be paid for the new Products, a Refund will be issued for the difference. x-resourceId: swap +type: object required: - fulfillment_status - payment_status diff --git a/docs/api/store/components/schemas/tax_line.yaml b/docs/api/store/components/schemas/tax_line.yaml index 491a7e0c00..3faaf02eb7 100644 --- a/docs/api/store/components/schemas/tax_line.yaml +++ b/docs/api/store/components/schemas/tax_line.yaml @@ -1,6 +1,7 @@ title: Tax Line description: Line item that specifies an amount of tax to add to a line item. x-resourceId: tax_line +type: object required: - rate - name diff --git a/docs/api/store/components/schemas/tax_provider.yaml b/docs/api/store/components/schemas/tax_provider.yaml index 267d162eae..7f53c424a5 100644 --- a/docs/api/store/components/schemas/tax_provider.yaml +++ b/docs/api/store/components/schemas/tax_provider.yaml @@ -1,6 +1,7 @@ title: Tax Provider description: The tax service used to calculate taxes x-resourceId: tax_provider +type: object properties: id: description: The id of the tax provider as given by the plugin. diff --git a/docs/api/store/components/schemas/tax_rate.yaml b/docs/api/store/components/schemas/tax_rate.yaml index 29f7e0e0a9..cbe718652e 100644 --- a/docs/api/store/components/schemas/tax_rate.yaml +++ b/docs/api/store/components/schemas/tax_rate.yaml @@ -3,6 +3,7 @@ description: >- A Tax Rate can be used to associate a certain rate to charge on products within a given Region x-resourceId: line_item +type: object required: - name - region_id diff --git a/docs/api/store/components/schemas/tracking_link.yaml b/docs/api/store/components/schemas/tracking_link.yaml index 2a79689722..25867d8a97 100644 --- a/docs/api/store/components/schemas/tracking_link.yaml +++ b/docs/api/store/components/schemas/tracking_link.yaml @@ -4,6 +4,7 @@ description: >- Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. x-resourceId: tracking_link +type: object required: - tracking_number - fulfillment_id diff --git a/docs/api/store/components/schemas/user.yaml b/docs/api/store/components/schemas/user.yaml index 5083be44de..042cd46cb2 100644 --- a/docs/api/store/components/schemas/user.yaml +++ b/docs/api/store/components/schemas/user.yaml @@ -1,6 +1,7 @@ title: User description: Represents a User who can manage store settings. x-resourceId: user +type: object required: - email properties: diff --git a/docs/api/store/openapi.yaml b/docs/api/store/openapi.yaml index 399b57e9e8..e379327bc3 100644 --- a/docs/api/store/openapi.yaml +++ b/docs/api/store/openapi.yaml @@ -145,10 +145,6 @@ tags: servers: - url: https://api.medusa-commerce.com/store paths: - /auth: - $ref: paths/auth.yaml - /auth/{email}: - $ref: paths/auth_{email}.yaml /carts/{id}/shipping-methods: $ref: paths/carts_{id}_shipping-methods.yaml /carts/{id}/taxes: @@ -157,8 +153,6 @@ paths: $ref: paths/carts_{id}_complete.yaml /carts: $ref: paths/carts.yaml - /carts/{id}/line-items: - $ref: paths/carts_{id}_line-items.yaml /carts/{id}/payment-sessions: $ref: paths/carts_{id}_payment-sessions.yaml /carts/{id}/discounts/{code}: @@ -173,6 +167,8 @@ paths: $ref: paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml /carts/{id}/payment-session: $ref: paths/carts_{id}_payment-session.yaml + /gift-cards/{code}: + $ref: paths/gift-cards_{code}.yaml /collections/{id}: $ref: paths/collections_{id}.yaml /collections: @@ -193,20 +189,38 @@ paths: $ref: paths/customers_password-token.yaml /customers/password-reset: $ref: paths/customers_password-reset.yaml - /gift-cards/{code}: - $ref: paths/gift-cards_{code}.yaml /order-edits/{id}/complete: $ref: paths/order-edits_{id}_complete.yaml /order-edits/{id}/decline: $ref: paths/order-edits_{id}_decline.yaml /order-edits/{id}: $ref: paths/order-edits_{id}.yaml + /orders/customer/confirm: + $ref: paths/orders_customer_confirm.yaml /orders/cart/{cart_id}: $ref: paths/orders_cart_{cart_id}.yaml /orders/{id}: $ref: paths/orders_{id}.yaml /orders: $ref: paths/orders.yaml + /orders/batch/customer/token: + $ref: paths/orders_batch_customer_token.yaml + /payment-collections/{id}/sessions/batch/authorize: + $ref: paths/payment-collections_{id}_sessions_batch_authorize.yaml + /payment-collections/{id}/sessions/{session_id}/authorize: + $ref: paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml + /payment-collections/{id}: + $ref: paths/payment-collections_{id}.yaml + /payment-collections/{id}/sessions/batch: + $ref: paths/payment-collections_{id}_sessions_batch.yaml + /payment-collections/{id}/sessions: + $ref: paths/payment-collections_{id}_sessions.yaml + /payment-collections/{id}/sessions/{session_id}: + $ref: paths/payment-collections_{id}_sessions_{session_id}.yaml + /auth: + $ref: paths/auth.yaml + /auth/{email}: + $ref: paths/auth_{email}.yaml /product-types: $ref: paths/product-types.yaml /products/{id}: @@ -237,6 +251,8 @@ paths: $ref: paths/variants_{variant_id}.yaml /variants: $ref: paths/variants.yaml + /carts/{id}/line-items: + $ref: paths/carts_{id}_line-items.yaml components: securitySchemes: cookie_auth: diff --git a/docs/api/store/paths/auth.yaml b/docs/api/store/paths/auth.yaml index 952a6f0889..7b6fdd2ea1 100644 --- a/docs/api/store/paths/auth.yaml +++ b/docs/api/store/paths/auth.yaml @@ -22,6 +22,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -105,6 +106,7 @@ get: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/store/paths/auth_{email}.yaml b/docs/api/store/paths/auth_{email}.yaml index 3878176db8..ad5684422d 100644 --- a/docs/api/store/paths/auth_{email}.yaml +++ b/docs/api/store/paths/auth_{email}.yaml @@ -27,6 +27,7 @@ get: content: application/json: schema: + type: object properties: exists: type: boolean diff --git a/docs/api/store/paths/carts.yaml b/docs/api/store/paths/carts.yaml index a8c7080251..b11e8871e8 100644 --- a/docs/api/store/paths/carts.yaml +++ b/docs/api/store/paths/carts.yaml @@ -10,6 +10,7 @@ post: content: application/json: schema: + type: object properties: region_id: type: string @@ -69,6 +70,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}.yaml b/docs/api/store/paths/carts_{id}.yaml index abb581574e..760c22fda0 100644 --- a/docs/api/store/paths/carts_{id}.yaml +++ b/docs/api/store/paths/carts_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml @@ -54,6 +55,7 @@ post: content: application/json: schema: + type: object properties: region_id: type: string @@ -132,6 +134,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_complete.yaml b/docs/api/store/paths/carts_{id}_complete.yaml index 66d7d45c11..4baa7467ee 100644 --- a/docs/api/store/paths/carts_{id}_complete.yaml +++ b/docs/api/store/paths/carts_{id}_complete.yaml @@ -36,6 +36,7 @@ post: content: application/json: schema: + type: object properties: type: type: string diff --git a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml b/docs/api/store/paths/carts_{id}_discounts_{code}.yaml index cef6054108..2dd270334a 100644 --- a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml +++ b/docs/api/store/paths/carts_{id}_discounts_{code}.yaml @@ -32,6 +32,7 @@ delete: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_line-items.yaml b/docs/api/store/paths/carts_{id}_line-items.yaml index ea30d1c05e..4bee2a8f96 100644 --- a/docs/api/store/paths/carts_{id}_line-items.yaml +++ b/docs/api/store/paths/carts_{id}_line-items.yaml @@ -26,6 +26,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml b/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml index c5b99c0a8f..f33aaa5f89 100644 --- a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml +++ b/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml @@ -33,6 +33,7 @@ delete: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml @@ -81,6 +82,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_payment-session.yaml b/docs/api/store/paths/carts_{id}_payment-session.yaml index da3d34bb0f..f9d6a4167a 100644 --- a/docs/api/store/paths/carts_{id}_payment-session.yaml +++ b/docs/api/store/paths/carts_{id}_payment-session.yaml @@ -28,6 +28,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_payment-sessions.yaml b/docs/api/store/paths/carts_{id}_payment-sessions.yaml index 628eb3f95e..6a6aa6dd63 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions.yaml @@ -28,6 +28,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml index 2f1050b1aa..393b320eed 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml @@ -36,6 +36,7 @@ delete: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml @@ -85,6 +86,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml index 4b78d36e4e..cabc2984bc 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml @@ -38,6 +38,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_shipping-methods.yaml b/docs/api/store/paths/carts_{id}_shipping-methods.yaml index ec9a204346..0ddffc8c5a 100644 --- a/docs/api/store/paths/carts_{id}_shipping-methods.yaml +++ b/docs/api/store/paths/carts_{id}_shipping-methods.yaml @@ -26,6 +26,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/carts_{id}_taxes.yaml b/docs/api/store/paths/carts_{id}_taxes.yaml index e732ff5534..46a0cb4500 100644 --- a/docs/api/store/paths/carts_{id}_taxes.yaml +++ b/docs/api/store/paths/carts_{id}_taxes.yaml @@ -24,6 +24,7 @@ post: content: application/json: schema: + type: object properties: cart: $ref: ../components/schemas/cart.yaml diff --git a/docs/api/store/paths/collections.yaml b/docs/api/store/paths/collections.yaml index 01c5399c9a..19187417c3 100644 --- a/docs/api/store/paths/collections.yaml +++ b/docs/api/store/paths/collections.yaml @@ -78,6 +78,7 @@ get: content: application/json: schema: + type: object properties: collections: type: array diff --git a/docs/api/store/paths/collections_{id}.yaml b/docs/api/store/paths/collections_{id}.yaml index 91c2025ce1..ff523113e4 100644 --- a/docs/api/store/paths/collections_{id}.yaml +++ b/docs/api/store/paths/collections_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: collection: $ref: ../components/schemas/product_collection.yaml diff --git a/docs/api/store/paths/customers.yaml b/docs/api/store/paths/customers.yaml index ebdf37d9f1..370c6e6928 100644 --- a/docs/api/store/paths/customers.yaml +++ b/docs/api/store/paths/customers.yaml @@ -6,6 +6,7 @@ post: content: application/json: schema: + type: object required: - first_name - last_name @@ -46,6 +47,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -60,6 +62,7 @@ post: content: application/json: schema: + type: object properties: code: type: string diff --git a/docs/api/store/paths/customers_me.yaml b/docs/api/store/paths/customers_me.yaml index cb815e3453..5dfbcc2e8d 100644 --- a/docs/api/store/paths/customers_me.yaml +++ b/docs/api/store/paths/customers_me.yaml @@ -24,6 +24,7 @@ get: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -48,6 +49,7 @@ post: content: application/json: schema: + type: object properties: first_name: description: The Customer's first name. @@ -93,6 +95,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/store/paths/customers_me_addresses.yaml b/docs/api/store/paths/customers_me_addresses.yaml index f9b39fdd01..e31fb66186 100644 --- a/docs/api/store/paths/customers_me_addresses.yaml +++ b/docs/api/store/paths/customers_me_addresses.yaml @@ -7,6 +7,7 @@ post: content: application/json: schema: + type: object required: - address properties: @@ -41,6 +42,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml b/docs/api/store/paths/customers_me_addresses_{address_id}.yaml index 763000bbe6..0434b866da 100644 --- a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml +++ b/docs/api/store/paths/customers_me_addresses_{address_id}.yaml @@ -31,6 +31,7 @@ delete: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml @@ -85,6 +86,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/store/paths/customers_me_orders.yaml b/docs/api/store/paths/customers_me_orders.yaml index 9afb3808b9..377bccbfa1 100644 --- a/docs/api/store/paths/customers_me_orders.yaml +++ b/docs/api/store/paths/customers_me_orders.yaml @@ -187,6 +187,7 @@ get: content: application/json: schema: + type: object properties: orders: type: array diff --git a/docs/api/store/paths/customers_me_payment-methods.yaml b/docs/api/store/paths/customers_me_payment-methods.yaml index dee3d2d6d2..f038460c11 100644 --- a/docs/api/store/paths/customers_me_payment-methods.yaml +++ b/docs/api/store/paths/customers_me_payment-methods.yaml @@ -25,6 +25,7 @@ get: content: application/json: schema: + type: object properties: payment_methods: type: array diff --git a/docs/api/store/paths/customers_password-reset.yaml b/docs/api/store/paths/customers_password-reset.yaml index b27edcaf26..bee027f4c8 100644 --- a/docs/api/store/paths/customers_password-reset.yaml +++ b/docs/api/store/paths/customers_password-reset.yaml @@ -8,6 +8,7 @@ post: content: application/json: schema: + type: object required: - email - password @@ -41,6 +42,7 @@ post: content: application/json: schema: + type: object properties: customer: $ref: ../components/schemas/customer.yaml diff --git a/docs/api/store/paths/customers_password-token.yaml b/docs/api/store/paths/customers_password-token.yaml index 7866611941..2949cdd90f 100644 --- a/docs/api/store/paths/customers_password-token.yaml +++ b/docs/api/store/paths/customers_password-token.yaml @@ -9,6 +9,7 @@ post: content: application/json: schema: + type: object required: - email properties: diff --git a/docs/api/store/paths/gift-cards_{code}.yaml b/docs/api/store/paths/gift-cards_{code}.yaml index 896eb67b27..ce5748cb97 100644 --- a/docs/api/store/paths/gift-cards_{code}.yaml +++ b/docs/api/store/paths/gift-cards_{code}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: gift_card: $ref: ../components/schemas/gift_card.yaml diff --git a/docs/api/store/paths/order-edits_{id}.yaml b/docs/api/store/paths/order-edits_{id}.yaml index e983c1a575..90bf87fb43 100644 --- a/docs/api/store/paths/order-edits_{id}.yaml +++ b/docs/api/store/paths/order-edits_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/store/paths/order-edits_{id}_complete.yaml b/docs/api/store/paths/order-edits_{id}_complete.yaml index 08c3a38bdb..1ff4cf22b8 100644 --- a/docs/api/store/paths/order-edits_{id}_complete.yaml +++ b/docs/api/store/paths/order-edits_{id}_complete.yaml @@ -26,6 +26,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/store/paths/order-edits_{id}_decline.yaml b/docs/api/store/paths/order-edits_{id}_decline.yaml index 2cc3593a92..ce8907e40b 100644 --- a/docs/api/store/paths/order-edits_{id}_decline.yaml +++ b/docs/api/store/paths/order-edits_{id}_decline.yaml @@ -13,6 +13,7 @@ post: content: application/json: schema: + type: object properties: declined_reason: type: string @@ -34,6 +35,7 @@ post: content: application/json: schema: + type: object properties: order_edit: $ref: ../components/schemas/order_edit.yaml diff --git a/docs/api/store/paths/orders.yaml b/docs/api/store/paths/orders.yaml index c8149d9397..325ddb75b0 100644 --- a/docs/api/store/paths/orders.yaml +++ b/docs/api/store/paths/orders.yaml @@ -46,6 +46,7 @@ get: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/store/paths/orders_batch_customer_token.yaml b/docs/api/store/paths/orders_batch_customer_token.yaml new file mode 100644 index 0000000000..945eb8412f --- /dev/null +++ b/docs/api/store/paths/orders_batch_customer_token.yaml @@ -0,0 +1,47 @@ +post: + operationId: PostOrdersCustomerOrderClaim + summary: Claim orders for signed in account + description: >- + Sends an email to emails registered to orders provided with link to transfer + order ownership + requestBody: + content: + application/json: + schema: + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/orders_batch_customer_token/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/orders_batch_customer_token/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + 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 diff --git a/docs/api/store/paths/orders_cart_{cart_id}.yaml b/docs/api/store/paths/orders_cart_{cart_id}.yaml index f75d7ec5b5..2250a041ce 100644 --- a/docs/api/store/paths/orders_cart_{cart_id}.yaml +++ b/docs/api/store/paths/orders_cart_{cart_id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/store/paths/orders_customer_confirm.yaml b/docs/api/store/paths/orders_customer_confirm.yaml new file mode 100644 index 0000000000..d841d7f5a0 --- /dev/null +++ b/docs/api/store/paths/orders_customer_confirm.yaml @@ -0,0 +1,45 @@ +post: + operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept + summary: Verify a claim to orders + description: >- + Verifies the claim order token provided to the customer upon request of + order ownership + requestBody: + content: + application/json: + schema: + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/orders_customer_confirm/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/orders_customer_confirm/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + 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 diff --git a/docs/api/store/paths/orders_{id}.yaml b/docs/api/store/paths/orders_{id}.yaml index 7a325d5a76..347273607a 100644 --- a/docs/api/store/paths/orders_{id}.yaml +++ b/docs/api/store/paths/orders_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: order: $ref: ../components/schemas/order.yaml diff --git a/docs/api/store/paths/payment-collections_{id}.yaml b/docs/api/store/paths/payment-collections_{id}.yaml new file mode 100644 index 0000000000..6876ea93ee --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}.yaml @@ -0,0 +1,58 @@ +get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Retrieve an PaymentCollection + description: Retrieves a PaymentCollection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/payment-collections_{id}/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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/docs/api/store/paths/payment-collections_{id}_sessions.yaml b/docs/api/store/paths/payment-collections_{id}_sessions.yaml new file mode 100644 index 0000000000..a18f5574f7 --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}_sessions.yaml @@ -0,0 +1,58 @@ +post: + operationId: PostPaymentCollectionsSessions + summary: Manage Payment Sessions from Payment Collections + description: Manages Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_sessions/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/payment-collections_{id}_sessions/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml new file mode 100644 index 0000000000..93c0ec4593 --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml @@ -0,0 +1,74 @@ +post: + operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch + summary: Manage Multiple Payment Sessions from Payment Collections + description: Manages Multiple Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + sessions: + description: >- + An array of payment sessions related to the Payment Collection. + If the session_id is not provided, existing sessions not present + will be deleted and the provided ones will be created. + type: array + items: + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml new file mode 100644 index 0000000000..3442c8640a --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml @@ -0,0 +1,59 @@ +post: + operationId: PostPaymentCollectionsSessionsBatchAuthorize + summary: Authorize Payment Sessions of a Payment Collection + description: Authorizes Payment Sessions of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + session_ids: + description: List of Payment Session IDs to authorize. + type: array + items: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: ../components/schemas/payment_collection.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/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml new file mode 100644 index 0000000000..460ad245e7 --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml @@ -0,0 +1,68 @@ +post: + operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the Payment + Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The id of the PaymentCollection. + schema: + type: string + - in: path + name: session_id + required: true + description: The id of the Payment Session to be refreshed. + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + - customer_id + properties: + provider_id: + description: The Payment Provider id. + type: string + customer_id: + description: The Customer id. + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_session: + $ref: ../components/schemas/payment_session.yaml + '400': + $ref: ../components/responses/400_error.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/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml new file mode 100644 index 0000000000..34e6dc23e1 --- /dev/null +++ b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml @@ -0,0 +1,55 @@ +post: + operationId: PostPaymentCollectionsSessionsSessionAuthorize + summary: Authorize a Payment Session of a Payment Collection + description: Authorizes a Payment Session of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + - in: path + name: session_id + required: true + description: The ID of the Payment Session. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_session: + $ref: ../components/schemas/payment_session.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/docs/api/store/paths/product-types.yaml b/docs/api/store/paths/product-types.yaml index 8de545f6f4..00a5779158 100644 --- a/docs/api/store/paths/product-types.yaml +++ b/docs/api/store/paths/product-types.yaml @@ -113,6 +113,7 @@ get: content: application/json: schema: + type: object properties: product_types: $ref: ../components/schemas/product_type.yaml diff --git a/docs/api/store/paths/products.yaml b/docs/api/store/paths/products.yaml index 9ee4789003..9d542519be 100644 --- a/docs/api/store/paths/products.yaml +++ b/docs/api/store/paths/products.yaml @@ -164,6 +164,7 @@ get: content: application/json: schema: + type: object properties: products: type: array diff --git a/docs/api/store/paths/products_search.yaml b/docs/api/store/paths/products_search.yaml index 3510f063d9..4c3b865030 100644 --- a/docs/api/store/paths/products_search.yaml +++ b/docs/api/store/paths/products_search.yaml @@ -36,6 +36,7 @@ post: content: application/json: schema: + type: object properties: hits: type: array diff --git a/docs/api/store/paths/products_{id}.yaml b/docs/api/store/paths/products_{id}.yaml index 5c84a67c8d..f5f090d682 100644 --- a/docs/api/store/paths/products_{id}.yaml +++ b/docs/api/store/paths/products_{id}.yaml @@ -50,6 +50,7 @@ get: content: application/json: schema: + type: object properties: product: allOf: diff --git a/docs/api/store/paths/regions.yaml b/docs/api/store/paths/regions.yaml index 54a8b669c6..aac1328eb4 100644 --- a/docs/api/store/paths/regions.yaml +++ b/docs/api/store/paths/regions.yaml @@ -76,6 +76,7 @@ get: content: application/json: schema: + type: object properties: regions: type: array diff --git a/docs/api/store/paths/regions_{id}.yaml b/docs/api/store/paths/regions_{id}.yaml index 6657ab4270..1c3c016a5c 100644 --- a/docs/api/store/paths/regions_{id}.yaml +++ b/docs/api/store/paths/regions_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: region: $ref: ../components/schemas/region.yaml diff --git a/docs/api/store/paths/return-reasons.yaml b/docs/api/store/paths/return-reasons.yaml index b7e2f66cfd..65109419c5 100644 --- a/docs/api/store/paths/return-reasons.yaml +++ b/docs/api/store/paths/return-reasons.yaml @@ -19,6 +19,7 @@ get: content: application/json: schema: + type: object properties: return_reasons: type: array diff --git a/docs/api/store/paths/return-reasons_{id}.yaml b/docs/api/store/paths/return-reasons_{id}.yaml index 8553da42e8..47ce85648e 100644 --- a/docs/api/store/paths/return-reasons_{id}.yaml +++ b/docs/api/store/paths/return-reasons_{id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: return_reason: $ref: ../components/schemas/return_reason.yaml diff --git a/docs/api/store/paths/returns.yaml b/docs/api/store/paths/returns.yaml index 1681832a2f..448553452f 100644 --- a/docs/api/store/paths/returns.yaml +++ b/docs/api/store/paths/returns.yaml @@ -6,6 +6,7 @@ post: content: application/json: schema: + type: object required: - order_id - items @@ -64,6 +65,7 @@ post: content: application/json: schema: + type: object properties: return: $ref: ../components/schemas/return.yaml diff --git a/docs/api/store/paths/shipping-options.yaml b/docs/api/store/paths/shipping-options.yaml index 326921f80d..0f6cb8c9a6 100644 --- a/docs/api/store/paths/shipping-options.yaml +++ b/docs/api/store/paths/shipping-options.yaml @@ -37,6 +37,7 @@ get: content: application/json: schema: + type: object properties: shipping_options: type: array diff --git a/docs/api/store/paths/shipping-options_{cart_id}.yaml b/docs/api/store/paths/shipping-options_{cart_id}.yaml index 71efdfa01e..409adecec6 100644 --- a/docs/api/store/paths/shipping-options_{cart_id}.yaml +++ b/docs/api/store/paths/shipping-options_{cart_id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: shipping_options: type: array diff --git a/docs/api/store/paths/swaps.yaml b/docs/api/store/paths/swaps.yaml index 39bbdd3fc5..a0f6784147 100644 --- a/docs/api/store/paths/swaps.yaml +++ b/docs/api/store/paths/swaps.yaml @@ -8,6 +8,7 @@ post: content: application/json: schema: + type: object required: - order_id - return_items @@ -72,6 +73,7 @@ post: content: application/json: schema: + type: object properties: swap: $ref: ../components/schemas/swap.yaml diff --git a/docs/api/store/paths/swaps_{cart_id}.yaml b/docs/api/store/paths/swaps_{cart_id}.yaml index 0b8201608d..59611a4b0c 100644 --- a/docs/api/store/paths/swaps_{cart_id}.yaml +++ b/docs/api/store/paths/swaps_{cart_id}.yaml @@ -26,6 +26,7 @@ get: content: application/json: schema: + type: object properties: swap: $ref: ../components/schemas/swap.yaml diff --git a/docs/api/store/paths/variants.yaml b/docs/api/store/paths/variants.yaml index f4f6f213d3..968c25d3bd 100644 --- a/docs/api/store/paths/variants.yaml +++ b/docs/api/store/paths/variants.yaml @@ -75,6 +75,7 @@ get: content: application/json: schema: + type: object properties: variants: type: array diff --git a/docs/api/store/paths/variants_{variant_id}.yaml b/docs/api/store/paths/variants_{variant_id}.yaml index 9611568690..b632807cee 100644 --- a/docs/api/store/paths/variants_{variant_id}.yaml +++ b/docs/api/store/paths/variants_{variant_id}.yaml @@ -42,6 +42,7 @@ get: content: application/json: schema: + type: object properties: variant: allOf: