⏳…

General Structure

Every webhook event for a resource is wrapped in the following structure:

{
  "apiVersion": "2024-08-01", // The API version of the webhook event payload.
  "event": {
    "id": "<webhook-event-id>", // The unique ID for the event; remains the same during reties.
    "name": "<webhook-event-name", // The name of the event in the format <resource-type>.<event_name>, eg. payment_code.expired.
    "timestamp": "1725018144" // The timestamp in Unix seconds when the event was fired.
  },
  "object": {
    "id": "<resource-id>", // The id of the resource for which the event was triggered
    "type": "<resource-type>" // The unique string representing the resource
  },
  "data": {} // Resource definition. (The payment code object)
}

⏳…

Payment Code

⏳…

Supported Events

The structure of the data field is the same as the object structure in the Rest API

Below is a sample:

{
    "apiVersion": "2024-08-01",
    "event": {
        "id": "wke-e8daf2bdea9f5e8587388a3a30b1efc6",
        "name": "payment_code.created",
        "timestamp": "1725018090"
    },
    "object": {
        "id": "pmc-YhNZjnLJR4fY7T3GXAXJrQmLY",
        "type": "payment_code"
    },
    "data": {
        "allowedProviders": [],
        "amount": {
            "currency": "SLE",
            "value": 100
        },
        "createTime": "2024-08-30T11:41:30.513423582Z",
        "customerTarget": null,
        "expireTime": "2024-08-30T11:46:30.513451171Z",
        "financialTarget": null,
        "id": "pmc-YhNZjnLJR4fY7T3GXAXJrQmLY",
        "isActive": true,
        "metadata": null,
        "mode": "oneTime",
        "name": "Topup",
        "progress": {
            "isCompleted": false,
            "totalPaymentCount": 0,
            "totalPaymentSum": null
        },
        "status": "pending",
        "ussdCode": "*715*1*7344331308#"
    }
}

Payout

⏳…

Supported Events

The structure of the data field is the same as the object structure in the Rest API

Below is a sample:

{
    "apiVersion": "2024-08-01",
    "event": {
        "id": "wke-1890fe24fa7457698c8ea20944403e4b",
        "name": "payout.failed",
        "timestamp": "1725022815"
    },
    "object": {
        "id": "pyt-YhUZVFtffj6JSbxpv9puNzYkE",
        "type": "payout"
    },
    "data": {
        "amount": {
            "currency": "SLE",
            "value": 10000
        },
        "charges": [],
        "createTime": "2024-08-30T13:00:15.220463Z",
        "destination": {
            "accountId": "+23278341807",
            "providerCode": "m17",
            "transactionReference": null
        },
        "failureDetail": {
            "code": "fundInsufficient",
            "explanation": "Financial account has insufficient funds."
        },
        "id": "pyt-YhUZVFtffj6JSbxpv9puNzYkE",
        "metadata": null,
        "source": {
            "financialAccountId": "fac-EBNBbzJXihwSFPcubG2v61YJH",
            "transactionReference": null
        },
        "status": "failed"
    }
}

Checkout Session

⏳…

Supported Events

Coming soon… ⏳