Installation
Initialization
PHP
api_key and auth_token from the LigdiCash dashboard by creating an API project.
Hosted payin
The customer is redirected to the payment page hosted by LigdiCash. This is the recommended flow for online stores.PHP
Direct payin
The customer pays directly from your interface. You must collect their phone number and, depending on the operator, their OTP code.PHP
The OTP mode varies by operator. For example, with a USSD operator, the customer generates the OTP on their phone before you submit. For an approval-mode operator (e.g. Moov Africa), send
"otp" => "" — the customer approves directly in their app. See the operator page for details.Payout
Send money to a customer — refund, salary, payout.To the customer’s LigdiCash wallet
PHP
Directly to mobile money
PHP
"type" => "client" uses POST /pay/v01/withdrawal/create (via the LigdiCash wallet). "type" => "merchant" uses POST /pay/v01/straight/payout (direct mobile money, slower). See Payout — Introduction.Status verification
CallgetTransaction with the token stored at creation (not the callback token, which is different).
PHP
In PHP, the
type parameter of getTransaction accepts "payin" or "payout" (not "client_payout" or "merchant_payout" as in the Python and JavaScript SDKs).$transaction:
| Property | Type | Description |
|---|---|---|
status | string | "completed", "pending", "cancelled" |
response_code | string | "00" success, "01" failure |
amount | int | Transaction amount |
operator_id | string | Operator identifier |
operator_name | string | Operator name |
customer | string | Customer phone number |
token | string | Transaction token |
custom_data | array | Custom data sent at creation |
wiki | array | Links to the endpoint’s error codes |
Error handling
PHP
Also check
$response->response_code after every call: "00" indicates success, "01" an error. On error, read $response->wiki to get the URL with sub-code details.