API

Rule

An authorisation rule for card spend.

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 create The created rule
GET /spend/applications/{clientId}/spend-controls/rules list A list of authorisation rules

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:

rules, err := client.Rule(nil).List(map[string]any{"application_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(rules)
created, err := client.Rule(nil).Create(map[string]any{"application_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)

Lua

Construct client as shown in the Lua setup, then call the operations:

local rules, err = client:Rule():list({ application_id = "example" })
local created, err = client:Rule():create({ application_id = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$rules = $client->Rule()->list(["application_id" => "example"]);
$created = $client->Rule()->create(["application_id" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

rules = client.Rule().list({"application_id": "example"})
created = client.Rule().create({ "application_id": "example" })

Ruby

Construct client as shown in the Ruby setup, then call the operations:

rules = client.Rule.list({ "application_id" => "example" })
created = client.Rule.create({ "application_id" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const rules = await client.Rule().list({ application_id: "example" })
const created = await client.Rule().create({ application_id: "example" })

Fields

Field Type Required Description
description string No The description of the authorisation rule.
id integer No The unique ID for the authorisation rule.
operation string No Determines whether the transactions should be allowed or blocked.
type string No The type of authorisation rule.
values array No A list of values based on the type of rule configured.

create

POST /spend/applications/{clientId}/spend-controls/rules

Operation ID: spendControlsRuleCreate.

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
description string No The description of the authorisation rule.
operation enum: ALLOW, BLOCK No Determines whether the transactions should be allowed or blocked.
type enum: MCC, CURRENCY No The type of authorisation rule.
values array of string No A list of values based on the type of rule. For example, setting MCC as type requires values to be set as ["1234", "5678"].

Example request body:

{
  "description": "Blocking all transactions from MCC 1234 and 5678",
  "operation": "BLOCK",
  "type": "MCC",
  "values": [
    "1234",
    "5678"
  ]
}

Responses

200: The created rule

application/json

Property Type Required Description
description string No The description of the authorisation rule.
id integer (int64) No The unique ID for the authorisation rule.
operation enum: ALLOW, BLOCK No Determines whether the transactions should be allowed or blocked.
type enum: MCC, CURRENCY No The type of authorisation rule.
values array of string No A list of values based on the type of rule configured.
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

Operation ID: spendControlsRulesList.

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 authorisation rules

application/json

Property Type Required Description
[].description string No The description of the authorisation rule.
[].id integer (int64) No The unique ID for the authorisation rule.
[].operation enum: ALLOW, BLOCK No Determines whether the transactions should be allowed or blocked.
[].type enum: MCC, CURRENCY No The type of authorisation rule.
[].values array of string No A list of values based on the type of rule configured.

Example response:

[
  {
    "description": "Blacklist gambling MCCs",
    "id": 1,
    "operation": "BLOCK",
    "type": "MCC",
    "values": [
      "7801",
      "7802",
      "7995",
      "9754"
    ]
  }
]
429: Rate limit exceeded. Retry after the number of seconds specified in the Retry-After header

application/json

The response is object.