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

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.

Update a Retailer's Transaction Fee Settings

patch

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 null clears 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_commission true, transaction_fee_remitter MERCHANT.
  • Fee passed to the retailer, commission on the gross amount: deduct_transaction_fees_before_commission false, transaction_fee_remitter MERCHANT.
  • The channel absorbs the fee: transaction_fee_remitter APP, 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.

Path parameters
merchant_idinteger · int32Required

The retailer whose settings are changed.

Example: 10000
app_idinteger · int32Required

The app the retailer's settings are 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 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.

fee_source_modestring · enum · nullableOptional

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.

Example: APP_PROVIDEDPossible values:
deduct_transaction_fees_before_commissionboolean · nullableOptional

Net Receipts. When true the transaction fee lowers the base that commission is calculated on. Null clears the override.

Example: true
transaction_fee_remitterstring · enum · nullableOptional

Who bears the transaction fee. MERCHANT withholds the fee from the retailer's share; APP leaves it with the app. Null clears the override.

Example: MERCHANTPossible values:
Responses
200

The retailer's fee settings after the update.

application/json

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.

merchant_idinteger · int32Required

The retailer the settings are for.

Example: 10000
app_idinteger · int32Required

The app the retailer's settings are with.

Example: 10001
patch/merchants/{merchant_id}/app_relationships/{app_id}/fee_settings
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?