Skip to main content
POST
/
cards
/
{cardId}
/
auth-controls
cURL
curl --request POST \
  --url 'https://api.equalsmoney.com/v2/cards/{cardId}/auth-controls?accountId={{accountId}}' \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Spending controls",
  "id": "a1e54aed-8a68-4602-a792-30f4c67497cf",
  "active": true,
  "startTime": "2023-03-14T12:08:53Z",
  "endTime": "2023-03-14T12:08:53Z",
  "merchantScope": {
    "mcc": "3596",
    "mid": "string",
    "mccGroup": "Airlines"
  }
}
'
import requests

url = "https://api.equalsmoney.com/v2/cards/{cardId}/auth-controls"

payload = {
"name": "Spending controls",
"id": "a1e54aed-8a68-4602-a792-30f4c67497cf",
"active": True,
"startTime": "2023-03-14T12:08:53Z",
"endTime": "2023-03-14T12:08:53Z",
"merchantScope": {
"mcc": "3596",
"mid": "string",
"mccGroup": "Airlines"
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Spending controls',
id: 'a1e54aed-8a68-4602-a792-30f4c67497cf',
active: true,
startTime: '2023-03-14T12:08:53Z',
endTime: '2023-03-14T12:08:53Z',
merchantScope: {mcc: '3596', mid: 'string', mccGroup: 'Airlines'}
})
};

fetch('https://api.equalsmoney.com/v2/cards/{cardId}/auth-controls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.equalsmoney.com/v2/cards/{cardId}/auth-controls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Spending controls',
'id' => 'a1e54aed-8a68-4602-a792-30f4c67497cf',
'active' => true,
'startTime' => '2023-03-14T12:08:53Z',
'endTime' => '2023-03-14T12:08:53Z',
'merchantScope' => [
'mcc' => '3596',
'mid' => 'string',
'mccGroup' => 'Airlines'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.equalsmoney.com/v2/cards/{cardId}/auth-controls"

payload := strings.NewReader("{\n \"name\": \"Spending controls\",\n \"id\": \"a1e54aed-8a68-4602-a792-30f4c67497cf\",\n \"active\": true,\n \"startTime\": \"2023-03-14T12:08:53Z\",\n \"endTime\": \"2023-03-14T12:08:53Z\",\n \"merchantScope\": {\n \"mcc\": \"3596\",\n \"mid\": \"string\",\n \"mccGroup\": \"Airlines\"\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.equalsmoney.com/v2/cards/{cardId}/auth-controls")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Spending controls\",\n \"id\": \"a1e54aed-8a68-4602-a792-30f4c67497cf\",\n \"active\": true,\n \"startTime\": \"2023-03-14T12:08:53Z\",\n \"endTime\": \"2023-03-14T12:08:53Z\",\n \"merchantScope\": {\n \"mcc\": \"3596\",\n \"mid\": \"string\",\n \"mccGroup\": \"Airlines\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.equalsmoney.com/v2/cards/{cardId}/auth-controls")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Spending controls\",\n \"id\": \"a1e54aed-8a68-4602-a792-30f4c67497cf\",\n \"active\": true,\n \"startTime\": \"2023-03-14T12:08:53Z\",\n \"endTime\": \"2023-03-14T12:08:53Z\",\n \"merchantScope\": {\n \"mcc\": \"3596\",\n \"mid\": \"string\",\n \"mccGroup\": \"Airlines\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "name": "Spending controls",
  "id": "a1e54aed-8a68-4602-a792-30f4c67497cf",
  "active": true,
  "startTime": "2023-03-14T12:08:53Z",
  "endTime": "2023-03-14T12:08:53Z",
  "merchantScope": {
    "mcc": "3596",
    "mid": "string",
    "mccGroup": "Airlines"
  }
}

Authorizations

Authorization
string
header
required

Path Parameters

cardId
string<uuid>
required

The ID of the card to work with.

Maximum string length: 36
Example:

"e9293471-5eb3-4dbc-916c-dbaf9e2deefd"

Query Parameters

accountId
string
required

The ID of the account to work with.

Example:

"F50091"

personId
string<uuid>

The ID of the person to work with.

Maximum string length: 36
Example:

"775596ae-2624-40af-a9dc-9756110a4a04"

Body

application/json

Body

name
string
required

The name of the authorisation control.

Maximum string length: 255
Example:

"Spending controls"

id
string<uuid>

Unique identifier of the resource. If an id is not provided one will be generated.

Maximum string length: 36
Example:

"a1e54aed-8a68-4602-a792-30f4c67497cf"

active
boolean

If the auth control is active. Default is true.

Example:

true

startTime
string<date-time>

Date and time when the control goes into effect, in UTC.

Example:

"2023-03-14T12:08:53Z"

endTime
string<date-time>

Date and time when the control ends, in UTC.

Example:

"2023-03-14T12:08:53Z"

merchantScope
object

Response

201 - application/json

Created

name
string
required

The name of the authorisation control.

Maximum string length: 255
Example:

"Spending controls"

id
string<uuid>

Unique identifier of the resource. If an id is not provided one will be generated.

Maximum string length: 36
Example:

"a1e54aed-8a68-4602-a792-30f4c67497cf"

active
boolean

If the auth control is active. Default is true.

Example:

true

startTime
string<date-time>

Date and time when the control goes into effect, in UTC.

Example:

"2023-03-14T12:08:53Z"

endTime
string<date-time>

Date and time when the control ends, in UTC.

Example:

"2023-03-14T12:08:53Z"

merchantScope
object