Simulate a card authorisation clearing
Simulates a card authorisation clearing.
This endpoint is for testing purposes only and won’t work in production.
POST
/
cards
/
simulations
/
transaction
/
authorization
/
clearing
cURL
curl --request POST \
--url 'https://api.equalsmoney.com/v2/cards/simulations/transaction/authorization/clearing?accountId={{accountId}}' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"precedingRelatedTransactionToken": "9d3dee7c-19df-4b71-bbb9-521bb04307bf",
"amount": 10,
"cardId": "f16ba382-eb42-481a-b08f-c57bdc9aae24"
}
'import requests
url = "https://api.equalsmoney.com/v2/cards/simulations/transaction/authorization/clearing"
payload = {
"precedingRelatedTransactionToken": "9d3dee7c-19df-4b71-bbb9-521bb04307bf",
"amount": 10,
"cardId": "f16ba382-eb42-481a-b08f-c57bdc9aae24"
}
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({
precedingRelatedTransactionToken: '9d3dee7c-19df-4b71-bbb9-521bb04307bf',
amount: 10,
cardId: 'f16ba382-eb42-481a-b08f-c57bdc9aae24'
})
};
fetch('https://api.equalsmoney.com/v2/cards/simulations/transaction/authorization/clearing', 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/simulations/transaction/authorization/clearing",
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([
'precedingRelatedTransactionToken' => '9d3dee7c-19df-4b71-bbb9-521bb04307bf',
'amount' => 10,
'cardId' => 'f16ba382-eb42-481a-b08f-c57bdc9aae24'
]),
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/simulations/transaction/authorization/clearing"
payload := strings.NewReader("{\n \"precedingRelatedTransactionToken\": \"9d3dee7c-19df-4b71-bbb9-521bb04307bf\",\n \"amount\": 10,\n \"cardId\": \"f16ba382-eb42-481a-b08f-c57bdc9aae24\"\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/simulations/transaction/authorization/clearing")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"precedingRelatedTransactionToken\": \"9d3dee7c-19df-4b71-bbb9-521bb04307bf\",\n \"amount\": 10,\n \"cardId\": \"f16ba382-eb42-481a-b08f-c57bdc9aae24\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.equalsmoney.com/v2/cards/simulations/transaction/authorization/clearing")
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 \"precedingRelatedTransactionToken\": \"9d3dee7c-19df-4b71-bbb9-521bb04307bf\",\n \"amount\": 10,\n \"cardId\": \"f16ba382-eb42-481a-b08f-c57bdc9aae24\"\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"acquirerFeeAmount": "1.2",
"type": "authorization.clearing",
"state": "COMPLETION",
"token": "7bff9f48-8c68-4937-917a-bf7cf4f0de27",
"userToken": "f0d5cae0-fb3f-417f-8f1c-51c5fb66259a",
"cardToken": "3c5d4203-99dc-4bbb-a8c4-e5c61fbe563a",
"requestAmount": "10.0",
"response": {
"code": "0000",
"memo": "Approved or completed successfully"
},
"createdTime": "2022-12-06T21:41:48Z",
"userTransactionTime": "2022-12-06T21:41:49Z",
"settlementDate": "2022-12-06T21:41:50Z",
"amount": "10.0",
"gpa": {
"ledgerBalance": "240.0",
"availableBalance": "240.0",
"impactedAmount": "-10.0"
},
"currencyCode": "GBP",
"currencyConversion": {
"originalAmount": "10.0",
"conversionRate": 1,
"originalCurrencyCode": "826"
},
"precedingRelatedTransactionToken": "8a6d911e-cb3d-41d2-b843-5f9dc97d503c",
"network": "VISA",
"subnetwork": "VISANET",
"cardAcceptor": {
"postalCode": "33705",
"mid": "000000000011111",
"mcc": "6411",
"name": "Card Acceptor Name",
"city": "Seattle",
"state": "WA",
"countryCode": "USA"
}
}
}Authorizations
Query Parameters
The ID of the account to work with.
Example:
"F50091"
Body
application/json
Body
The token of the transaction to work with.
Example:
"9d3dee7c-19df-4b71-bbb9-521bb04307bf"
The amount.
Required range:
x >= 0Example:
10
Optional. When supplied, em-cards-api routes the simulation to the Marqeta tenant matching the card's product market (UK or US). Omit to keep the legacy UK routing.
Maximum string length:
36Response
201 - application/json
Created
Details about the transaction.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
cURL
curl --request POST \
--url 'https://api.equalsmoney.com/v2/cards/simulations/transaction/authorization/clearing?accountId={{accountId}}' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"precedingRelatedTransactionToken": "9d3dee7c-19df-4b71-bbb9-521bb04307bf",
"amount": 10,
"cardId": "f16ba382-eb42-481a-b08f-c57bdc9aae24"
}
'import requests
url = "https://api.equalsmoney.com/v2/cards/simulations/transaction/authorization/clearing"
payload = {
"precedingRelatedTransactionToken": "9d3dee7c-19df-4b71-bbb9-521bb04307bf",
"amount": 10,
"cardId": "f16ba382-eb42-481a-b08f-c57bdc9aae24"
}
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({
precedingRelatedTransactionToken: '9d3dee7c-19df-4b71-bbb9-521bb04307bf',
amount: 10,
cardId: 'f16ba382-eb42-481a-b08f-c57bdc9aae24'
})
};
fetch('https://api.equalsmoney.com/v2/cards/simulations/transaction/authorization/clearing', 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/simulations/transaction/authorization/clearing",
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([
'precedingRelatedTransactionToken' => '9d3dee7c-19df-4b71-bbb9-521bb04307bf',
'amount' => 10,
'cardId' => 'f16ba382-eb42-481a-b08f-c57bdc9aae24'
]),
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/simulations/transaction/authorization/clearing"
payload := strings.NewReader("{\n \"precedingRelatedTransactionToken\": \"9d3dee7c-19df-4b71-bbb9-521bb04307bf\",\n \"amount\": 10,\n \"cardId\": \"f16ba382-eb42-481a-b08f-c57bdc9aae24\"\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/simulations/transaction/authorization/clearing")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"precedingRelatedTransactionToken\": \"9d3dee7c-19df-4b71-bbb9-521bb04307bf\",\n \"amount\": 10,\n \"cardId\": \"f16ba382-eb42-481a-b08f-c57bdc9aae24\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.equalsmoney.com/v2/cards/simulations/transaction/authorization/clearing")
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 \"precedingRelatedTransactionToken\": \"9d3dee7c-19df-4b71-bbb9-521bb04307bf\",\n \"amount\": 10,\n \"cardId\": \"f16ba382-eb42-481a-b08f-c57bdc9aae24\"\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"acquirerFeeAmount": "1.2",
"type": "authorization.clearing",
"state": "COMPLETION",
"token": "7bff9f48-8c68-4937-917a-bf7cf4f0de27",
"userToken": "f0d5cae0-fb3f-417f-8f1c-51c5fb66259a",
"cardToken": "3c5d4203-99dc-4bbb-a8c4-e5c61fbe563a",
"requestAmount": "10.0",
"response": {
"code": "0000",
"memo": "Approved or completed successfully"
},
"createdTime": "2022-12-06T21:41:48Z",
"userTransactionTime": "2022-12-06T21:41:49Z",
"settlementDate": "2022-12-06T21:41:50Z",
"amount": "10.0",
"gpa": {
"ledgerBalance": "240.0",
"availableBalance": "240.0",
"impactedAmount": "-10.0"
},
"currencyCode": "GBP",
"currencyConversion": {
"originalAmount": "10.0",
"conversionRate": 1,
"originalCurrencyCode": "826"
},
"precedingRelatedTransactionToken": "8a6d911e-cb3d-41d2-b843-5f9dc97d503c",
"network": "VISA",
"subnetwork": "VISANET",
"cardAcceptor": {
"postalCode": "33705",
"mid": "000000000011111",
"mcc": "6411",
"name": "Card Acceptor Name",
"city": "Seattle",
"state": "WA",
"countryCode": "USA"
}
}
}