Create Setting
Last updated
POST
https://api.sfox.com/v1/enterprise/monetization/settings
Create a monetization setting.
The first step to monetizing your user's activity is to create monetization settings. Using this endpoint, Partners can specify the feature, method, currency, and user they would like the fee to be applied to.
The following combinations of Feature and Method are supported
RFQ
FEE_RATE , SPREAD_ADJUSTMENT
SPOT_TRADE
FEE_RATE
feature required
string
RFQ
SPOT_TRADE
WITHDRAW
method required
string
FEE_RATE
FEE_FLAT
SPREAD_ADJUSTMENT
user_id
string
The Connect user ID this fee is specified for. If no user_id is specified, the fee is applied to all users.
amount required
number
The monetization amount in decimal format i.e. 0.01 (1%)
security_pair
string
Used when applying a FEE_RATE or SPREAD_ADJUSTMENT to a specific instrument, such as btcusd
monetization_id
int
Unique ID for this monetization setting.
monetization_feature
string
Feature this setting applies to.
monetization_feature_code
string
API readable code for the feature.
monetization_method
string
Monetization method of the setting.
monetization_method_code
string
API readable code for the monetization method.
monetization_amount
number
Monetization amount in decimal format.
user_id
string
User ID of the end user that the setting is applied to, if applicable. null if the setting applies to all end users.
currency_code
string
Currency that the setting is applied to, if applicable. null if the setting applies to all currencies or is not applicable to currencies.
currency_pair
string
Currency pair that the setting is applied to, if applicable. null if the setting applies to all pairs or is not applicable to currency pairs.
date_updated
datetime
Date and time the setting was most recently updated or created.
Last updated
curl -X POST \
-H 'Content-type: application/json' \
-H "Authorization: Bearer ${ENTERPRISE_API_KEY}" \
--data '{ "feature": "SPOT_TRADE",
"method": "FEE_RATE",
"amount": 0.01,
"user_id": "client25" }' \
'https://api.sfox.com/v1/enterprise/monetization/settings'const axios = require('axios');
const config = {
method: 'post',
url: 'https://api.sfox.com/v1/enterprise/monetization/settings',
headers: {
"Content-Type": "application/json",
'Authorization': `Bearer ${process.env.ENTERPRISE_API_KEY}`
},
data: {
feature: 'SPOT_TRADE',
method: 'FEE_RATE',
amount: 0.01,
user_id: 'client25'
}
}
axios(config)
.then((response) => {
console.log(response.status);
console.log(response.data);
})
.catch((error) => {
console.error(error.response.status);
console.error(error.response.data);
});import requests
import os
data = requests.post(
"https://api.sfox.com/v1/enterprise/monetization/settings",
headers={
"Authorization": f"Bearer {os.environ['ENTERPRISE_API_KEY']}"
},
json={
"feature": "SPOT_TRADE",
"method": "FEE_RATE",
"amount": 0.01,
"user_id": "client25"
}
)
print(data.status_code)
print(data.json()){
"data": {
"monetization_id": 1310717,
"monetization_feature": "Spot Trading",
"monetization_feature_code": "SPOT_TRADE",
"monetization_method": "Fee Rate",
"monetization_method_code": "FEE_RATE",
"monetization_amount": 0.01,
"user_id": "client25",
"currency_code": null,
"currency_pair": null,
"date_updated": "2023-06-07T21:49:22.000Z"
}
}{
"error": "Monetization setting already exists"
}{
"error": "You do not have RFQ monetization permission"
}{
"error": "You do not have FEE_RATE monetization permission for RFQ"
}