Skip to main content

Transactions APIs

Fund user account

info

This request must have the authorization header. Refer to Authorization method guide for more details

Request

PropertyValue
methodPOST
url$baseUrl/transactions/fund-user
Content-Typeapplication/json

Body

PropertyTypeRequiredDefaultDescription
amountnumberYes-Amount to be credited to user's account (must be >= 0.01)
user_idnumberNo-User Id
user_referencestringNo-User Reference
descriptionstringNo"Balance funded"Description for the transaction
info

Either the user_id or user_reference must be provided

curl -X POST "$baseUrl/transactions/fund-user" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $token" \
-d '{
"amount": 1000,
"user_id": 1,
"description": "Deposit via bank transfer"
}'

Response

Http Code: 201

{
"data": {
"id": 1,
"user_id": 1,
"account_id": 2,
"reference": "TX_u6qGJ1A4qw0mV_5wMSJQ7dF5pe0S8HA3c4i1Z5YN7HD7loom",
"amount": 1000,
"description": "Balance funded",
"transaction_type": "credit",
"transaction_source": "funding",
"created_at": "2025-05-09T14:57:43.759Z"
},
"message": "Account funded successfully"
}

Withdraw from user account

info

This request must have the authorization header. Refer to Authorization method guide for more details

Request

PropertyValue
methodPOST
url$baseUrl/transactions/withdraw
Content-Typeapplication/json

Body

PropertyTypeRequiredDefaultDescription
amountnumberYes-Amount to be debited from user's account (must be >= 0.01)
user_idnumberNo-User Id
user_referencestringNo-User Reference
descriptionstringNo"Withdrawal"Description for the transaction
info

Either the user_id or user_reference must be provided. The user must have sufficient balance for the withdrawal.

curl -X POST "$baseUrl/transactions/withdraw" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $token" \
-d '{
"amount": 100.00,
"user_id": 1,
"description": "Bank withdrawal request"
}'

Response

Http Code: 201

{
"data": {
"id": 3,
"user_id": 1,
"account_id": 2,
"reference": "TX_YXIDYBNaiABJVeXm-_mpnx8WsnWt8ANgwqyjqTd-Vi5WsuXS",
"amount": 100,
"description": "Withdrawal",
"transaction_type": "debit",
"transaction_source": "withdrawal",
"created_at": "2025-05-09T15:02:37.463Z"
},
"message": "Account funded successfully"
}

Get transactions

info

This request must have the authorization header. Refer to Authorization method guide for more details

Request

PropertyValue
methodGET
url$baseUrl/transactions
Content-Typeapplication/json

Query Params

PropertyTypeRequiredDefaultDescription
pagenumberNo1Current page
per_pagenumberNo20Number of items per page
user_idsnumber(comma separated)No-Comma separated user ids
user_referencesstring(comma separated)No-Comma separated user references
transaction_type"credit" | "debit" | "no-action"No-Transaction type
transaction_source"funding" | "bet" | "withdrawal"No-Transaction source
start_datenumber(timestamp) | DateStringNo-Filter result from this date
end_datenumber(timestamp) | DateStringNo-Filter result to this date
info

user_ids and user_references can be used in combination. The results would be merged

curl -G "$baseUrl/transactions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $token" \
--data-urlencode "page=1" \
--data-urlencode "per_page=20" \
--data-urlencode "user_ids=123,456" \
--data-urlencode "user_references=user1,user2" \
--data-urlencode "transaction_type=credit" \
--data-urlencode "transaction_source=funding" \
--data-urlencode "start_date=2023-01-01" \
--data-urlencode "end_date=2023-12-31"

Response

Http Code: 200

{
"data": [
{
"id": 5,
"account_id": 4,
"user_id": 123,
"user_reference": "janedoe123",
"reference": "TX_DjpdJjlfEqPQAFazlI3c1OvLoZdjfXSw1ut92z6IbHDG3gLP",
"amount": 1000,
"bet_trail_id": null,
"description": "Balance funded",
"transaction_type": "credit",
"transaction_source": "funding",
"created_at": "2025-03-11T14:38:38.502Z"
},
{
"id": 4,
"account_id": 4,
"user_id": "user2",
"user_reference": "a4_user_lhgDKSI2Tg-B1BWl",
"reference": "TX_tM9r78kLSXaTbxW9Dd7ulQHbPdcInOwKd9RIdyt_kUmp-lWq",
"amount": 1000,
"bet_trail_id": null,
"description": "Balance funded",
"transaction_type": "credit",
"transaction_source": "funding",
"created_at": "2025-03-11T14:36:41.818Z"
}
],
"per_page": 20,
"page": 1,
"total": 2,
"from": 1,
"to": 2,
"last_page": 1
}

Get transaction by id

info

This request must have the authorization header. Refer to Authorization method guide for more details

Request

PropertyValue
methodGET
url$baseUrl/transactions/:id
Content-Typeapplication/json
curl -X GET "$baseUrl/transactions/:id" \
-H "Content-Type: application/json"

Response

Http Code: 200

{
"data": {
"id": 5,
"account_id": 4,
"user_id": 6,
"user_reference": "janedoe123",
"reference": "TX_DjpdJjlfEqPQAFazlI3c1OvLoZdjfXSw1ut92z6IbHDG3gLP",
"amount": 1000,
"bet_trail_id": null,
"description": "Balance funded",
"transaction_type": "credit",
"transaction_source": "funding",
"created_at": "2025-03-11T14:38:38.502Z"
},
"message": "Transaction retrieved successfully"
}

Get transaction by reference

info

This request must have the authorization header. Refer to Authorization method guide for more details

Request

PropertyValue
methodGET
url$baseUrl/transactions/:reference/reference
Content-Typeapplication/json
curl -X GET "$baseUrl/transactions/:reference/reference" \
-H "Content-Type: application/json"

Response

Http Code: 200

{
"data": {
"id": 5,
"account_id": 4,
"user_id": 6,
"user_reference": "janedoe123",
"reference": "TX_DjpdJjlfEqPQAFazlI3c1OvLoZdjfXSw1ut92z6IbHDG3gLP",
"amount": 1000,
"bet_trail_id": null,
"description": "Balance funded",
"transaction_type": "credit",
"transaction_source": "funding",
"created_at": "2025-03-11T14:38:38.502Z"
},
"message": "Transaction retrieved successfully"
}