Payment events
| Event type | Description |
|---|---|
payment_method_required | The server-to-server request has been successful and the method now needs to be added via the Hosted forms flow |
payment_accepted | The payment has been accepted by our system and we will now attempt to route and process the payment |
payment_captured | The payment has been captured |
payment_declined | The payment has been declined, please see the errors object for more details |
payment_failed | The payment has failed, please see the errors object for more details |
payment_abandoned | The payment has been abandoned as no action has been taken in 15 minutes since initiation |
Payloads
payment_method_required
{
"id": "web_123455",
"event_type": "payment_method_required",
"data": {
"id": "pay_12345",
"reference": "ord12345",
"status": "pending",
"timestamp": "2024-08-05T11:25:36Z",
"metadata": {
"key": "value",
},
"_links": {
"self": {
"href": "https://sandbox.api.paytently.io/payments/pay_12345",
"method": "GET"
},
"hosted_forms": {
"href": "https://sandbox.api.paytently.io/hosted-forms?paymentId=pay_12345",
"method": "GET"
}
}
}
}
payment_accepted
{
"id": "web_123455",
"event_type": "payment_accepted",
"data": {
"id": "pay_12345",
"status": "pending",
"reference": "ord12345",
"timestamp": "2024-12-18T13:27:39Z",
"metadata": {
"key": "value",
},
"_links": {
"self": {
"href": "https://sandbox.api.paytently.io/payments/pay_12345",
"method": "GET"
},
"authorize": {
"href": "https://sandbox.payredirect.io/authorize/pay_12345",
"method": "GET"
}
}
}
}
payment_captured
{
"id": "web_123455",
"event_type": "payment_captured",
"data": {
"id": "pay_12345",
"status": "captured",
"reference": "ord12345",
"timestamp": "2024-12-18T13:19:21Z",
"metadata": {
"key": "value",
},
"_links": {
"self": {
"href": "https://sandbox.api.paytently.io/payments/pay_12345",
"method": "GET"
},
"refund": {
"href": "https://sandbox.api.paytently.io/payments/pay_12345/refunds",
"method": "POST"
}
}
}
}
payment_declined
{
"id": "web_123455",
"event_type": "payment_declined",
"data": {
"id": "pay_12345",
"status": "declined",
"reference": "ord12345",
"timestamp": "2024-12-18T13:28:04Z",
"route": {
"external_transaction_id": "a1b2c3",
"external_error_code": "decline",
"external_error_message": "Transaction is declined"
},
"metadata": {
"key": "value",
},
"errors": [
{
"code": "0051",
"reason": "Insufficient funds",
"docs": "https://docs.paytently.io/category/developer-resources"
}
],
"_links": {
"self": {
"href": "https://sandbox.api.paytently.io/payments/pay_12345",
"method": "GET"
}
}
}
}
payment_failed
{
"id": "web_123455",
"event_type": "payment_failed",
"data": {
"id": "pay_12345",
"status": "failed",
"reference": "ord12345",
"timestamp": "2024-12-18T13:28:04Z",
"metadata": {
"key": "value",
},
"errors": [
{
"code": "9999",
"reason": "Something went wrong",
"docs": "https://docs.paytently.io/category/developer-resources"
}
],
"_links": {
"self": {
"href": "https://sandbox.api.paytently.io/payments/pay_12345",
"method": "GET"
}
}
}
}
payment_abandoned
{
"id": "web_123455",
"event_type": "payment_abandoned",
"data": {
"id": "pay_12345",
"status": "abandoned",
"reference": "ord12345",
"timestamp": "2024-12-18T13:28:04Z",
"metadata": {
"key": "value",
},
"_links": {
"self": {
"href": "https://sandbox.api.paytently.io/payments/pay_12345",
"method": "GET"
}
}
}
}