Transactions
Create a Transaction
All requests to the /v2/transactions/*
endpoints must include both the
client_id
and api_key
as detailed in the
Authentication document.
Send Money to a User
Method
Make a request to /v2/transactions/create
To send money to a user,
amount
must be negative> curl https://pls.senddots.com/v2/transactions/create \
-X POST \
-H "Authorization: Basic <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"user_id": "8732b0e5-8d47-4be7-839f-5cdecbe2df99",
"amount": -1000,
"notes": {
"internal_id": "tr_213124"
}
}'
> response = {
"success": true,
"transaction": {
'id': "5cfabe15-d452-4558-8e46-56d90ebe48f7",
'date': "Mon, 21 Feb 2022 21:08:49 GMT",
'source_username': "test_app",
'destination_username': "bobloblaw",
'amount': 1000,
'completed': true,
"receipt": {},
"notes": {
"internal_id": "tr_213124"
}
}
}
Debit Money from a User
Method
Make a request to /v2/transactions/create
To debit money from a user,
amount
must be positivecurl https://pls.senddots.com/v2/transactions/create \
-X POST \
-H "Authorization: Basic <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"user_id": "8732b0e5-8d47-4be7-839f-5cdecbe2df99",
"amount": 1000,
"notes": {
"internal_id": "tr_213124"
}
}'
response = {
"success": true,
"transaction": {
'id': "5cfabe15-d452-4558-8e46-56d90ebe48f7",
'date': "Mon, 21 Feb 2022 21:08:49 GMT",
'source_username': "bobloblaw",
'destination_username': "test_app",
'amount': 1000,
'completed': true,
"receipt": {},
"notes": {
"internal_id": "tr_213124"
}
}
}