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.
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_policyleft out: unchanged.- Set to
REVERSE: the commission is reversed with a return (SAR contracts). This is an override like any other: it staysREVERSEif the app's default later changes toRETAIN. - 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, orREVERSEif 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.
The retailer whose policy is changed.
10000The app the retailer's policy is with.
10001Token of the caller: a Violet admin, or a user of the channel that owns the app.
Secret of the app the token was issued for.
Id of the app the token was issued for. This is not necessarily the app in the path.
10001A 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.
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.
RETAINPossible values: The retailer's return commission policy after the update.
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.
The retailer the policy is for.
10000The app the retailer's policy is with.
10001Nothing was changed. The value is not allowed, the body contains a field that cannot be set here, the body is not a single JSON object with no repeated fields, or there is no body.
The caller is not a Violet admin or the channel that owns the app, or the retailer is not enabled on that app. Retailers cannot change their own policy, and a request with no credentials is refused.
The retailer is not connected to the app.
Another request was changing this retailer's policy. Nothing was changed; retry the request.
An unexpected error occurred. Nothing was changed.
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?