Rules API Overview

In the domain of financial services, establishing and adhering to a set of rules is paramount to ensure regulatory compliance, efficient operations, and risk management. Gravity's Rules API offers correspondents an interface to manage their unique business logic and compliance controls.

Breaking Down the Rules

Group: Rules are organized into groups, each representing a set of related policies. For example, a group named "High Risk" may contain rules that restrict trading in volatile assets. Each group has a unique ID and a name. Once a group is created, correspondents can assign or bucket their customers into these groups. Customers in the same group will follow the same set of rules.

Trading: Rules related to trading activities, such as options, equities, and mutual funds. Correspondents can define policies like commission charges, margin trading, or trading restrictions.

  • Options: Control over opening and closing trades, along with commission decisions.
  • Equities: Rules governing equities trade, such as using unsettled cash, margin trades, or fractional trading.
  • Mutual Funds: Policies related to mutual fund trades.

Transfers: Manage the permissions for different types of transfers like ACH or Wire. - Set limits on the amount and frequency of deposits and withdrawals. - Define the hold period for transferred amounts to ensure funds are settled before use or withdrawal.

By utilizing the Rules API, correspondents ensure their business processes and transactions seamlessly align with Gravity's operations, ensuring a streamlined and compliant experience for all stakeholders.

POST/v1/customers/groups

Create Group

Use this endpoint to create a group of rules for a correspondent.

Request Body

ParameterDescriptionTypeInput
groupName
Name of the groupStringRequired
correspondentId
Unique ID for the correspondentUUIDRequired

Success Response

JSON
201 Created
{
    "message": "Customer group created",
    "createdAt": "2024-03-01T00:48:27.978Z",
    "updatedAt": "2024-03-01T00:48:27.978Z",
    "groupId": "93e339af-a0de-47d9-877b-8fd5f8bc71b4",
    "groupName": "high risk"
}

GET/v1/customers/groups/{correspondentId}/all

Get All Groups

Use this endpoint to retrieve the all the customer groups associated with a correspondent.

Path Parameters

ParameterDescriptionTypeInput
correspondentId
Unique ID for the correspondentUUIDRequired

Success Response

JSON
200 OK
[
  {
    "createdAt": "2024-03-01T00:48:27.978Z",
    "updatedAt": "2024-03-01T00:48:27.978Z",
    "groupId": "93e339af-a0de-47d9-877b-8fd5f8bc71b4",
    "groupName": "high risk",
  }
]

GET/v1/correspondent/rules/{groupId}

Get Rules

Use this endpoint to retrieve the rules associated with a correspondent.

Path Parameters

ParameterDescriptionTypeInput
groupId
Unique ID for the groupIdUUIDRequired

Success Response

JSON
200 OK
{
  "createdAt": "2024-03-01T00:28:47.779Z",
  "updatedAt": "2024-03-12T07:59:38.486Z",
  "rulesId": "e42ff651-b8db-4c08-9686-59c753dc14fa",
  "maxSources": 1,
  "canAddSource": false,
  "canArchiveSource": false,
  "canOpenOptions": false,
  "canCloseOptions": false,
  "canChargeOptionsCommissions": false,
  "optionsCommission": null,
  "canOpenEquities": false,
  "canCloseEquities": false,
  "canAllowEquitiesFractions": false,
  "canTradeEquitiesWithMargin": false,
  "canChargeEquitiesCommissions": false,
  "canTradeEquitiesWithUnsettledCash": false,
  "equitiesCommission": null,
  "canOpenMutualFunds": false,
  "canCloseMutualFunds": false,
  "canChargeMutualFundsCommissions": false,
  "mutualFundsCommission": null,
  "canOpenAccounts": false,
  "canCloseAccounts": false,
  "canFreezeAccounts": false,
  "allowAchDeposits": true,
  "allowAchWithdrawals": true,
  "allowWireDeposits": true,
  "allowWireWithdrawals": true,
  "maxAchDeposit": 10000,
  "maxAchWithdrawal": 10000,
  "maxWireDeposit": 10000,
  "maxWireWithdrawal": 10000,
  "maxDepositPerDay": 25000,
  "maxWithdrawalPerDay": 25000,
  "depositsPerDay": 5,
  "withdrawalsPerDay": 5,
  "holdPeriod": 4,
  "restrictedSymbols": ["string"]
}

