Charge Authorization
Processing a Charge Authorization Request
To process the authorization request of a charge, you will need to extract the charge reference from the authorization payload that Thepeer sends via webhook and use it in the authorization endpoint.
- Learn more about webhooks here
Endpoint Post
https://api.thepeer.co/authorization/{{CHARGE_REFERENCE}}
Path Parameter
URL Parameter | Description | Required | Data type |
---|---|---|---|
CHARGE_REFERENCE | The reference of the charge in the authorization payload | true | String |
Request Body Parameters
Name | Description | Required | Data type |
---|---|---|---|
event | The event is a required string that could be one of four supported values that describes the status of the charge | true | String |
Sample request
{
"event": "success"
}
Supported Values
Event | Description |
---|---|
success | Should be used to approve the request |
insufficient_funds | Should be used to reject the request in a situation where a user does not have sufficient funds. |
business_decline | Should be used in a situation where the business wants to decline the request at its own discretion. |
user_decline | Should be used when the user declines the request |
The response this endpoint returns in the case of a successful event adheres to the transaction object’s format. For the other events, you get a message property with the event as the value.
Sample response
{
"message": "insufficient funds"
}