API reference
Discounts
List discounts
/api/v1/discounts
The shop’s discount codes and automatic discounts, newest first, with how often each was redeemed and what it took off. `state` is active, paused, scheduled, ended, or used up.
- Scope
- MCP tool
- discounts_list
- Changes data
- No
Parameters
| Name | Type | Description |
|---|---|---|
limitquery · optional | integer | Results per page, 1-100 |
cursorquery · optional | string | The `next_cursor` from the previous page |
Request
curl "https://3commerce.com/api/v1/discounts" \
-H "Authorization: Bearer 3c_live_…"Response
{
"data": [
{
"id": "6d8f0a2c-4e6b-4d8f-a0c2-4e6a8c0e2b4d",
"code": "WELCOME10",
"title": "10% off your first order",
"kind": "percent",
"value": 10,
"min_subtotal": 0,
"free_shipping": false,
"applies_to": "all",
"product_ids": [],
"cost_floor": true,
"starts_on": "2026-11-01",
"ends_on": null,
"usage_limit": null,
"per_customer_limit": 1,
"status": "active",
"state": "active",
"redemptions": 14,
"discounted": 186.4,
"created_at": "2026-11-01T08:00:00.000Z"
}
],
"next_cursor": null
}Get a discount
/api/v1/discounts/{id}
One discount with its rules and what it has done so far.
- Scope
- MCP tool
- discounts_get
- Changes data
- No
Parameters
| Name | Type | Description |
|---|---|---|
idpath · required | string (uuid) | The resource id |
Request
curl "https://3commerce.com/api/v1/discounts/6f1c2a4e-8b3d-4c5e-9a7f-1d2e3f4a5b6c" \
-H "Authorization: Bearer 3c_live_…"Response
{
"id": "6d8f0a2c-4e6b-4d8f-a0c2-4e6a8c0e2b4d",
"code": "WELCOME10",
"title": "10% off your first order",
"kind": "percent",
"value": 10,
"min_subtotal": 0,
"free_shipping": false,
"applies_to": "all",
"product_ids": [],
"cost_floor": true,
"starts_on": "2026-11-01",
"ends_on": null,
"usage_limit": null,
"per_customer_limit": 1,
"status": "active",
"state": "active",
"redemptions": 14,
"discounted": 186.4,
"created_at": "2026-11-01T08:00:00.000Z"
}Create a discount
/api/v1/discounts
Creates a discount code, or an automatic discount when `code` is null. A code another shop already uses is 409 `code_taken`. Each redemption sends `discount.redeemed`.
- Scope
- MCP tool
- discounts_create
- Changes data
- Yes
- Idempotency-Key
- Accepted
Parameters
| Name | Type | Description |
|---|---|---|
codebody · optional | string or null | 4-16 letters or numbers, unique across 3Commerce, or null for an automatic discount |
titlebody · optional | string | What shoppers read; required for an automatic discount |
kindbody · required | enum | A whole percent up to 90, or USD up to 1000 |
valuebody · required | number | The percent or amount it takes off |
min_subtotalbody · optional | number | What eligible lines must come to first, in USD |
free_shippingbody · optional | boolean | Whether it also ships free |
applies_tobody · optional | enum | Every product, or only `product_ids` |
product_idsbody · optional | array of string (uuid) | The products it covers |
cost_floorbody · optional | boolean | Never take a line below what it costs the shop |
starts_onbody · optional | string (date) or null | The first day, or null to start now |
ends_onbody · optional | string (date) or null | The last day it works, or null for no end |
usage_limitbody · optional | integer or null | Redemptions in total, or null for no limit |
per_customer_limitbody · optional | integer or null | Redemptions per shopper, or null for no limit |
Request
curl -X POST "https://3commerce.com/api/v1/discounts" \
-H "Authorization: Bearer 3c_live_…" \
-H "Content-Type: application/json" \
-d '{
"kind": "percent",
"value": 10
}'Response
{
"id": "6d8f0a2c-4e6b-4d8f-a0c2-4e6a8c0e2b4d",
"code": "WELCOME10",
"title": "10% off your first order",
"kind": "percent",
"value": 10,
"min_subtotal": 0,
"free_shipping": false,
"applies_to": "all",
"product_ids": [],
"cost_floor": true,
"starts_on": "2026-11-01",
"ends_on": null,
"usage_limit": null,
"per_customer_limit": 1,
"status": "active",
"state": "active",
"redemptions": 0,
"discounted": 0,
"created_at": "2026-11-01T08:00:00.000Z"
}Update a discount
/api/v1/discounts/{id}
Changes the fields you send and keeps the rest. Its redemptions so far are kept.
- Scope
- MCP tool
- discounts_update
- Changes data
- Yes
Parameters
| Name | Type | Description |
|---|---|---|
idpath · required | string (uuid) | The resource id |
codebody · optional | string or null | 4-16 letters or numbers, unique across 3Commerce, or null for an automatic discount |
titlebody · optional | string | What shoppers read; required for an automatic discount |
kindbody · optional | enum | A whole percent up to 90, or USD up to 1000 |
valuebody · optional | number | The percent or amount it takes off |
min_subtotalbody · optional | number | What eligible lines must come to first, in USD |
free_shippingbody · optional | boolean | Whether it also ships free |
applies_tobody · optional | enum | Every product, or only `product_ids` |
product_idsbody · optional | array of string (uuid) | The products it covers |
cost_floorbody · optional | boolean | Never take a line below what it costs the shop |
starts_onbody · optional | string (date) or null | The first day, or null to start now |
ends_onbody · optional | string (date) or null | The last day it works, or null for no end |
usage_limitbody · optional | integer or null | Redemptions in total, or null for no limit |
per_customer_limitbody · optional | integer or null | Redemptions per shopper, or null for no limit |
Request
curl -X PATCH "https://3commerce.com/api/v1/discounts/6f1c2a4e-8b3d-4c5e-9a7f-1d2e3f4a5b6c" \
-H "Authorization: Bearer 3c_live_…" \
-H "Content-Type: application/json" \
-d '{}'Response
{
"id": "6d8f0a2c-4e6b-4d8f-a0c2-4e6a8c0e2b4d",
"code": "WELCOME10",
"title": "10% off your first order",
"kind": "percent",
"value": 10,
"min_subtotal": 0,
"free_shipping": false,
"applies_to": "all",
"product_ids": [],
"cost_floor": true,
"starts_on": "2026-11-01",
"ends_on": null,
"usage_limit": null,
"per_customer_limit": 1,
"status": "active",
"state": "active",
"redemptions": 14,
"discounted": 186.4,
"created_at": "2026-11-01T08:00:00.000Z"
}Pause or resume a discount
/api/v1/discounts/{id}/status
Sets a discount `paused`, so carts stop taking it, or back to `active`. Its redemptions are kept.
- Scope
- MCP tool
- discounts_set_status
- Changes data
- Yes
Parameters
| Name | Type | Description |
|---|---|---|
idpath · required | string (uuid) | The resource id |
statusbody · required | enum | The new status |
Request
curl -X POST "https://3commerce.com/api/v1/discounts/6f1c2a4e-8b3d-4c5e-9a7f-1d2e3f4a5b6c/status" \
-H "Authorization: Bearer 3c_live_…" \
-H "Content-Type: application/json" \
-d '{
"status": "active"
}'Response
{
"id": "6d8f0a2c-4e6b-4d8f-a0c2-4e6a8c0e2b4d",
"code": "WELCOME10",
"title": "10% off your first order",
"kind": "percent",
"value": 10,
"min_subtotal": 0,
"free_shipping": false,
"applies_to": "all",
"product_ids": [],
"cost_floor": true,
"starts_on": "2026-11-01",
"ends_on": null,
"usage_limit": null,
"per_customer_limit": 1,
"status": "paused",
"state": "paused",
"redemptions": 14,
"discounted": 186.4,
"created_at": "2026-11-01T08:00:00.000Z"
}Get gift card spend
/api/v1/gift-cards/summary
How many of your orders a gift card helped pay for, and how much it paid. Payouts transfer that share from the 3Commerce balance, so you are paid in full. On the 3Commerce shop’s own key it also totals every card.
- Scope
- MCP tool
- gift_cards_summary
- Changes data
- No
Parameters
No parameters.
Request
curl "https://3commerce.com/api/v1/gift-cards/summary" \
-H "Authorization: Bearer 3c_live_…"Response
{
"orders": 6,
"amount": 210,
"platform": null
}List gift cards
/api/v1/gift-cards
Every gift card, newest first, with codes masked to their last 4. Only the 3Commerce shop’s key can call it: any other is 403 `platform_only`.
- Scope
- MCP tool
- gift_cards_list
- Changes data
- No
Parameters
| Name | Type | Description |
|---|---|---|
limitquery · optional | integer | Results per page, 1-100 |
cursorquery · optional | string | The `next_cursor` from the previous page |
Request
curl "https://3commerce.com/api/v1/gift-cards" \
-H "Authorization: Bearer 3c_live_…"Response
{
"data": [
{
"id": "9a1c3e5f-7b9d-4f1a-8c3e-5a7c9e1b3d5f",
"code": "•••• 7KQM",
"initial_balance": 50,
"balance": 22.5,
"status": "active",
"source": "purchase",
"recipient": "sam@example.com",
"order_number": "3C-104801",
"created_at": "2026-11-02T10:00:00.000Z"
}
],
"next_cursor": null
}Issue a gift card
/api/v1/gift-cards
Issues a gift card, emails the code to `email`, and sends `gift_card.issued`. Only the 3Commerce shop’s key can call it: any other is 403 `platform_only`.
- Scope
- MCP tool
- gift_cards_issue
- Changes data
- Yes
- Idempotency-Key
- Accepted
Parameters
| Name | Type | Description |
|---|---|---|
amountbody · required | number | USD, 5-2000 |
emailbody · required | string (email) | Who receives it |
namebody · optional | string | Their name, for the email |
messagebody · optional | string | A note in the email |
Request
curl -X POST "https://3commerce.com/api/v1/gift-cards" \
-H "Authorization: Bearer 3c_live_…" \
-H "Content-Type: application/json" \
-d '{
"amount": 48,
"email": "ada@example.com"
}'Response
{
"id": "9a1c3e5f-7b9d-4f1a-8c3e-5a7c9e1b3d5f",
"amount": 50,
"email": "sam@example.com",
"status": "active"
}Disable or enable a gift card
/api/v1/gift-cards/{id}/status
Sets a card `disabled`, so it no longer pays, or back to `active`. Its balance is kept. Only the 3Commerce shop’s key can call it.
- Scope
- MCP tool
- gift_cards_set_status
- Changes data
- Yes
Parameters
| Name | Type | Description |
|---|---|---|
idpath · required | string (uuid) | The resource id |
statusbody · required | enum | The new status |
Request
curl -X POST "https://3commerce.com/api/v1/gift-cards/6f1c2a4e-8b3d-4c5e-9a7f-1d2e3f4a5b6c/status" \
-H "Authorization: Bearer 3c_live_…" \
-H "Content-Type: application/json" \
-d '{
"status": "active"
}'Response
{
"id": "9a1c3e5f-7b9d-4f1a-8c3e-5a7c9e1b3d5f",
"status": "disabled"
}