Outgoing authorisation control webhook endpoint
This is not an endpoint. This is the description of a request that is sent to issuers’ decision-making systems
curl --request POST \
--url http://localhost/auth \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"id": "<string>",
"traceId": "<string>",
"linkId": "<string>"
},
"customer": {
"customerId": "<string>"
},
"account": {
"accountId": "<string>",
"availableAmount": {
"amount": 3.14,
"currency": "EUR"
}
},
"card": {
"cardId": "<string>",
"expiration": {
"year": 2019,
"month": 1
}
},
"transactionData": {
"transactionAmount": {
"amount": 3.14,
"currency": "EUR"
},
"cardholderPresent": true,
"merchantInitiated": true,
"cardholderVerifications": [],
"transactionFees": [
{
"feeAmount": {
"amount": 3.14,
"currency": "EUR"
}
}
],
"additionalAmountAccountType": "<string>",
"additionalAmountType": "<string>",
"transactionDateTime": "2023-11-07T05:31:56Z",
"authValidityInDays": 123,
"retrievalReferenceNumber": "<string>",
"authCode": "<string>",
"schemeTransactionLinkId": "<string>",
"incremental": true
},
"merchantData": {
"merchantCategory": {
"code": "5734",
"codeDescription": "<string>"
},
"acquirerId": "<string>",
"partialApprovalCapable": true,
"merchantId": "<string>",
"subMerchantId": "<string>",
"merchantName": "<string>",
"merchantCity": "<string>",
"merchantCountry": "FIN",
"acquirerCountry": "FIN",
"terminalId": "<string>"
}
}
'import requests
url = "http://localhost/auth"
payload = {
"metadata": {
"id": "<string>",
"traceId": "<string>",
"linkId": "<string>"
},
"customer": { "customerId": "<string>" },
"account": {
"accountId": "<string>",
"availableAmount": {
"amount": 3.14,
"currency": "EUR"
}
},
"card": {
"cardId": "<string>",
"expiration": {
"year": 2019,
"month": 1
}
},
"transactionData": {
"transactionAmount": {
"amount": 3.14,
"currency": "EUR"
},
"cardholderPresent": True,
"merchantInitiated": True,
"cardholderVerifications": [],
"transactionFees": [{ "feeAmount": {
"amount": 3.14,
"currency": "EUR"
} }],
"additionalAmountAccountType": "<string>",
"additionalAmountType": "<string>",
"transactionDateTime": "2023-11-07T05:31:56Z",
"authValidityInDays": 123,
"retrievalReferenceNumber": "<string>",
"authCode": "<string>",
"schemeTransactionLinkId": "<string>",
"incremental": True
},
"merchantData": {
"merchantCategory": {
"code": "5734",
"codeDescription": "<string>"
},
"acquirerId": "<string>",
"partialApprovalCapable": True,
"merchantId": "<string>",
"subMerchantId": "<string>",
"merchantName": "<string>",
"merchantCity": "<string>",
"merchantCountry": "FIN",
"acquirerCountry": "FIN",
"terminalId": "<string>"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {id: '<string>', traceId: '<string>', linkId: '<string>'},
customer: {customerId: '<string>'},
account: {accountId: '<string>', availableAmount: {amount: 3.14, currency: 'EUR'}},
card: {cardId: '<string>', expiration: {year: 2019, month: 1}},
transactionData: {
transactionAmount: {amount: 3.14, currency: 'EUR'},
cardholderPresent: true,
merchantInitiated: true,
cardholderVerifications: [],
transactionFees: [{feeAmount: {amount: 3.14, currency: 'EUR'}}],
additionalAmountAccountType: '<string>',
additionalAmountType: '<string>',
transactionDateTime: '2023-11-07T05:31:56Z',
authValidityInDays: 123,
retrievalReferenceNumber: '<string>',
authCode: '<string>',
schemeTransactionLinkId: '<string>',
incremental: true
},
merchantData: {
merchantCategory: {code: '5734', codeDescription: '<string>'},
acquirerId: '<string>',
partialApprovalCapable: true,
merchantId: '<string>',
subMerchantId: '<string>',
merchantName: '<string>',
merchantCity: '<string>',
merchantCountry: 'FIN',
acquirerCountry: 'FIN',
terminalId: '<string>'
}
})
};
fetch('http://localhost/auth', 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 => "http://localhost/auth",
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([
'metadata' => [
'id' => '<string>',
'traceId' => '<string>',
'linkId' => '<string>'
],
'customer' => [
'customerId' => '<string>'
],
'account' => [
'accountId' => '<string>',
'availableAmount' => [
'amount' => 3.14,
'currency' => 'EUR'
]
],
'card' => [
'cardId' => '<string>',
'expiration' => [
'year' => 2019,
'month' => 1
]
],
'transactionData' => [
'transactionAmount' => [
'amount' => 3.14,
'currency' => 'EUR'
],
'cardholderPresent' => true,
'merchantInitiated' => true,
'cardholderVerifications' => [
],
'transactionFees' => [
[
'feeAmount' => [
'amount' => 3.14,
'currency' => 'EUR'
]
]
],
'additionalAmountAccountType' => '<string>',
'additionalAmountType' => '<string>',
'transactionDateTime' => '2023-11-07T05:31:56Z',
'authValidityInDays' => 123,
'retrievalReferenceNumber' => '<string>',
'authCode' => '<string>',
'schemeTransactionLinkId' => '<string>',
'incremental' => true
],
'merchantData' => [
'merchantCategory' => [
'code' => '5734',
'codeDescription' => '<string>'
],
'acquirerId' => '<string>',
'partialApprovalCapable' => true,
'merchantId' => '<string>',
'subMerchantId' => '<string>',
'merchantName' => '<string>',
'merchantCity' => '<string>',
'merchantCountry' => 'FIN',
'acquirerCountry' => 'FIN',
'terminalId' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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 := "http://localhost/auth"
payload := strings.NewReader("{\n \"metadata\": {\n \"id\": \"<string>\",\n \"traceId\": \"<string>\",\n \"linkId\": \"<string>\"\n },\n \"customer\": {\n \"customerId\": \"<string>\"\n },\n \"account\": {\n \"accountId\": \"<string>\",\n \"availableAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n },\n \"card\": {\n \"cardId\": \"<string>\",\n \"expiration\": {\n \"year\": 2019,\n \"month\": 1\n }\n },\n \"transactionData\": {\n \"transactionAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n },\n \"cardholderPresent\": true,\n \"merchantInitiated\": true,\n \"cardholderVerifications\": [],\n \"transactionFees\": [\n {\n \"feeAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n }\n ],\n \"additionalAmountAccountType\": \"<string>\",\n \"additionalAmountType\": \"<string>\",\n \"transactionDateTime\": \"2023-11-07T05:31:56Z\",\n \"authValidityInDays\": 123,\n \"retrievalReferenceNumber\": \"<string>\",\n \"authCode\": \"<string>\",\n \"schemeTransactionLinkId\": \"<string>\",\n \"incremental\": true\n },\n \"merchantData\": {\n \"merchantCategory\": {\n \"code\": \"5734\",\n \"codeDescription\": \"<string>\"\n },\n \"acquirerId\": \"<string>\",\n \"partialApprovalCapable\": true,\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"merchantCity\": \"<string>\",\n \"merchantCountry\": \"FIN\",\n \"acquirerCountry\": \"FIN\",\n \"terminalId\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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("http://localhost/auth")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"id\": \"<string>\",\n \"traceId\": \"<string>\",\n \"linkId\": \"<string>\"\n },\n \"customer\": {\n \"customerId\": \"<string>\"\n },\n \"account\": {\n \"accountId\": \"<string>\",\n \"availableAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n },\n \"card\": {\n \"cardId\": \"<string>\",\n \"expiration\": {\n \"year\": 2019,\n \"month\": 1\n }\n },\n \"transactionData\": {\n \"transactionAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n },\n \"cardholderPresent\": true,\n \"merchantInitiated\": true,\n \"cardholderVerifications\": [],\n \"transactionFees\": [\n {\n \"feeAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n }\n ],\n \"additionalAmountAccountType\": \"<string>\",\n \"additionalAmountType\": \"<string>\",\n \"transactionDateTime\": \"2023-11-07T05:31:56Z\",\n \"authValidityInDays\": 123,\n \"retrievalReferenceNumber\": \"<string>\",\n \"authCode\": \"<string>\",\n \"schemeTransactionLinkId\": \"<string>\",\n \"incremental\": true\n },\n \"merchantData\": {\n \"merchantCategory\": {\n \"code\": \"5734\",\n \"codeDescription\": \"<string>\"\n },\n \"acquirerId\": \"<string>\",\n \"partialApprovalCapable\": true,\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"merchantCity\": \"<string>\",\n \"merchantCountry\": \"FIN\",\n \"acquirerCountry\": \"FIN\",\n \"terminalId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/auth")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"id\": \"<string>\",\n \"traceId\": \"<string>\",\n \"linkId\": \"<string>\"\n },\n \"customer\": {\n \"customerId\": \"<string>\"\n },\n \"account\": {\n \"accountId\": \"<string>\",\n \"availableAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n },\n \"card\": {\n \"cardId\": \"<string>\",\n \"expiration\": {\n \"year\": 2019,\n \"month\": 1\n }\n },\n \"transactionData\": {\n \"transactionAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n },\n \"cardholderPresent\": true,\n \"merchantInitiated\": true,\n \"cardholderVerifications\": [],\n \"transactionFees\": [\n {\n \"feeAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n }\n ],\n \"additionalAmountAccountType\": \"<string>\",\n \"additionalAmountType\": \"<string>\",\n \"transactionDateTime\": \"2023-11-07T05:31:56Z\",\n \"authValidityInDays\": 123,\n \"retrievalReferenceNumber\": \"<string>\",\n \"authCode\": \"<string>\",\n \"schemeTransactionLinkId\": \"<string>\",\n \"incremental\": true\n },\n \"merchantData\": {\n \"merchantCategory\": {\n \"code\": \"5734\",\n \"codeDescription\": \"<string>\"\n },\n \"acquirerId\": \"<string>\",\n \"partialApprovalCapable\": true,\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"merchantCity\": \"<string>\",\n \"merchantCountry\": \"FIN\",\n \"acquirerCountry\": \"FIN\",\n \"terminalId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"transactionData": {
"authResponseCode": {
"code": "00"
},
"additionalAmountAccountType": "<string>",
"additionalAmountType": "<string>",
"additionalAmount": {
"amount": 3.14,
"currency": "EUR"
},
"partialApprovalAmount": {
"amount": 3.14,
"currency": "EUR"
},
"availableBalance": {
"amount": 3.14,
"currency": "EUR"
}
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
The metadata includes relevant message and authorisation ids and the message category that identifies the type of authorisation message.
Show child attributes
Show child attributes
Data of the customer linked to the card with which the transaction is done with. Enables the issuer to identify to which customer the authorisation is related to.
Show child attributes
Show child attributes
Data of the account linked to the card with which the transaction is done with. Enables the issuer to identify to which account the authorisation is related to.
Show child attributes
Show child attributes
Data of the card with which the transaction is done with. Enables the issuer to identify to which card the authorisation is related to.
Show child attributes
Show child attributes
Transaction specific data including amounts and fees, transaction type as well as information about the purchase conditions.
Show child attributes
Show child attributes
Merchant specific data including acquirer data, merchant data and merchant category.
Show child attributes
Show child attributes
Data of the token with which the transaction is done with. Enables the issuer to identify if a token was used and what kind.
Show child attributes
Show child attributes
Response
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url http://localhost/auth \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"id": "<string>",
"traceId": "<string>",
"linkId": "<string>"
},
"customer": {
"customerId": "<string>"
},
"account": {
"accountId": "<string>",
"availableAmount": {
"amount": 3.14,
"currency": "EUR"
}
},
"card": {
"cardId": "<string>",
"expiration": {
"year": 2019,
"month": 1
}
},
"transactionData": {
"transactionAmount": {
"amount": 3.14,
"currency": "EUR"
},
"cardholderPresent": true,
"merchantInitiated": true,
"cardholderVerifications": [],
"transactionFees": [
{
"feeAmount": {
"amount": 3.14,
"currency": "EUR"
}
}
],
"additionalAmountAccountType": "<string>",
"additionalAmountType": "<string>",
"transactionDateTime": "2023-11-07T05:31:56Z",
"authValidityInDays": 123,
"retrievalReferenceNumber": "<string>",
"authCode": "<string>",
"schemeTransactionLinkId": "<string>",
"incremental": true
},
"merchantData": {
"merchantCategory": {
"code": "5734",
"codeDescription": "<string>"
},
"acquirerId": "<string>",
"partialApprovalCapable": true,
"merchantId": "<string>",
"subMerchantId": "<string>",
"merchantName": "<string>",
"merchantCity": "<string>",
"merchantCountry": "FIN",
"acquirerCountry": "FIN",
"terminalId": "<string>"
}
}
'import requests
url = "http://localhost/auth"
payload = {
"metadata": {
"id": "<string>",
"traceId": "<string>",
"linkId": "<string>"
},
"customer": { "customerId": "<string>" },
"account": {
"accountId": "<string>",
"availableAmount": {
"amount": 3.14,
"currency": "EUR"
}
},
"card": {
"cardId": "<string>",
"expiration": {
"year": 2019,
"month": 1
}
},
"transactionData": {
"transactionAmount": {
"amount": 3.14,
"currency": "EUR"
},
"cardholderPresent": True,
"merchantInitiated": True,
"cardholderVerifications": [],
"transactionFees": [{ "feeAmount": {
"amount": 3.14,
"currency": "EUR"
} }],
"additionalAmountAccountType": "<string>",
"additionalAmountType": "<string>",
"transactionDateTime": "2023-11-07T05:31:56Z",
"authValidityInDays": 123,
"retrievalReferenceNumber": "<string>",
"authCode": "<string>",
"schemeTransactionLinkId": "<string>",
"incremental": True
},
"merchantData": {
"merchantCategory": {
"code": "5734",
"codeDescription": "<string>"
},
"acquirerId": "<string>",
"partialApprovalCapable": True,
"merchantId": "<string>",
"subMerchantId": "<string>",
"merchantName": "<string>",
"merchantCity": "<string>",
"merchantCountry": "FIN",
"acquirerCountry": "FIN",
"terminalId": "<string>"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {id: '<string>', traceId: '<string>', linkId: '<string>'},
customer: {customerId: '<string>'},
account: {accountId: '<string>', availableAmount: {amount: 3.14, currency: 'EUR'}},
card: {cardId: '<string>', expiration: {year: 2019, month: 1}},
transactionData: {
transactionAmount: {amount: 3.14, currency: 'EUR'},
cardholderPresent: true,
merchantInitiated: true,
cardholderVerifications: [],
transactionFees: [{feeAmount: {amount: 3.14, currency: 'EUR'}}],
additionalAmountAccountType: '<string>',
additionalAmountType: '<string>',
transactionDateTime: '2023-11-07T05:31:56Z',
authValidityInDays: 123,
retrievalReferenceNumber: '<string>',
authCode: '<string>',
schemeTransactionLinkId: '<string>',
incremental: true
},
merchantData: {
merchantCategory: {code: '5734', codeDescription: '<string>'},
acquirerId: '<string>',
partialApprovalCapable: true,
merchantId: '<string>',
subMerchantId: '<string>',
merchantName: '<string>',
merchantCity: '<string>',
merchantCountry: 'FIN',
acquirerCountry: 'FIN',
terminalId: '<string>'
}
})
};
fetch('http://localhost/auth', 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 => "http://localhost/auth",
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([
'metadata' => [
'id' => '<string>',
'traceId' => '<string>',
'linkId' => '<string>'
],
'customer' => [
'customerId' => '<string>'
],
'account' => [
'accountId' => '<string>',
'availableAmount' => [
'amount' => 3.14,
'currency' => 'EUR'
]
],
'card' => [
'cardId' => '<string>',
'expiration' => [
'year' => 2019,
'month' => 1
]
],
'transactionData' => [
'transactionAmount' => [
'amount' => 3.14,
'currency' => 'EUR'
],
'cardholderPresent' => true,
'merchantInitiated' => true,
'cardholderVerifications' => [
],
'transactionFees' => [
[
'feeAmount' => [
'amount' => 3.14,
'currency' => 'EUR'
]
]
],
'additionalAmountAccountType' => '<string>',
'additionalAmountType' => '<string>',
'transactionDateTime' => '2023-11-07T05:31:56Z',
'authValidityInDays' => 123,
'retrievalReferenceNumber' => '<string>',
'authCode' => '<string>',
'schemeTransactionLinkId' => '<string>',
'incremental' => true
],
'merchantData' => [
'merchantCategory' => [
'code' => '5734',
'codeDescription' => '<string>'
],
'acquirerId' => '<string>',
'partialApprovalCapable' => true,
'merchantId' => '<string>',
'subMerchantId' => '<string>',
'merchantName' => '<string>',
'merchantCity' => '<string>',
'merchantCountry' => 'FIN',
'acquirerCountry' => 'FIN',
'terminalId' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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 := "http://localhost/auth"
payload := strings.NewReader("{\n \"metadata\": {\n \"id\": \"<string>\",\n \"traceId\": \"<string>\",\n \"linkId\": \"<string>\"\n },\n \"customer\": {\n \"customerId\": \"<string>\"\n },\n \"account\": {\n \"accountId\": \"<string>\",\n \"availableAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n },\n \"card\": {\n \"cardId\": \"<string>\",\n \"expiration\": {\n \"year\": 2019,\n \"month\": 1\n }\n },\n \"transactionData\": {\n \"transactionAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n },\n \"cardholderPresent\": true,\n \"merchantInitiated\": true,\n \"cardholderVerifications\": [],\n \"transactionFees\": [\n {\n \"feeAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n }\n ],\n \"additionalAmountAccountType\": \"<string>\",\n \"additionalAmountType\": \"<string>\",\n \"transactionDateTime\": \"2023-11-07T05:31:56Z\",\n \"authValidityInDays\": 123,\n \"retrievalReferenceNumber\": \"<string>\",\n \"authCode\": \"<string>\",\n \"schemeTransactionLinkId\": \"<string>\",\n \"incremental\": true\n },\n \"merchantData\": {\n \"merchantCategory\": {\n \"code\": \"5734\",\n \"codeDescription\": \"<string>\"\n },\n \"acquirerId\": \"<string>\",\n \"partialApprovalCapable\": true,\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"merchantCity\": \"<string>\",\n \"merchantCountry\": \"FIN\",\n \"acquirerCountry\": \"FIN\",\n \"terminalId\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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("http://localhost/auth")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"id\": \"<string>\",\n \"traceId\": \"<string>\",\n \"linkId\": \"<string>\"\n },\n \"customer\": {\n \"customerId\": \"<string>\"\n },\n \"account\": {\n \"accountId\": \"<string>\",\n \"availableAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n },\n \"card\": {\n \"cardId\": \"<string>\",\n \"expiration\": {\n \"year\": 2019,\n \"month\": 1\n }\n },\n \"transactionData\": {\n \"transactionAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n },\n \"cardholderPresent\": true,\n \"merchantInitiated\": true,\n \"cardholderVerifications\": [],\n \"transactionFees\": [\n {\n \"feeAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n }\n ],\n \"additionalAmountAccountType\": \"<string>\",\n \"additionalAmountType\": \"<string>\",\n \"transactionDateTime\": \"2023-11-07T05:31:56Z\",\n \"authValidityInDays\": 123,\n \"retrievalReferenceNumber\": \"<string>\",\n \"authCode\": \"<string>\",\n \"schemeTransactionLinkId\": \"<string>\",\n \"incremental\": true\n },\n \"merchantData\": {\n \"merchantCategory\": {\n \"code\": \"5734\",\n \"codeDescription\": \"<string>\"\n },\n \"acquirerId\": \"<string>\",\n \"partialApprovalCapable\": true,\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"merchantCity\": \"<string>\",\n \"merchantCountry\": \"FIN\",\n \"acquirerCountry\": \"FIN\",\n \"terminalId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/auth")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"id\": \"<string>\",\n \"traceId\": \"<string>\",\n \"linkId\": \"<string>\"\n },\n \"customer\": {\n \"customerId\": \"<string>\"\n },\n \"account\": {\n \"accountId\": \"<string>\",\n \"availableAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n },\n \"card\": {\n \"cardId\": \"<string>\",\n \"expiration\": {\n \"year\": 2019,\n \"month\": 1\n }\n },\n \"transactionData\": {\n \"transactionAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n },\n \"cardholderPresent\": true,\n \"merchantInitiated\": true,\n \"cardholderVerifications\": [],\n \"transactionFees\": [\n {\n \"feeAmount\": {\n \"amount\": 3.14,\n \"currency\": \"EUR\"\n }\n }\n ],\n \"additionalAmountAccountType\": \"<string>\",\n \"additionalAmountType\": \"<string>\",\n \"transactionDateTime\": \"2023-11-07T05:31:56Z\",\n \"authValidityInDays\": 123,\n \"retrievalReferenceNumber\": \"<string>\",\n \"authCode\": \"<string>\",\n \"schemeTransactionLinkId\": \"<string>\",\n \"incremental\": true\n },\n \"merchantData\": {\n \"merchantCategory\": {\n \"code\": \"5734\",\n \"codeDescription\": \"<string>\"\n },\n \"acquirerId\": \"<string>\",\n \"partialApprovalCapable\": true,\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\",\n \"merchantName\": \"<string>\",\n \"merchantCity\": \"<string>\",\n \"merchantCountry\": \"FIN\",\n \"acquirerCountry\": \"FIN\",\n \"terminalId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"transactionData": {
"authResponseCode": {
"code": "00"
},
"additionalAmountAccountType": "<string>",
"additionalAmountType": "<string>",
"additionalAmount": {
"amount": 3.14,
"currency": "EUR"
},
"partialApprovalAmount": {
"amount": 3.14,
"currency": "EUR"
},
"availableBalance": {
"amount": 3.14,
"currency": "EUR"
}
}
}
