Cash on delivery

Offer cash on delivery in a market and set its fee and limits by destination.

Use these endpoints to offer cash on delivery in a market. Read requests require read_markets; changes require write_markets. COD settings switch cash on delivery on for the market and hold what checkout tells shoppers; COD zones hold where it applies, its fee and its order-value limits. Every market has a default zone, Everywhere, for addresses no other zone covers.

Where cash on delivery applies#

is_enabled on COD settings switches cash on delivery on for the whole market. Where it is offered, and at what fee and order values, is set on COD zones. Every market has a default zone, created with the market as Everywhere, that covers addresses no other zone covers; it cannot be deleted or stop being the default. Checkout looks for a postcode zone, then a subdivision zone, then a country zone, and finally the default zone. A disabled matching zone blocks COD; checkout does not fall back to a broader zone. An empty min_order_amounts, max_order_amounts or waive_fee_over_amounts is no such rule.

Product eligibility and unavailable options#

Read the cod-rules list response for supported fields, operators, priorities and max_rules. Priority 1 runs first; equal priorities run from oldest to newest. The first rule matching any product wins. A block rule makes COD unavailable. An allow rule still requires COD to be enabled and the destination and order-value checks to pass. When no product rule matches, those checks still apply.

When an order can't use COD (its minimum or maximum order value, a product rule or the destination), unavailable_display decides what checkout does: hide leaves COD out of the payment methods; show_reason lists it disabled with a reason in the shopper's language. The reason is a storefront message the merchant can reword in Storefront Messages: CHECKOUT_COD_UNAVAILABLE_BELOW_MIN or CHECKOUT_COD_UNAVAILABLE_ABOVE_MAX, which print the missed order value in the shopper's currency, when that is why, and CHECKOUT_COD_UNAVAILABLE otherwise. Send unavailable_display when replacing settings: omission resets it to hide. Switching COD off for the market hides it regardless of this preference.

unavailable_display is on COD settings and applies in every zone of the market, whatever makes COD unavailable: the zone is off, the minimum or maximum order value, a blocked postcode or a product rule. Settings saved without it use hide.

Fee waiver message#

While COD is available, checkout can show a message about the fee waiver on the COD payment option; the message is on COD settings, the amount on each zone. When the discounted merchandise subtotal reaches the matched zone's waive_fee_over_amounts amount for the checkout currency, it says the fee is waived (standard text: "Cash on delivery fee waived."). Below that amount, it says how much more the order needs (standard text: "Add {{.amount}} more to have the cash on delivery fee waived."), where {{.amount}} is the waiver amount minus the subtotal, in the checkout currency. Nothing is shown when the matched zone has no waiver amount for the checkout currency, when the fee is 0 anyway (fee_type free or a zero fee), or when waiver_notice_enabled is false.

The standard texts exist in every storefront language. waiver_notice_waived and waiver_notice_remaining override them per store language, the default language included: checkout shows your text in the shopper's language when it is not empty, else the standard text in the shopper's language. Texts accept up to 200 characters; only waiver_notice_remaining may use {{.amount}}, and no other placeholder is accepted (COD_WAIVER_NOTICE_PLACEHOLDER_INVALID). Empty texts are dropped, and keys must be languages enabled for the store (STOREFRONT_LANGUAGE_NOT_ENABLED). Reads add waiver_notice_defaults, the standard texts in each enabled store language with {{.amount}} left as written, to show as placeholders in an editor. These fields are on COD settings and apply in every zone; the waiver amount is each zone's. Omitting waiver_notice_enabled turns the message on.

How order values and fees are calculated#

Minimum, maximum, fee-waiver, and percentage-fee rules use the merchandise subtotal after every merchandise discount. Shipping, tax, duties, checkout fees, and the COD fee are not part of that subtotal. Minimum and maximum values include the boundary itself. The fee is waived when the subtotal reaches or exceeds the waiver amount.

A fixed fee uses the amount saved for the order currency. A percentage fee uses the discounted merchandise subtotal. After the fee is resolved, Tringify applies the selected market tax class and records the fee, tax class, and tax code in the order pricing snapshot.

Endpoints#

Get COD settings

GET read_markets

Read the cash-on-delivery switch and shopper messages for a market.

