For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update Return Commission Policy

Sets whether the commission is reversed (REVERSE) or kept (RETAIN) when one of a retailer's sales with an app is returned. Send null to clear the retailer's override. A change applies to sales made after it.

Update a Retailer's Return Commission Policy

patch

Sets what happens to the commission when one of a retailer's sales with an app is returned. Only return_commission_policy can be changed; nothing else on the relationship or its payment configuration is touched.

What a request means

  • return_commission_policy left out: unchanged.
  • Set to REVERSE: the commission is reversed with a return (SAR contracts). This is an override like any other: it stays REVERSE if the app's default later changes to RETAIN.
  • Set to RETAIN: the commission is kept on a return (SBR and SBR Net Receipts contracts).
  • Set to null: clears the retailer's override, so that the app's default applies again, or REVERSE if the app has none.
  • {} changes nothing. A value the policy already has is not a change and is not recorded.
  • If the retailer has no payment configuration yet, one is created holding only the policy.
  • The body must be a single JSON object with no repeated fields, sent as application/json. Any other content type is refused with a 415 before the request reaches this endpoint.

A retailer whose payment configuration is set not to inherit from the app takes nothing from the app: with no override of its own it resolves to REVERSE, and clearing its override leads there too.

When it takes effect

A change applies to sales made after it. A sale that already exists keeps the policy it was made under; changing the policy never alters one. The cached copy of the relationship that sales read is evicted when the change is committed, so the new policy is picked up on its next lookup. Should that eviction fail the change still stands, but the previous policy can be served for up to an hour, the cache's time to live.

Every change is recorded with who made it and the previous and new value. Changes to one retailer's payment configuration are applied one at a time.

Only Violet admins and the channel that owns the app, with the retailer enabled on it, can call this. A retailer cannot change its own terms.

Path parameters
merchant_idinteger · int32Required

The retailer whose policy is changed.

Example: 10000
app_idinteger · int32Required

The app the retailer's policy is with.

Example: 10001
Header parameters
X-Violet-TokenstringRequired

Token of the caller: a Violet admin, or a user of the channel that owns the app.

X-Violet-App-SecretstringRequired

Secret of the app the token was issued for.

X-Violet-App-Idinteger · int32Required

Id of the app the token was issued for. This is not necessarily the app in the path.

Example: 10001
Body

A partial update to a retailer's return commission policy with one app. A field that is left out is unchanged; a field set to null clears the retailer-specific override so that the app's default applies again. No other setting can be changed here: any other field is rejected, and an empty object changes nothing.

return_commission_policystring · enum · nullableOptional

What happens to the commission when a sale is returned. REVERSE reverses it (SAR contracts). RETAIN keeps it (SBR and SBR Net Receipts contracts). Null clears the override.

Example: RETAINPossible values:
Responses
200

The retailer's return commission policy after the update.

application/json

A retailer's return commission policy with one app: what happens to the commission when a sale is returned. 'overrides' is what is stored for this retailer; 'effective' is what applies to sales made from now on, and where it came from. A change applies to new sales only: a sale that already exists keeps the policy it was made under.

merchant_idinteger · int32Required

The retailer the policy is for.

Example: 10000
app_idinteger · int32Required

The app the retailer's policy is with.

Example: 10001
patch/merchants/{merchant_id}/app_relationships/{app_id}/return_commission_policy
PATCH /v1/merchants/{merchant_id}/app_relationships/{app_id}/return_commission_policy HTTP/1.1
Host: sandbox-api.violet.io
X-Violet-Token: text
X-Violet-App-Secret: text
X-Violet-App-Id: 1
Content-Type: application/json
Accept: */*
Content-Length: 37

{
  "return_commission_policy": "RETAIN"
}
{
  "merchant_id": 10000,
  "app_id": 10001,
  "overrides": {
    "return_commission_policy": "RETAIN"
  },
  "effective": {
    "return_commission_policy": {
      "value": "RETAIN",
      "source": "MERCHANT"
    }
  }
}

Last updated

Was this helpful?