### Invoice Creation Response JSON Source: https://developers.ligdicash.com/api1/payin-sans-redirection Example of the JSON response received after creating an invoice, containing the transaction token and custom data. ```json { "response_code": "00", "token": "eyJ0eXAiOiJKV1QiLCJh...GlyeV9kYXRlIjoxNzE2Mzc2NTE3fQ.7iwLZVmG_Hw_ncFUcF5Hzk8cB2BSUqroF9rGqym_qSw", "response_text": "", "description": "", "custom_data": { "logfile": "20240521131517664c9e65689a3" }, "wiki": "https://client.ligdicash.com/wiki/createInvoice" } ``` -------------------------------- ### Transaction Status Verification Response JSON Source: https://developers.ligdicash.com/api1/payin-sans-redirection Example response from the transaction verification endpoint, indicating the status and transaction details. ```json { "date": "2023-10-29 09:46:27+00", "response_code": "00", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUz...bdqRzL_aOJ1SYzY", "description": "”, "amount": "100", "montant": "100", "response_text": null, "status": "completed", "custom_data": [ { "id_invoice": 29505444, "keyof_customdata": "order_id", "valueof_customdata": "MonSiteOrder234" } ], "operator_name": "ORANGE BURKINA", "operator_id": "11", "customer": “”, "transaction_id": “TRNS.36887”, "external_id": null, } ``` -------------------------------- ### GET /pay/v01/redirect/checkout-invoice/confirm/ Source: https://developers.ligdicash.com/api1/payin-redirection Verifies the status of a transaction using an invoice token. ```APIDOC ## GET /pay/v01/redirect/checkout-invoice/confirm/ ### Description Verifies the status of a transaction. Ensure `response_code == 00` and `status == completed` before validating the transaction. ### Method GET ### Endpoint /pay/v01/redirect/checkout-invoice/confirm/?invoiceToken={token_de_la_transaction} ### Parameters #### Query Parameters - **invoiceToken** (string) - Required - Unique identifier for the transaction. ### Response #### Success Response (200) - **response_code** (string) - 00 for success, 01 for error. - **token** (string) - Unique transaction identifier. - **response_text** (string) - Error message or redirection URL. - **date** (string) - Transaction date. - **description** (string) - Response description. - **status** (string) - Transaction status (completed, pending, no). - **custom_data** (array) - Custom data sent in the request. - **montant** (integer) - Transaction amount. - **amount** (integer) - Transaction amount. - **operator_id** (string) - Operator identifier. - **operator_name** (string) - Operator name. - **customer** (string) - Phone number used for the transaction. - **external_id** (string) - External transaction identifier. - **request_id** (string) - Request identifier. - **wiki** (string) - URL for error code documentation. #### Response Example { "date": "2023-10-29 09:46:27+00", "response_code": "00", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUz...bdqRzL_aOJ1SYzY", "description": "", "amount": "100", "montant": "100", "response_text": null, "status": "completed", "custom_data": [ { "id_invoice": 29505444, "keyof_customdata": "order_id", "valueof_customdata": "MonSiteOrder234" } ], "operator_name": "ORANGE BURKINA", "operator_id": "11", "customer": "", "transaction_id": "TRNS.36887", "external_id": null } ``` -------------------------------- ### Handle Callback in PHP with Laravel Source: https://developers.ligdicash.com/api1/callback This example shows how to handle LigdiCash callbacks within a Laravel application. It uses Laravel's Request object and Eloquent ORM for database operations. ```PHP getContent(); $event = json_decode($payload); $token = $event->token; $transaction_id = $event->transaction_id; $status = $event->status; $transaction = Transaction::where('token', $token)->first(); // Ou avec le transaction_id ou tout autre identifiant unique if ($transaction->status === "pending" && $status === "completed") { // Mettre à jour le statut de la transaction dans la base de données $transaction->status = "completed"; $transaction->save(); // Livrer le produit ou valider la commande process_order($transaction); } } } ``` -------------------------------- ### GET /withdrawal/confirm Source: https://developers.ligdicash.com/api1/payout Endpoint to confirm the status of a withdrawal transaction using a transaction token. ```APIDOC ## GET /withdrawal/confirm ### Description This endpoint allows you to retrieve the status of a withdrawal transaction. The payout is considered complete if `response_code` is '00' and `status` is 'completed'. ### Method GET ### Endpoint `https://app.ligdicash.com/pay/v01/withdrawal/confirm/?withdrawalToken={token_de_la_transaction}` ### Parameters #### Query Parameters - **withdrawalToken** (string) - Required - The unique identifier for the transaction. ### Response #### Success Response (200) - **date** (string) - Date of the transaction. - **response_code** (string) - Response code of the request. '00' for success, '01' for incorrect request. - **token** (string) - Transaction identifier. Will be empty in the response as it's already in the request URL. - **description** (string) - Description of the response. - **amount** (integer) - Transaction amount. - **montant** (integer) - Transaction amount. - **response_text** (string) - If `response_code` is '01', this field contains the error message. If `response_code` is '00', this field is null. - **status** (string) - Transaction status: 'completed', 'pending', or 'nocompleted'. - **custom_data** (array of object) - Array containing custom data sent in the request. - **item** (object) - Represents a custom data item. - **id_invoice** (string) - Invoice identifier. - **keyof_customdata** (string) - Key of the custom data. - **valueof_customdata** (string) - Value of the custom data. - **operator_name** (string) - Name of the operator. - **operator_id** (string) - Identifier of the operator. - **customer** (string) - Phone number used for the transaction. - **transaction_id** (string) - External identifier for the transaction. - **external_id** (string) - External identifier for the transaction. - **wiki** (string) - URL documenting error codes. #### Response Example ```json { "date": "2023-10-29 09:46:27+00", "response_code": "00", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUz...bdqRzL_aOJ1SYzY", "description": "", "amount": "100", "montant": "100", "response_text": null, "status": "completed", "custom_data": [ { "id_invoice": 29505444, "keyof_customdata": "order_id", "valueof_customdata": "MonSiteOrder234" } ], "operator_name": "ORANGE BURKINA", "operator_id": "11", "customer": "", "transaction_id": "TRNS.36887", "external_id": null, "wiki": "https://developers.ligdicash.com/error-codes" } ``` ``` -------------------------------- ### GET /pay/v01/redirect/checkout-invoice/confirm - Verify Transaction Status Source: https://developers.ligdicash.com/api1/payin-redirection This endpoint is used to verify the status of a transaction after a client has completed or cancelled the payment. It requires the `token` obtained during the invoice creation. The client is redirected to a `return_url` or `cancel_url` after payment, and this API call confirms the actual payment status. ```APIDOC ## GET /pay/v01/redirect/checkout-invoice/confirm ### Description Verifies the status of a transaction using the provided transaction token. This is typically called after the client is redirected back from the payment page. ### Method GET ### Endpoint https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/confirm/ ### Parameters #### Query Parameters - **invoiceToken** (string) - Required - The transaction token received during invoice creation. #### Headers - **Apikey** (string) - Required - Your project's API Key. - **Authorization** (string) - Required - Bearer + API TOKEN of your project. - **Accept** (string) - Required - Must be `application/json`. - **Content-Type** (string) - Required - Must be `application/json`. ### Request Example ```curl curl --location 'https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/confirm/?invoiceToken=eyJ0eXAiOiJK...nk159cWyokRv6wAlh3g' \ --header 'Apikey: 81J...IDH8C' \ --header 'Authorization: Bearer eyJ0eXAiOiJ...4LyaRolhw' \ --data '' ``` ### Response (Note: The response structure for this endpoint is not detailed in the provided text. Typically, it would include transaction status details.) #### Success Response (200) - **(Details not provided in source text)** #### Response Example (Example not provided in source text) ``` -------------------------------- ### Create a Payout Source: https://developers.ligdicash.com/api1/payout Initiate a transfer from a merchant account to a customer's wallet or mobile money account using cURL. ```bash curl --location 'https://app.ligdicash.com/pay/v01/withdrawal/create' \ --header 'Apikey: 81J...DH8C' \ --header 'Authorization: Bearer eyJ0eXA...hc3VPYrv7U' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "commande": { "amount": 100, "description": "Remboursement de la commande ORD-123456", "customer": "226XXXXXXXX", "custom_data": { "transaction_id": "TXTLGC2022" }, "callback_url": "https://backend.masuperboutique.com/callback-payout", "top_up_wallet": 1 // 1 si l'argent doit rester dans le wallet du client, 0 si l'argent doit être envoyé sur son compte mobile money } }' ``` -------------------------------- ### POST /pay/v01/redirect/checkout-invoice/create - Create and Redirect to Payment Link Source: https://developers.ligdicash.com/api1/payin-redirection This endpoint is used to create a payment invoice. Upon successful creation, it returns a payment link that can be used to redirect the client to the payment page. The `response_code` '00' indicates success, with the payment URL in `response_text`. ```APIDOC ## POST /pay/v01/redirect/checkout-invoice/create ### Description Creates a payment invoice and returns a redirect URL for the client to complete the payment. Success is indicated by `response_code: "00"`. ### Method POST ### Endpoint https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/create ### Parameters #### Request Body - **response_code** (string) - Required - Response code of the request. '00' for success, '01' for incorrect request. - **response_text** (string) - Required - If response code is '01', contains the error message. If response code is '00', contains the redirect URL. - **token** (string) - Required - Unique transaction identifier. - **description** (string) - Required - Description of the response. - **custom_data** (object) - Required - Object containing custom data sent in the request. - **wiki** (string) - Required - URL documenting error codes. ### Request Example ```json { "response_code": "00", "token": "eyJ0eXAiOiJKV1QiLCJh...GlyeV9kYXRlIjoxNzE2Mzc2NTE3fQ.7iwLZVmG_Hw_ncFUcF5Hzk8cB2BSUqroF9rGqym_qSw", "response_text": "https://client.ligdicash.com/directpayment/invoice/eyJ0eXAiOiJKV1QiL...SUqroF9rGqym_qSw", "description": "", "custom_data": { "logfile": "20240521131517664c9e65689a3" }, "wiki": "https://client.ligdicash.com/wiki/createInvoice" } ``` ### Response #### Success Response (200) - **response_code** (string) - Response code of the request. '00' for success. - **token** (string) - Unique transaction identifier. - **response_text** (string) - The URL to redirect the client to for payment. - **description** (string) - Description of the response. - **custom_data** (object) - Custom data sent with the request. - **wiki** (string) - URL for error code documentation. #### Response Example ```json { "response_code": "00", "token": "eyJ0eXAiOiJKV1QiLCJh...GlyeV9kYXRlIjoxNzE2Mzc2NTE3fQ.7iwLZVmG_Hw_ncFUcF5Hzk8cB2BSUqroF9rGqym_qSw", "response_text": "https://client.ligdicash.com/directpayment/invoice/eyJ0eXAiOiJKV1QiL...SUqroF9rGqym_qSw", "description": "", "custom_data": { "logfile": "20240521131517664c9e65689a3" }, "wiki": "https://client.ligdicash.com/wiki/createInvoice" } ``` ``` -------------------------------- ### Implémenter un callback avec Node.js et Express Source: https://developers.ligdicash.com/api1/callback Utilise body-parser pour traiter les requêtes JSON entrantes et mettre à jour le statut de la transaction. ```javascript const express = require('express'); const bodyParser = require('body-parser'); const app = express(); app.use(bodyParser.json()); app.post('/callback', (req, res) => { const event = req.body; const token = event.token; const transaction_id = event.transaction_id; const status = event.status; const transaction = findTransactionByToken(token); // Ou avec le transaction_id ou tout autre identifiant unique if (transaction.status === "pending" && status === "completed") { // Mettre à jour le statut de la transaction dans la base de données transaction.status = "completed"; transaction.save(); // Livrer le produit ou valider la commande processOrder(transaction); } res.json({ status: "success" }); }); app.listen(3000, () => { console.log('Server is running on port 3000'); }); ``` -------------------------------- ### Implémenter un callback avec Python et Django Source: https://developers.ligdicash.com/api1/callback Utilise le décorateur csrf_exempt pour permettre la réception de requêtes POST externes et JsonResponse pour la réponse. ```python from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from .models import Transaction @csrf_exempt def callback(request): payload = request.body event = json.loads(payload) token = event['token'] transaction_id = event['transaction_id'] status = event['status'] transaction = Transaction.objects.get(token=token) # Ou avec le transaction_id ou tout autre identifiant unique if transaction.status === "pending" and status == "completed": # Mettre à jour le statut de la transaction dans la base de données transaction.status = "completed" transaction.save() # Livrer le produit ou valider la commande process_order(transaction) return JsonResponse({"status": "success"}) ``` -------------------------------- ### POST /pay/v01/redirect/checkout-invoice/create Source: https://developers.ligdicash.com/api1/payin-redirection Creates a new checkout invoice for processing payments. ```APIDOC ## POST /pay/v01/redirect/checkout-invoice/create ### Description Creates a new checkout invoice to initiate a payment process. ### Method POST ### Endpoint https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/create ### Parameters #### Request Body - **commande** (object) - Required - Details of the order - **invoice** (object) - Required - Invoice details - **items** (array) - Required - List of invoice items - **name** (string) - Required - Item name - **description** (string) - Required - Item description - **quantity** (integer) - Required - Item quantity - **unit_price** (integer) - Required - Unit price - **total_price** (integer) - Required - Total price of item - **total_amount** (integer) - Required - Total invoice amount - **devise** (string) - Required - Currency (must be XOF) - **description** (string) - Required - Invoice description - **customer** (string) - Required - Customer ID (must be empty) - **customer_firstname** (string) - Optional - Customer first name - **customer_lastname** (string) - Optional - Customer last name - **customer_email** (string) - Optional - Customer email - **external_id** (string) - Required - Must be empty - **otp** (string) - Required - Must be empty - **store** (object) - Required - Store details - **name** (string) - Required - Store name - **website_url** (string) - Required - Store website URL - **actions** (object) - Required - Post-payment actions - **cancel_url** (string) - Required - Redirection URL on cancellation - **return_url** (string) - Required - Redirection URL on success - **callback_url** (string) - Required - Backend endpoint for transaction details - **custom_data** (object) - Required - Custom data associated with the transaction ### Request Example { "commande": { "invoice": { "items": [ { "name": "Premier produit", "description": "__description_du_produit__", "quantity": 1, "unit_price": 1000, "total_price": 1000 } ], "total_amount": 1000, "devise": "XOF", "description": "Achat de produits", "customer": "", "external_id": "", "otp": "" }, "store": { "name": "Ma boutique", "website_url": "https://masuperboutique.com" }, "actions": { "cancel_url": "https://masuperboutique.com/cancel", "return_url": "https://masuperboutique.com/success", "callback_url": "https://backend.masuperboutique.com/callback" }, "custom_data": { "order_id": "ORD-1234567890" } } } ``` -------------------------------- ### Valider une transaction avec OTP via cURL Source: https://developers.ligdicash.com/api1/payin-sans-redirection Requête POST pour valider le paiement en transmettant les détails de la commande, le numéro de téléphone du client et le code OTP. ```bash curl --location 'https://app.ligdicash.com/pay/v02/debitwallet/withotp' \ --header 'Apikey: 81J...DH8C' \ --header 'Authorization: Bearer eyJ0eXAiO...4LyaRolhw' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data-raw '{ "commande": { "invoice": { "items": [ { "name": "Premier produit", "description": "__description_du_produit__", "quantity": 1, "unit_price": 1000, "total_price": 1000 }, { "name": "Deuxieme produit", "description": "__description_du_produit__", "quantity": 3, "unit_price": 5000, "total_price": 5000 } ], "total_amount": 16000, "devise": "XOF", "description": "Achat de produits sur https://masuperboutique.com", "customer": "226XXXXXXXX", // <--- Numéro de téléphone utilisé pour obtenir le code OTP. Préfixé par l'indicatif du pays "customer_firstname": "Cheik", "customer_lastname": "Cissé", "customer_email": "cheikcisse@gmail.com", "external_id": "", "otp": "XXXXXX" // <--- Code OTP obtenu par le client }, "store": { "name": "Ma boutique", "website_url": "https://masuperboutique.com" }, "actions": { "cancel_url": "", "return_url": "", "callback_url": "https://backend.masuperboutique.com/callback" }, "custom_data": { "order_id": "ORD-1234567890", "transaction_id": "ORD-1234567890" } } }' ``` -------------------------------- ### Implémenter un callback avec Java et Spring Boot Source: https://developers.ligdicash.com/api1/callback Utilise @RestController et @PostMapping pour exposer un endpoint traitant les payloads JSON via JSONObject. ```java import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @RestController public class CallbackController { @PostMapping("/callback") public String handleCallback(@RequestBody String payload) { JSONObject event = new JSONObject(payload); String token = event.getString("token"); String transactionId = event.getString("transaction_id"); String status = event.getString("status"); Transaction transaction = findTransactionByToken(token); // Ou avec le transaction_id ou tout autre identifiant unique if (transaction.getStatus().equals("pending") && status.equals("completed")) { // Mettre à jour le statut de la transaction dans la base de données transaction.setStatus("completed"); saveTransaction(transaction); // Livrer le produit ou valider la commande processOrder(transaction); } return "success"; } } ``` -------------------------------- ### Initiate OTP Transaction via cURL Source: https://developers.ligdicash.com/api1/payin-sans-redirection Use this request to trigger an OTP code for a transaction. Ensure the phone number includes the country code and the API credentials are provided in the headers. ```bash curl --location 'https://app.ligdicash.com/pay/v02/debitotp/{phone_number}/{amount}' \ --header 'Apikey: 81J...DH8C' \ --header 'Authorization: Bearer eyJ0eXAiO...4LyaRolhw' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' ``` -------------------------------- ### Handle Callback in PHP without Framework Source: https://developers.ligdicash.com/api1/callback Use this snippet to process incoming callback data in a plain PHP environment. It decodes the JSON payload and updates transaction status. ```PHP token; $transaction_id = $event->transaction_id; $status = $event->status; $transaction = find_transaction_from_bd_by_token($token); // Ou avec le transaction_id ou tout autre identifiant unique if ($status === "completed") { // Mettre à jour le statut de la transaction dans la base de données $transaction->status = "completed"; save_transaction_to_bd($transaction); // Livrer le produit ou valider la commande process_order($transaction); } ``` -------------------------------- ### POST /pay/v02/debitwallet/withotp Source: https://developers.ligdicash.com/api1/payin-sans-redirection Validates a transaction by debiting the customer's LigdiCash wallet and crediting the merchant's wallet using an OTP. ```APIDOC ## POST /pay/v02/debitwallet/withotp ### Description This endpoint validates a transaction by debiting the customer's LigdiCash account and crediting the merchant's LigdiCash account using a One-Time Password (OTP) provided by the customer. ### Method POST ### Endpoint https://app.ligdicash.com/pay/v02/debitwallet/withotp ### Headers - **Apikey** (string) - Required - Your project's API Key. - **Authorization** (string) - Required - Bearer + API TOKEN of your project. - **Accept** (string) - Required - Must be `application/json`. - **Content-Type** (string) - Required - Must be `application/json`. ### Request Body - **commande** (object) - Required - Contains details of the order and transaction. - **invoice** (object) - Required - Defines invoice details. - **items** (array) - Required - List of items in the invoice. - **name** (string) - Required - Name of the item. - **description** (string) - Required - Description of the item. - **quantity** (integer) - Required - Quantity of the item. - **unit_price** (integer) - Required - Unit price of the item. - **total_price** (integer) - Required - Total price of the item. - **total_amount** (integer) - Required - Total amount of the invoice. - **devise** (string) - Required - Invoice currency. Must always be `XOF`. - **description** (string) - Required - Description of the invoice. - **customer** (string) - Required - LigdiCash phone number used to obtain the OTP. Must be prefixed with the country code (e.g., 22670000000). - **customer_firstname** (string) - Optional - First name of the customer. - **customer_lastname** (string) - Optional - Last name of the customer. - **customer_email** (string) - Optional - Email of the customer. - **external_id** (string) - Required - This field must be empty. - **otp** (string) - Required - The OTP obtained by the customer. - **store** (object) - Required - Defines store details. - **name** (string) - Required - Name of the store. - **website_url** (string) - Required - URL of the store's website. - **actions** (object) - Required - Defines actions to be performed after payment. - **cancel_url** (string) - Required - Redirect URL in case of payment cancellation. - **return_url** (string) - Required - Redirect URL after successful payment. - **callback_url** (string) - Required - Your backend endpoint URL that will receive transaction details via POST request. - **custom_data** (object) - Optional - Defines custom data to associate with the transaction. - **transaction_id** (string) - Special `custom_data` corresponding to a unique identifier generated by your system for the transaction. ### Request Example ```json { "commande": { "invoice": { "items": [ { "name": "Premier produit", "description": "__description_du_produit__", "quantity": 1, "unit_price": 1000, "total_price": 1000 }, { "name": "Deuxieme produit", "description": "__description_du_produit__", "quantity": 3, "unit_price": 5000, "total_price": 5000 } ], "total_amount": 16000, "devise": "XOF", "description": "Achat de produits sur https://masuperboutique.com", "customer": "226XXXXXXXX", "customer_firstname": "Cheik", "customer_lastname": "Cissé", "customer_email": "cheikcisse@gmail.com", "external_id": "", "otp": "XXXXXX" }, "store": { "name": "Ma boutique", "website_url": "https://masuperboutique.com" }, "actions": { "cancel_url": "", "return_url": "", "callback_url": "https://backend.masuperboutique.com/callback" }, "custom_data": { "order_id": "ORD-1234567890", "transaction_id": "ORD-1234567890" } } } ``` ### Response (Success and error response details are not provided in the source text.) ### Callback Implementation It is highly recommended to implement the callback endpoint to receive transaction details after payment. This allows you to update order statuses in your system and provide services/products to your customers without requiring them to return to your site. ``` -------------------------------- ### Create Checkout Invoice Request Source: https://developers.ligdicash.com/api1/payin-redirection Use this cURL command to send a POST request to create a checkout invoice. Ensure you replace placeholder values for API keys, tokens, and item details. The callback URL is crucial for receiving transaction status updates. ```cURL curl --location 'https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/create' \ --header 'Apikey: 81J...DH8C' \ --header 'Authorization: Bearer eyJ0eXAiO...4LyaRolhw' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data-raw '{ \ "commande": { \ "invoice": { \ "items": [ \ { \ "name": "Premier produit", \ "description": "__description_du_produit__", \ "quantity": 1, \ "unit_price": 1000, \ "total_price": 1000 \ }, \ { \ "name": "Deuxieme produit", \ "description": "__description_du_produit__", \ "quantity": 3, \ "unit_price": 5000, \ "total_price": 5000 \ } \ ], \ "total_amount": 16000, \ "devise": "XOF", \ "description": "Achat de produits sur https://masuperboutique.com", \ "customer": "", \ "customer_firstname": "Cheik", \ "customer_lastname": "Cissé", \ "customer_email": "cheikcisse@gmail.com", \ "external_id": "", \ "otp": "" \ }, \ "store": { \ "name": "Ma boutique", \ "website_url": "https://masuperboutique.com" \ }, \ "actions": { \ "cancel_url": "https://masuperboutique.com/success", \ "return_url": "https://masuperboutique.com/cancel", \ "callback_url": "https://backend.masuperboutique.com/callback" \ }, \ "custom_data": { \ "order_id": "ORD-1234567890", \ "transaction_id": "ORD-1234567890" \ } \ } \ }' ``` -------------------------------- ### POST /pay/v01/withdrawal/create Source: https://developers.ligdicash.com/api1/payout Initiates a payout transfer from the merchant account to a customer's Ligdicash wallet or mobile money account. ```APIDOC ## POST /pay/v01/withdrawal/create ### Description Allows a merchant to perform transfers from their merchant account to a customer's Ligdicash wallet or mobile money account. ### Method POST ### Endpoint https://app.ligdicash.com/pay/v01/withdrawal/create ### Parameters #### Request Body - **commande** (object) - Required - Details of the order - **customer** (string) - Required - Recipient phone number (prefixed with country code, e.g., 226XXXXXXXX) - **top_up_wallet** (integer) - Required - 0: Transfer to Ligdicash wallet; 1: Transfer to wallet then to mobile money - **amount** (integer) - Required - Amount to transfer - **description** (string) - Required - Transaction description - **callback_url** (string) - Required - URL to receive transaction details via POST - **custom_data** (object) - Required - Custom data associated with the transaction - **transaction_id** (string) - Optional - Unique identifier generated by your system ### Request Example { "commande": { "amount": 100, "description": "Remboursement de la commande ORD-123456", "customer": "226XXXXXXXX", "custom_data": { "transaction_id": "TXTLGC2022" }, "callback_url": "https://backend.masuperboutique.com/callback-payout", "top_up_wallet": 1 } } ``` -------------------------------- ### POST /pay/v01/redirect/checkout-invoice/confirm/ Source: https://developers.ligdicash.com/api1/payin-sans-redirection Verifies the status of a transaction using the invoice token. ```APIDOC ## POST /pay/v01/redirect/checkout-invoice/confirm/ ### Description Verifies the status of a transaction to confirm payment completion. This request should be made after receiving the initial transaction response. ### Method POST ### Endpoint https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/confirm/?invoiceToken={invoiceToken} ### Parameters #### Path Parameters - **invoiceToken** (string) - Required - The unique transaction token received during invoice creation. #### Headers - **Apikey** (string) - Required - Your project API Key. - **Authorization** (string) - Required - Bearer + API TOKEN. - **Accept** (string) - Required - application/json. - **Content-Type** (string) - Required - application/json. ### Request Example curl --location 'https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/confirm/?invoiceToken=eyJ0eXAiOiJK...nk159cWyokRv6wAlh3g' \ --header 'Apikey: 81J...IDH8C' \ --header 'Authorization: Bearer eyJ0eXAiOiJ...4LyaRolhw' \ --data '' ### Response #### Success Response (200) - **response_code** (string) - 00 for success, 01 for error. - **status** (string) - Transaction status (completed, pending, no). - **amount** (integer) - Transaction amount. - **date** (string) - Transaction date. #### Response Example { "date": "2023-10-29 09:46:27+00", "response_code": "00", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUz...bdqRzL_aOJ1SYzY", "status": "completed", "amount": "100", "operator_name": "ORANGE BURKINA" } ``` -------------------------------- ### POST /pay/v02/debitotp Source: https://developers.ligdicash.com/api1/payin-sans-redirection Initiates a payment transaction by sending an OTP to the customer's phone number. This method is used for collecting payments without redirecting the user. ```APIDOC ## POST /pay/v02/debitotp ### Description Initiates a payment transaction by sending an OTP to the customer's phone number. This method is used for collecting payments without redirecting the user. ### Method GET ### Endpoint https://app.ligdicash.com/pay/v02/debitotp/{phone_number}/{amount} ### Parameters #### Path Parameters - **phone_number** (string) - Required - Customer's phone number. Must be prefixed with the country code. Example: 22670000000 - **amount** (integer) - Required - Transaction amount #### Headers - **Apikey** (string) - Required - Your API Key - **Authorization** (string) - Required - Bearer + API TOKEN - **Accept** (string) - Required - application/json - **Content-Type** (string) - Required - application/json ### Request Example ```json { "example": "curl --location 'https://app.ligdicash.com/pay/v02/debitotp/{phone_number}/{amount}' \ --header 'Apikey: 81J...DH8C' \ --header 'Authorization: Bearer eyJ0eXAiO...4LyaRolhw' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json'" } ``` ### Response #### Success Response (200) - **error** (boolean) - Indicates if the request was processed successfully - **message** (string) - Success or error message #### Response Example ```json { "error": false, "message": "OTP sent. Please check your phone." } ``` ``` -------------------------------- ### POST /callback-endpoint Source: https://developers.ligdicash.com/api1/callback Endpoint to receive transaction status updates from LigdiCash. The server sends the same data in two formats: form-urlencoded and JSON. ```APIDOC ## POST /callback-endpoint ### Description Receives transaction details from LigdiCash upon successful payment processing. It is recommended to verify if the transaction has already been processed to avoid duplicate service delivery. ### Method POST ### Request Body - **response_code** (string) - Required - 00 for success, 01 for error. - **token** (string) - Required - Unique transaction identifier. - **response_text** (string) - Required - Response message. - **date** (string) - Required - Transaction date. - **description** (string) - Required - Response description. - **status** (string) - Required - Transaction status (completed, pending, nocompleted). - **custom_data** (array) - Required - Array of custom data objects. - **montant** (integer) - Required - Transaction amount. - **amount** (integer) - Required - Transaction amount. - **operator_id** (string) - Required - Operator identifier. - **operator_name** (string) - Required - Operator name. - **customer** (string) - Required - Customer phone number. - **external_id** (string) - Required - External transaction identifier. - **request_id** (string) - Required - Request identifier. - **transaction_id** (string) - Required - System-generated transaction ID. - **wiki** (string) - Required - URL for error code documentation. ``` -------------------------------- ### Create Payment Invoice Response Source: https://developers.ligdicash.com/api1/payin-redirection This JSON response indicates a successful invoice creation. The 'response_text' field contains the payment redirection URL. Ensure 'response_code' is '00' for success. ```json { "response_code": "00", "token": "eyJ0eXAiOiJKV1QiLCJh...GlyeV9kYXRlIjoxNzE2Mzc2NTE3fQ.7iwLZVmG_Hw_ncFUcF5Hzk8cB2BSUqroF9rGqym_qSw", "response_text": "https://client.ligdicash.com/directpayment/invoice/eyJ0eXAiOiJKV1QiL...SUqroF9rGqym_qSw", "description": "", "custom_data": { "logfile": "20240521131517664c9e65689a3" }, "wiki": "https://client.ligdicash.com/wiki/createInvoice" } ``` -------------------------------- ### OTP Transaction Response Source: https://developers.ligdicash.com/api1/payin-sans-redirection The expected JSON response after successfully initiating an OTP-based transaction. ```json { "error": false, "message": "OTP sent. Please check your phone." } ``` -------------------------------- ### Verify Transaction Status using cURL Source: https://developers.ligdicash.com/api1/payin-redirection Use this cURL command to verify the status of a transaction using the invoice token. Ensure your API key and API token are correctly set in the headers. ```curl curl --location 'https://app.ligdicash.com/pay/v01/redirect/checkout-invoice/confirm/?invoiceToken=eyJ0eXAiOiJK...nk159cWyokRv6wAlh3g' \ --header 'Apikey: 81J...IDH8C' \ --header 'Authorization: Bearer eyJ0eXAiOiJ...4LyaRolhw' \ --data '' ``` -------------------------------- ### Verify Transaction Status Source: https://developers.ligdicash.com/api1/payout Check the status of a previously initiated payout using the transaction token. ```python import requests url = "https://app.ligdicash.com/pay/v01/withdrawal/confirm/?withdrawalToken=eyJ0eXAi...GAxBYCbRqE-Fj0rgl_xdh5E" payload = "" headers = { 'Apikey': '81J...DH8C', 'Authorization': 'Bearer eyJ0eX...W-HqqUxUC4pl89q_oIj4LyaRolhw', 'Content-Type': 'application/json', 'Accept': 'application/json' } response = requests.request("GET", url, headers=headers, data=payload) print(response.text) ``` -------------------------------- ### POST /pay/v01/withdrawal/confirm Source: https://developers.ligdicash.com/api1/payout Verifies the status of a previously initiated payout transaction using the transaction token. ```APIDOC ## POST /pay/v01/withdrawal/confirm ### Description Checks the status of a transaction to determine the result of the operation using the token returned during creation. ### Method POST ### Endpoint https://app.ligdicash.com/pay/v01/withdrawal/confirm/?withdrawalToken={token_de_la_transaction} ### Parameters #### Query Parameters - **withdrawalToken** (string) - Required - The transaction token to verify ### Request Example https://app.ligdicash.com/pay/v01/withdrawal/confirm/?withdrawalToken=eyJ0eXAi...GAxBYCbRqE-Fj0rgl_xdh5E ``` -------------------------------- ### Exemple de réponse JSON de vérification de transaction Source: https://developers.ligdicash.com/api1/payout Structure type de la réponse retournée par l'API de confirmation de retrait. ```json { "date": "2023-10-29 09:46:27+00", "response_code": "00", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUz...bdqRzL_aOJ1SYzY", "description": "", "amount": "100", "montant": "100", "response_text": null, "status": "completed", "custom_data": [ { "id_invoice": 29505444, "keyof_customdata": "order_id", "valueof_customdata": "MonSiteOrder234" } ], "operator_name": "ORANGE BURKINA", "operator_id": "11", "customer": "", "transaction_id": "TRNS.36887", "external_id": null } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.