The response says whether cash on delivery is enabled in the market, unavailable_display (what checkout does when an order can't use COD), and waiver_notice_enabled, waiver_notice_waived and waiver_notice_remaining (the fee waiver message); keep all of them when editing one. waiver_notice_defaults is read-only: Tringify's default fee waiver texts for each language enabled for the store (remaining shows the literal {{.amount}}), for use as placeholders where you have no text of your own. The fee, order-amount limits and fee waiver amount are the market's COD zones': read them with GET /markets/{marketId}/cod-zones.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID.

  • 404 COD_SETTINGS_NOT_FOUND

    Cash-on-delivery settings have not been created for this market.

  • 404 NOT_FOUND

    The market does not exist in this store.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Update COD settings

PUT write_markets

Switch cash on delivery on or off for a market and save its shopper messages.

Send the complete settings object. is_enabled controls whether checkout may offer COD in the market at all; where it applies, what it costs and the order amounts it accepts are set on the market's COD zones. The "When COD is unavailable" setting and the fee waiver message apply to every zone. An unchanged request leaves the settings untouched and publishes no webhook; a successful change publishes cod_settings/update.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
is_enabled required boolean

Whether checkout may offer cash on delivery in this market. The market's COD zones set where, at what fee and for which order amounts.

Example: true
unavailable_display string

What checkout does with cash on delivery when an order can't use it, for every zone and reason: hide leaves it out of the payment methods; show_reason lists it disabled with a reason: the built-in storefront message CHECKOUT_COD_UNAVAILABLE_BELOW_MIN or CHECKOUT_COD_UNAVAILABLE_ABOVE_MAX with the order-amount limit when that limit was missed, otherwise CHECKOUT_COD_UNAVAILABLE, in the shopper's language (reword them in Storefront Messages). Omission is hide.

Example: show_reason
waiver_notice_enabled boolean

Whether checkout shows a message about the fee waiver on the cash-on-delivery option while COD is available. Once the discounted merchandise subtotal reaches the matched zone's waive_fee_over_amounts amount for the checkout currency, it says the fee is waived; below it, it says how much more the order needs. Nothing is shown when the zone has no waiver amount for the checkout currency, or when there is no fee to waive (fee_type free or a zero fee). Omission is true.

Example: true
waiver_notice_waived object

Your text for the message shown when the fee is waived, keyed by store language code (the default language included). A language without a text shows Tringify's default in the shopper's language (waiver_notice_defaults.waived). At most 200 characters each; placeholders are not accepted. Leading and trailing whitespace is trimmed and empty texts are dropped. Keys must be languages enabled for the store. Reads list only languages enabled for the store. Omission clears every text.

Example: {"en":"Free cash on delivery on this order."}
waiver_notice_remaining object

Your text for the message shown while the order is below the waiver amount, keyed by store language code (the default language included). {{.amount}} prints how much more the order needs: the waiver amount minus the discounted merchandise subtotal, in the checkout currency. A language without a text shows Tringify's default in the shopper's language (waiver_notice_defaults.remaining). Same rules as waiver_notice_waived, except that {{.amount}} is accepted (written with spaces, such as {{ .amount }}, it is saved as {{.amount}}); no other placeholder is.

Example: {"en":"Add {{.amount}} more for free cash on delivery."}

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID. The request body is not valid JSON.

  • 400 INVALID_INPUT

    unavailable_display is not hide or show_reason (details.field).

  • 400 COD_WAIVER_NOTICE_TOO_LONG

    A fee waiver text is longer than 200 characters (details.field, details.locale).

  • 403 STORE_COMMERCE_TEST_GATEWAY_ONLY

    is_enabled is true on a development or transfer store. Those stores take payments through the test gateway only; save the settings with is_enabled false.

  • 404 NOT_FOUND

    The market does not exist in this store.

  • 400 COD_WAIVER_NOTICE_PLACEHOLDER_INVALID

    A waiver_notice_waived text uses a placeholder, or a waiver_notice_remaining text uses one other than {{.amount}} (details.field, details.locale).

  • 400 STOREFRONT_LANGUAGE_NOT_ENABLED

    A key of waiver_notice_waived or waiver_notice_remaining is not a language enabled for the store (details.field, details.locale).

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Get COD zone limits

GET read_markets

Read the limits used when creating and editing COD zones.

Use these values to validate zone names, descriptions, tax codes, and the number of zones before sending a write. The limits come from the same contract enforced by the service.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID.

  • 404 MARKET_NOT_FOUND

    No market with this id exists in the store.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

List COD zones

GET read_markets

List where cash on delivery applies in a market and what it costs there.

Zones are returned in matching priority order. Every market has a default zone, created with it as Everywhere: it covers market destinations no other zone covers. A non-default zone covers its saved countries, subdivisions or postcodes. A disabled matching zone blocks COD; it does not fall back to a broader zone.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID.

  • 404 MARKET_NOT_FOUND

    No market with this id exists in the store.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Create a COD zone

POST write_markets

Add a zone with its own cash-on-delivery fee and limits.

Choose a country, subdivision or postcode scope. Every zone has its own availability, fee, minimum, maximum, fee waiver amount and fee-tax configuration; an empty amount map means no such rule. Countries must belong to the market, subdivisions must belong to a selected country, and zone names must be unique within the market. Zones never cover the same place: one zone per subdivision, one zone per whole country, and no postcode in two zones of a country. A narrower zone still sits inside a wider one, so a postcode zone wins over a subdivision zone, and a subdivision zone over a whole-country zone. A successful create publishes cod_zones/create.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
name required string

A name merchants can recognize when managing the zone.

Example: New York
description string

Optional note describing when this rule should be used.

Example: Cash on delivery within New York State
countries array<string>

Country codes from this market covered by the zone. Leave empty for the default zone.

Example: ["US"]
subdivisions array<string>

Subdivision codes from province.options in GET /reference/address-format/{country} (e.g. US-CA); codes are matched case-insensitively and stored uppercase; subdivision names are refused. An unknown subdivision is refused with SUBDIVISION_INVALID. Reads add subdivisions_display, their names in English in the same order. Each subdivision must belong to a selected country.

Example: ["US-NY"]
postal_codes array<string>

Optional postcodes this zone covers, for exactly one country in countries and no subdivisions: exact codes (110001) or prefixes ending in * (1100* covers every postcode starting 1100). Spaces and hyphens are ignored and letters are stored in upper case. Up to 5,000 entries. A zone listing postcodes covers only those postcodes, and is matched before subdivision and country zones.

Example: ["110001", "1100*"]
is_default required boolean

Whether this zone covers market destinations not matched by a more specific zone; when true, countries, subdivisions and postal_codes must be empty. A market has exactly one default zone.

Example: false
is_enabled required boolean

Whether checkout may offer cash on delivery when this zone matches.

Example: true
fee_type required string

Use free, fixed, or percent.

Example: fixed
percent_value string|null

Percentage of discounted merchandise subtotal when fee_type is percent: greater than 0 and at most 100, with at most two decimal places. Trailing zeros are accepted.

Example: 2.5
fee_min_amounts object

Optional smallest fee per currency when fee_type is percent: a percentage that works out lower is raised to it. Decimal strings with the same precision and maximum as fee_amounts; ignored for other fee types.

Example: {"USD":"2.00"}
fee_max_amounts object

Optional largest fee per currency when fee_type is percent: a percentage that works out higher is capped at it. A minimum cannot exceed the maximum for the same currency.

Example: {"USD":"25.00"}
fee_amounts object

Positive decimal-string COD fees for every market currency when fee_type is fixed. Missing values are not converted. Amounts must not exceed 9999999999999999.9999 and must fit currency amount precision: CAD and IDR allow two fractional digits, KWD three, and KRW none. Trailing zeros are accepted.

Example: {"USD":"5.00"}
min_order_amounts object

Inclusive minimum discounted merchandise subtotal keyed by currency code; empty for no minimum. When set, provide a positive amount for every market currency using the same precision and maximum as fee_amounts. A minimum cannot exceed the corresponding maximum.

Example: {"USD":"20.00"}
max_order_amounts object

Inclusive maximum discounted merchandise subtotal keyed by currency code; empty for no maximum. When set, provide a positive amount for every market currency. Equal minimum and maximum values are allowed.

Example: {"USD":"500.00"}
waive_fee_over_amounts object

Subtotal at or above which the fee is waived, keyed by currency code; empty for no waiver. When set, provide a positive amount for every market currency. A waiver amount cannot exceed the corresponding maximum.

Example: {"USD":"100.00"}
tax_class_id uuid|null

A tax class assigned to this market. Its rate is applied to the resolved COD fee.

Example: 4be5c5d1-0999-48ea-a2e0-f86703d99169
tax_code string

The COD fee's tax code on invoices and tax reports, such as its SAC code in India.

Example: 996812

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID. The request body is not valid JSON.

  • 400 COD_ZONE_NAME_REQUIRED

    name is empty.

  • 400 COD_ZONE_NAME_TOO_LONG

    name exceeds the configured limit.

  • 400 COD_ZONE_DESCRIPTION_TOO_LONG

    description exceeds the configured limit.

  • 400 ZONE_DEFAULT_NO_REGIONS

    A default zone cannot also select countries or subdivisions.

  • 400 COD_ZONE_POSTCODE_INVALID

    An entry in postal_codes is not a postcode or a prefix ending in *.

  • 400 COD_ZONE_POSTCODES_TOO_MANY

    postal_codes lists more than 5,000 entries.

  • 400 COD_ZONE_POSTCODES_ONE_COUNTRY

    A zone with postal_codes must list exactly one country and no subdivisions.

  • 400 ZONE_COUNTRY_TAKEN

    Another COD zone already covers this country whole. The message names the zone.

  • 400 ZONE_SUBDIVISION_TAKEN

    Another COD zone already lists this subdivision. The message names the zone.

  • 400 COD_ZONE_POSTCODE_TAKEN

    Another COD zone for the same country already lists this postcode, or a prefix covering it. The message names the postcode and the zone.

  • 400 ZONE_NEEDS_REGION

    A non-default zone must select at least one country or subdivision.

  • 400 ZONE_COUNTRY_INVALID

    A selected country does not belong to this market.

  • 400 SUBDIVISION_INVALID

    A subdivision is not in the subdivision reference list for its country (details.country, details.field).

  • 400 ZONE_SUBDIVISION_NOT_IN_COUNTRY

    A selected subdivision does not belong to one of the zone's selected countries.

  • 400 COD_FEE_TYPE_INVALID

    fee_type is not free, fixed, or percent.

  • 400 COD_AMOUNT_REQUIRED

    A required amount map lacks a positive amount for a market currency (details.field; the message names the currency).

  • 400 COD_AMOUNT_CURRENCY_INVALID

    An amount uses a currency the market doesn't have (details.field).

  • 400 COD_AMOUNT_NEGATIVE

    An optional amount is negative (details.field).

  • 400 COD_MIN_ABOVE_MAX

    A minimum order value is above the maximum for the same currency.

  • 400 COD_WAIVER_ABOVE_MAX

    A fee waiver amount is above the maximum order value for the same currency.

  • 400 CHECKOUT_FEE_PERCENT_RANGE

    The COD percentage is missing, is not greater than 0 and at most 100, or has more than two decimal places.

  • 400 CHECKOUT_AMOUNT_TOO_LARGE

    An amount exceeds 9999999999999999.9999.

  • 400 CHECKOUT_AMOUNT_TOO_PRECISE

    An amount cannot be represented exactly at its currency's amount precision.

  • 400 TAX_CODE_TOO_LONG

    tax_code exceeds the configured length limit.

  • 400 TAX_CLASS_NOT_IN_MARKET

    The selected tax class does not belong to this market.

  • 404 NOT_FOUND

    The market does not exist in this store.

  • 400 COD_ZONE_LIMIT_REACHED

    The market already has the maximum number of COD zones.

  • 409 COD_ZONE_NAME_DUPLICATE

    Another COD zone in this market already uses this name.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Get a COD zone

GET read_markets

Read one zone and its complete fee configuration.

Use the returned values to populate an edit form or inspect the exact rule checkout will consider for this zone.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789
zoneId required uuid

COD zone ID.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID.

  • 404 NOT_FOUND

    The market or COD zone does not exist in this store.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Update a COD zone

PUT write_markets

Replace the editable definition of a COD zone.

Send the complete zone definition you want to keep. The same geographic, currency, threshold and tax-class rules used during creation apply here. To make a zone the default, send is_default: true with empty countries, subdivisions and postal_codes; this clears the previous default. An unchanged request publishes no webhook; a successful change publishes cod_zones/update.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789
zoneId required uuid

COD zone ID.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
name required string

A name merchants can recognize when managing the zone.

Example: New York
description string

Optional note describing when this rule should be used.

Example: Cash on delivery within New York State
countries array<string>

Country codes from this market covered by the zone. Leave empty for the default zone.

Example: ["US"]
subdivisions array<string>

Subdivision codes from province.options in GET /reference/address-format/{country} (e.g. US-CA); codes are matched case-insensitively and stored uppercase; subdivision names are refused. An unknown subdivision is refused with SUBDIVISION_INVALID. Reads add subdivisions_display, their names in English in the same order. Each subdivision must belong to a selected country.

Example: ["US-NY"]
postal_codes array<string>

Optional postcodes this zone covers, for exactly one country in countries and no subdivisions: exact codes (110001) or prefixes ending in * (1100* covers every postcode starting 1100). Spaces and hyphens are ignored and letters are stored in upper case. Up to 5,000 entries. A zone listing postcodes covers only those postcodes, and is matched before subdivision and country zones.

Example: ["110001", "1100*"]
is_default required boolean

Whether this zone covers market destinations not matched by a more specific zone; when true, countries, subdivisions and postal_codes must be empty. A market has exactly one default zone.

Example: false
is_enabled required boolean

Whether checkout may offer cash on delivery when this zone matches.

Example: true
fee_type required string

Use free, fixed, or percent.

Example: fixed
percent_value string|null

Percentage of discounted merchandise subtotal when fee_type is percent: greater than 0 and at most 100, with at most two decimal places. Trailing zeros are accepted.

Example: 2.5
fee_min_amounts object

Optional smallest fee per currency when fee_type is percent: a percentage that works out lower is raised to it. Decimal strings with the same precision and maximum as fee_amounts; ignored for other fee types.

Example: {"USD":"2.00"}
fee_max_amounts object

Optional largest fee per currency when fee_type is percent: a percentage that works out higher is capped at it. A minimum cannot exceed the maximum for the same currency.

Example: {"USD":"25.00"}
fee_amounts object

Positive decimal-string COD fees for every market currency when fee_type is fixed. Missing values are not converted. Amounts must not exceed 9999999999999999.9999 and must fit currency amount precision: CAD and IDR allow two fractional digits, KWD three, and KRW none. Trailing zeros are accepted.

Example: {"USD":"5.00"}
min_order_amounts object

Inclusive minimum discounted merchandise subtotal keyed by currency code; empty for no minimum. When set, provide a positive amount for every market currency using the same precision and maximum as fee_amounts. A minimum cannot exceed the corresponding maximum.

Example: {"USD":"20.00"}
max_order_amounts object

Inclusive maximum discounted merchandise subtotal keyed by currency code; empty for no maximum. When set, provide a positive amount for every market currency. Equal minimum and maximum values are allowed.

Example: {"USD":"500.00"}
waive_fee_over_amounts object

Subtotal at or above which the fee is waived, keyed by currency code; empty for no waiver. When set, provide a positive amount for every market currency. A waiver amount cannot exceed the corresponding maximum.

Example: {"USD":"100.00"}
tax_class_id uuid|null

A tax class assigned to this market. Its rate is applied to the resolved COD fee.

Example: 4be5c5d1-0999-48ea-a2e0-f86703d99169
tax_code string

The COD fee's tax code on invoices and tax reports, such as its SAC code in India.

Example: 996812

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID. The request body is not valid JSON.

  • 400 COD_ZONE_NAME_REQUIRED

    name is empty.

  • 400 COD_ZONE_NAME_TOO_LONG

    name exceeds the configured limit.

  • 400 COD_ZONE_DESCRIPTION_TOO_LONG

    description exceeds the configured limit.

  • 400 ZONE_DEFAULT_NO_REGIONS

    A default zone cannot also select countries or subdivisions.

  • 400 COD_ZONE_POSTCODE_INVALID

    An entry in postal_codes is not a postcode or a prefix ending in *.

  • 400 COD_ZONE_POSTCODES_TOO_MANY

    postal_codes lists more than 5,000 entries.

  • 400 COD_ZONE_POSTCODES_ONE_COUNTRY

    A zone with postal_codes must list exactly one country and no subdivisions.

  • 400 ZONE_COUNTRY_TAKEN

    Another COD zone already covers this country whole. The message names the zone.

  • 400 ZONE_SUBDIVISION_TAKEN

    Another COD zone already lists this subdivision. The message names the zone.

  • 400 COD_ZONE_POSTCODE_TAKEN

    Another COD zone for the same country already lists this postcode, or a prefix covering it. The message names the postcode and the zone.

  • 400 ZONE_NEEDS_REGION

    A non-default zone must select at least one country or subdivision.

  • 400 ZONE_COUNTRY_INVALID

    A selected country does not belong to this market.

  • 400 SUBDIVISION_INVALID

    A subdivision is not in the subdivision reference list for its country (details.country, details.field).

  • 400 ZONE_SUBDIVISION_NOT_IN_COUNTRY

    A selected subdivision does not belong to one of the zone's selected countries.

  • 400 COD_FEE_TYPE_INVALID

    fee_type is not free, fixed, or percent.

  • 400 COD_AMOUNT_REQUIRED

    A required amount map lacks a positive amount for a market currency (details.field; the message names the currency).

  • 400 COD_AMOUNT_CURRENCY_INVALID

    An amount uses a currency the market doesn't have (details.field).

  • 400 COD_AMOUNT_NEGATIVE

    An optional amount is negative (details.field).

  • 400 COD_MIN_ABOVE_MAX

    A minimum order value is above the maximum for the same currency.

  • 400 COD_WAIVER_ABOVE_MAX

    A fee waiver amount is above the maximum order value for the same currency.

  • 400 CHECKOUT_FEE_PERCENT_RANGE

    The COD percentage is missing, is not greater than 0 and at most 100, or has more than two decimal places.

  • 400 CHECKOUT_AMOUNT_TOO_LARGE

    An amount exceeds 9999999999999999.9999.

  • 400 CHECKOUT_AMOUNT_TOO_PRECISE

    An amount cannot be represented exactly at its currency's amount precision.

  • 400 TAX_CODE_TOO_LONG

    tax_code exceeds the configured length limit.

  • 400 TAX_CLASS_NOT_IN_MARKET

    The selected tax class does not belong to this market.

  • 404 NOT_FOUND

    The market does not exist in this store.

  • 400 COD_ZONE_DEFAULT_UNSET_LOCKED

    The default zone cannot stop being the default; make another zone the default instead.

  • 409 COD_ZONE_NAME_DUPLICATE

    Another COD zone in this market already uses this name.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Delete a COD zone

DELETE write_markets

Remove a zone from the market.

The default zone cannot be deleted. Existing orders keep the COD fee and tax snapshots recorded when they were placed. A successful deletion publishes cod_zones/delete.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789
zoneId required uuid

COD zone ID.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID.

  • 400 COD_ZONE_DEFAULT_DELETE_LOCKED

    The default zone cannot be deleted; make another zone the default first.

  • 404 NOT_FOUND

    The market or COD zone does not exist in this store.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The request body has a property; this endpoint takes no body. Send no body or an empty object {}.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Get blocked COD postcodes

GET read_markets

Read the postcodes where the market never offers cash on delivery.

Returns one country's blocked postcodes and prefixes (1100* covers every postcode starting 1100) in their stored form: upper case, without spaces or hyphens. count is that country's entries, total_count the market's across its countries and max_entries the most a market can hold; countries lists each country that has entries. Blocked postcodes apply before COD zones: a blocked address never gets cash on delivery.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789

Query parameters

Name Type Description
country_code required string

ISO 3166-1 alpha-2 code of one of the market's countries.

Example: IN

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID.

  • 400 COD_BLOCKED_POSTCODES_COUNTRY_NOT_IN_MARKET

    country_code is not one of the market's countries.

  • 404 NOT_FOUND

    The market does not exist in this store.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The query string has a parameter this request does not accept. The message and error.details.allowed_parameters list the ones it does.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Replace blocked COD postcodes

PUT write_markets

Replace one country's blocked postcodes.

Send the complete list for one country; it replaces the saved one, and an empty list removes them all. Entries are exact postcodes or prefixes ending in *, letters and digits only, up to 12 characters; spaces, hyphens and letter case don't matter, and repeats are saved once. The market can hold up to max_entries across its countries. A change publishes cod_settings/update with the new blocked_postcode_count.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
country_code required string

ISO 3166-1 alpha-2 code of one of the market's countries.

Example: IN
postal_codes required array<string>

The country's blocked postcodes and prefixes.

Example: ["110001", "1100*"]

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID. The body is not valid JSON or a field has the wrong type.

  • 400 COD_BLOCKED_POSTCODE_INVALID

    An entry is not a postcode or a prefix ending in *; the message names it.

  • 400 COD_BLOCKED_POSTCODES_TOO_MANY

    The market would hold more than max_entries blocked postcodes.

  • 400 COD_BLOCKED_POSTCODES_COUNTRY_NOT_IN_MARKET

    country_code is not one of the market's countries.

  • 404 NOT_FOUND

    The market does not exist in this store.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Check COD for an address

POST read_markets

Find out whether cash on delivery is offered at an address, and why.

Answers for the address alone: whether the market serves the country, COD is on, the postcode is blocked, which zone covers it (another zone or the Everywhere zone) and whether that zone is on. decided_by is not_served, cod_off, blocked_postcode, zone, zone_off or no_zone; explanation says the same in English, and blocked_entry is the matching blocked postcode or prefix. At checkout the order's amount limits and the COD rules for products and customer groups also apply; note says so. Nothing is saved.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
country_code required string

ISO 3166-1 alpha-2 country code of the address.

Example: IN
subdivision string

The address's state or province, as a code (MH or IN-MH) or name.

Example: DL
postal_code string

The address's postcode.

Example: 110001

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID. The body is not valid JSON or a field has the wrong type.

  • 400 INVALID_INPUT

    country_code is missing or not a country code.

  • 404 NOT_FOUND

    The market does not exist in this store.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

List COD rules

GET read_markets

Read product eligibility rules and the choices supported by the rule editor.

The response contains rules, max_rules, rule_fields, actions and priorities. Use the returned field/operator catalog, including requires_value and each field's and operator's label, when building an editor. The example shows illustrative records and current choices; use the live response for limits. Rules run by ascending priority, with equal priorities evaluated from oldest to newest. The first rule matching any product decides. An allow rule still requires COD to be enabled and destination and order-value checks to pass. No matching product rule leaves those checks in effect.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID.

  • 404 NOT_FOUND

    Market or rule not found in this store, or a customer_group value names no customer group in it.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Create a COD rule

POST write_markets

Add an allow or block condition for cash on delivery.

Send the complete rule definition using a field and operator from the list response. For customer_group, use is_member or is_not_member with a customer group ID from this store: the rule matches the shopper, not a product, and a guest is never a member. Title conditions use contains or not_contains. For category, vendor and brand comparisons, value is the resource ID as a string and must belong to this store. For tag comparisons, value is the tag ID or its slug; a slug is resolved to the tag ID when the rule is saved, a value that is the ID of a tag in this store is read as that ID, and an ID or slug that matches no tag in this store is rejected with COLLECTION_RULE_TAG_NOT_FOUND. Presence checks do not require a value. include_subcategories applies to category conditions. The response returns the saved rule, including its ID and timestamps. Store and market ownership come from the token and URL.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
priority required integer

Priority from 1 through 10; lower is evaluated first. Equal priorities are evaluated from oldest to newest.

Example: 1
action required string

Use allow or block.

Example: block
field required string

A field from the list response rule_fields catalog.

Example: title
operator required string

An operator supported by the selected field. For title, use contains or not_contains.

Example: contains
value string|null

Condition value required by the selected operator.

Example: Gift card
include_subcategories boolean

Include descendant categories for a category condition.

Example: false

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID. Request body must be a JSON object.

  • 404 NOT_FOUND

    Market or rule not found in this store, or a customer_group value names no customer group in it.

  • 400 COD_RULE_ACTION_INVALID

    action is not allow or block.

  • 400 COD_RULE_PRIORITY_RANGE

    priority is outside 1 through 10; the message states the range.

  • 400 COLLECTION_RULE_FIELD_INVALID

    Rule field is not valid.

  • 400 COLLECTION_RULE_OPERATOR_INVALID

    Rule operator is not valid for the selected field.

  • 400 COLLECTION_RULE_VALUE_REQUIRED

    This rule operator requires a value.

  • 400 COLLECTION_RULE_VALUE_NOT_ALLOWED

    is_empty, is_not_empty, is_true and is_false take no value.

  • 400 COLLECTION_RULE_CURRENCY_INVALID

    currency is set on a rule other than price or regular_price, or is not one of the store's currencies.

  • 400 COLLECTION_RULES_CONTRADICTORY

    Under match_type all, the rule can never match a product together with one of the {{singular_lower}}'s other rules. error.details.rules gives their 1-based positions; the message names them.

  • 400 COLLECTION_RULE_SUBCATEGORIES_NOT_ALLOWED

    include_subcategories is only valid on a category rule with equals or not_equals.

  • 400 COLLECTION_RULE_CATEGORY_ID_INVALID

    Category value is not a positive integer ID.

  • 400 COLLECTION_RULE_VENDOR_ID_INVALID

    Vendor value is not a positive integer ID.

  • 400 COLLECTION_RULE_BRAND_ID_INVALID

    Brand value is not a positive integer ID.

  • 400 COLLECTION_RULE_TITLE_TOO_LONG

    Title rule value exceeds the contract max length.

  • 400 COLLECTION_RULE_TAG_NOT_FOUND

    No tag in this store has the given ID or slug; the message names the value.

  • 400 COLLECTION_RULE_CATEGORY_NOT_FOUND

    Referenced category does not exist in this store.

  • 400 COLLECTION_RULE_VENDOR_NOT_FOUND

    Referenced vendor does not exist in this store.

  • 400 COLLECTION_RULE_BRAND_NOT_FOUND

    Referenced brand does not exist in this store.

  • 400 COD_RULE_LIMIT_REACHED

    The market already has the maximum number of COD rules.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Update a COD rule

PUT write_markets

Replace a saved condition and its priority.

Send the complete rule definition using a field and operator from the list response. For customer_group, use is_member or is_not_member with a customer group ID from this store: the rule matches the shopper, not a product, and a guest is never a member. Title conditions use contains or not_contains. For category, vendor and brand comparisons, value is the resource ID as a string and must belong to this store. For tag comparisons, value is the tag ID or its slug; a slug is resolved to the tag ID when the rule is saved, a value that is the ID of a tag in this store is read as that ID, and an ID or slug that matches no tag in this store is rejected with COLLECTION_RULE_TAG_NOT_FOUND. Presence checks do not require a value. include_subcategories applies to category conditions. The response returns the saved rule, including its ID and timestamps. Store and market ownership come from the token and URL.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789
ruleId required uuid

COD rule id.

Example: 6b2e8d90-1234-4678-9abc-def012345678

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
priority required integer

Priority from 1 through 10; lower is evaluated first. Equal priorities are evaluated from oldest to newest.

Example: 1
action required string

Use allow or block.

Example: block
field required string

A field from the list response rule_fields catalog.

Example: title
operator required string

An operator supported by the selected field. For title, use contains or not_contains.

Example: contains
value string|null

Condition value required by the selected operator.

Example: Gift card
include_subcategories boolean

Include descendant categories for a category condition.

Example: false

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID. Request body must be a JSON object.

  • 404 NOT_FOUND

    Market or rule not found in this store, or a customer_group value names no customer group in it.

  • 400 COD_RULE_ACTION_INVALID

    action is not allow or block.

  • 400 COD_RULE_PRIORITY_RANGE

    priority is outside 1 through 10; the message states the range.

  • 400 COLLECTION_RULE_FIELD_INVALID

    Rule field is not valid.

  • 400 COLLECTION_RULE_OPERATOR_INVALID

    Rule operator is not valid for the selected field.

  • 400 COLLECTION_RULE_VALUE_REQUIRED

    This rule operator requires a value.

  • 400 COLLECTION_RULE_VALUE_NOT_ALLOWED

    is_empty, is_not_empty, is_true and is_false take no value.

  • 400 COLLECTION_RULE_CURRENCY_INVALID

    currency is set on a rule other than price or regular_price, or is not one of the store's currencies.

  • 400 COLLECTION_RULES_CONTRADICTORY

    Under match_type all, the rule can never match a product together with one of the {{singular_lower}}'s other rules. error.details.rules gives their 1-based positions; the message names them.

  • 400 COLLECTION_RULE_SUBCATEGORIES_NOT_ALLOWED

    include_subcategories is only valid on a category rule with equals or not_equals.

  • 400 COLLECTION_RULE_CATEGORY_ID_INVALID

    Category value is not a positive integer ID.

  • 400 COLLECTION_RULE_VENDOR_ID_INVALID

    Vendor value is not a positive integer ID.

  • 400 COLLECTION_RULE_BRAND_ID_INVALID

    Brand value is not a positive integer ID.

  • 400 COLLECTION_RULE_TITLE_TOO_LONG

    Title rule value exceeds the contract max length.

  • 400 COLLECTION_RULE_TAG_NOT_FOUND

    No tag in this store has the given ID or slug; the message names the value.

  • 400 COLLECTION_RULE_CATEGORY_NOT_FOUND

    Referenced category does not exist in this store.

  • 400 COLLECTION_RULE_VENDOR_NOT_FOUND

    Referenced vendor does not exist in this store.

  • 400 COLLECTION_RULE_BRAND_NOT_FOUND

    Referenced brand does not exist in this store.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The body has a property this request does not accept. The message and error.details.properties list the allowed and required properties (nested for each object or list of objects).

  • 400 STORE_API_BODY_PROPERTY_INVALID

    A body property has the wrong type (error.details.expected_type). The message and error.details.properties list the allowed and required properties.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Delete a COD rule

DELETE write_markets

Remove one cash-on-delivery condition.

The rule must belong to the market and store identified by the URL and token. A successful response contains deleted: true. Remaining rules keep their priorities.

Path parameters

Name Type Description
marketId required uuid

Market id.

Example: 9a1f2c3d-4e5f-6789-abcd-ef0123456789
ruleId required uuid

COD rule id.

Example: 6b2e8d90-1234-4678-9abc-def012345678

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 401 UNAUTHORIZED

    The Authorization header is missing.

  • 401 INVALID_TOKEN

    The Authorization header is not Bearer followed by a token, or the token is not in the form Tringify issues.

  • 401 TOKEN_NOT_ACCEPTED

    The token is unknown, expired, revoked or replaced, or its app was uninstalled.

  • 402 SUBSCRIPTION_REQUIRED

    The store does not have an active or trialing subscription.

  • 403 API_VERSION_UNSUPPORTED

    The credential is pinned to an API version that cannot be served.

  • 403 STORE_SUSPENDED

    Tringify has suspended the store. Every request is refused until it is reinstated.

  • 403 STORE_TERMINATED

    Tringify has terminated the store permanently. Every request is refused.

  • 400 STORE_API_INVALID_REQUEST_BODY

    marketId must be a valid UUID.

  • 404 NOT_FOUND

    Market or rule not found in this store, or a customer_group value names no customer group in it.

  • 400 STORE_API_QUERY_PARAMETER_UNKNOWN

    The request has a query parameter; this endpoint takes none.

  • 400 STORE_API_BODY_PROPERTY_UNKNOWN

    The request body has a property; this endpoint takes no body. Send no body or an empty object {}.

  • 429 RATE_LIMITED

    The request allowance is exhausted. Wait for Retry-After before retrying.

Webhook events#

Subscribe to these events when your app keeps a local copy of cash-on-delivery settings or zones. Settings updates contain the complete saved configuration. Zone create and update events contain the complete zone; zone delete identifies the removed zone. Requests that make no effective change do not publish an event.

Cash on delivery settings updated

EVENT cod_settings/update App scope: read_markets Staff permission: markets:write

Fired when a market's cash-on-delivery switch, unavailable-option display, fee waiver message or blocked postcodes change. Fees, order-value limits, waiver amounts and fee tax are on COD zones (cod_zones/*). The snapshot includes unavailable_display, and waiver_notice_enabled, waiver_notice_waived and waiver_notice_remaining (the fee waiver message and its texts per store language). Money maps contain exact decimal strings keyed by currency code, using currency amount precision (for example KWD 1.234, KRW 1234, USD 12.34). They never use General display separators or symbols.

Payload fields

Field Type Description
cod_settings.id string Always present
cod_settings.market_id string Selectable in the Payload builder
cod_settings.is_enabled boolean Selectable in the Payload builder
cod_settings.unavailable_display string Selectable in the Payload builder
cod_settings.waiver_notice_enabled boolean Selectable in the Payload builder
cod_settings.waiver_notice_waived object Selectable in the Payload builder
cod_settings.waiver_notice_remaining object Selectable in the Payload builder
cod_settings.blocked_postcode_count integer Selectable in the Payload builder
cod_settings.created_at string Selectable in the Payload builder
cod_settings.updated_at string Selectable in the Payload builder

Cash on delivery zone created

EVENT cod_zones/create App scope: read_markets Staff permission: markets:write

Fired when a cash-on-delivery zone is created in a market. The snapshot is the complete zone: where it applies, whether it is on, its fee, order-value limits, fee waiver amount and fee tax. Money maps contain exact decimal strings keyed by currency code, using currency amount precision (for example KWD 1.234, KRW 1234, USD 12.34). They never use General display separators or symbols.

Payload fields

Field Type Description
cod_zone.id string Always present
cod_zone.market_id string Selectable in the Payload builder
cod_zone.name string Selectable in the Payload builder
cod_zone.description string Selectable in the Payload builder
cod_zone.countries array Selectable in the Payload builder
cod_zone.subdivisions array Selectable in the Payload builder
cod_zone.subdivisions_display array Selectable in the Payload builder
cod_zone.postal_codes array Selectable in the Payload builder
cod_zone.is_default boolean Selectable in the Payload builder
cod_zone.priority integer Selectable in the Payload builder
cod_zone.is_enabled boolean Selectable in the Payload builder
cod_zone.fee_type string Selectable in the Payload builder
cod_zone.percent_value string | null Selectable in the Payload builder
cod_zone.fee_amounts object Selectable in the Payload builder
cod_zone.min_order_amounts object Selectable in the Payload builder
cod_zone.max_order_amounts object Selectable in the Payload builder
cod_zone.waive_fee_over_amounts object Selectable in the Payload builder
cod_zone.fee_min_amounts object Selectable in the Payload builder
cod_zone.fee_max_amounts object Selectable in the Payload builder
cod_zone.tax_class_id string | null Selectable in the Payload builder
cod_zone.tax_code string Selectable in the Payload builder
cod_zone.created_at string Selectable in the Payload builder
cod_zone.updated_at string Selectable in the Payload builder

Cash on delivery zone updated

EVENT cod_zones/update App scope: read_markets Staff permission: markets:write

Fired when a cash-on-delivery zone changes. The snapshot is the complete zone. The unavailable-option display and the fee waiver message are on COD settings (cod_settings/update). Money maps contain exact decimal strings keyed by currency code, using currency amount precision (for example KWD 1.234, KRW 1234, USD 12.34). They never use General display separators or symbols.

Payload fields

Field Type Description
cod_zone.id string Always present
cod_zone.market_id string Selectable in the Payload builder
cod_zone.name string Selectable in the Payload builder
cod_zone.description string Selectable in the Payload builder
cod_zone.countries array Selectable in the Payload builder
cod_zone.subdivisions array Selectable in the Payload builder
cod_zone.subdivisions_display array Selectable in the Payload builder
cod_zone.postal_codes array Selectable in the Payload builder
cod_zone.is_default boolean Selectable in the Payload builder
cod_zone.priority integer Selectable in the Payload builder
cod_zone.is_enabled boolean Selectable in the Payload builder
cod_zone.fee_type string Selectable in the Payload builder
cod_zone.percent_value string | null Selectable in the Payload builder
cod_zone.fee_amounts object Selectable in the Payload builder
cod_zone.min_order_amounts object Selectable in the Payload builder
cod_zone.max_order_amounts object Selectable in the Payload builder
cod_zone.waive_fee_over_amounts object Selectable in the Payload builder
cod_zone.fee_min_amounts object Selectable in the Payload builder
cod_zone.fee_max_amounts object Selectable in the Payload builder
cod_zone.tax_class_id string | null Selectable in the Payload builder
cod_zone.tax_code string Selectable in the Payload builder
cod_zone.created_at string Selectable in the Payload builder
cod_zone.updated_at string Selectable in the Payload builder

Cash on delivery zone deleted

EVENT cod_zones/delete App scope: read_markets Staff permission: markets:write

Fired when a cash-on-delivery zone is deleted.

Payload fields

Field Type Description
cod_zone.id string Always present
cod_zone.market_id string Selectable in the Payload builder
cod_zone.name string Selectable in the Payload builder