1. Make Payment
-
Request method
POSTURLhttp://epay.chargily.com.dz/api/invoice -
Request Headers:
X-Authorization: API_KEYAccept: application/json
-
Request Parameters:
Name Description Validation clientYour client name Required; String; Min:3 client_emailYour client email Required; Email invoice_numberOrder number used to check payment response Required amountOrder total amount, must be greater than or equal to 75 Required; Numeric; Min:75 discountDiscount percentage Required; Numeric; Min:0; Max:99.99 back_urlURL redirected to after payment is done Required; String; URL webhook_urlSource URL for payment response information Required; String; URL modePayment method (“EDAHABIA” or “CIB”) Required; In: EDAHABIA / CIB commentDescription for payment reason Required; String -
Responses:
-
201: Payment created successfully Response as ‘json’:checkout_urlExample:{"checkout_url": "https://epay.chargily.com.dz/checkout/random_token_here"} -
401: Unauthorized InvalidAPI_KEY -
422: Invalid parameters The request was well-formed but was unable to be followed due to semantic errors
-
If the creation of the invoice is successful, make redirection to checkout_url
2. Payment Confirmation
We will send you operation response via the already sent “webhook_url”.-
Method
POST -
Headers:
Signature - Body: Invoice with payment status
- Signature Validation: Incoming webhook request has a header that can be used to verify the payload. The name of the header containing the signature can be configured in the ‘Signature’ header key to validate signatures.
-
This is an example of how you will compute the signature in PHP: