1. Make Payment
-
Request method
POST
URLhttp://epay.chargily.com.dz/api/invoice
-
Request Headers:
X-Authorization: API_KEY
Accept: application/json
-
Request Parameters:
Name Description Validation client
Your client name Required; String; Min:3 client_email
Your client email Required; Email invoice_number
Order number used to check payment response Required amount
Order total amount, must be greater than or equal to 75 Required; Numeric; Min:75 discount
Discount percentage Required; Numeric; Min:0; Max:99.99 back_url
URL redirected to after payment is done Required; String; URL webhook_url
Source URL for payment response information Required; String; URL mode
Payment method (“EDAHABIA” or “CIB”) Required; In: EDAHABIA / CIB comment
Description for payment reason Required; String -
Responses:
-
201
: Payment created successfully Response as ‘json’:checkout_url
Example:{"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: