SpendControl
The authorisation rules applied to an application.
Operations
Every route this entity exposes. Each route links to its own reference on this page.
| Method | Route | SDK operation | Returns |
|---|---|---|---|
POST |
/spend/applications/{clientId}/spend-controls/rules/apply |
create |
Rule applied successfully |
POST |
/spend/applications/{clientId}/spend-controls/rules/unapply |
create |
Rule unapplied successfully |
GET |
/spend/applications/{clientId}/spend-controls/rules/applied |
list |
A list of applied rule IDs |
DELETE |
/spend/applications/{clientId}/spend-controls/rules/{ruleId} |
remove |
Rule deleted successfully |
Examples
One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.
Golang
Construct client as shown in the Golang setup, then call the operations:
spend_controls, err := client.SpendControl(nil).List(map[string]any{"application_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(spend_controls)
removed, err := client.SpendControl(nil).Remove(map[string]any{"application_id": "example", "rule_id": 1}, nil)
if err != nil {
panic(err)
}
fmt.Println(removed)
Lua
Construct client as shown in the Lua setup, then call the operations:
local spend_controls, err = client:SpendControl():list({ application_id = "example" })
local removed, err = client:SpendControl():remove({ application_id = "example", rule_id = 1 })
PHP
Construct client as shown in the PHP setup, then call the operations:
$spend_controls = $client->SpendControl()->list(["application_id" => "example"]);
$client->SpendControl()->remove(["application_id" => "example", "rule_id" => 1]);
Python
Construct client as shown in the Python setup, then call the operations:
spend_controls = client.SpendControl().list({"application_id": "example"})
client.SpendControl().remove({"application_id": "example", "rule_id": 1})
Ruby
Construct client as shown in the Ruby setup, then call the operations:
spend_controls = client.SpendControl.list({ "application_id" => "example" })
client.SpendControl.remove({ "application_id" => "example", "rule_id" => 1 })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const spend_controls = await client.SpendControl().list({ application_id: "example" })
await client.SpendControl().remove({ application_id: "example", rule_id: 1 })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
ruleId |
integer |
No | The ID of the applied authorisation rule. |
create
POST /spend/applications/{clientId}/spend-controls/rules/apply
Operation ID: spendControlsRuleApply.
Authentication: bearer token (ClientCredentialsToken).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
clientId |
path |
string |
Yes | The application client ID. |
X-External-Correlation-Id |
header |
string (uuid) |
No | Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more. |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
ruleId |
string |
No | The ID of the authorisation rule. |
Example request body:
{
"ruleId": "123"
}
Responses
200: Rule applied successfully
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header
application/json
The response is object.
POST /spend/applications/{clientId}/spend-controls/rules/unapply
Operation ID: spendControlsRuleUnapply.
Authentication: bearer token (ClientCredentialsToken).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
clientId |
path |
string |
Yes | The application client ID. |
X-External-Correlation-Id |
header |
string (uuid) |
No | Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more. |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
ruleId |
string |
No | The ID of the authorisation rule. |
Example request body:
{
"ruleId": "123"
}
Responses
200: Rule unapplied successfully
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header
application/json
The response is object.
list
GET /spend/applications/{clientId}/spend-controls/rules/applied
Operation ID: spendControlsAppliedRulesList.
Authentication: bearer token (ClientCredentialsToken).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
clientId |
path |
string |
Yes | The application client ID. |
X-External-Correlation-Id |
header |
string (uuid) |
No | Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more. |
Responses
200: A list of applied rule IDs
application/json
| Property | Type | Required | Description |
|---|---|---|---|
[].ruleId |
integer (int64) |
No | The ID of the applied authorisation rule. |
Example response:
[
{
"ruleId": 123
},
{
"ruleId": 456
}
]
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header
application/json
The response is object.
remove
DELETE /spend/applications/{clientId}/spend-controls/rules/{ruleId}
Operation ID: spendControlsRuleDelete.
Authentication: bearer token (ClientCredentialsToken).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
clientId |
path |
string |
Yes | The application client ID. |
ruleId |
path |
integer (int64) |
Yes | The ID of the authorisation rule to delete. |
X-External-Correlation-Id |
header |
string (uuid) |
No | Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more. |
Responses
200: Rule deleted successfully
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header
application/json
The response is object.