PUT/v1/correspondent/rules/{groupId}

Update Rules

Use this endpoint to update the rules associated with a correspondent. Each field is optional. Only the fields that need to be updated should be included in the request body.

Path Parameters

ParameterDescriptionTypeInput
groupId
Unique ID for the groupIdUUIDRequired

Request Body

Request Body

JSON
Payload
{
  "maxSources": 1312,
  "canAddSource": true,
  "canArchiveSource": true,
  "canOpenOptions": false,
  "canCloseOptions": false,
  "canChargeOptionsCommissions": false,
  "optionsCommission": null,
  "canOpenEquities": false,
  "canCloseEquities": false,
  "canAllowEquitiesFractions": false,
  "canTradeEquitiesWithMargin": false,
  "canChargeEquitiesCommissions": false,
  "canTradeEquitiesWithUnsettledCash": false,
  "equitiesCommission": null,
  "canOpenMutualFunds": false,
  "canCloseMutualFunds": false,
  "canChargeMutualFundsCommissions": false,
  "mutualFundsCommission": null,
  "canOpenAccounts": false,
  "canCloseAccounts": false,
  "canFreezeAccounts": false,
  "allowAchDeposits": true,
  "allowAchWithdrawals": true,
  "allowWireDeposits": true,
  "allowWireWithdrawals": true,
  "maxAchDeposit": 10000,
  "maxAchWithdrawal": 10000,
  "maxWireDeposit": 10000,
  "maxWireWithdrawal": 10000,
  "maxDepositPerDay": 25000,
  "maxWithdrawalPerDay": 25000,
  "depositsPerDay": 5,
  "withdrawalsPerDay": 5,
  "holdPeriod": 4,
  "restrictedSymbols": ["string"]
}

Success Response

JSON
200 OK
{
  "createdAt": "2024-03-01T00:28:47.779Z",
  "updatedAt": "2024-04-09T05:34:27.620Z",
  "rulesId": "e42ff651-b8db-4c08-9686-59c753dc14fa",
  "maxSources": 1312,
  "canAddSource": true,
  "canArchiveSource": true,
  "canOpenOptions": false,
  "canCloseOptions": false,
  "canChargeOptionsCommissions": false,
  "optionsCommission": null,
  "canOpenEquities": false,
  "canCloseEquities": false,
  "canAllowEquitiesFractions": false,
  "canTradeEquitiesWithMargin": false,
  "canChargeEquitiesCommissions": false,
  "canTradeEquitiesWithUnsettledCash": false,
  "equitiesCommission": null,
  "canOpenMutualFunds": false,
  "canCloseMutualFunds": false,
  "canChargeMutualFundsCommissions": false,
  "mutualFundsCommission": null,
  "canOpenAccounts": false,
  "canCloseAccounts": false,
  "canFreezeAccounts": false,
  "allowAchDeposits": true,
  "allowAchWithdrawals": true,
  "allowWireDeposits": true,
  "allowWireWithdrawals": true,
  "maxAchDeposit": 10000,
  "maxAchWithdrawal": 10000,
  "maxWireDeposit": 10000,
  "maxWireWithdrawal": 10000,
  "maxDepositPerDay": 25000,
  "maxWithdrawalPerDay": 25000,
  "depositsPerDay": 5,
  "withdrawalsPerDay": 5,
  "holdPeriod": 4,
  "restrictedSymbols": ["string"]
}

DELETE/v1/correspondent/rules/{groupId}

Delete Rules

Use this endpoint to delete the rules associated with a customer group. Once the rules are deleted, all the customers associated with the group will be moved to the default group.

Path Parameters

ParameterDescriptionTypeInput
groupId
Unique ID for the groupIdUUIDRequired

Success Response

JSON
200 OK
{
  "message": "Correspondent rules with groupId {groupId} deleted successfully"
}