sFOX API
Sign InOpen Account
Connect API
Connect API
  • Introduction
    • Welcome
    • Getting Started
    • Resources
      • Terminology
      • Systems & Operations
      • Integration Options
    • Guides
      • End User Onboarding & KYC
        • Individuals
        • Businesses
        • Enhanced Due Diligence
  • REST API
    • REST Endpoints
    • Authentication
    • End Users
      • Create End User Account
      • Request Verification Code
      • Confirm Verification Code
      • Create User Auth Token(s)
      • Get End User(s)
      • Get EDD Requests
      • Get EDD Prompts
      • Create EDD Responses
        • Uploading Files as Responses
      • Submit Documents
      • Deactivate User
    • Payments
      • Create Bank Account (Plaid)
      • Create Bank Account
      • Get Bank Account
      • Get Plaid Processors
      • Amend Plaid Processors
      • Verify Bank Account
      • Delete Bank Account
      • Get Wire Instructions
      • Get ACH Agreement Status
      • Request ACH Onboarding
      • Get ACH Deposit Limit
    • Withdrawals
      • Confirm Withdrawal
      • Resend Confirmation Code
      • Cancel Withdrawal
    • Transfers
      • Create Transfer
      • Confirm Transfer
      • Resend Confirmation Code
      • Cancel Transfer
      • Get Transfer Permissions
      • Get Transfer History
    • Monetization
      • Create Setting
      • Update Setting
      • Delete Setting
      • Get Settings
      • Get Permissions
      • Get Monetization History
  • WebSocket API
    • Connecting
    • Authentication
    • Subscribing & Unsubscribing
    • Message Format
    • End Users
      • Onboarding
      • Balances
      • Orders
      • Trades
    • Market Data
      • Order Book
      • Trades
      • Ticker
  • Single Sign-On
    • Overview
      • IdP Initiated SSO
    • IdP Data
    • SAML Response Data
  • Errors
    • Error Codes
Powered by GitBook
  1. REST API
  2. Monetization

Update Setting

PUT https://api.sfox.com/v1/enterprise/monetization/settings/:id

This endpoint allows Partners to update the monetization amount of existing monetization settings. For example, you would use this endpoint to increase or decrease the monetization amount of a specific monetization setting. Once updated, all future orders or transactions will be charged the new monetization amount.

Path Parameters

Name
Type
Description

id required

number

The monetization ID of the setting to be updated

Body Parameters

Name
Type
Description

new_monetization_amount required

number

The updated monetization amount. Must be > 0.

Responses

200 OK
Setting Updated
{
    "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,
        "security_pair_raw": null,
        "date_updated": "2023-06-07T21:49:22.000Z"
    }
}
422 Unprocessable Content
Invalid amount, format, or ID
{
    "error": "new_monetization_amount must be greater than 0"
}

{
    "error": "new_monetization_amount must be a number"
}

{
    "error": "Invalid monetization ID."
}
403 Forbidden
No permission
{
    "error": "You do not have RFQ monetization permission"
}

{
    "error": "You do not have FEE_RATE monetization permission for RFQ"
}

Response Body

Key
Description

monetization_id

Unique ID for this monetization setting

monetization_feature

Feature the fee will apply to

monetization_feature_code

API readable monetization feature

monetization_method

Monetization method of the setting

monetization_method_code

API readable monetization method

monetization_amount

Monetization amount in decimal format

user_id

User Id of the user that the fee is specified for

currency_code

Currency that the fee is specified for

currency_pair

Currency pair that the fee is specifed for

date_updated

Datetime the fee was created or updated

Example Requests

curl -X PUT \
  -H 'Content-type: application/json' \
  -H 'Authorization: Bearer <ENTERPRISE_API_KEY>' \
  --data '{ "new_monetization_amount": 0.01}'  \
  'https://api.sfox.com/v1/enterprise/monetization/settings/1310717'
const axios = require('axios');

const config = {
  method: 'put',
  url: 'https://api.sfox.com/v1/enterprise/monetization/settings/1310717',
  headers: {
    "Content-Type": "application/json",
    'Authorization': `Bearer ${process.env.ENTERPRISE_API_KEY}`
  },
  data: {
    new_monetization_amount: 0.01
  }
}

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.put(
  "https://api.sfox.com/v1/enterprise/monetization/settings/1310717",
  headers={
    "Authorization": f"Bearer {os.environ['ENTERPRISE_API_KEY']}"
  },
  json={
    "new_monetization_amount": 0.01
  }
)
print(data.status_code)
print(data.json())
PreviousCreate SettingNextDelete Setting

Last updated 11 months ago