Skip to content

Delete a partner group

DELETE /program/affiliates/groups/{group_id}
Scopeprogram:write
Customer session tokenNot accepted: call from your server with an API key
Rate limit classwrite_shopify (limits)
Idempotency keyRequired (idempotency)
MCP toolcharm_delete_affiliate_group

Deletes a group; its partners fall back to the programme’s rates (their own overrides stay). The dry run says how many partners that is; the real call needs confirm_delete: true.

NameInTypeDescription
group_idpathstringThe group’s id.
FieldTypeDescription
confirm_deletebooleanRequired, as true, when the call would actually delete. Call with dry_run: true first and show the merchant what goes away, then repeat with this set. (optional)
dry_runboolean(optional)

Returns AffiliateGroupWriteResult.

FieldTypeDescription
dry_runboolean
groupAffiliateGroup
members_detachedintegerDeleting: partners who fall back to the programme’s rates. (optional)
partner_codes_sync_failedboolean(optional)
{
"dry_run": false,
"group": {
"id": "id",
"name": "Gold",
"commission": {
"type": "percent",
"code_rate": 1,
"link_rate": 1
},
"customer_discount": {
"type": "percentage",
"value": 1
},
"member_count": 1
},
"members_detached": 1,
"partner_codes_sync_failed": false
}
Terminal window
# 1. Dry run: writes nothing and needs no Idempotency-Key. Show the merchant the result.
curl -X DELETE "https://charm.appfleece.app/api/v1/program/affiliates/groups/<group_id>" \
-H "Authorization: Bearer chrm_live_..." \
-H "Content-Type: application/json" \
-d '{"dry_run":true}'
# 2. After the merchant says yes: the real call with the confirmation.
curl -X DELETE "https://charm.appfleece.app/api/v1/program/affiliates/groups/<group_id>" \
-H "Authorization: Bearer chrm_live_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"confirm_delete":true}'

unauthorized · invalid_token · insufficient_scope · access_required · not_found · 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.