Pay everyone you work with from one wallet.
Freelancers, partners, suppliers, whole teams. Xtrm is a global payment platform, and with the Xtrm API you fund one wallet and pay them all with a single request.
That request is a batch. One batch can carry as many payments as your account allows, mix individuals and businesses, and pay each one the way that suits whoever receives it: straight to their Xtrm wallet or bank account, onto a prepaid debit card or digital gift card, to a card with Rapid Transfer, or by mailed check in the US.
You stay in the loop, too. Xtrm checks every payment's details the moment you submit the batch and tells you right away which ones it accepted. From there, webhooks and status calls keep you posted on every payment.
Payments and currency exchange are executed by regulated financial partners.
Get a sandbox token and pay your first batch payment.
ConceptsHow batch payments workThe batch lifecycle, wallet-first delivery, statuses, webhooks and retries.
Batch paymentsAPI referenceCreate a batch and check the status of the batch and each payment, with samples in six languages.
#Pay for your company, or for your clients
Paying your own recipients? Use your own API credentials and start with the Quickstart.
Running payments for other companies? As a managing platform, you make the same calls with each client company's pseudo credentials, so one integration serves every client. Pseudo credentials require manager services, which Xtrm turns on for your company. Start with How managing platforms work.
#Why use batch payments
- One request, many payments. Pay individuals and businesses in the same batch, each by the method that suits them. See Payment methods & destinations.
- Every payment checked first. Xtrm checks each payment's details before any money moves, so fewer payments fail.
- Wallet-first delivery. Every payment goes through the recipient's Xtrm wallet on its way to their bank, card or other destination, so every payment takes the same path and is easy to reconcile.
- Wallets picked for you. Leave out the wallet and Xtrm pays into the recipient's wallet in the batch currency, and creates one if they don't have it yet.
- Your IDs, end to end. You name every batch and payment with your own IDs, and they come back in every response and webhook.
- Tracking built in. Signed webhooks and status calls tell you where every payment stands.
#How a batch payment works
Every batch payment integration follows the same six steps. Each one links to the page that covers it in depth.
- Authenticate
Exchange your client ID and secret for an access token at
/oAuth/token, then send it asAuthorization: Bearer <access_token>on every call. See Authentication. - Fund your source wallet
Every batch is paid from one of your company wallets, its
SourceWalletId, and that wallet sets the currency of the whole batch. Check balances withGetCompanyWallets, fund the wallet by bank transfer, bank debit or credit card, and exchange currency when you need to. See Fund your wallet. - Add recipients
Each payment goes to a
RecipientId: an existing individual recipient (PAT…) or business recipient (SPN…) account. Look up or create your recipients, and link the bank accounts or cards you want to pay to. Linking needs a connection to the recipient, which your company has with every recipient it creates. - Submit the batch payment
Put all the payments in one
BatchTransferrequest (POST /API/v4/Fund/BatchTransfer). Each item names aRecipientId, anAmount(a JSON number), aSendMethodIdand aDestinationwhose fields depend on that method. A batch holds up to your account's item limit.202 Acceptedmeans Xtrm accepted the payments that passed its checks for processing. The status endpoints show which payments were stored, and nothing is debited until Xtrm processes each one. You can have several batches in flight. See Create a batch payment. - Track every payment
Xtrm processes the accepted payments in the background. Check the status of the batch or of a single payment, with
history=trueto include every attempt. Xtrm can also notify your server with webhooks signed with HMAC-SHA256, on one endpoint per company account that Xtrm support sets up with you; see Enable webhooks. Confirm each payment's final status with the status endpoints. See Batch and payment statuses. - Reconcile and retry
Match the
CustomerBatchIdandCustomerTransactionIdin each response and webhook to your own records. Every payment ends in one of three statuses:Success: the provider accepted the payment or, for a wallet payment, Xtrm credited the wallet.RetainedInWallet: Xtrm has credited the money to the recipient's Xtrm wallet and is delivering it on. Bank, card, check, gift card and prepaid payments pass through this status, usually only briefly, on their way toSuccess, so don't act on it while the batch is stillProcessing. A payment that is stillRetainedInWalletonce the batch status is final has stuck: the delivery didn't go through, the money stays in the recipient's Xtrm wallet, and the fee isn't refunded. Treat it like a wallet payment: the recipient transfers it out in the Xtrm web app, or, if your company is connected to the recipient, you request that transfer for them with their one-time password. You can't retry it as a batch payment. Webhook events never carry this status: a delivery that didn't go through arrives as aBatch.Item.Completedevent withStatusSuccessandDeliveryTypeWallet(see Events for a delivery to the destination). See When a payment stays RetainedInWallet.Failed: the payment's latest attempt (withhistory=true) carries anErrorCodesuch asINSUFFICIENT_BALANCE. To retry it once you've fixed the cause, resubmit it under its originalCustomerBatchIdandCustomerTransactionId; it gets a newAttemptNoand keeps its earlier attempts.
Batch and payment statuses says what to do for each status and error code, and Retries & idempotency covers resubmitting safely.
#Your first batch payment
Every call starts with an access token. Set XTRM_CLIENT_ID and XTRM_CLIENT_SECRET to the sandbox credentials from your Xtrm dashboard (Settings → Integrations → Get Credentials), then run:
curl -X POST "https://xapisandbox.xtrm.com/oAuth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json" \
--data-urlencode "grant_type=password" \
--data-urlencode "client_id=$XTRM_CLIENT_ID" \
--data-urlencode "client_secret=$XTRM_CLIENT_SECRET"const response = await fetch('https://xapisandbox.xtrm.com/oAuth/token', {
method: 'POST',
headers: { Accept: 'application/json' },
body: new URLSearchParams({
grant_type: 'password',
client_id: process.env.XTRM_CLIENT_ID,
client_secret: process.env.XTRM_CLIENT_SECRET,
}),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const data = await response.json();
console.log(JSON.stringify(data, null, 2));import os
import requests
response = requests.post(
"https://xapisandbox.xtrm.com/oAuth/token",
headers={"Accept": "application/json"},
data={
"grant_type": "password",
"client_id": os.environ["XTRM_CLIENT_ID"],
"client_secret": os.environ["XTRM_CLIENT_SECRET"],
},
)
if not response.ok:
raise SystemExit(f"{response.status_code} {response.text}")
print(response.json())using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var form = new FormUrlEncodedContent(new Dictionary<string, string>
{
["grant_type"] = "password",
["client_id"] = Environment.GetEnvironmentVariable("XTRM_CLIENT_ID")!,
["client_secret"] = Environment.GetEnvironmentVariable("XTRM_CLIENT_SECRET")!,
});
var response = await client.PostAsync("https://xapisandbox.xtrm.com/oAuth/token", form);
var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode) throw new HttpRequestException($"{(int)response.StatusCode} {body}");
Console.WriteLine(body);import java.net.URI;
import java.net.URLEncoder;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
String form = "grant_type=password"
+ "&client_id=" + URLEncoder.encode(System.getenv("XTRM_CLIENT_ID"), StandardCharsets.UTF_8)
+ "&client_secret=" + URLEncoder.encode(System.getenv("XTRM_CLIENT_SECRET"), StandardCharsets.UTF_8);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://xapisandbox.xtrm.com/oAuth/token"))
.header("Content-Type", "application/x-www-form-urlencoded")
.header("Accept", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(form))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 400) throw new RuntimeException(response.statusCode() + " " + response.body());
System.out.println(response.body());<?php
$ch = curl_init('https://xapisandbox.xtrm.com/oAuth/token');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'grant_type' => 'password',
'client_id' => getenv('XTRM_CLIENT_ID'),
'client_secret' => getenv('XTRM_CLIENT_SECRET'),
]),
CURLOPT_HTTPHEADER => ['Accept: application/json'],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException("HTTP $status: $response");
}
print_r(json_decode($response, true));Copy the access_token from the response into XTRM_ACCESS_TOKEN. This batch payment pays a business recipient by ACH bank transfer and an individual recipient with a prepaid debit card, both from wallet 122181. It assumes both recipients exist and the bank account is linked to the business recipient: Pay individual recipients, Pay business recipients and Bank accounts & transfers cover those steps. Replace the account numbers, wallet ID, destinations and IDs with your own sandbox values. CustomerBatchId values are shared across all Xtrm accounts, so make yours unique, for example by including your account number or a UUID.
curl -X POST "https://xapisandbox.xtrm.com/API/v4/Fund/BatchTransfer" \
-H "Authorization: Bearer $XTRM_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"IssuerAccountNumber": "SPN1111222",
"SourceWalletId": 122181,
"CustomerBatchId": "BATCH-HOME-0001",
"Items": [
{
"CustomerTransactionId": "TXN-HOME-0001",
"RecipientId": "SPN8888777",
"Amount": 100,
"Destination": {
"BeneficiaryBankID": "41953ec32f3e4765a35a902c82bdd995",
"BeneficiaryBankPaymentMethod": "ACH"
},
"SendMethodId": "XTR94500",
"Description": "TXN-HOME-0001 Q3 Executive Sales Performance Incentive"
},
{
"CustomerTransactionId": "TXN-HOME-0002",
"RecipientId": "PAT9999888",
"Amount": 50,
"Destination": {
"Email": "[email protected]",
"SKU": "PREP9001"
},
"SendMethodId": "XTR94503",
"Description": "TXN-HOME-0002 Q3 Top Performer Contractor Reward"
}
]
}'const response = await fetch('https://xapisandbox.xtrm.com/API/v4/Fund/BatchTransfer', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.XTRM_ACCESS_TOKEN}`,
'Content-Type': 'application/json',
Accept: 'application/json',
},
body: JSON.stringify({
IssuerAccountNumber: 'SPN1111222',
SourceWalletId: 122181,
CustomerBatchId: 'BATCH-HOME-0001',
Items: [
{
CustomerTransactionId: 'TXN-HOME-0001',
RecipientId: 'SPN8888777',
Amount: 100,
Destination: {
BeneficiaryBankID: '41953ec32f3e4765a35a902c82bdd995',
BeneficiaryBankPaymentMethod: 'ACH',
},
SendMethodId: 'XTR94500',
Description: 'TXN-HOME-0001 Q3 Executive Sales Performance Incentive',
},
{
CustomerTransactionId: 'TXN-HOME-0002',
RecipientId: 'PAT9999888',
Amount: 50,
Destination: {
Email: '[email protected]',
SKU: 'PREP9001',
},
SendMethodId: 'XTR94503',
Description: 'TXN-HOME-0002 Q3 Top Performer Contractor Reward',
},
],
}),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const data = await response.json();
console.log(JSON.stringify(data, null, 2));import os
import requests
response = requests.post(
"https://xapisandbox.xtrm.com/API/v4/Fund/BatchTransfer",
headers={
"Authorization": f"Bearer {os.environ['XTRM_ACCESS_TOKEN']}",
"Accept": "application/json",
},
json={
"IssuerAccountNumber": "SPN1111222",
"SourceWalletId": 122181,
"CustomerBatchId": "BATCH-HOME-0001",
"Items": [
{
"CustomerTransactionId": "TXN-HOME-0001",
"RecipientId": "SPN8888777",
"Amount": 100,
"Destination": {
"BeneficiaryBankID": "41953ec32f3e4765a35a902c82bdd995",
"BeneficiaryBankPaymentMethod": "ACH",
},
"SendMethodId": "XTR94500",
"Description": "TXN-HOME-0001 Q3 Executive Sales Performance Incentive",
},
{
"CustomerTransactionId": "TXN-HOME-0002",
"RecipientId": "PAT9999888",
"Amount": 50,
"Destination": {
"Email": "[email protected]",
"SKU": "PREP9001",
},
"SendMethodId": "XTR94503",
"Description": "TXN-HOME-0002 Q3 Top Performer Contractor Reward",
},
],
},
)
if not response.ok:
raise SystemExit(f"{response.status_code} {response.text}")
print(response.json())using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("XTRM_ACCESS_TOKEN"));
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var json = """
{
"IssuerAccountNumber": "SPN1111222",
"SourceWalletId": 122181,
"CustomerBatchId": "BATCH-HOME-0001",
"Items": [
{
"CustomerTransactionId": "TXN-HOME-0001",
"RecipientId": "SPN8888777",
"Amount": 100,
"Destination": {
"BeneficiaryBankID": "41953ec32f3e4765a35a902c82bdd995",
"BeneficiaryBankPaymentMethod": "ACH"
},
"SendMethodId": "XTR94500",
"Description": "TXN-HOME-0001 Q3 Executive Sales Performance Incentive"
},
{
"CustomerTransactionId": "TXN-HOME-0002",
"RecipientId": "PAT9999888",
"Amount": 50,
"Destination": {
"Email": "[email protected]",
"SKU": "PREP9001"
},
"SendMethodId": "XTR94503",
"Description": "TXN-HOME-0002 Q3 Top Performer Contractor Reward"
}
]
}
""";
var response = await client.PostAsync(
"https://xapisandbox.xtrm.com/API/v4/Fund/BatchTransfer",
new StringContent(json, Encoding.UTF8, "application/json"));
var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode) throw new HttpRequestException($"{(int)response.StatusCode} {body}");
Console.WriteLine(body);import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String json = """
{
"IssuerAccountNumber": "SPN1111222",
"SourceWalletId": 122181,
"CustomerBatchId": "BATCH-HOME-0001",
"Items": [
{
"CustomerTransactionId": "TXN-HOME-0001",
"RecipientId": "SPN8888777",
"Amount": 100,
"Destination": {
"BeneficiaryBankID": "41953ec32f3e4765a35a902c82bdd995",
"BeneficiaryBankPaymentMethod": "ACH"
},
"SendMethodId": "XTR94500",
"Description": "TXN-HOME-0001 Q3 Executive Sales Performance Incentive"
},
{
"CustomerTransactionId": "TXN-HOME-0002",
"RecipientId": "PAT9999888",
"Amount": 50,
"Destination": {
"Email": "[email protected]",
"SKU": "PREP9001"
},
"SendMethodId": "XTR94503",
"Description": "TXN-HOME-0002 Q3 Top Performer Contractor Reward"
}
]
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://xapisandbox.xtrm.com/API/v4/Fund/BatchTransfer"))
.header("Authorization", "Bearer " + System.getenv("XTRM_ACCESS_TOKEN"))
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 400) throw new RuntimeException(response.statusCode() + " " + response.body());
System.out.println(response.body());<?php
$ch = curl_init('https://xapisandbox.xtrm.com/API/v4/Fund/BatchTransfer');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'IssuerAccountNumber' => 'SPN1111222',
'SourceWalletId' => 122181,
'CustomerBatchId' => 'BATCH-HOME-0001',
'Items' => [
[
'CustomerTransactionId' => 'TXN-HOME-0001',
'RecipientId' => 'SPN8888777',
'Amount' => 100,
'Destination' => [
'BeneficiaryBankID' => '41953ec32f3e4765a35a902c82bdd995',
'BeneficiaryBankPaymentMethod' => 'ACH',
],
'SendMethodId' => 'XTR94500',
'Description' => 'TXN-HOME-0001 Q3 Executive Sales Performance Incentive',
],
[
'CustomerTransactionId' => 'TXN-HOME-0002',
'RecipientId' => 'PAT9999888',
'Amount' => 50,
'Destination' => [
'Email' => '[email protected]',
'SKU' => 'PREP9001',
],
'SendMethodId' => 'XTR94503',
'Description' => 'TXN-HOME-0002 Q3 Top Performer Contractor Reward',
],
],
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('XTRM_ACCESS_TOKEN'),
'Content-Type: application/json',
'Accept: application/json',
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status >= 400) {
throw new RuntimeException("HTTP $status: $response");
}
print_r(json_decode($response, true));When at least one payment passes its checks, Xtrm responds with 202 Accepted and a BatchTransferResponse that echoes your CustomerBatchId and counts the accepted and rejected items in ItemsCount. From there, follow the batch with webhooks or the status endpoints. The Quickstart walks through the whole flow.
#Popular guides
- Create a batch payment (the core guide): build a batch, submit it, and track the batch and every payment in it.
- Pay individual recipients: find or create individual recipients and pay them in a batch.
- Pay business recipients: add business recipients and include them in your batches.
- Bank accounts & transfers: link recipients' bank accounts so payments in a batch can go to them.
- Rewards with gift & prepaid cards: find card SKUs and pay with digital gift cards and prepaid debit cards in a batch.
- Track & reconcile payments: match batch and payment IDs to your records and review every attempt.
#Environments
| Environment | API base URL | Use it for |
|---|---|---|
| Sandbox | https://xapisandbox.xtrm.com/API/v4 | Building and testing. It works the same as production, with test data only, and no real money moves. |
| Production | https://xapi.xtrm.com/API/v4 | Live payments with real funds. |
See Sandbox & environments for sandbox access, IP allowlisting and moving to production.
#What's new
- Batch payments (4.92.4).
BatchTransferpays many recipients from one wallet in a single request. TwoGETendpoints return the status of a batch and of a single payment, including the history of every attempt.
See the full changelog.
Need help?
Email [email protected] for sandbox access, IP approval and integration questions. See Support for what to include in a request.