Skip to content

Change the partner programme

PATCH /program/affiliates/settings
Scopeprogram:write
Customer session tokenNot accepted: call from your server with an API key
Rate limit classwrite_shopify (limits)
Idempotency keyRequired (idempotency)
MCP toolcharm_update_affiliate_program_settings

Changes the programme’s defaults. A new buyer discount reaches every partner code that inherits it. Switching the programme on, opening applications, approving partners, payouts and invoicing stay in the admin. Call with dry_run: true first.

FieldTypeDescription
commissionobject(optional)
customer_discountobject(optional)
commission_baseobject(optional)
holdback_daysinteger(optional)
link_attribution_window_daysinteger(optional)
code_prefixstring(optional)
terms_urlstring or null(optional, nullable)
allow_self_referralboolean(optional)
hub_invite_after_referralsinteger(optional)
hide_order_valueboolean(optional)
utmobject(optional)
dry_runbooleanPreview only: validate, resolve references and return the diff and summary, but write nothing. Costs no idempotency key and is limited as a read. Call with this first, show the merchant, then repeat without it. (optional)
if_revisionintegerThe program revision you last read (from GET /program or a previous write). When the program changed since, the write is refused with 409 revision_conflict instead of overwriting a concurrent admin edit. (optional)

Returns AffiliateSettingsWriteResult.

FieldTypeDescription
dry_runboolean
revisioninteger
operationstring: update, none
diffarray of FieldChange
summarystring or null(nullable)
affiliate_settingsAffiliateProgramSettings
partner_codes_sync_failedbooleanSaved, but some partner codes did not take the new buyer discount yet; the next change retries. (optional)
{
"dry_run": false,
"revision": 1,
"operation": "update",
"diff": [
{
"path": "path",
"before": null,
"after": null
}
],
"summary": "summary",
"affiliate_settings": {
"revision": 1,
"enabled": true,
"applications_open": false,
"auto_approve": false,
"commission": {
"type": "percent",
"code_rate": 1,
"link_rate": 1
},
"customer_discount": {
"type": "percentage",
"value": 1
},
"commission_base": {
"include_shipping": false,
"include_tax": false,
"after_discounts": false
},
"holdback_days": 1,
"link_attribution_window_days": 1,
"code_prefix": "REF",
"terms_url": "terms url",
"allow_self_referral": false,
"hub_invite_after_referrals": 1,
"hide_order_value": false,
"utm": {
"enabled": true,
"source": "order",
"medium": "medium",
"campaign": "campaign"
}
},
"partner_codes_sync_failed": false
}
Terminal window
curl -X PATCH "https://charm.appfleece.app/api/v1/program/affiliates/settings" \
-H "Authorization: Bearer chrm_live_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'

unauthorized · invalid_token · insufficient_scope · access_required · validation_error · rate_limited · idempotency_conflict · shopify_unavailable

Every error body carries code, message, request_id and a doc_url pointing at the matching entry in the error catalog.