curl --request POST \
--url https://{host}/bonus/v1/transactions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"operationId": "<string>",
"transactionType": "<string>",
"toAccountId": 123,
"fromAccountId": 123,
"accountExternalId": "<string>",
"amount": 123,
"metadata": {},
"instantCapture": true,
"expirationDate": "2023-11-07T05:31:56Z",
"autoCaptureDate": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{host}/bonus/v1/transactions"
payload = {
"operationId": "<string>",
"transactionType": "<string>",
"toAccountId": 123,
"fromAccountId": 123,
"accountExternalId": "<string>",
"amount": 123,
"metadata": {},
"instantCapture": True,
"expirationDate": "2023-11-07T05:31:56Z",
"autoCaptureDate": "2023-11-07T05:31:56Z"
}
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({
operationId: '<string>',
transactionType: '<string>',
toAccountId: 123,
fromAccountId: 123,
accountExternalId: '<string>',
amount: 123,
metadata: {},
instantCapture: true,
expirationDate: '2023-11-07T05:31:56Z',
autoCaptureDate: '2023-11-07T05:31:56Z'
})
};
fetch('https://{host}/bonus/v1/transactions', 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://{host}/bonus/v1/transactions",
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([
'operationId' => '<string>',
'transactionType' => '<string>',
'toAccountId' => 123,
'fromAccountId' => 123,
'accountExternalId' => '<string>',
'amount' => 123,
'metadata' => [
],
'instantCapture' => true,
'expirationDate' => '2023-11-07T05:31:56Z',
'autoCaptureDate' => '2023-11-07T05:31:56Z'
]),
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://{host}/bonus/v1/transactions"
payload := strings.NewReader("{\n \"operationId\": \"<string>\",\n \"transactionType\": \"<string>\",\n \"toAccountId\": 123,\n \"fromAccountId\": 123,\n \"accountExternalId\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"instantCapture\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"autoCaptureDate\": \"2023-11-07T05:31:56Z\"\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://{host}/bonus/v1/transactions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operationId\": \"<string>\",\n \"transactionType\": \"<string>\",\n \"toAccountId\": 123,\n \"fromAccountId\": 123,\n \"accountExternalId\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"instantCapture\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"autoCaptureDate\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/bonus/v1/transactions")
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 \"operationId\": \"<string>\",\n \"transactionType\": \"<string>\",\n \"toAccountId\": 123,\n \"fromAccountId\": 123,\n \"accountExternalId\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"instantCapture\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"autoCaptureDate\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"transactionId": 123,
"amount": 123
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Create a transaction
The transaction can be captured instantly if ‘InstantCapture’ parameter is set to true. Accrues the specified amount on the member’s active account. The specified amount can be negative, then the amount will be deducted from the member’s account. The operation is idempotent.
Attention: CreatePayment endpoint must be used for a payment.
curl --request POST \
--url https://{host}/bonus/v1/transactions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"operationId": "<string>",
"transactionType": "<string>",
"toAccountId": 123,
"fromAccountId": 123,
"accountExternalId": "<string>",
"amount": 123,
"metadata": {},
"instantCapture": true,
"expirationDate": "2023-11-07T05:31:56Z",
"autoCaptureDate": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{host}/bonus/v1/transactions"
payload = {
"operationId": "<string>",
"transactionType": "<string>",
"toAccountId": 123,
"fromAccountId": 123,
"accountExternalId": "<string>",
"amount": 123,
"metadata": {},
"instantCapture": True,
"expirationDate": "2023-11-07T05:31:56Z",
"autoCaptureDate": "2023-11-07T05:31:56Z"
}
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({
operationId: '<string>',
transactionType: '<string>',
toAccountId: 123,
fromAccountId: 123,
accountExternalId: '<string>',
amount: 123,
metadata: {},
instantCapture: true,
expirationDate: '2023-11-07T05:31:56Z',
autoCaptureDate: '2023-11-07T05:31:56Z'
})
};
fetch('https://{host}/bonus/v1/transactions', 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://{host}/bonus/v1/transactions",
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([
'operationId' => '<string>',
'transactionType' => '<string>',
'toAccountId' => 123,
'fromAccountId' => 123,
'accountExternalId' => '<string>',
'amount' => 123,
'metadata' => [
],
'instantCapture' => true,
'expirationDate' => '2023-11-07T05:31:56Z',
'autoCaptureDate' => '2023-11-07T05:31:56Z'
]),
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://{host}/bonus/v1/transactions"
payload := strings.NewReader("{\n \"operationId\": \"<string>\",\n \"transactionType\": \"<string>\",\n \"toAccountId\": 123,\n \"fromAccountId\": 123,\n \"accountExternalId\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"instantCapture\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"autoCaptureDate\": \"2023-11-07T05:31:56Z\"\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://{host}/bonus/v1/transactions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operationId\": \"<string>\",\n \"transactionType\": \"<string>\",\n \"toAccountId\": 123,\n \"fromAccountId\": 123,\n \"accountExternalId\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"instantCapture\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"autoCaptureDate\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/bonus/v1/transactions")
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 \"operationId\": \"<string>\",\n \"transactionType\": \"<string>\",\n \"toAccountId\": 123,\n \"fromAccountId\": 123,\n \"accountExternalId\": \"<string>\",\n \"amount\": 123,\n \"metadata\": {},\n \"instantCapture\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"autoCaptureDate\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"transactionId": 123,
"amount": 123
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Authorizations
JWT Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"
Body
Unique identifier of the operation (should be the same only for retries of the same operation).
1 - 128Type of the transaction (like: FixedBonus, EmployeeBonus, ...).
1Destination account Id
Source account Id
60Amount to be reserved. Can be positive or negative. If the amount is positive, then the amount is added to the member's account. If the amount is negative, then the amount is subtracted from the member's account.
Set of key-value pairs that you can attach to a transaction. This can be useful for storing additional information about the transaction in a structured format.
Show child attributes
Show child attributes
Indicates whether a capture of the reservation is instantaneous.
Optional expiration date
Optional date of the automatic capture of the transaction This field should be sent with a value only if InstantCapture = false