Fetch the funding instructions provided at the time of the transaction, specifically for transactions involving split funding.
Retrieve a transaction's funding instructions to see how its funds are allocated to multiple bank accounts through Split Funding (distributing a single transaction's funds among multiple bank accounts).
This API reference is for developers integrating with the Stax API. Use GET /transaction/{id}/funding to retrieve the instructions provided when the transaction was processed; this request does not change those instructions.
Key Features
- Retrieve funding allocations for a transaction.
- Understand how funds are distributed among multiple accounts.
- Access Split Funding details for auditing and reconciliation (matching your payment records to the funds distributed to each account).
Usage Notes
Prepare your request
- Confirm that your merchant account is enrolled in Split Funding so you can retrieve funding allocations.
- Obtain a merchant API key for authentication. Keep it out of client-side code and public repositories. Use a sandbox key for testing; sandbox and live keys use the same base URL.
- Copy the transaction's
idfrom an existing transaction API response for that merchant. For example,"a72abd1a-ff7c-4b52-aaca-6c565da7904d"shows the ID format used in this endpoint's response example; supply your own transaction's ID. Choose a transaction processed with funding instructions. - Install Python 3 to run the following example, which uses only the standard library.
The required id path parameter is a string with no default. Pass the transaction's ID, not an account ID or invoice ID. This GET request has no request body or documented optional parameters.
Retrieve the funding instructions
Save this example as get_funding.py and run python3 get_funding.py. It prompts for your API key without displaying it, sets a 30-second timeout, and prints only the allocation fields needed to inspect the result.
import getpass
import json
import sys
from urllib.error import HTTPError, URLError
from urllib.parse import quote
from urllib.request import Request, urlopen
def main():
api_key = getpass.getpass("Merchant API key: ").strip()
# Copy id from an existing transaction API response for this merchant.
transaction_id = input("Transaction ID: ").strip()
if not api_key or not transaction_id:
sys.exit("Provide both an API key and a transaction ID.")
request = Request(
"https://apiprod.fattlabs.com/transaction/"
+ quote(transaction_id, safe="")
+ "/funding",
headers={
"Authorization": "Bearer " + api_key,
"Accept": "application/json",
},
method="GET",
)
try:
with urlopen(request, timeout=30) as response:
instructions = json.load(response)
except HTTPError as error:
messages = {
400: "Check the transaction ID format.",
401: "Check your merchant API key.",
403: "Confirm Split Funding enrollment for this merchant.",
404: "Check the transaction ID and whether it has funding instructions.",
}
sys.exit(
f"HTTP {error.code}: "
+ messages.get(error.code, "Request failed; check the API status before retrying.")
)
except (URLError, TimeoutError, OSError) as error:
sys.exit(f"Connection failed: {error}")
except (ValueError, UnicodeError):
sys.exit("The API did not return valid JSON.")
if not isinstance(instructions, list):
sys.exit("Expected an array of funding instructions.")
if not instructions:
print("No funding instructions returned.")
return
fields = ("transaction_id", "account_id", "amount")
if any(
not isinstance(item, dict) or any(field not in item for field in fields)
for item in instructions
):
sys.exit("A funding instruction is missing expected allocation fields.")
print(json.dumps([
{field: item[field] for field in fields}
for item in instructions
], indent=2))
if __name__ == "__main__":
main()For the transaction in this endpoint's documented response example, the script prints:
[
{
"transaction_id": "a72abd1a-ff7c-4b52-aaca-6c565da7904d",
"account_id": "41926685-879c-4240-b5d4-37dd44ee6ed4",
"amount": 50
},
{
"transaction_id": "a72abd1a-ff7c-4b52-aaca-6c565da7904d",
"account_id": "87fc674f-a7bb-4f02-ad9c-7f6c0cfb9d02",
"amount": 20
},
{
"transaction_id": "a72abd1a-ff7c-4b52-aaca-6c565da7904d",
"account_id": "7ec0ebb6-36a4-4774-8f0a-f38aa3c5881e",
"amount": 30
}
]Your values depend on the transaction you retrieve. Success means you received the recorded funding allocations; it does not confirm that funds have reached the bank accounts.
Response Structure
| Code | Response | Reason |
|---|---|---|
| 200 | Success | Returns an array of funding instruction objects, including transaction_id, account_id, amount, and associated metadata. |
| 400 | Bad Request | Invalid transaction ID format. |
| 401 | Unauthorized | Authentication failed. |
| 403 | Forbidden | Split Funding feature not enabled. |
| 404 | Not Found | Transaction ID does not exist or has no funding instructions. |
| 500 | Internal Server Error | An unexpected server error occurred. |
Important Considerations
Data Security — Recommended: Keep API keys on your server, limit access to funding instructions, and avoid logging sensitive financial information.
Reconciliation: Compare the recorded funding allocations with your payment and bank records to check how funds were distributed.
Compliance: Funding instructions can support compliance efforts by providing records of fund allocations; they do not establish compliance. Meet applicable PCI compliance requirements when handling payment card data, and consult your legal team regarding specific requirements for fund allocations and transfers. The security practices above are recommendations, not a complete compliance checklist.
