@mercurjs/docs 2.2.0-canary.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/content/blocks.mdx +209 -0
- package/content/learn/architecture.mdx +215 -0
- package/content/learn/attributes.mdx +89 -0
- package/content/learn/blocks.mdx +99 -0
- package/content/learn/commissions.mdx +175 -0
- package/content/learn/concepts.mdx +84 -0
- package/content/learn/installation.mdx +117 -0
- package/content/learn/introduction.mdx +71 -0
- package/content/learn/offers.mdx +78 -0
- package/content/learn/order-groups.mdx +114 -0
- package/content/learn/payouts.mdx +175 -0
- package/content/learn/product-requests.mdx +82 -0
- package/content/learn/products.mdx +79 -0
- package/content/learn/registry.mdx +155 -0
- package/content/learn/seller-members.mdx +62 -0
- package/content/learn/sellers.mdx +118 -0
- package/content/migration/from-1-x-to-2-0.mdx +152 -0
- package/content/migration/from-2-0-to-2-1.mdx +105 -0
- package/content/migration/overview.mdx +58 -0
- package/content/references/api/admin/commission-rates/batch-commission-rules.mdx +70 -0
- package/content/references/api/admin/commission-rates/create-commission-rate.mdx +95 -0
- package/content/references/api/admin/commission-rates/delete-commission-rate.mdx +40 -0
- package/content/references/api/admin/commission-rates/list-commission-rates.mdx +92 -0
- package/content/references/api/admin/commission-rates/retrieve-commission-rate.mdx +70 -0
- package/content/references/api/admin/commission-rates/update-commission-rate.mdx +84 -0
- package/content/references/api/admin/members/list-members.mdx +61 -0
- package/content/references/api/admin/offers/batch-create-offers.mdx +130 -0
- package/content/references/api/admin/offers/delete-offer.mdx +40 -0
- package/content/references/api/admin/offers/list-offers.mdx +106 -0
- package/content/references/api/admin/offers/retrieve-offer.mdx +82 -0
- package/content/references/api/admin/order-groups/list-order-groups.mdx +77 -0
- package/content/references/api/admin/order-groups/retrieve-order-group.mdx +56 -0
- package/content/references/api/admin/orders/get-order-commission-lines.mdx +65 -0
- package/content/references/api/admin/orders/get-order-order-group.mdx +56 -0
- package/content/references/api/admin/orders/list-orders.mdx +79 -0
- package/content/references/api/admin/payouts/list-payouts.mdx +75 -0
- package/content/references/api/admin/payouts/retrieve-payout.mdx +62 -0
- package/content/references/api/admin/product-attributes/create-attribute-value.mdx +76 -0
- package/content/references/api/admin/product-attributes/create-product-attribute.mdx +99 -0
- package/content/references/api/admin/product-attributes/delete-attribute-value.mdx +52 -0
- package/content/references/api/admin/product-attributes/delete-product-attribute.mdx +40 -0
- package/content/references/api/admin/product-attributes/list-product-attributes.mdx +91 -0
- package/content/references/api/admin/product-attributes/retrieve-product-attribute.mdx +81 -0
- package/content/references/api/admin/product-attributes/update-attribute-value.mdx +66 -0
- package/content/references/api/admin/product-attributes/update-product-attribute.mdx +76 -0
- package/content/references/api/admin/product-changes/cancel-product-change.mdx +68 -0
- package/content/references/api/admin/product-changes/confirm-product-change.mdx +47 -0
- package/content/references/api/admin/products/batch-product-attributes.mdx +96 -0
- package/content/references/api/admin/products/confirm-product.mdx +59 -0
- package/content/references/api/admin/products/create-product-variant.mdx +78 -0
- package/content/references/api/admin/products/create-product.mdx +169 -0
- package/content/references/api/admin/products/delete-product-variant.mdx +48 -0
- package/content/references/api/admin/products/delete-product.mdx +40 -0
- package/content/references/api/admin/products/list-product-variants.mdx +91 -0
- package/content/references/api/admin/products/list-products.mdx +109 -0
- package/content/references/api/admin/products/preview-product.mdx +78 -0
- package/content/references/api/admin/products/reject-product.mdx +59 -0
- package/content/references/api/admin/products/request-product-changes.mdx +59 -0
- package/content/references/api/admin/products/retrieve-product-variant.mdx +73 -0
- package/content/references/api/admin/products/retrieve-product.mdx +96 -0
- package/content/references/api/admin/products/set-product-sellers.mdx +47 -0
- package/content/references/api/admin/products/update-product-variant.mdx +89 -0
- package/content/references/api/admin/products/update-product.mdx +133 -0
- package/content/references/api/admin/sellers/add-seller-member.mdx +63 -0
- package/content/references/api/admin/sellers/approve-seller.mdx +54 -0
- package/content/references/api/admin/sellers/create-seller.mdx +100 -0
- package/content/references/api/admin/sellers/delete-member-invite.mdx +42 -0
- package/content/references/api/admin/sellers/delete-professional-details.mdx +52 -0
- package/content/references/api/admin/sellers/invite-seller-member.mdx +63 -0
- package/content/references/api/admin/sellers/list-member-invites.mdx +71 -0
- package/content/references/api/admin/sellers/list-seller-members.mdx +71 -0
- package/content/references/api/admin/sellers/list-seller-products.mdx +85 -0
- package/content/references/api/admin/sellers/list-sellers.mdx +96 -0
- package/content/references/api/admin/sellers/remove-seller-member.mdx +42 -0
- package/content/references/api/admin/sellers/resend-member-invite.mdx +55 -0
- package/content/references/api/admin/sellers/retrieve-seller.mdx +81 -0
- package/content/references/api/admin/sellers/suspend-seller.mdx +60 -0
- package/content/references/api/admin/sellers/terminate-seller.mdx +60 -0
- package/content/references/api/admin/sellers/unsuspend-seller.mdx +52 -0
- package/content/references/api/admin/sellers/unterminate-seller.mdx +52 -0
- package/content/references/api/admin/sellers/update-seller.mdx +83 -0
- package/content/references/api/admin/sellers/upsert-payment-details.mdx +88 -0
- package/content/references/api/admin/sellers/upsert-professional-details.mdx +78 -0
- package/content/references/api/admin/sellers/upsert-seller-address.mdx +91 -0
- package/content/references/api/admin.mdx +134 -0
- package/content/references/api/conventions.mdx +109 -0
- package/content/references/api/store/carts/add-line-item.mdx +115 -0
- package/content/references/api/store/carts/add-shipping-methods.mdx +84 -0
- package/content/references/api/store/carts/apply-promotions.mdx +83 -0
- package/content/references/api/store/carts/complete-cart.mdx +98 -0
- package/content/references/api/store/offers/list-offers.mdx +161 -0
- package/content/references/api/store/offers/retrieve-offer.mdx +112 -0
- package/content/references/api/store/order-groups/list-order-groups.mdx +105 -0
- package/content/references/api/store/order-groups/retrieve-order-group.mdx +78 -0
- package/content/references/api/store/product-attributes/list-product-attributes.mdx +134 -0
- package/content/references/api/store/product-attributes/retrieve-product-attribute.mdx +78 -0
- package/content/references/api/store/product-categories/list-product-categories.mdx +126 -0
- package/content/references/api/store/product-categories/retrieve-product-category.mdx +79 -0
- package/content/references/api/store/products/list-products.mdx +184 -0
- package/content/references/api/store/products/retrieve-product.mdx +107 -0
- package/content/references/api/store/search/search.mdx +136 -0
- package/content/references/api/store/sellers/list-sellers.mdx +105 -0
- package/content/references/api/store/sellers/retrieve-seller.mdx +62 -0
- package/content/references/api/store/shipping-options/list-shipping-options.mdx +74 -0
- package/content/references/api/store.mdx +67 -0
- package/content/references/api/vendor/members/accept-member-invite.mdx +65 -0
- package/content/references/api/vendor/members/retrieve-current-member.mdx +51 -0
- package/content/references/api/vendor/members/update-current-member.mdx +70 -0
- package/content/references/api/vendor/offers/batch-create-offers.mdx +123 -0
- package/content/references/api/vendor/offers/batch-offer-inventory-items.mdx +103 -0
- package/content/references/api/vendor/offers/create-offer.mdx +141 -0
- package/content/references/api/vendor/offers/delete-offer.mdx +51 -0
- package/content/references/api/vendor/offers/list-offers.mdx +125 -0
- package/content/references/api/vendor/offers/retrieve-offer.mdx +74 -0
- package/content/references/api/vendor/offers/update-offer.mdx +82 -0
- package/content/references/api/vendor/orders/cancel-fulfillment.mdx +63 -0
- package/content/references/api/vendor/orders/cancel-order.mdx +56 -0
- package/content/references/api/vendor/orders/complete-order.mdx +55 -0
- package/content/references/api/vendor/orders/create-fulfillment.mdx +76 -0
- package/content/references/api/vendor/orders/create-shipment.mdx +99 -0
- package/content/references/api/vendor/orders/get-order-commission-lines.mdx +66 -0
- package/content/references/api/vendor/orders/list-order-changes.mdx +75 -0
- package/content/references/api/vendor/orders/list-orders.mdx +103 -0
- package/content/references/api/vendor/orders/mark-fulfillment-delivered.mdx +62 -0
- package/content/references/api/vendor/orders/preview-order.mdx +65 -0
- package/content/references/api/vendor/orders/retrieve-order.mdx +84 -0
- package/content/references/api/vendor/payout-accounts/create-onboarding.mdx +68 -0
- package/content/references/api/vendor/payout-accounts/create-payout-account.mdx +59 -0
- package/content/references/api/vendor/payout-accounts/retrieve-payout-account-by-id.mdx +60 -0
- package/content/references/api/vendor/payout-accounts/retrieve-payout-account.mdx +77 -0
- package/content/references/api/vendor/payouts/list-payouts.mdx +90 -0
- package/content/references/api/vendor/payouts/retrieve-payout.mdx +63 -0
- package/content/references/api/vendor/product-attributes/list-product-attributes.mdx +135 -0
- package/content/references/api/vendor/product-attributes/retrieve-product-attribute.mdx +71 -0
- package/content/references/api/vendor/product-variants/list-variants.mdx +136 -0
- package/content/references/api/vendor/products/batch-product-attributes.mdx +104 -0
- package/content/references/api/vendor/products/cancel-product-change.mdx +62 -0
- package/content/references/api/vendor/products/create-product-variant.mdx +92 -0
- package/content/references/api/vendor/products/create-product.mdx +197 -0
- package/content/references/api/vendor/products/delete-product-variant.mdx +68 -0
- package/content/references/api/vendor/products/delete-product.mdx +62 -0
- package/content/references/api/vendor/products/list-product-variants.mdx +114 -0
- package/content/references/api/vendor/products/list-products.mdx +163 -0
- package/content/references/api/vendor/products/preview-product.mdx +61 -0
- package/content/references/api/vendor/products/retrieve-product-variant.mdx +76 -0
- package/content/references/api/vendor/products/retrieve-product.mdx +69 -0
- package/content/references/api/vendor/products/update-product-variant.mdx +104 -0
- package/content/references/api/vendor/products/update-product.mdx +148 -0
- package/content/references/api/vendor/sellers/create-seller.mdx +150 -0
- package/content/references/api/vendor/sellers/delete-professional-details.mdx +54 -0
- package/content/references/api/vendor/sellers/invite-seller-member.mdx +67 -0
- package/content/references/api/vendor/sellers/list-member-invites.mdx +82 -0
- package/content/references/api/vendor/sellers/list-seller-members.mdx +80 -0
- package/content/references/api/vendor/sellers/list-sellers.mdx +71 -0
- package/content/references/api/vendor/sellers/remove-seller-member.mdx +48 -0
- package/content/references/api/vendor/sellers/retrieve-current-seller-member.mdx +59 -0
- package/content/references/api/vendor/sellers/retrieve-current-seller.mdx +69 -0
- package/content/references/api/vendor/sellers/select-seller.mdx +44 -0
- package/content/references/api/vendor/sellers/update-current-seller.mdx +108 -0
- package/content/references/api/vendor/sellers/update-member-role.mdx +51 -0
- package/content/references/api/vendor/sellers/upsert-payment-details.mdx +74 -0
- package/content/references/api/vendor/sellers/upsert-professional-details.mdx +70 -0
- package/content/references/api/vendor/sellers/upsert-seller-address.mdx +81 -0
- package/content/references/api/vendor.mdx +150 -0
- package/content/references/configuration.mdx +155 -0
- package/content/references/modules/commission.mdx +106 -0
- package/content/references/modules/custom-fields.mdx +45 -0
- package/content/references/modules/media.mdx +55 -0
- package/content/references/modules/offer.mdx +64 -0
- package/content/references/modules/payout.mdx +121 -0
- package/content/references/modules/product-attribute.mdx +111 -0
- package/content/references/modules/product-edit.mdx +80 -0
- package/content/references/modules/search.mdx +112 -0
- package/content/references/modules/seller.mdx +175 -0
- package/content/references/overview.mdx +70 -0
- package/content/references/workflows/cart/add-seller-shipping-method-to-cart.mdx +44 -0
- package/content/references/workflows/cart/complete-cart-with-split-orders.mdx +36 -0
- package/content/references/workflows/cart/list-seller-shipping-options-for-cart.mdx +39 -0
- package/content/references/workflows/cart/update-cart-seller-promotions.mdx +42 -0
- package/content/references/workflows/commission/batch-commission-rules.mdx +45 -0
- package/content/references/workflows/commission/create-commission-rates.mdx +41 -0
- package/content/references/workflows/commission/delete-commission-rates.mdx +34 -0
- package/content/references/workflows/commission/refresh-order-commission-lines.mdx +30 -0
- package/content/references/workflows/commission/update-commission-rates.mdx +35 -0
- package/content/references/workflows/media/set-category-images.mdx +41 -0
- package/content/references/workflows/media/set-collection-images.mdx +41 -0
- package/content/references/workflows/member/accept-member-invite.mdx +33 -0
- package/content/references/workflows/member/add-seller-member.mdx +30 -0
- package/content/references/workflows/member/create-member-invites.mdx +34 -0
- package/content/references/workflows/member/delete-member-invite.mdx +24 -0
- package/content/references/workflows/member/remove-seller-member.mdx +28 -0
- package/content/references/workflows/member/resend-member-invite.mdx +28 -0
- package/content/references/workflows/member/update-member-role.mdx +28 -0
- package/content/references/workflows/member/update-member.mdx +35 -0
- package/content/references/workflows/offer/batch-offer-inventory-items.mdx +58 -0
- package/content/references/workflows/offer/create-offers.mdx +63 -0
- package/content/references/workflows/offer/delete-offers.mdx +35 -0
- package/content/references/workflows/offer/update-offers.mdx +51 -0
- package/content/references/workflows/order/cancel-order-fulfillment.mdx +34 -0
- package/content/references/workflows/order/confirm-claim-request.mdx +25 -0
- package/content/references/workflows/order/confirm-exchange-request.mdx +25 -0
- package/content/references/workflows/order/confirm-order-edit-request.mdx +25 -0
- package/content/references/workflows/order/confirm-return-receive.mdx +25 -0
- package/content/references/workflows/order/create-order-fulfillment.mdx +45 -0
- package/content/references/workflows/order-group/get-order-group-detail.mdx +29 -0
- package/content/references/workflows/order-group/get-order-groups-list.mdx +36 -0
- package/content/references/workflows/overview.mdx +72 -0
- package/content/references/workflows/payout/create-onboarding.mdx +36 -0
- package/content/references/workflows/payout/create-payout-account.mdx +33 -0
- package/content/references/workflows/payout/create-payout.mdx +30 -0
- package/content/references/workflows/payout/process-payout-for-webhook.mdx +32 -0
- package/content/references/workflows/product/confirm-products.mdx +46 -0
- package/content/references/workflows/product/create-products.mdx +63 -0
- package/content/references/workflows/product/link-sellers-to-product-category.mdx +40 -0
- package/content/references/workflows/product/link-sellers-to-product.mdx +40 -0
- package/content/references/workflows/product/reject-product.mdx +46 -0
- package/content/references/workflows/product/request-product-change.mdx +46 -0
- package/content/references/workflows/product-attribute/add-product-attributes-to-product.mdx +49 -0
- package/content/references/workflows/product-attribute/create-and-link-product-attributes-to-product.mdx +46 -0
- package/content/references/workflows/product-attribute/create-product-attribute-values.mdx +43 -0
- package/content/references/workflows/product-attribute/create-product-attributes.mdx +56 -0
- package/content/references/workflows/product-attribute/delete-product-attribute-values.mdx +30 -0
- package/content/references/workflows/product-attribute/delete-product-attributes.mdx +30 -0
- package/content/references/workflows/product-attribute/remove-product-attributes-from-product.mdx +29 -0
- package/content/references/workflows/product-attribute/update-product-attribute-values.mdx +44 -0
- package/content/references/workflows/product-attribute/update-product-attributes-on-product.mdx +41 -0
- package/content/references/workflows/product-attribute/update-product-attributes.mdx +48 -0
- package/content/references/workflows/product-attribute/upsert-product-attribute-values.mdx +43 -0
- package/content/references/workflows/product-edit/auto-confirm-product-change.mdx +39 -0
- package/content/references/workflows/product-edit/cancel-product-change.mdx +49 -0
- package/content/references/workflows/product-edit/confirm-product-change.mdx +57 -0
- package/content/references/workflows/product-edit/create-product-change.mdx +72 -0
- package/content/references/workflows/product-edit/reject-product-change.mdx +54 -0
- package/content/references/workflows/product-edit/stage-product-change.mdx +75 -0
- package/content/references/workflows/seller/approve-seller.mdx +34 -0
- package/content/references/workflows/seller/create-seller-account.mdx +59 -0
- package/content/references/workflows/seller/create-seller-defaults.mdx +22 -0
- package/content/references/workflows/seller/create-sellers.mdx +65 -0
- package/content/references/workflows/seller/delete-seller-professional-details.mdx +37 -0
- package/content/references/workflows/seller/delete-sellers.mdx +24 -0
- package/content/references/workflows/seller/invite-seller.mdx +28 -0
- package/content/references/workflows/seller/suspend-seller.mdx +35 -0
- package/content/references/workflows/seller/terminate-seller.mdx +35 -0
- package/content/references/workflows/seller/unsuspend-seller.mdx +34 -0
- package/content/references/workflows/seller/unterminate-seller.mdx +34 -0
- package/content/references/workflows/seller/update-seller-address.mdx +55 -0
- package/content/references/workflows/seller/update-seller-payment-details.mdx +52 -0
- package/content/references/workflows/seller/update-seller-professional-details.mdx +48 -0
- package/content/references/workflows/seller/update-sellers.mdx +57 -0
- package/content/resources/ai/llms.mdx +74 -0
- package/content/resources/ai/mcp.mdx +152 -0
- package/content/resources/ai/overview.mdx +97 -0
- package/content/resources/customization/custom-fields.mdx +182 -0
- package/content/resources/customization/extend-a-workflow.mdx +39 -0
- package/content/resources/customization/extending-panels.mdx +309 -0
- package/content/resources/deployment/medusa-cloud.mdx +167 -0
- package/content/resources/integrations/notifications.mdx +39 -0
- package/content/resources/integrations/search.mdx +122 -0
- package/content/resources/integrations/stripe-connect.mdx +395 -0
- package/content/resources/tutorials/add-a-block.mdx +74 -0
- package/content/resources/tutorials/attributes-and-variant-axes.mdx +111 -0
- package/content/resources/tutorials/build-a-block.mdx +134 -0
- package/content/resources/tutorials/configure-commissions.mdx +127 -0
- package/content/resources/tutorials/custom-api-route.mdx +142 -0
- package/content/resources/tutorials/custom-panel-page.mdx +78 -0
- package/content/resources/tutorials/first-marketplace.mdx +45 -0
- package/content/resources/tutorials/handle-product-requests.mdx +80 -0
- package/content/resources/tutorials/import-export-products.mdx +96 -0
- package/content/resources/tutorials/master-products-and-offers.mdx +89 -0
- package/content/resources/tutorials/recompose-a-page.mdx +129 -0
- package/content/resources/tutorials/replace-panel-components.mdx +116 -0
- package/content/resources/tutorials/seller-payouts-stripe.mdx +89 -0
- package/content/telemetry.mdx +67 -0
- package/content/tools/api-client.mdx +155 -0
- package/content/tools/cli.mdx +196 -0
- package/content/tools/dashboard-sdk.mdx +35 -0
- package/content/user-guide/admin/overview.mdx +23 -0
- package/content/user-guide/admin/stores.mdx +193 -0
- package/content/user-guide/vendor/overview.mdx +23 -0
- package/content/user-guide/vendor/stores.mdx +209 -0
- package/llms.txt +307 -0
- package/package.json +33 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Retrieve Order Group"
|
|
3
|
+
api: "GET /admin/order-groups/{id}"
|
|
4
|
+
description: "Retrieve an order group by ID."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Returns a single order group.
|
|
8
|
+
|
|
9
|
+
## Path parameters
|
|
10
|
+
|
|
11
|
+
<ParamField path="id" type="string" required>The order group's ID.</ParamField>
|
|
12
|
+
|
|
13
|
+
## Query parameters
|
|
14
|
+
|
|
15
|
+
<ParamField query="fields" type="string">Comma-separated fields to include in the response.</ParamField>
|
|
16
|
+
|
|
17
|
+
## Response
|
|
18
|
+
|
|
19
|
+
<ResponseField name="order_group" type="object">
|
|
20
|
+
<Expandable title="properties">
|
|
21
|
+
<ResponseField name="id" type="string">The order group's ID.</ResponseField>
|
|
22
|
+
<ResponseField name="customer_id" type="string">ID of the customer who placed the order.</ResponseField>
|
|
23
|
+
<ResponseField name="seller_count" type="number">Number of sellers in the group.</ResponseField>
|
|
24
|
+
<ResponseField name="total" type="number">The group's total amount.</ResponseField>
|
|
25
|
+
<ResponseField name="created_at" type="string">Creation timestamp.</ResponseField>
|
|
26
|
+
<ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
|
|
27
|
+
</Expandable>
|
|
28
|
+
</ResponseField>
|
|
29
|
+
|
|
30
|
+
<RequestExample>
|
|
31
|
+
```bash cURL
|
|
32
|
+
curl 'http://localhost:9000/admin/order-groups/og_01HXYZ8Q2M4N6P8R0T2V4W6X8Y' \
|
|
33
|
+
-H 'Authorization: Bearer <token>'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```ts JS Client
|
|
37
|
+
const { order_group } = await client.admin.orderGroups.$id.query({
|
|
38
|
+
$id: "og_01HXYZ8Q2M4N6P8R0T2V4W6X8Y",
|
|
39
|
+
})
|
|
40
|
+
```
|
|
41
|
+
</RequestExample>
|
|
42
|
+
|
|
43
|
+
<ResponseExample>
|
|
44
|
+
```json 200
|
|
45
|
+
{
|
|
46
|
+
"order_group": {
|
|
47
|
+
"id": "og_01HXYZ8Q2M4N6P8R0T2V4W6X8Y",
|
|
48
|
+
"customer_id": "cus_01HXYZ",
|
|
49
|
+
"seller_count": 2,
|
|
50
|
+
"total": 7400,
|
|
51
|
+
"created_at": "2026-06-01T10:00:00.000Z",
|
|
52
|
+
"updated_at": "2026-06-01T10:00:00.000Z"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
</ResponseExample>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Get Order Commission Lines"
|
|
3
|
+
api: "GET /admin/orders/{id}/commission-lines"
|
|
4
|
+
description: "Retrieve the commission lines calculated for an order."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Returns the commission lines applied to an order's items and shipping methods.
|
|
8
|
+
|
|
9
|
+
## Path parameters
|
|
10
|
+
|
|
11
|
+
<ParamField path="id" type="string" required>The order's ID.</ParamField>
|
|
12
|
+
|
|
13
|
+
## Response
|
|
14
|
+
|
|
15
|
+
<ResponseField name="commission_lines" type="object[]">
|
|
16
|
+
<Expandable title="properties">
|
|
17
|
+
<ResponseField name="id" type="string">The commission line's ID.</ResponseField>
|
|
18
|
+
<ResponseField name="item_id" type="string | null">ID of the order item the line applies to.</ResponseField>
|
|
19
|
+
<ResponseField name="shipping_method_id" type="string | null">ID of the shipping method the line applies to.</ResponseField>
|
|
20
|
+
<ResponseField name="commission_rate_id" type="string | null">ID of the commission rate that produced the line.</ResponseField>
|
|
21
|
+
<ResponseField name="code" type="string">Code of the applied commission rate.</ResponseField>
|
|
22
|
+
<ResponseField name="rate" type="number">The applied commission rate value.</ResponseField>
|
|
23
|
+
<ResponseField name="amount" type="number">The calculated commission amount.</ResponseField>
|
|
24
|
+
<ResponseField name="description" type="string | null">Optional description of the line.</ResponseField>
|
|
25
|
+
<ResponseField name="created_at" type="string">Creation timestamp.</ResponseField>
|
|
26
|
+
<ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
|
|
27
|
+
</Expandable>
|
|
28
|
+
</ResponseField>
|
|
29
|
+
<ResponseField name="count" type="number">Number of commission lines on the order.</ResponseField>
|
|
30
|
+
|
|
31
|
+
<RequestExample>
|
|
32
|
+
```bash cURL
|
|
33
|
+
curl 'http://localhost:9000/admin/orders/order_01HXYZ8Q2M4N6P8R0T2V4W6X8Y/commission-lines' \
|
|
34
|
+
-H 'Authorization: Bearer <token>'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```ts JS Client
|
|
38
|
+
const { commission_lines, count } =
|
|
39
|
+
await client.admin.orders.$id.commissionLines.query({
|
|
40
|
+
$id: "order_01HXYZ8Q2M4N6P8R0T2V4W6X8Y",
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
</RequestExample>
|
|
44
|
+
|
|
45
|
+
<ResponseExample>
|
|
46
|
+
```json 200
|
|
47
|
+
{
|
|
48
|
+
"commission_lines": [
|
|
49
|
+
{
|
|
50
|
+
"id": "comline_01HXYZ8Q2M4N6P8R0T2V4W6X8Y",
|
|
51
|
+
"item_id": "ordli_01HXYZ",
|
|
52
|
+
"shipping_method_id": null,
|
|
53
|
+
"commission_rate_id": "comrate_01HXYZ",
|
|
54
|
+
"code": "default",
|
|
55
|
+
"rate": 10,
|
|
56
|
+
"amount": 490,
|
|
57
|
+
"description": null,
|
|
58
|
+
"created_at": "2026-06-01T10:00:00.000Z",
|
|
59
|
+
"updated_at": "2026-06-01T10:00:00.000Z"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"count": 1
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
</ResponseExample>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Get Order's Order Group"
|
|
3
|
+
api: "GET /admin/orders/{id}/order-group"
|
|
4
|
+
description: "Retrieve the order group a specific order belongs to."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Looks up the order group containing the given order and returns its details. Responds with `404` if the order is not part of any group.
|
|
8
|
+
|
|
9
|
+
## Path parameters
|
|
10
|
+
|
|
11
|
+
<ParamField path="id" type="string" required>The order's ID.</ParamField>
|
|
12
|
+
|
|
13
|
+
## Query parameters
|
|
14
|
+
|
|
15
|
+
<ParamField query="fields" type="string">Comma-separated fields to include in the response.</ParamField>
|
|
16
|
+
|
|
17
|
+
## Response
|
|
18
|
+
|
|
19
|
+
<ResponseField name="order_group" type="object">
|
|
20
|
+
<Expandable title="properties">
|
|
21
|
+
<ResponseField name="id" type="string">The order group's ID.</ResponseField>
|
|
22
|
+
<ResponseField name="customer_id" type="string">ID of the customer who placed the order.</ResponseField>
|
|
23
|
+
<ResponseField name="seller_count" type="number">Number of sellers in the group.</ResponseField>
|
|
24
|
+
<ResponseField name="total" type="number">The group's total amount.</ResponseField>
|
|
25
|
+
<ResponseField name="created_at" type="string">Creation timestamp.</ResponseField>
|
|
26
|
+
<ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
|
|
27
|
+
</Expandable>
|
|
28
|
+
</ResponseField>
|
|
29
|
+
|
|
30
|
+
<RequestExample>
|
|
31
|
+
```bash cURL
|
|
32
|
+
curl 'http://localhost:9000/admin/orders/order_01HXYZ8Q2M4N6P8R0T2V4W6X8Y/order-group' \
|
|
33
|
+
-H 'Authorization: Bearer <token>'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```ts JS Client
|
|
37
|
+
const { order_group } = await client.admin.orders.$id.orderGroup.query({
|
|
38
|
+
$id: "order_01HXYZ8Q2M4N6P8R0T2V4W6X8Y",
|
|
39
|
+
})
|
|
40
|
+
```
|
|
41
|
+
</RequestExample>
|
|
42
|
+
|
|
43
|
+
<ResponseExample>
|
|
44
|
+
```json 200
|
|
45
|
+
{
|
|
46
|
+
"order_group": {
|
|
47
|
+
"id": "og_01HXYZ8Q2M4N6P8R0T2V4W6X8Y",
|
|
48
|
+
"customer_id": "cus_01HXYZ",
|
|
49
|
+
"seller_count": 2,
|
|
50
|
+
"total": 7400,
|
|
51
|
+
"created_at": "2026-06-01T10:00:00.000Z",
|
|
52
|
+
"updated_at": "2026-06-01T10:00:00.000Z"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
</ResponseExample>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "List Orders"
|
|
3
|
+
api: "GET /admin/orders"
|
|
4
|
+
description: "Retrieve a paginated list of orders across all sellers."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Returns orders platform-wide. Mercur extends the standard Medusa endpoint with `seller_id` and `name` filters.
|
|
8
|
+
|
|
9
|
+
## Query parameters
|
|
10
|
+
|
|
11
|
+
<ParamField query="limit" type="number" default="15">Maximum number of records to return.</ParamField>
|
|
12
|
+
<ParamField query="offset" type="number" default="0">Number of records to skip.</ParamField>
|
|
13
|
+
<ParamField query="order" type="string">Field to sort by, prefix with `-` for descending order.</ParamField>
|
|
14
|
+
<ParamField query="fields" type="string">Comma-separated fields to include in the response.</ParamField>
|
|
15
|
+
<ParamField query="q" type="string">Search term matched against orders.</ParamField>
|
|
16
|
+
<ParamField query="id" type="string | string[]">Filter by order ID(s).</ParamField>
|
|
17
|
+
<ParamField query="status" type="string | string[]">Filter by order status.</ParamField>
|
|
18
|
+
<ParamField query="seller_id" type="string | string[]">Filter to orders belonging to the given seller(s).</ParamField>
|
|
19
|
+
<ParamField query="name" type="string | string[]">Filter by order name(s).</ParamField>
|
|
20
|
+
<ParamField query="sales_channel_id" type="string[]">Filter by sales channel IDs.</ParamField>
|
|
21
|
+
<ParamField query="region_id" type="string | string[]">Filter by region ID(s).</ParamField>
|
|
22
|
+
<ParamField query="customer_id" type="string | string[]">Filter by customer ID(s).</ParamField>
|
|
23
|
+
<ParamField query="total" type="object">Filter by order total using operators like `$gte` and `$lte`.</ParamField>
|
|
24
|
+
<ParamField query="created_at" type="object">Filter by creation date using operators like `$gte` and `$lte`.</ParamField>
|
|
25
|
+
<ParamField query="updated_at" type="object">Filter by update date using operators like `$gte` and `$lte`.</ParamField>
|
|
26
|
+
|
|
27
|
+
## Response
|
|
28
|
+
|
|
29
|
+
<ResponseField name="orders" type="object[]">
|
|
30
|
+
<Expandable title="properties">
|
|
31
|
+
<ResponseField name="id" type="string">The order's ID.</ResponseField>
|
|
32
|
+
<ResponseField name="display_id" type="number">Human-readable order number.</ResponseField>
|
|
33
|
+
<ResponseField name="status" type="string">The order's status.</ResponseField>
|
|
34
|
+
<ResponseField name="currency_code" type="string">The order's currency.</ResponseField>
|
|
35
|
+
<ResponseField name="total" type="number">The order's total amount.</ResponseField>
|
|
36
|
+
<ResponseField name="customer_id" type="string">ID of the customer who placed the order.</ResponseField>
|
|
37
|
+
<ResponseField name="created_at" type="string">Creation timestamp.</ResponseField>
|
|
38
|
+
<ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
|
|
39
|
+
</Expandable>
|
|
40
|
+
</ResponseField>
|
|
41
|
+
<ResponseField name="count" type="number">Total number of matching orders.</ResponseField>
|
|
42
|
+
<ResponseField name="offset" type="number">Number of records skipped.</ResponseField>
|
|
43
|
+
<ResponseField name="limit" type="number">Maximum number of records returned.</ResponseField>
|
|
44
|
+
|
|
45
|
+
<RequestExample>
|
|
46
|
+
```bash cURL
|
|
47
|
+
curl 'http://localhost:9000/admin/orders?seller_id=sel_01HXYZ&limit=20' \
|
|
48
|
+
-H 'Authorization: Bearer <token>'
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```ts JS Client
|
|
52
|
+
const { orders, count } = await client.admin.orders.query({
|
|
53
|
+
seller_id: "sel_01HXYZ",
|
|
54
|
+
limit: 20,
|
|
55
|
+
})
|
|
56
|
+
```
|
|
57
|
+
</RequestExample>
|
|
58
|
+
|
|
59
|
+
<ResponseExample>
|
|
60
|
+
```json 200
|
|
61
|
+
{
|
|
62
|
+
"orders": [
|
|
63
|
+
{
|
|
64
|
+
"id": "order_01HXYZ8Q2M4N6P8R0T2V4W6X8Y",
|
|
65
|
+
"display_id": 128,
|
|
66
|
+
"status": "pending",
|
|
67
|
+
"currency_code": "usd",
|
|
68
|
+
"total": 4900,
|
|
69
|
+
"customer_id": "cus_01HXYZ",
|
|
70
|
+
"created_at": "2026-06-01T10:00:00.000Z",
|
|
71
|
+
"updated_at": "2026-06-01T10:00:00.000Z"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"count": 1,
|
|
75
|
+
"offset": 0,
|
|
76
|
+
"limit": 20
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
</ResponseExample>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "List Payouts"
|
|
3
|
+
api: "GET /admin/payouts"
|
|
4
|
+
description: "Retrieve a paginated list of payouts across all sellers."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Returns payouts with their payout account and seller details.
|
|
8
|
+
|
|
9
|
+
## Query parameters
|
|
10
|
+
|
|
11
|
+
<ParamField query="limit" type="number" default="50">Maximum number of records to return.</ParamField>
|
|
12
|
+
<ParamField query="offset" type="number" default="0">Number of records to skip.</ParamField>
|
|
13
|
+
<ParamField query="order" type="string">Field to sort by, prefix with `-` for descending order.</ParamField>
|
|
14
|
+
<ParamField query="fields" type="string">Comma-separated fields to include in the response.</ParamField>
|
|
15
|
+
<ParamField query="id" type="string | string[]">Filter by payout ID(s).</ParamField>
|
|
16
|
+
<ParamField query="status" type="string | string[]">Filter by payout status.</ParamField>
|
|
17
|
+
<ParamField query="account_id" type="string | string[]">Filter by payout account ID(s).</ParamField>
|
|
18
|
+
<ParamField query="created_at" type="object">Filter by creation date using operators like `$gte` and `$lte`.</ParamField>
|
|
19
|
+
<ParamField query="updated_at" type="object">Filter by update date using operators like `$gte` and `$lte`.</ParamField>
|
|
20
|
+
|
|
21
|
+
## Response
|
|
22
|
+
|
|
23
|
+
<ResponseField name="payouts" type="object[]">
|
|
24
|
+
<Expandable title="properties">
|
|
25
|
+
<ResponseField name="id" type="string">The payout's ID.</ResponseField>
|
|
26
|
+
<ResponseField name="display_id" type="number">Human-readable payout number.</ResponseField>
|
|
27
|
+
<ResponseField name="amount" type="number">The payout amount.</ResponseField>
|
|
28
|
+
<ResponseField name="currency_code" type="string">The payout currency.</ResponseField>
|
|
29
|
+
<ResponseField name="status" type="string">The payout status.</ResponseField>
|
|
30
|
+
<ResponseField name="data" type="object | null">Provider-specific payout data.</ResponseField>
|
|
31
|
+
<ResponseField name="account" type="object">The payout account, with `id` and `status`.</ResponseField>
|
|
32
|
+
<ResponseField name="seller" type="object">The seller, with `id`, `name`, and `handle`.</ResponseField>
|
|
33
|
+
<ResponseField name="created_at" type="string">Creation timestamp.</ResponseField>
|
|
34
|
+
<ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
|
|
35
|
+
</Expandable>
|
|
36
|
+
</ResponseField>
|
|
37
|
+
<ResponseField name="count" type="number">Total number of matching payouts.</ResponseField>
|
|
38
|
+
<ResponseField name="offset" type="number">Number of records skipped.</ResponseField>
|
|
39
|
+
<ResponseField name="limit" type="number">Maximum number of records returned.</ResponseField>
|
|
40
|
+
|
|
41
|
+
<RequestExample>
|
|
42
|
+
```bash cURL
|
|
43
|
+
curl 'http://localhost:9000/admin/payouts?status=completed&limit=20' \
|
|
44
|
+
-H 'Authorization: Bearer <token>'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```ts JS Client
|
|
48
|
+
const { payouts, count } = await client.admin.payouts.query({
|
|
49
|
+
status: "completed",
|
|
50
|
+
limit: 20,
|
|
51
|
+
})
|
|
52
|
+
```
|
|
53
|
+
</RequestExample>
|
|
54
|
+
|
|
55
|
+
<ResponseExample>
|
|
56
|
+
```json 200
|
|
57
|
+
{
|
|
58
|
+
"payouts": [
|
|
59
|
+
{
|
|
60
|
+
"id": "pout_01HXYZ8Q2M4N6P8R0T2V4W6X8Y",
|
|
61
|
+
"display_id": 42,
|
|
62
|
+
"amount": 1250,
|
|
63
|
+
"currency_code": "usd",
|
|
64
|
+
"status": "completed",
|
|
65
|
+
"data": null,
|
|
66
|
+
"account": { "id": "pacc_01HXYZ", "status": "active" },
|
|
67
|
+
"seller": { "id": "sel_01HXYZ", "name": "Acme Store", "handle": "acme-store" }
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"count": 1,
|
|
71
|
+
"offset": 0,
|
|
72
|
+
"limit": 20
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
</ResponseExample>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Retrieve Payout"
|
|
3
|
+
api: "GET /admin/payouts/{id}"
|
|
4
|
+
description: "Retrieve a payout by ID."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Returns a single payout with its payout account and seller details.
|
|
8
|
+
|
|
9
|
+
## Path parameters
|
|
10
|
+
|
|
11
|
+
<ParamField path="id" type="string" required>The payout's ID.</ParamField>
|
|
12
|
+
|
|
13
|
+
## Query parameters
|
|
14
|
+
|
|
15
|
+
<ParamField query="fields" type="string">Comma-separated fields to include in the response.</ParamField>
|
|
16
|
+
|
|
17
|
+
## Response
|
|
18
|
+
|
|
19
|
+
<ResponseField name="payout" type="object">
|
|
20
|
+
<Expandable title="properties">
|
|
21
|
+
<ResponseField name="id" type="string">The payout's ID.</ResponseField>
|
|
22
|
+
<ResponseField name="display_id" type="number">Human-readable payout number.</ResponseField>
|
|
23
|
+
<ResponseField name="amount" type="number">The payout amount.</ResponseField>
|
|
24
|
+
<ResponseField name="currency_code" type="string">The payout currency.</ResponseField>
|
|
25
|
+
<ResponseField name="status" type="string">The payout status.</ResponseField>
|
|
26
|
+
<ResponseField name="data" type="object | null">Provider-specific payout data.</ResponseField>
|
|
27
|
+
<ResponseField name="account" type="object">The payout account, with `id` and `status`.</ResponseField>
|
|
28
|
+
<ResponseField name="seller" type="object">The seller, with `id`, `name`, and `handle`.</ResponseField>
|
|
29
|
+
<ResponseField name="created_at" type="string">Creation timestamp.</ResponseField>
|
|
30
|
+
<ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
|
|
31
|
+
</Expandable>
|
|
32
|
+
</ResponseField>
|
|
33
|
+
|
|
34
|
+
<RequestExample>
|
|
35
|
+
```bash cURL
|
|
36
|
+
curl 'http://localhost:9000/admin/payouts/pout_01HXYZ8Q2M4N6P8R0T2V4W6X8Y' \
|
|
37
|
+
-H 'Authorization: Bearer <token>'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```ts JS Client
|
|
41
|
+
const { payout } = await client.admin.payouts.$id.query({
|
|
42
|
+
$id: "pout_01HXYZ8Q2M4N6P8R0T2V4W6X8Y",
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
</RequestExample>
|
|
46
|
+
|
|
47
|
+
<ResponseExample>
|
|
48
|
+
```json 200
|
|
49
|
+
{
|
|
50
|
+
"payout": {
|
|
51
|
+
"id": "pout_01HXYZ8Q2M4N6P8R0T2V4W6X8Y",
|
|
52
|
+
"display_id": 42,
|
|
53
|
+
"amount": 1250,
|
|
54
|
+
"currency_code": "usd",
|
|
55
|
+
"status": "completed",
|
|
56
|
+
"data": null,
|
|
57
|
+
"account": { "id": "pacc_01HXYZ", "status": "active" },
|
|
58
|
+
"seller": { "id": "sel_01HXYZ", "name": "Acme Store", "handle": "acme-store" }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
</ResponseExample>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Upsert Attribute Values"
|
|
3
|
+
api: "POST /admin/product-attributes/{id}/values"
|
|
4
|
+
description: "Create or update values on a product attribute."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Upserts the given values on the attribute — items with an `id` update an existing value, items without one create a new value.
|
|
8
|
+
|
|
9
|
+
## Path parameters
|
|
10
|
+
|
|
11
|
+
<ParamField path="id" type="string" required>The attribute's ID.</ParamField>
|
|
12
|
+
|
|
13
|
+
## Body parameters
|
|
14
|
+
|
|
15
|
+
<ParamField body="values" type="object[]" required>
|
|
16
|
+
Values to create or update — one of two shapes per item.
|
|
17
|
+
<Expandable title="update existing value (by id)">
|
|
18
|
+
<ParamField body="id" type="string" required>The value's ID.</ParamField>
|
|
19
|
+
<ParamField body="name" type="string">Value name.</ParamField>
|
|
20
|
+
<ParamField body="handle" type="string">Unique URL-safe handle.</ParamField>
|
|
21
|
+
<ParamField body="rank" type="number">Sort rank; must be non-negative.</ParamField>
|
|
22
|
+
<ParamField body="is_active" type="boolean">Whether the value is active.</ParamField>
|
|
23
|
+
<ParamField body="metadata" type="object">Custom key-value data.</ParamField>
|
|
24
|
+
</Expandable>
|
|
25
|
+
<Expandable title="create new value (by name)">
|
|
26
|
+
<ParamField body="name" type="string" required>Value name.</ParamField>
|
|
27
|
+
<ParamField body="handle" type="string">Unique URL-safe handle.</ParamField>
|
|
28
|
+
<ParamField body="rank" type="number">Sort rank; must be non-negative.</ParamField>
|
|
29
|
+
<ParamField body="is_active" type="boolean">Whether the value is active.</ParamField>
|
|
30
|
+
<ParamField body="metadata" type="object">Custom key-value data.</ParamField>
|
|
31
|
+
</Expandable>
|
|
32
|
+
</ParamField>
|
|
33
|
+
|
|
34
|
+
## Response
|
|
35
|
+
|
|
36
|
+
<ResponseField name="product_attribute" type="object">
|
|
37
|
+
<Expandable title="properties">
|
|
38
|
+
<ResponseField name="id" type="string">The attribute's ID.</ResponseField>
|
|
39
|
+
<ResponseField name="name" type="string">Attribute name.</ResponseField>
|
|
40
|
+
<ResponseField name="type" type="string">The attribute's type.</ResponseField>
|
|
41
|
+
<ResponseField name="values" type="object[]">All values after the upsert, with `id`, `name`, `handle`, `rank`, and `is_active`.</ResponseField>
|
|
42
|
+
<ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
|
|
43
|
+
</Expandable>
|
|
44
|
+
</ResponseField>
|
|
45
|
+
|
|
46
|
+
<RequestExample>
|
|
47
|
+
```bash cURL
|
|
48
|
+
curl -X POST 'http://localhost:9000/admin/product-attributes/pattr_01HXYZABCDEF/values' \
|
|
49
|
+
-H 'Authorization: Bearer <token>' \
|
|
50
|
+
-H 'Content-Type: application/json' \
|
|
51
|
+
-d '{"values": [{ "name": "Wool" }, { "id": "pattrval_01HXYZABCDEF", "rank": 1 }]}'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```ts JS Client
|
|
55
|
+
const { product_attribute } = await client.admin.productAttributes.$id.values.mutate({
|
|
56
|
+
$id: "pattr_01HXYZABCDEF",
|
|
57
|
+
values: [{ name: "Wool" }, { id: "pattrval_01HXYZABCDEF", rank: 1 }],
|
|
58
|
+
})
|
|
59
|
+
```
|
|
60
|
+
</RequestExample>
|
|
61
|
+
|
|
62
|
+
<ResponseExample>
|
|
63
|
+
```json 200
|
|
64
|
+
{
|
|
65
|
+
"product_attribute": {
|
|
66
|
+
"id": "pattr_01HXYZABCDEF",
|
|
67
|
+
"name": "Material",
|
|
68
|
+
"type": "single_select",
|
|
69
|
+
"values": [
|
|
70
|
+
{ "id": "pattrval_01HXYZABCDEG", "name": "Wool", "rank": 0 },
|
|
71
|
+
{ "id": "pattrval_01HXYZABCDEF", "name": "Linen", "rank": 1 }
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
</ResponseExample>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Create Product Attribute"
|
|
3
|
+
api: "POST /admin/product-attributes"
|
|
4
|
+
description: "Create a catalog product attribute."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Creates a shared attribute that products across the catalog can use.
|
|
8
|
+
|
|
9
|
+
<Note>
|
|
10
|
+
`is_variant_axis` is only valid for `multi_select` attributes — axis attributes provide the value sets that variants are generated from.
|
|
11
|
+
</Note>
|
|
12
|
+
|
|
13
|
+
## Body parameters
|
|
14
|
+
|
|
15
|
+
<ParamField body="name" type="string" required>Attribute name.</ParamField>
|
|
16
|
+
<ParamField body="type" type="string" required>One of `single_select`, `multi_select`, `unit`, `toggle`, `text`.</ParamField>
|
|
17
|
+
<ParamField body="handle" type="string">Unique URL-safe handle, generated from the name if omitted.</ParamField>
|
|
18
|
+
<ParamField body="description" type="string">Attribute description.</ParamField>
|
|
19
|
+
<ParamField body="is_required" type="boolean">Whether a value is required on products.</ParamField>
|
|
20
|
+
<ParamField body="is_filterable" type="boolean">Whether the attribute can be used as a storefront filter.</ParamField>
|
|
21
|
+
<ParamField body="is_variant_axis" type="boolean">Whether the attribute drives variant generation; only valid for `multi_select`.</ParamField>
|
|
22
|
+
<ParamField body="rank" type="number">Sort rank of the attribute; must be non-negative.</ParamField>
|
|
23
|
+
<ParamField body="is_active" type="boolean">Whether the attribute is active.</ParamField>
|
|
24
|
+
<ParamField body="category_ids" type="string[]">IDs of categories to link the attribute to; omit for a global attribute.</ParamField>
|
|
25
|
+
<ParamField body="values" type="object[]">
|
|
26
|
+
Initial attribute values for select types.
|
|
27
|
+
<Expandable title="properties">
|
|
28
|
+
<ParamField body="name" type="string" required>Value name.</ParamField>
|
|
29
|
+
<ParamField body="handle" type="string">Unique URL-safe handle.</ParamField>
|
|
30
|
+
<ParamField body="rank" type="number">Sort rank; must be non-negative.</ParamField>
|
|
31
|
+
<ParamField body="is_active" type="boolean">Whether the value is active.</ParamField>
|
|
32
|
+
<ParamField body="metadata" type="object">Custom key-value data.</ParamField>
|
|
33
|
+
</Expandable>
|
|
34
|
+
</ParamField>
|
|
35
|
+
<ParamField body="metadata" type="object">Custom key-value data.</ParamField>
|
|
36
|
+
<ParamField body="additional_data" type="object">Custom data passed to workflow hooks.</ParamField>
|
|
37
|
+
|
|
38
|
+
## Response
|
|
39
|
+
|
|
40
|
+
<ResponseField name="product_attribute" type="object">
|
|
41
|
+
<Expandable title="properties">
|
|
42
|
+
<ResponseField name="id" type="string">The attribute's ID.</ResponseField>
|
|
43
|
+
<ResponseField name="name" type="string">Attribute name.</ResponseField>
|
|
44
|
+
<ResponseField name="handle" type="string">Unique URL-safe handle.</ResponseField>
|
|
45
|
+
<ResponseField name="type" type="string">One of `single_select`, `multi_select`, `unit`, `toggle`, `text`.</ResponseField>
|
|
46
|
+
<ResponseField name="is_required" type="boolean">Whether a value is required on products.</ResponseField>
|
|
47
|
+
<ResponseField name="is_filterable" type="boolean">Whether the attribute can be used as a storefront filter.</ResponseField>
|
|
48
|
+
<ResponseField name="is_variant_axis" type="boolean">Whether the attribute drives variant generation.</ResponseField>
|
|
49
|
+
<ResponseField name="is_active" type="boolean">Whether the attribute is active.</ResponseField>
|
|
50
|
+
<ResponseField name="values" type="object[]">The attribute's values.</ResponseField>
|
|
51
|
+
<ResponseField name="categories" type="object[]">Linked categories with `id`, `name`, and `handle`.</ResponseField>
|
|
52
|
+
<ResponseField name="created_at" type="string">Creation timestamp.</ResponseField>
|
|
53
|
+
<ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
|
|
54
|
+
</Expandable>
|
|
55
|
+
</ResponseField>
|
|
56
|
+
|
|
57
|
+
<RequestExample>
|
|
58
|
+
```bash cURL
|
|
59
|
+
curl -X POST 'http://localhost:9000/admin/product-attributes' \
|
|
60
|
+
-H 'Authorization: Bearer <token>' \
|
|
61
|
+
-H 'Content-Type: application/json' \
|
|
62
|
+
-d '{
|
|
63
|
+
"name": "Material",
|
|
64
|
+
"type": "single_select",
|
|
65
|
+
"is_filterable": true,
|
|
66
|
+
"values": [{ "name": "Linen" }, { "name": "Cotton" }]
|
|
67
|
+
}'
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```ts JS Client
|
|
71
|
+
const { product_attribute } = await client.admin.productAttributes.mutate({
|
|
72
|
+
name: "Material",
|
|
73
|
+
type: "single_select",
|
|
74
|
+
is_filterable: true,
|
|
75
|
+
values: [{ name: "Linen" }, { name: "Cotton" }],
|
|
76
|
+
})
|
|
77
|
+
```
|
|
78
|
+
</RequestExample>
|
|
79
|
+
|
|
80
|
+
<ResponseExample>
|
|
81
|
+
```json 200
|
|
82
|
+
{
|
|
83
|
+
"product_attribute": {
|
|
84
|
+
"id": "pattr_01HXYZABCDEF",
|
|
85
|
+
"name": "Material",
|
|
86
|
+
"handle": "material",
|
|
87
|
+
"type": "single_select",
|
|
88
|
+
"is_required": false,
|
|
89
|
+
"is_filterable": true,
|
|
90
|
+
"is_variant_axis": false,
|
|
91
|
+
"is_active": true,
|
|
92
|
+
"values": [
|
|
93
|
+
{ "id": "pattrval_01HXYZABCDEF", "name": "Linen", "rank": 0 },
|
|
94
|
+
{ "id": "pattrval_01HXYZABCDEG", "name": "Cotton", "rank": 1 }
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
</ResponseExample>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Delete Attribute Value"
|
|
3
|
+
api: "DELETE /admin/product-attributes/{id}/values/{value_id}"
|
|
4
|
+
description: "Delete a value from a product attribute."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Deletes the value and returns the parent attribute.
|
|
8
|
+
|
|
9
|
+
## Path parameters
|
|
10
|
+
|
|
11
|
+
<ParamField path="id" type="string" required>The attribute's ID.</ParamField>
|
|
12
|
+
<ParamField path="value_id" type="string" required>The value's ID.</ParamField>
|
|
13
|
+
|
|
14
|
+
## Response
|
|
15
|
+
|
|
16
|
+
<ResponseField name="product_attribute" type="object">
|
|
17
|
+
<Expandable title="properties">
|
|
18
|
+
<ResponseField name="id" type="string">The attribute's ID.</ResponseField>
|
|
19
|
+
<ResponseField name="name" type="string">Attribute name.</ResponseField>
|
|
20
|
+
<ResponseField name="type" type="string">The attribute's type.</ResponseField>
|
|
21
|
+
<ResponseField name="values" type="object[]">Remaining values after deletion.</ResponseField>
|
|
22
|
+
<ResponseField name="updated_at" type="string">Last update timestamp.</ResponseField>
|
|
23
|
+
</Expandable>
|
|
24
|
+
</ResponseField>
|
|
25
|
+
|
|
26
|
+
<RequestExample>
|
|
27
|
+
```bash cURL
|
|
28
|
+
curl -X DELETE 'http://localhost:9000/admin/product-attributes/pattr_01HXYZABCDEF/values/pattrval_01HXYZABCDEF' \
|
|
29
|
+
-H 'Authorization: Bearer <token>'
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```ts JS Client
|
|
33
|
+
const { product_attribute } =
|
|
34
|
+
await client.admin.productAttributes.$id.values.$value_id.delete({
|
|
35
|
+
$id: "pattr_01HXYZABCDEF",
|
|
36
|
+
$value_id: "pattrval_01HXYZABCDEF",
|
|
37
|
+
})
|
|
38
|
+
```
|
|
39
|
+
</RequestExample>
|
|
40
|
+
|
|
41
|
+
<ResponseExample>
|
|
42
|
+
```json 200
|
|
43
|
+
{
|
|
44
|
+
"product_attribute": {
|
|
45
|
+
"id": "pattr_01HXYZABCDEF",
|
|
46
|
+
"name": "Material",
|
|
47
|
+
"type": "single_select",
|
|
48
|
+
"values": []
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
</ResponseExample>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Delete Product Attribute"
|
|
3
|
+
api: "DELETE /admin/product-attributes/{id}"
|
|
4
|
+
description: "Delete a catalog product attribute."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Deletes the attribute and its values.
|
|
8
|
+
|
|
9
|
+
## Path parameters
|
|
10
|
+
|
|
11
|
+
<ParamField path="id" type="string" required>The attribute's ID.</ParamField>
|
|
12
|
+
|
|
13
|
+
## Response
|
|
14
|
+
|
|
15
|
+
<ResponseField name="id" type="string">The deleted attribute's ID.</ResponseField>
|
|
16
|
+
<ResponseField name="object" type="string">Always `product_attribute`.</ResponseField>
|
|
17
|
+
<ResponseField name="deleted" type="boolean">Always `true`.</ResponseField>
|
|
18
|
+
|
|
19
|
+
<RequestExample>
|
|
20
|
+
```bash cURL
|
|
21
|
+
curl -X DELETE 'http://localhost:9000/admin/product-attributes/pattr_01HXYZABCDEF' \
|
|
22
|
+
-H 'Authorization: Bearer <token>'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```ts JS Client
|
|
26
|
+
const result = await client.admin.productAttributes.$id.delete({
|
|
27
|
+
$id: "pattr_01HXYZABCDEF",
|
|
28
|
+
})
|
|
29
|
+
```
|
|
30
|
+
</RequestExample>
|
|
31
|
+
|
|
32
|
+
<ResponseExample>
|
|
33
|
+
```json 200
|
|
34
|
+
{
|
|
35
|
+
"id": "pattr_01HXYZABCDEF",
|
|
36
|
+
"object": "product_attribute",
|
|
37
|
+
"deleted": true
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
</ResponseExample>
|