Server Callback

Merchants receive a POST HTTP request once any charge request order is created also when any updates are applied to orders like being paid, expired ...etc.

Callback Payload

Each callback request from our side contains the following keys

KeyDescription
cowpay_reference_idThe charge request generated id from cowpay side
payment_gateway_reference_idThe charge request generated id from the gateway of charge request
merchant_reference_idThe id of the charge request from the merchant side
order_statusThe latest order status update
amountAmount of the charge request
callback_typeMerchant receives at least two callbacks for each charge request. The difference mentioned below
signatureThe signature is md5 of: merchant_hash_key + amount + cowpay_reference_id + merchant_reference_id + order_status
You can generate signatures while testing here

Callback Types

Order created callback

This one is sent to the merchant server once the order is created after charge request sent as a confirmation that order successfully created.

{
    "cowpay_reference_id": 100092881,
    "payment_gateway_reference_id": "969708632",
    "merchant_reference_id": "8709",
    "customer_merchant_profile_id": "14023",
    "order_status": "UNPAID",
    "amount": "100.00",
    "signature": "4b490927f6f6dc66f6591426874d0a8d",
    "callback_type": "charge_request"
}

Order update callback

This one sent when the order status updated like being PAID, EXPIRED, DELIVERED ...etc.

{
    "cowpay_reference_id": 100092881,
    "payment_gateway_reference_id": "969708632",
    "merchant_reference_id": "8709",
    "customer_merchant_profile_id": "14023",
    "order_status": "PAID",
    "amount": "100.00",
    "signature": "2ca4c078ab0d4c50ba90e31b3b0339d4d",
    "callback_type": "order_status_update"
}

Possible Order Status Values

ValueDescription
PAIDSent when an order is paid
FAILEDMostly sent for card charge requests when the payment operation don't complete successfully
EXPIREDWhen fawry charge request order is being not paid within 48 hours
DELIVEREDSent when cash collection orders being collected and registered in our system

Callback Retry

Cowpay system tries to reach your server upto 5 times within 1 minute difference between each in case of callback failure