Skip to content

API reference

Discounts

Create and pause discount codes, and read what gift cards paid toward your orders.

List discounts

GET/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
discounts:read
MCP tool
discounts_list
Changes data
No

Parameters

NameTypeDescription
limitquery · optionalintegerResults per page, 1-1001-100default 25
cursorquery · optionalstringThe `next_cursor` from the previous page

Request

curl "https://3commerce.com/api/v1/discounts" \
  -H "Authorization: Bearer 3c_live_…"

Response

200 OK
{
  "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

GET/api/v1/discounts/{id}

One discount with its rules and what it has done so far.

Scope
discounts:read
MCP tool
discounts_get
Changes data
No

Parameters

NameTypeDescription
idpath · requiredstring (uuid)The resource id

Request

curl "https://3commerce.com/api/v1/discounts/6f1c2a4e-8b3d-4c5e-9a7f-1d2e3f4a5b6c" \
  -H "Authorization: Bearer 3c_live_…"

Response

200 OK
{
  "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

POST/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
discounts:write
MCP tool
discounts_create
Changes data
Yes
Idempotency-Key
Accepted

Parameters

NameTypeDescription
codebody · optionalstring or null4-16 letters or numbers, unique across 3Commerce, or null for an automatic discountdefault null
titlebody · optionalstringWhat shoppers read; required for an automatic discountmax 60 charsdefault ""
kindbody · requiredenumA whole percent up to 90, or USD up to 1000one of percent, fixed
valuebody · requirednumberThe percent or amount it takes offmin 0
min_subtotalbody · optionalnumberWhat eligible lines must come to first, in USDmin 0default 0
free_shippingbody · optionalbooleanWhether it also ships freedefault false
applies_tobody · optionalenumEvery product, or only `product_ids`one of all, productsdefault "all"
product_idsbody · optionalarray of string (uuid)The products it coversmax 100 itemsdefault []
cost_floorbody · optionalbooleanNever take a line below what it costs the shopdefault true
starts_onbody · optionalstring (date) or nullThe first day, or null to start nowdefault null
ends_onbody · optionalstring (date) or nullThe last day it works, or null for no enddefault null
usage_limitbody · optionalinteger or nullRedemptions in total, or null for no limit1-9007199254740991default null
per_customer_limitbody · optionalinteger or nullRedemptions per shopper, or null for no limit1-9007199254740991default null

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

201 Created
{
  "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

PATCH/api/v1/discounts/{id}

Changes the fields you send and keeps the rest. Its redemptions so far are kept.

Scope
discounts:write
MCP tool
discounts_update
Changes data
Yes

Parameters

NameTypeDescription
idpath · requiredstring (uuid)The resource id
codebody · optionalstring or null4-16 letters or numbers, unique across 3Commerce, or null for an automatic discount
titlebody · optionalstringWhat shoppers read; required for an automatic discountmax 60 chars
kindbody · optionalenumA whole percent up to 90, or USD up to 1000one of percent, fixed
valuebody · optionalnumberThe percent or amount it takes offmin 0
min_subtotalbody · optionalnumberWhat eligible lines must come to first, in USDmin 0
free_shippingbody · optionalbooleanWhether it also ships free
applies_tobody · optionalenumEvery product, or only `product_ids`one of all, products
product_idsbody · optionalarray of string (uuid)The products it coversmax 100 items
cost_floorbody · optionalbooleanNever take a line below what it costs the shop
starts_onbody · optionalstring (date) or nullThe first day, or null to start now
ends_onbody · optionalstring (date) or nullThe last day it works, or null for no end
usage_limitbody · optionalinteger or nullRedemptions in total, or null for no limit1-9007199254740991
per_customer_limitbody · optionalinteger or nullRedemptions per shopper, or null for no limit1-9007199254740991

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

200 OK
{
  "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

POST/api/v1/discounts/{id}/status

Sets a discount `paused`, so carts stop taking it, or back to `active`. Its redemptions are kept.

Scope
discounts:write
MCP tool
discounts_set_status
Changes data
Yes

Parameters

NameTypeDescription
idpath · requiredstring (uuid)The resource id
statusbody · requiredenumThe new statusone of active, paused

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

201 Created
{
  "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

GET/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
discounts:read
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

200 OK
{
  "orders": 6,
  "amount": 210,
  "platform": null
}

List gift cards

GET/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
discounts:read
MCP tool
gift_cards_list
Changes data
No

Parameters

NameTypeDescription
limitquery · optionalintegerResults per page, 1-1001-100default 25
cursorquery · optionalstringThe `next_cursor` from the previous page

Request

curl "https://3commerce.com/api/v1/gift-cards" \
  -H "Authorization: Bearer 3c_live_…"

Response

200 OK
{
  "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

POST/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
discounts:write
MCP tool
gift_cards_issue
Changes data
Yes
Idempotency-Key
Accepted

Parameters

NameTypeDescription
amountbody · requirednumberUSD, 5-20005-2000
emailbody · requiredstring (email)Who receives it
namebody · optionalstringTheir name, for the emailmax 80 charsdefault ""
messagebody · optionalstringA note in the emailmax 300 charsdefault ""

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

201 Created
{
  "id": "9a1c3e5f-7b9d-4f1a-8c3e-5a7c9e1b3d5f",
  "amount": 50,
  "email": "sam@example.com",
  "status": "active"
}

Disable or enable a gift card

POST/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
discounts:write
MCP tool
gift_cards_set_status
Changes data
Yes

Parameters

NameTypeDescription
idpath · requiredstring (uuid)The resource id
statusbody · requiredenumThe new statusone of active, disabled

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

201 Created
{
  "id": "9a1c3e5f-7b9d-4f1a-8c3e-5a7c9e1b3d5f",
  "status": "disabled"
}