Webhooks
Webhooks are sent following creation and update events. Webhooks can be configured in the Control Center. For more information on webhooks, see the PaymentsOS documentation.
Reconciling webhooks with their transactions
The body of webhooks contains the "event_type" attribute, which specifies the event that the webhook relates to. These events include create and update events for the following:
- Authorization
- Capture
- Charge
- Refund
- Void
Example
A refund update webhook will contain the following:
-
{ "id": "a3006729-09d7-41e3-9c2f-8fa0cd9d6fdc-2018-10-03T05:22:45.610Z-83233f6e-767f-4f55-9d8f-448019e90fbf", "created": "2018-10-03T05:22:45.610Z", "account_id": "961c3ded-d539-4b5f-8950-3de93570e988", "app_id": "com.zooz.docapp", "payment_id": "a3006729-09d7-41e3-9c2f-8fa0cd9d6fdc", "data": { "id": "df6cfb45-5e03-4815-b777-3124f7a86a43", "created": "1538544162818", "result": { "status": "Succeed" }, "provider_data": { "provider_name": "MockProcessor", "response_code": "0", "description": "Refunded.", "raw_response": "{\"OID\":\"a3006729-09d7-41e3-9c2f-8fa0cd9d6fdc\",\"AUTH_CODE\":\"a3006\",\"RETURN_MESSAGE\":\"Refunded.\",\"TRANSID\":\"67_961c3ded-d539-4b5f-8950-3de93570e988_Refund\",\"STATUS\":\"SUCCESS\",\"AMOUNT\":\"20\",\"DATE\":\"1538544165606\",\"RETURN_CODE\":\"0\",\"CURRENCY\":\"USD\"}", "authorization_code": "a3006", "transaction_id": "67_961c3ded-d539-4b5f-8950-3de93570e988_Refund", "external_id": "a3006729-09d7-41e3-9c2f-8fa0cd9d6fdc" }, "amount": 2000 } }
PaymentsOS will send Webhook notifications via HTTP POST requests to the URL endpoints that you defined.
If the system doesn’t receive a “Request received successfully” status code response (2xx HTTP), then it will continue resending the Webhook notification for 24 hours, using an exponential retry basis.