curl --request POST \
--url https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"type": "card_network",
"currency_code": "USD",
"amount": 1500,
"amount_breakdown": {
"principal": 0,
"interest": 0,
"fees": 1500
},
"effective_at": "2026-09-30T00:00:00Z",
"description": "Monthly card fee",
"details": {
"fee_type": "card",
"card_network": {
"card_id": "card_xyz123",
"bin": "412345",
"card_network": "visa",
"original_transaction_id": "user_credit_transaction_id_xyz",
"network_transfer_type": "card",
"authorization_amount": 1500,
"authorization_currency_code": "USD",
"settlement_amount": 1500,
"settlement_currency_code": "USD",
"settlement_date": "2026-09-30",
"merchant": {
"name": "Acme Inc.",
"address_line_1": "123 Main St",
"city": "Kansas City",
"state": "MO",
"country_code": "US",
"zip_code": "64105",
"mcc": "5411"
}
}
},
"funding_id": "funding_123",
"metadata": {}
}
'import requests
url = "https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions"
payload = {
"type": "card_network",
"currency_code": "USD",
"amount": 1500,
"amount_breakdown": {
"principal": 0,
"interest": 0,
"fees": 1500
},
"effective_at": "2026-09-30T00:00:00Z",
"description": "Monthly card fee",
"details": {
"fee_type": "card",
"card_network": {
"card_id": "card_xyz123",
"bin": "412345",
"card_network": "visa",
"original_transaction_id": "user_credit_transaction_id_xyz",
"network_transfer_type": "card",
"authorization_amount": 1500,
"authorization_currency_code": "USD",
"settlement_amount": 1500,
"settlement_currency_code": "USD",
"settlement_date": "2026-09-30",
"merchant": {
"name": "Acme Inc.",
"address_line_1": "123 Main St",
"city": "Kansas City",
"state": "MO",
"country_code": "US",
"zip_code": "64105",
"mcc": "5411"
}
}
},
"funding_id": "funding_123",
"metadata": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'card_network',
currency_code: 'USD',
amount: 1500,
amount_breakdown: {principal: 0, interest: 0, fees: 1500},
effective_at: '2026-09-30T00:00:00Z',
description: 'Monthly card fee',
details: {
fee_type: 'card',
card_network: {
card_id: 'card_xyz123',
bin: '412345',
card_network: 'visa',
original_transaction_id: 'user_credit_transaction_id_xyz',
network_transfer_type: 'card',
authorization_amount: 1500,
authorization_currency_code: 'USD',
settlement_amount: 1500,
settlement_currency_code: 'USD',
settlement_date: '2026-09-30',
merchant: {
name: 'Acme Inc.',
address_line_1: '123 Main St',
city: 'Kansas City',
state: 'MO',
country_code: 'US',
zip_code: '64105',
mcc: '5411'
}
}
},
funding_id: 'funding_123',
metadata: {}
})
};
fetch('https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_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://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_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([
'type' => 'card_network',
'currency_code' => 'USD',
'amount' => 1500,
'amount_breakdown' => [
'principal' => 0,
'interest' => 0,
'fees' => 1500
],
'effective_at' => '2026-09-30T00:00:00Z',
'description' => 'Monthly card fee',
'details' => [
'fee_type' => 'card',
'card_network' => [
'card_id' => 'card_xyz123',
'bin' => '412345',
'card_network' => 'visa',
'original_transaction_id' => 'user_credit_transaction_id_xyz',
'network_transfer_type' => 'card',
'authorization_amount' => 1500,
'authorization_currency_code' => 'USD',
'settlement_amount' => 1500,
'settlement_currency_code' => 'USD',
'settlement_date' => '2026-09-30',
'merchant' => [
'name' => 'Acme Inc.',
'address_line_1' => '123 Main St',
'city' => 'Kansas City',
'state' => 'MO',
'country_code' => 'US',
'zip_code' => '64105',
'mcc' => '5411'
]
]
],
'funding_id' => 'funding_123',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions"
payload := strings.NewReader("{\n \"type\": \"card_network\",\n \"currency_code\": \"USD\",\n \"amount\": 1500,\n \"amount_breakdown\": {\n \"principal\": 0,\n \"interest\": 0,\n \"fees\": 1500\n },\n \"effective_at\": \"2026-09-30T00:00:00Z\",\n \"description\": \"Monthly card fee\",\n \"details\": {\n \"fee_type\": \"card\",\n \"card_network\": {\n \"card_id\": \"card_xyz123\",\n \"bin\": \"412345\",\n \"card_network\": \"visa\",\n \"original_transaction_id\": \"user_credit_transaction_id_xyz\",\n \"network_transfer_type\": \"card\",\n \"authorization_amount\": 1500,\n \"authorization_currency_code\": \"USD\",\n \"settlement_amount\": 1500,\n \"settlement_currency_code\": \"USD\",\n \"settlement_date\": \"2026-09-30\",\n \"merchant\": {\n \"name\": \"Acme Inc.\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Kansas City\",\n \"state\": \"MO\",\n \"country_code\": \"US\",\n \"zip_code\": \"64105\",\n \"mcc\": \"5411\"\n }\n }\n },\n \"funding_id\": \"funding_123\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"card_network\",\n \"currency_code\": \"USD\",\n \"amount\": 1500,\n \"amount_breakdown\": {\n \"principal\": 0,\n \"interest\": 0,\n \"fees\": 1500\n },\n \"effective_at\": \"2026-09-30T00:00:00Z\",\n \"description\": \"Monthly card fee\",\n \"details\": {\n \"fee_type\": \"card\",\n \"card_network\": {\n \"card_id\": \"card_xyz123\",\n \"bin\": \"412345\",\n \"card_network\": \"visa\",\n \"original_transaction_id\": \"user_credit_transaction_id_xyz\",\n \"network_transfer_type\": \"card\",\n \"authorization_amount\": 1500,\n \"authorization_currency_code\": \"USD\",\n \"settlement_amount\": 1500,\n \"settlement_currency_code\": \"USD\",\n \"settlement_date\": \"2026-09-30\",\n \"merchant\": {\n \"name\": \"Acme Inc.\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Kansas City\",\n \"state\": \"MO\",\n \"country_code\": \"US\",\n \"zip_code\": \"64105\",\n \"mcc\": \"5411\"\n }\n }\n },\n \"funding_id\": \"funding_123\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"card_network\",\n \"currency_code\": \"USD\",\n \"amount\": 1500,\n \"amount_breakdown\": {\n \"principal\": 0,\n \"interest\": 0,\n \"fees\": 1500\n },\n \"effective_at\": \"2026-09-30T00:00:00Z\",\n \"description\": \"Monthly card fee\",\n \"details\": {\n \"fee_type\": \"card\",\n \"card_network\": {\n \"card_id\": \"card_xyz123\",\n \"bin\": \"412345\",\n \"card_network\": \"visa\",\n \"original_transaction_id\": \"user_credit_transaction_id_xyz\",\n \"network_transfer_type\": \"card\",\n \"authorization_amount\": 1500,\n \"authorization_currency_code\": \"USD\",\n \"settlement_amount\": 1500,\n \"settlement_currency_code\": \"USD\",\n \"settlement_date\": \"2026-09-30\",\n \"merchant\": {\n \"name\": \"Acme Inc.\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Kansas City\",\n \"state\": \"MO\",\n \"country_code\": \"US\",\n \"zip_code\": \"64105\",\n \"mcc\": \"5411\"\n }\n }\n },\n \"funding_id\": \"funding_123\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "user_credit_transaction_xyz123",
"user_credit_balance_id": "user_credit_balance_xyz123",
"type": "card_network",
"core_transaction_id": "core_transaction_xyz123",
"counterparty_core_transaction_id": "core_transaction_xyz123",
"currency_code": "USD",
"amount": 1500,
"amount_breakdown": {
"principal": 0,
"interest": 0,
"fees": 1500
},
"effective_at": "2026-09-30T00:00:00Z",
"metadata": {},
"created_at": "2026-09-30T11:01:36Z",
"updated_at": "2026-09-30T11:05:00Z",
"description": "Monthly card fee",
"amount_in_usd": 1500,
"details": {
"fee_type": "card",
"card_network": {
"card_id": "card_xyz123",
"bin": "412345",
"card_network": "visa",
"original_transaction_id": "user_credit_transaction_id_xyz",
"network_transfer_type": "card",
"authorization_amount": 1500,
"authorization_currency_code": "USD",
"settlement_amount": 1500,
"settlement_currency_code": "USD",
"settlement_date": "2026-09-30",
"merchant": {
"name": "Acme Inc.",
"address_line_1": "123 Main St",
"city": "Kansas City",
"state": "MO",
"country_code": "US",
"zip_code": "64105",
"mcc": "5411"
}
},
"rewards": {
"amount": 500,
"unit": "points"
},
"reversal": {
"original_transaction_id": "user_credit_transaction_xyz123"
}
},
"funding_id": "funding_123",
"reversal_transaction_id": "user_credit_transaction_abc789"
}{
"code": "request_malformed",
"message": "The request is invalid and cannot be parsed by the server.",
"errors": [
{
"code": "payload_invalid",
"message": "The request body is not valid JSON."
}
]
}{
"code": "authentication_missing",
"message": "The request has no authentication credentials. Send your API token in the Authorization header.",
"errors": [
{
"code": "authentication_missing",
"message": "The Authorization header is missing. Send your API token as a bearer token.",
"parameters": [
"Authorization"
]
}
]
}{
"code": "object_not_found",
"message": "No object exists at the requested ID, or it is not visible to this caller."
}{
"code": "idempotency_key_in_use",
"message": "A concurrent request using this Idempotency-Key is still in flight."
}{
"code": "parameters_invalid",
"message": "One or more parameters are invalid.",
"errors": [
{
"code": "required",
"message": "amount_breakdown.principal is required.",
"parameters": [
"amount_breakdown.principal"
]
},
{
"code": "dependent_parameter_required",
"message": "details.fee_type is required when type is fee.",
"parameters": [
"details.fee_type"
]
}
]
}{
"code": "rate_limit_exceeded",
"message": "You have exceeded the rate limit for this endpoint. Retry with backoff."
}{
"code": "internal_server_error",
"message": "An unexpected error occurred. Contact support with the Request-Id header value."
}{
"code": "endpoint_disabled",
"message": "This endpoint is temporarily disabled. Retry after the interval given in the Retry-After header."
}{
"code": "gateway_timeout",
"message": "An upstream system timed out. Retry with backoff."
}Create a User Credit Transaction
Create a User Credit Transaction on a User Credit Balance.
curl --request POST \
--url https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"type": "card_network",
"currency_code": "USD",
"amount": 1500,
"amount_breakdown": {
"principal": 0,
"interest": 0,
"fees": 1500
},
"effective_at": "2026-09-30T00:00:00Z",
"description": "Monthly card fee",
"details": {
"fee_type": "card",
"card_network": {
"card_id": "card_xyz123",
"bin": "412345",
"card_network": "visa",
"original_transaction_id": "user_credit_transaction_id_xyz",
"network_transfer_type": "card",
"authorization_amount": 1500,
"authorization_currency_code": "USD",
"settlement_amount": 1500,
"settlement_currency_code": "USD",
"settlement_date": "2026-09-30",
"merchant": {
"name": "Acme Inc.",
"address_line_1": "123 Main St",
"city": "Kansas City",
"state": "MO",
"country_code": "US",
"zip_code": "64105",
"mcc": "5411"
}
}
},
"funding_id": "funding_123",
"metadata": {}
}
'import requests
url = "https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions"
payload = {
"type": "card_network",
"currency_code": "USD",
"amount": 1500,
"amount_breakdown": {
"principal": 0,
"interest": 0,
"fees": 1500
},
"effective_at": "2026-09-30T00:00:00Z",
"description": "Monthly card fee",
"details": {
"fee_type": "card",
"card_network": {
"card_id": "card_xyz123",
"bin": "412345",
"card_network": "visa",
"original_transaction_id": "user_credit_transaction_id_xyz",
"network_transfer_type": "card",
"authorization_amount": 1500,
"authorization_currency_code": "USD",
"settlement_amount": 1500,
"settlement_currency_code": "USD",
"settlement_date": "2026-09-30",
"merchant": {
"name": "Acme Inc.",
"address_line_1": "123 Main St",
"city": "Kansas City",
"state": "MO",
"country_code": "US",
"zip_code": "64105",
"mcc": "5411"
}
}
},
"funding_id": "funding_123",
"metadata": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'card_network',
currency_code: 'USD',
amount: 1500,
amount_breakdown: {principal: 0, interest: 0, fees: 1500},
effective_at: '2026-09-30T00:00:00Z',
description: 'Monthly card fee',
details: {
fee_type: 'card',
card_network: {
card_id: 'card_xyz123',
bin: '412345',
card_network: 'visa',
original_transaction_id: 'user_credit_transaction_id_xyz',
network_transfer_type: 'card',
authorization_amount: 1500,
authorization_currency_code: 'USD',
settlement_amount: 1500,
settlement_currency_code: 'USD',
settlement_date: '2026-09-30',
merchant: {
name: 'Acme Inc.',
address_line_1: '123 Main St',
city: 'Kansas City',
state: 'MO',
country_code: 'US',
zip_code: '64105',
mcc: '5411'
}
}
},
funding_id: 'funding_123',
metadata: {}
})
};
fetch('https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_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://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_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([
'type' => 'card_network',
'currency_code' => 'USD',
'amount' => 1500,
'amount_breakdown' => [
'principal' => 0,
'interest' => 0,
'fees' => 1500
],
'effective_at' => '2026-09-30T00:00:00Z',
'description' => 'Monthly card fee',
'details' => [
'fee_type' => 'card',
'card_network' => [
'card_id' => 'card_xyz123',
'bin' => '412345',
'card_network' => 'visa',
'original_transaction_id' => 'user_credit_transaction_id_xyz',
'network_transfer_type' => 'card',
'authorization_amount' => 1500,
'authorization_currency_code' => 'USD',
'settlement_amount' => 1500,
'settlement_currency_code' => 'USD',
'settlement_date' => '2026-09-30',
'merchant' => [
'name' => 'Acme Inc.',
'address_line_1' => '123 Main St',
'city' => 'Kansas City',
'state' => 'MO',
'country_code' => 'US',
'zip_code' => '64105',
'mcc' => '5411'
]
]
],
'funding_id' => 'funding_123',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions"
payload := strings.NewReader("{\n \"type\": \"card_network\",\n \"currency_code\": \"USD\",\n \"amount\": 1500,\n \"amount_breakdown\": {\n \"principal\": 0,\n \"interest\": 0,\n \"fees\": 1500\n },\n \"effective_at\": \"2026-09-30T00:00:00Z\",\n \"description\": \"Monthly card fee\",\n \"details\": {\n \"fee_type\": \"card\",\n \"card_network\": {\n \"card_id\": \"card_xyz123\",\n \"bin\": \"412345\",\n \"card_network\": \"visa\",\n \"original_transaction_id\": \"user_credit_transaction_id_xyz\",\n \"network_transfer_type\": \"card\",\n \"authorization_amount\": 1500,\n \"authorization_currency_code\": \"USD\",\n \"settlement_amount\": 1500,\n \"settlement_currency_code\": \"USD\",\n \"settlement_date\": \"2026-09-30\",\n \"merchant\": {\n \"name\": \"Acme Inc.\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Kansas City\",\n \"state\": \"MO\",\n \"country_code\": \"US\",\n \"zip_code\": \"64105\",\n \"mcc\": \"5411\"\n }\n }\n },\n \"funding_id\": \"funding_123\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"card_network\",\n \"currency_code\": \"USD\",\n \"amount\": 1500,\n \"amount_breakdown\": {\n \"principal\": 0,\n \"interest\": 0,\n \"fees\": 1500\n },\n \"effective_at\": \"2026-09-30T00:00:00Z\",\n \"description\": \"Monthly card fee\",\n \"details\": {\n \"fee_type\": \"card\",\n \"card_network\": {\n \"card_id\": \"card_xyz123\",\n \"bin\": \"412345\",\n \"card_network\": \"visa\",\n \"original_transaction_id\": \"user_credit_transaction_id_xyz\",\n \"network_transfer_type\": \"card\",\n \"authorization_amount\": 1500,\n \"authorization_currency_code\": \"USD\",\n \"settlement_amount\": 1500,\n \"settlement_currency_code\": \"USD\",\n \"settlement_date\": \"2026-09-30\",\n \"merchant\": {\n \"name\": \"Acme Inc.\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Kansas City\",\n \"state\": \"MO\",\n \"country_code\": \"US\",\n \"zip_code\": \"64105\",\n \"mcc\": \"5411\"\n }\n }\n },\n \"funding_id\": \"funding_123\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"card_network\",\n \"currency_code\": \"USD\",\n \"amount\": 1500,\n \"amount_breakdown\": {\n \"principal\": 0,\n \"interest\": 0,\n \"fees\": 1500\n },\n \"effective_at\": \"2026-09-30T00:00:00Z\",\n \"description\": \"Monthly card fee\",\n \"details\": {\n \"fee_type\": \"card\",\n \"card_network\": {\n \"card_id\": \"card_xyz123\",\n \"bin\": \"412345\",\n \"card_network\": \"visa\",\n \"original_transaction_id\": \"user_credit_transaction_id_xyz\",\n \"network_transfer_type\": \"card\",\n \"authorization_amount\": 1500,\n \"authorization_currency_code\": \"USD\",\n \"settlement_amount\": 1500,\n \"settlement_currency_code\": \"USD\",\n \"settlement_date\": \"2026-09-30\",\n \"merchant\": {\n \"name\": \"Acme Inc.\",\n \"address_line_1\": \"123 Main St\",\n \"city\": \"Kansas City\",\n \"state\": \"MO\",\n \"country_code\": \"US\",\n \"zip_code\": \"64105\",\n \"mcc\": \"5411\"\n }\n }\n },\n \"funding_id\": \"funding_123\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "user_credit_transaction_xyz123",
"user_credit_balance_id": "user_credit_balance_xyz123",
"type": "card_network",
"core_transaction_id": "core_transaction_xyz123",
"counterparty_core_transaction_id": "core_transaction_xyz123",
"currency_code": "USD",
"amount": 1500,
"amount_breakdown": {
"principal": 0,
"interest": 0,
"fees": 1500
},
"effective_at": "2026-09-30T00:00:00Z",
"metadata": {},
"created_at": "2026-09-30T11:01:36Z",
"updated_at": "2026-09-30T11:05:00Z",
"description": "Monthly card fee",
"amount_in_usd": 1500,
"details": {
"fee_type": "card",
"card_network": {
"card_id": "card_xyz123",
"bin": "412345",
"card_network": "visa",
"original_transaction_id": "user_credit_transaction_id_xyz",
"network_transfer_type": "card",
"authorization_amount": 1500,
"authorization_currency_code": "USD",
"settlement_amount": 1500,
"settlement_currency_code": "USD",
"settlement_date": "2026-09-30",
"merchant": {
"name": "Acme Inc.",
"address_line_1": "123 Main St",
"city": "Kansas City",
"state": "MO",
"country_code": "US",
"zip_code": "64105",
"mcc": "5411"
}
},
"rewards": {
"amount": 500,
"unit": "points"
},
"reversal": {
"original_transaction_id": "user_credit_transaction_xyz123"
}
},
"funding_id": "funding_123",
"reversal_transaction_id": "user_credit_transaction_abc789"
}{
"code": "request_malformed",
"message": "The request is invalid and cannot be parsed by the server.",
"errors": [
{
"code": "payload_invalid",
"message": "The request body is not valid JSON."
}
]
}{
"code": "authentication_missing",
"message": "The request has no authentication credentials. Send your API token in the Authorization header.",
"errors": [
{
"code": "authentication_missing",
"message": "The Authorization header is missing. Send your API token as a bearer token.",
"parameters": [
"Authorization"
]
}
]
}{
"code": "object_not_found",
"message": "No object exists at the requested ID, or it is not visible to this caller."
}{
"code": "idempotency_key_in_use",
"message": "A concurrent request using this Idempotency-Key is still in flight."
}{
"code": "parameters_invalid",
"message": "One or more parameters are invalid.",
"errors": [
{
"code": "required",
"message": "amount_breakdown.principal is required.",
"parameters": [
"amount_breakdown.principal"
]
},
{
"code": "dependent_parameter_required",
"message": "details.fee_type is required when type is fee.",
"parameters": [
"details.fee_type"
]
}
]
}{
"code": "rate_limit_exceeded",
"message": "You have exceeded the rate limit for this endpoint. Retry with backoff."
}{
"code": "internal_server_error",
"message": "An unexpected error occurred. Contact support with the Request-Id header value."
}{
"code": "endpoint_disabled",
"message": "This endpoint is temporarily disabled. Retry after the interval given in the Retry-After header."
}{
"code": "gateway_timeout",
"message": "An upstream system timed out. Retry with backoff."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Idempotency key
5 - 255Path Parameters
The ID of the User Credit Balance to create the transaction against.
^user_credit_balance_\w+$Body
Request body for creating a new User Credit Transaction.
The type of the User Credit Transaction, which determines how the transaction affects the associated User Credit Balance.
card_network, funding, fee, fee_accrued, dispute_provisional, dispute_won, dispute_lost, charge_off, charge_off_recovery, rewards_earned, rewards_spent, rewards_redeemed, interest_accrued, adjustment, reallocation, payment, cancellation, client_credit "card_network"
A three-letter currency code as defined in ISO 4217.
USD "USD"
The transaction amount, represented in minor units. Sign rules and amount_breakdown treatment depend on type:
- Non-negative (
>= 0), rule applies toamountand all ofamount_breakdown.principal/.interest/.fees:dispute_lost - Non-negative (
>= 0), rule applies toamountandamount_breakdown.interestonly;amount_breakdown.principaland.feesare forced to0:funding,interest_accrued - Non-negative (
>= 0);amount_breakdown.principaland.interestare forced to0:fee - Strictly positive (
> 0);amount_breakdown.principaland.interestare forced to0:fee_accrued - Non-positive (
<= 0), rule applies toamountand all ofamount_breakdown.principal/.interest/.fees:payment,dispute_provisional,charge_off,rewards_redeemed,cancellation,client_credit,dispute_won,charge_off_recovery - Exactly
0, and all ofamount_breakdown.principal/.interest/.feesforced to0:rewards_earned,rewards_spent(the signed rewards value instead lives indetails.rewards.amount) - Exactly
0at the top level only;amount_breakdowncomponents may be nonzero as long as they sum to0:reallocation - Unconstrained:
card_network,adjustment
1500
A breakdown of amount into its principal, interest, and fee components. The three values must sum to amount.
Show child attributes
Show child attributes
An RFC 3339 timestamp representing when the transaction is effective. Must fall within the current or prior calendar quarter.
"2026-09-30T00:00:00Z"
An optional, client-provided description of the transaction. Limited to 120 characters.
120"Monthly card fee"
Additional details about the User Credit Transaction. Which properties are populated depends on the transaction type: fee_type is required when type is fee; rewards is required when type is rewards_redeemed, rewards_earned, or rewards_spent; card_network is present when type is card_network; reversal is present only on a transaction created by a reverse action.
Show child attributes
Show child attributes
The ID of the associated Funding object. Required when type is funding, and must be absent otherwise.
^funding_\w+$"funding_123"
A set of key-value pairs that can be used to store additional information related to this object.
Show child attributes
Show child attributes
Response
The created User Credit Transaction object.
The ID of the User Credit Transaction object.
^user_credit_transaction_\w+$"user_credit_transaction_xyz123"
The ID of the User Credit Balance that this transaction belongs to.
^user_credit_balance_\w+$"user_credit_balance_xyz123"
The type of the User Credit Transaction, which determines how the transaction affects the associated User Credit Balance.
card_network, funding, fee, fee_accrued, dispute_provisional, dispute_won, dispute_lost, charge_off, charge_off_recovery, rewards_earned, rewards_spent, rewards_redeemed, interest_accrued, adjustment, reallocation, payment, cancellation, client_credit "card_network"
The core transaction on the settlement (FBO) account side of this transaction's posting. Null until the transaction posts.
^core_transaction_.+~\d+$"core_transaction_xyz123"
The core transaction on the counterparty's operating account side of this transaction's posting. Present only when the counterparty account is a program DDA; null when the counterparty is a GL account, or until the transaction posts.
^core_transaction_.+~\d+$"core_transaction_xyz123"
A three-letter currency code as defined in ISO 4217.
USD "USD"
The transaction amount, represented in minor units. See CreateUserCreditTransactionRequest.amount for the per-type sign rules. On a transaction created by a reverse action, this is the negation of the original transaction's amount.
1500
A breakdown of amount into its principal, interest, and fee components. The three values must sum to amount.
Show child attributes
Show child attributes
An RFC 3339 timestamp representing when the transaction is effective.
"2026-09-30T00:00:00Z"
A set of key-value pairs that can be used to store additional information related to this object.
Show child attributes
Show child attributes
An ISO-8601 timestamp at which the User Credit Transaction was created.
"2026-09-30T11:01:36Z"
An ISO-8601 timestamp at which the User Credit Transaction was last updated.
"2026-09-30T11:05:00Z"
A client-provided description of the transaction.
120"Monthly card fee"
The transaction amount converted to USD, represented in minor units. On a transaction created by a reverse action, this is the negation of the original transaction's amount_in_usd.
1500
Additional details about the User Credit Transaction. Which properties are populated depends on the transaction type: fee_type is required when type is fee; rewards is required when type is rewards_redeemed, rewards_earned, or rewards_spent; card_network is present when type is card_network; reversal is present only on a transaction created by a reverse action.
Show child attributes
Show child attributes
The ID of the associated Funding object. Present when type is funding.
^funding_\w+$"funding_123"
The ID of the reversal User Credit Transaction created when this transaction was reversed. Present only once this transaction has been reversed.
^user_credit_transaction_\w+$"user_credit_transaction_abc789"
Was this page helpful?

