Transaction
This represents a debit or a credit on your Djamo Business account balance.
At the moment, what you can do trough the Business API, is debit your business account and credit one or many Djamo clients. ie: Send money to one or multiple Djamo clients.
You can also get the list of transactions that have impacted your business account or the status for a particular transaction.
The transaction object
Attribute | Type | Description |
---|---|---|
id | String | The ID for the transaction |
amount | Amount | The amount charged for the transaction. |
fee | Amount | The fee charged for the tranasction. |
totalAmount | Amount | The total amount charged for the transaction (amount + fee). |
msisdn | Phone Number | The msisdn of the Djamo client |
status | String | The current status of the transaction. Can be one of the following : pending , completed or failed |
reference | String | The reference that you indicated when creating the transaction. Can be your internal ID for exemple. |
type | String | The type of the transaction. At the moment, the only type allowed is transfer . |
batchId | String | The ID for the batch that created this transaction (only if the transation was created as part of a batch). |
createdAt | Timestamp | Timestamp indicating when the transactions was created. |
updatedAt | Timestamp | Timestamp indicating when the transaction has been updated. |
Sending money to one Djamo client
POST /v1/transactions
Parameter | Type | Description |
---|---|---|
amount | Amount | The amount charged for the transaction. Should be in the range of 5.000 - 500.000 |
msisdn | Phone Number | The msisdn of the Djamo client |
reference | String | A reference that you indicate. Can be your internal ID for exemple. |
type | String | The type of the transaction. At the moment, the only type allowed is transfer . |
{
"id": "txn_2cdc8ab1-6d50-49cc-ba14-54e4ac7ec231",
"createdAt": "2023-05-25T17:43:15.970Z",
"updatedAt": "2023-05-25T17:43:15.970Z",
"amount": 500000,
"fee": 5000,
"totalAmount": 505000,
"status": "pending",
"msisdn": "+22507XXXXXX00",
"reference": "17f99xApUe472A",
"description": "Prime de juin",
"type": "transfer"
}
Sending money to multiple Djamo clients
!!! note 1. The batch endpoint only available for transactions with type transfer
. 2. You will receive a JSON representing the the batch object.
POST /v1/transactions/batch
Parameter | Type | Description |
---|---|---|
transactions | Array | A list of transaction parameters objects used in the endpoint to create a single transaction. See example below |
Example
bash
curl \
-XPOST \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer <API_KEY>' \
-d '{
"transactions": [
{
"msisdn": "+22507XXXXXX00",
"amount": 500000,
"reference": "17f99xApUe472A",
"description": "Prime de juin"
},
{
"msisdn": "+22507XXXXXX01",
"amount": 550000,
"reference": "12E94bDeOP209T",
"description": "Prime de juin"
}
]
}' \
<BASE_URL>/v1/transactions/batch
json
{
"id": "bat_27fb25f4-3246-44c9-9f30-f0df3d9188cf",
"createdAt": "2023-03-16T22:01:11.070Z",
"updatedAt": "2023-03-16T22:01:11.269Z",
"totalAmount": 8300,
"status": "processing",
"totalFee": 5,
"transactions": [
{
"id": "txn_2cdc8ab1-6d50-49cc-ba14-54e4ac7ec231",
"createdAt": "2023-11-24T17:43:15.970Z",
"updatedAt": "2023-11-24T17:43:15.970Z",
"amount": 500000,
"fee": 5000,
"totalAmount": 505000,
"status": "pending",
"msisdn": "+22507XXXXXX00",
"reference": "17f99xApUe472A",
"description": "Prime de juin",
"type": "transfer"
},
{
"id": "txn_ae189ba6-0dc9-492a-9bde-ffdcf0decb0b",
"createdAt": "2023-11-24T17:44:15.970Z",
"updatedAt": "2023-11-24T17:44:15.970Z",
"amount": 430000,
"fee": 4300,
"totalAmount": 434300,
"status": "pending",
"msisdn": "+22507XXXXXX01",
"reference": "2E94bDeOP209T",
"description": "Prime de juin",
"type": "transfer"
}
]
}
Retrieving details about a transaction
GET /v1/transactions/<id>
Note
You can alternatively use webhooks to be notified about transaction status changes.
bash
curl \
-X GET \
-H 'Authorization: Bearer <API_KEY>' \
<BASE_URL>/v1/transactions/txn_fbf960c4-294b-43cd-99a4-920b61efb17d
{
"id": "txn_fbf960c4-294b-43cd-99a4-920b61efb17d",
"createdAt": "2023-11-24T17:43:15.970Z",
"updatedAt": "2023-11-24T17:43:16.970Z",
"amount": 5000,
"fee": 50,
"totalAmount": 5050,
"status": "completed",
"msisdn": "+225079932203",
"reference": "17f9956f-0965-4964-b2c1-40b4fef141a7",
"failureReason": null,
"description": "July's salary",
"type": "transfer",
"batchId": "17f9956f-0965-4964-b2c1-40b4fef141a7"
}
Check customer
GET /v1/transactions/customers/check
Note
This endpoint is used to check the information a user has entered. For the moment, it just returns the customer's KYC status. The complete
status is the only one that indicates that the client has been validated by the system. Any other status indicates that there is a problem with client identification.
Parameter | Type | Description |
---|---|---|
subCompanyId (Optional) | String | The ID of the sub company |
msisdn (Required) | Phone Number | The msisdn of the Djamo client |
bash
curl \
-X GET \
-H 'Authorization: Bearer <API_KEY>' \
<BASE_URL>/v1/transactions/customers/check
Here is the list of the possible KYC status:
Name | Description |
---|---|
awaiting_data | We don't yet have the customer's data for verification |
awaiting_approval | The team has not yet verified the data submitted |
age_rejected | In the case of a minor customer or if the date on the ID has been misread |
expired_document_date | If the customer's piece has expired |
rejected | Customer information not correct |
unverified | We don't yet have the customer's data for verification |
suspected | Two pieces of ID with the same information detected |
complete | Customer identification has been validated |