Step 5: make a budget transfer
Now that you have at least two budgets, you can transfer funds from one budget to another. You'll need to provide the source budget's ID in the path itself, and the destination budget's ID in the body of the request.
In this example, we're transferring 20 USD
from a source budget A to a destination budget B.
SandboxProduction
curl -i -X POST 'https://api-sandbox.equalsmoney.com/v2/budgets/{budgetIdA}/transfer?accountId={accountId}' \ # The ID of your source budget and your account ID
-H 'Authorization: ApiKey {apiKey}' \ # Your API key
-H 'Content-Type: application/json' \
-d '{
"destinationBudgetId": "{budgetIdB}", # Your destination budget's ID
"currency": "USD",
"amount": "20"
}'
curl -i -X POST 'https://api.equalsmoney.com/v2/budgets/{budgetIdA}/transfer?accountId={accountId}' \ # The ID of your source budget and your account ID
-H 'Authorization: ApiKey {apiKey}' \ # Your API key
-H 'Content-Type: application/json' \
-d '{
"destinationBudgetId": "{budgetIdB}", # Your destination budget's ID
"currency": "USD",
"amount": "20"
}'
If your request is successful, you'll receive a 200
response showing success
as true
and including a debitBoxTransactionId
and creditBoxTransactionId
.
{
"success": true,
"debitBoxTransactionId": 179032,
"creditBoxTransactionId": 179033
}
You'll also receive a BoxDebited
webhook for your source budget and a BoxCredited
webhook for your destination budget.
BoxDebitedBoxCredited
{
"body": {
"accountId": "F67104",
"boxTransactionId": 8622112,
"budgetId": "42082c6b-4ab2-4bf6-b71f-287ge74a66c3",
"budgetName": "Marketing",
"identification": "5***",
"institutionAddress": null,
"institutionBic": "231884",
"orderId": "E7PD93VMX3MC",
"paymentMethod": "UK.OBIE.BalanceTransfer",
"reference": "REF 123456",
"schemeName": "UK.OBIE.SortCodeAccountNumber",
"settlementPriceAmount": 40000,
"settlementPriceCurrency": "USD",
"source": "orders",
"ledgerBalance": "19.99",
"sequentialId": "10",
"valueDateTime": "2024-04-30T06:26:17.297Z",
"messageId": "f10bf4e9-bf1a-49e0-b10a-a461bf5659f8",
"webhookEventTypeName": "BoxDebited"
}
}
{
"body": {
"accountId": "F12345",
"budgetId": "4db84122-9c4e-4607-98f7-84b2bbe02daf",
"source": "orders",
"identification": "12345678",
"institutionBic": "231884",
"institutionAddress": null,
"schemeName": "UK.OBIE.SortCodeAccountNumber",
"reference": "REF 123456",
"remitterAddress": null,
"remitterName": "Sally Smith",
"budgetName": "Marketing",
"settlementPriceAmount": 0.5,
"settlementPriceCurrency": "EUR",
"paymentMethod": "UK.OBIE.BalanceTransfer",
"boxTransactionId": 1234567,
"ledgerBalance": "19.99",
"sequentialId": "10",
"valueDateTime": "2024-04-30T06:26:17.297Z",
"messageId": "b04b2d4a-0ae7-4125-9389-15bb6d47645c",
"webhookEventTypeName": "BoxCredited"
}
}