Update Transaction Fee Settings
Sets fee_source_mode, deduct_transaction_fees_before_commission and transaction_fee_remitter for a retailer with an app. Send null to clear an override. New settings apply to payout splits generated after the change.
Sets how transaction fees apply to a retailer's orders with an app. Only the three fields in the request body can be changed; nothing else on the relationship or its payment configuration is touched.
What a request means
- A field that is left out is unchanged.
- A field set to a value is set to it.
- A field set to
nullclears the retailer's override, so that the app's own setting applies again. {}changes nothing. A value a setting already has is not a change and is not recorded.- If the retailer has no payment configuration yet, one is created holding only the settings sent.
- The request is all or nothing: if any part of it is rejected, none of it is applied.
- 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.
Choosing settings for a contract type
- Net Receipts, where the fee lowers the commission base and is withheld from the retailer:
deduct_transaction_fees_before_commissiontrue,transaction_fee_remitterMERCHANT. - Fee passed to the retailer, commission on the gross amount:
deduct_transaction_fees_before_commissionfalse,transaction_fee_remitterMERCHANT. - The channel absorbs the fee:
transaction_fee_remitterAPP, or unset.
When it takes effect
New settings apply to payout splits generated after the change. Splits that were already generated keep the settings they were generated with. The cached copy of the relationship that payout generation reads is evicted when the change is committed, so the new settings are picked up on its next lookup. Should that eviction fail the change still stands, but the previous settings 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 settings 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 settings are changed.
10000The app the retailer's settings are 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 transaction-fee settings 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 setting applies again. No other setting can be changed here: any other field is rejected, and an empty object changes nothing.
Whether this retailer accepts transaction fees supplied by the app. APP_PROVIDED requires the app to allow app-provided fees. VIOLET_CONFIGURED is not supported yet and is rejected. Null clears the override.
APP_PROVIDEDPossible values: Net Receipts. When true the transaction fee lowers the base that commission is calculated on. Null clears the override.
trueWho bears the transaction fee. MERCHANT withholds the fee from the retailer's share; APP leaves it with the app. Null clears the override.
MERCHANTPossible values: The retailer's fee settings after the update.
A retailer's transaction-fee settings with one app. 'overrides' is what is stored for this retailer; 'effective' is what applies to payout splits generated from now on, and where each value came from. Splits that were already generated keep the settings stamped on them.
The retailer the settings are for.
10000The app the retailer's settings are with.
10001Nothing was changed. A value is not allowed, APP_PROVIDED was requested for an app that does not allow app-provided fees, 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 settings, and a request with no credentials is refused.
The retailer is not connected to the app.
Another request was changing this retailer's settings. Nothing was changed; retry the request.
An unexpected error occurred. Nothing was changed.
PATCH /v1/merchants/{merchant_id}/app_relationships/{app_id}/fee_settings 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: 88
{
"deduct_transaction_fees_before_commission": true,
"transaction_fee_remitter": "MERCHANT"
}{
"merchant_id": 10000,
"app_id": 10001,
"overrides": {
"fee_source_mode": "APP_PROVIDED",
"deduct_transaction_fees_before_commission": true,
"transaction_fee_remitter": "MERCHANT"
},
"effective": {
"fee_source_mode": {
"value": "APP_PROVIDED",
"source": "MERCHANT"
},
"deduct_transaction_fees_before_commission": {
"value": true,
"source": "MERCHANT"
},
"transaction_fee_remitter": {
"value": "MERCHANT",
"source": "MERCHANT"
}
}
}Last updated
Was this helpful?