meCash Webhooks
Webhooks are a way for meCash to send your application automatic notifications whenever specific events take place. Instead of your application constantly asking meCash for updates, meCash pushes the information to you in real-time.
How they work
- You provide meCash with a specific web address (a webhook URL) where you want to receive these notifications.
- When an event you've subscribed to happens, meCash sends a message (a webhook payload) to that URL using a standard web request (specifically, a
POST
request).
How to Configure a Webhook in meCash
1. Navigate to the Webhooks Page
-
In the Developers section of your meCash dashboard, select Webhooks from the left-hand menu.
2. Click on "Create Webhook"
-
To add a new webhook, click on the Create Webhook button at the top right of the page.
3. Enter the Webhook URL
-
Provide the URL where you want to receive webhook events.
-
Ensure that your endpoint is publicly accessible and can handle incoming POST requests.
-
Your endpoint should return an HTTP 2XX status code to acknowledge receipt.
4. Confirm and Activate
- Click Confirm to register the webhook.
- Once added, the webhook will appear in the list along with its status.
Supported Webhook Events
This section lists the different types of events that meCash can notify you about via webhooks:
collection.completed
(FUNDING): This event is triggered when a collection or funding process (like a user adding money to their wallet) has been successfully finished.collection.failed
(FUNDING): This event is triggered when a collection or funding process has failed.payout.completed
(SEND): This event is triggered when a payout (sending money to someone else) has been successfully completed.payout.failed
(SEND): This event is triggered when a payout has failed.payout.pending
(SEND): This event is triggered when a payout request has been initiated but is still being processed and hasn't yet completed or failed.
Event | Type | Description |
---|---|---|
collection.completed | FUNDING | Sent when collection/funding has been successfully completed |
collection.failed | FUNDING | Sent when collection/funding has failed |
payout.completed | SEND | Sent when payout has been successfully completed |
payout.failed | SEND | Sent when payout has failed |
payout.pending | SEND | Sent when payout is pending |
Transaction States
This explains the different possible statuses of a transaction that you might see within the webhook payload:
State | Description |
---|---|
COMPLETED | The transaction was processed successfully |
PENDING | The transaction is still in progress |
FAILED | The transaction could not be processed |
REFUNDED | The transaction was returned to sender. |
Transaction Types
The payout type
field in a webhook shows the transaction category:
State | Description |
---|---|
SEND | This refers to an event where money is being sent from one currency to another (like a payout). |
FUNDING | This refers to an event where money is being added to a wallet (like a collection). |
Webhook Payload Format
When an event occurs, meCash sends a POST request to your webhook URL with a JSON payload.
Example: collection.completed
This payload is sent when a funding transaction (e.g., from a bank) is completed and successfully credited to a wallet.
{
"event":"collection.completed",
"data":{
"id":"866be9f6-1e3c-4083-87a5-8ab51c16b252",
"referenceNumber":"V6FUNZNGIV8BY",
"amount":200,
"type":"FUNDING",
"state":"COMPLETED",
"destination":"NGN wallet",
"source":{
"bankName":"GTBANK",
"accountName":"OMOLOKUN OMOYEMI",
"accountNumber":"0211232342"
},
"created": "2025-03-28T11:37:32.390606321",
"processed": "2025-03-28T11:37:32.390606321"
}
}
Payload Breakdown
Field | Type | Description |
---|---|---|
event | string | Type of the event trigger |
data.id | string (UUID) | Unique transaction ID |
data.referenceNumber | string | Reference number associated with the transaction |
data.amount | number | Amount of the transaction |
data.type | string | FUNDING or SEND |
data.state | string | Transaction state: COMPLETED , FAILED , etc. |
data.destination | string | Receiving account or wallet |
data.source.bankName | string | Bank name of the sender |
data.source.accountName | string | Sender's account name |
data.source.accountNumber | string | Sender's account number |
data.created | timestamp | ISO-8601 timestamp when the transaction was initiated |
data.processed | timestamp | ISO-8601 timestamp when the transaction was processed |
Example: payout.completed
(NGN to CNY)
This is a sample payload sent when a payout transaction from a NGN source to a CNY destination is successfully completed.
{
"event": "payout.completed",
"data": {
"id": "79d3acd4-1465-87hj-xft6-cf5t3b12a56b",
"referenceNumber": "RRT6ADX1KLFOP",
"remark": null,
"type": "SEND",
"state": "COMPLETED",
"quote": {
"id": "79d3acd4-1465-87hj-xft6-cf5t3b12a56b",
"sourceCurrency": "NGN",
"sourceAmount": 30000,
"targetCurrency": "CNY",
"targetAmount": 136.15,
"rate": 220.3431138,
"fees": [
{
"paymentChannel": "WECHAT",
"amount": 5
}
]
},
"recipient": {
"name": "Zui len",
"firstName": "Zui",
"lastName": "len",
"relationship": "SELF",
"account": {
"sortCode": "",
"accountNumber": "8612343562723",
"branchCode": ""
},
"currency": "CNY",
"country": "CN",
"stored": false
},
"created": "2025-05-13T15:23:15.258847784",
"processed": "2025-05-13T15:23:16.258847784"
}
}
Payload Breakdown
Top-Level Fields
Field | Type | Description |
---|---|---|
event | string | Type of event (e.g., payout.completed ) |
id | string | Unique identifier for the transaction |
referenceNumber | string | Internal tracking reference |
remark | string/null | Optional comment |
type | string | Type of payout (SEND ) |
state | string | Transaction state |
created | timestamp | Time transaction was created |
processed | timestamp | Time transaction was processed |
quote
Object
Field | Type | Description |
---|---|---|
sourceCurrency | string | Currency sent (e.g., NGN ) |
sourceAmount | number | Amount sent |
targetCurrency | string | Currency received (e.g., CNY ) |
targetAmount | number | Amount received |
rate | number | Conversion rate |
fees[].paymentChannel | string | Payment provider used |
fees[].amount | number | Transaction fee charged |
recipient
Object
Field | Type | Description |
---|---|---|
name | string | Full name of the recipient |
firstName | string | First name of the recipient |
lastName | string | Last name of the recipient |
relationship | string | How the recipient is related to the sender (SELF , FAMILY , etc.) |
account.sortCode | string | Bank sort code (empty if not required by destination country) |
account.accountNumber | string | Recipient’s account number |
account.branchCode | string | Branch code (may be empty depending on the country) |
currency | string | Currency in which the recipient receives funds (e.g., CNY ) |
country | string | Recipient’s country code (e.g., CN for China) |
stored | boolean | Whether the recipient’s details were stored for future use |
Example: payout.pending
This payload is sent when a payout request is created but still in progress (not yet completed or failed).
{
"event": "payout.pending",
"data": {
"id": "8b99b9d8-998a-48db-9102-d0719d1bda25",
"referenceNumber": "RRT6CBX1NMGUJ",
"remark": null,
"type": "SEND",
"state": "PENDING",
"quote": {
"id": "68d2bae4-7365-42fc-bbc2-cf8e3b12a16a",
"sourceCurrency": "NGN",
"sourceAmount": 3000,
"targetCurrency": "CNY",
"targetAmount": 13.62,
"rate": 220.3431138,
"fees": [
{
"paymentChannel": "WECHAT",
"amount": 5
}
]
},
"recipient": {
"name": "Zui len",
"firstName": "Zui",
"lastName": "len",
"relationship": "SELF",
"account": {
"sortCode": "",
"accountNumber": "8612343562723",
"branchCode": ""
},
"currency": "CNY",
"country": "CN",
"stored": false
},
"created": "2025-03-13T15:28:37.258847784",
"processed": "2025-03-13T15:28:37.258847784"
}
}
Payload structure and field definitions are the same as in payout.completed
.
Securing Your Webhooks
To ensure webhook integrity:
- Validate the
x-mecash-signature
header, which is included in every webhook request. - Respond with HTTP status
200 OK
upon successful receipt. - Implement retry logic in case of network failures.