Generate a Checkout
Generate a Checkout
This is a checkout endpoint that you can use to generate a link for your customer to make a one-time payment with
Endpoint POST
https://api.thepeer.co/checkout
Request Body Parameters
Name | Description | Required | Data type |
---|---|---|---|
currency | The currency the transaction should be carried out in. The supported value is NGN . | true | String |
amount | The amount you are debiting the customer. This should be in kobo. The minimum value is 10000 | true | Number |
The customer’s email address | true | String | |
redirect_url | The url we should redirect to after the customer completes payment. | false | String |
meta | An object containing additional attributes you will like to have in your transaction response. | false | Object |
Sample request
{
"currency": "NGN",
"amount": 200000,
"email": "post@malone.co",
"meta": {
"city": "Ketu",
"state": "London"
},
"redirect_url": "https://thepeer.co"
}
Sample response
{
"redirect_url": "https://thepeer.co",
"url": "https://checkout.thepeer.co/c50cc534-8c47-40af-9213-cb38adca0b28",
"checkout": {
"id": "c50cc534-8c47-40af-9213-cb38adca0b28",
"amount": 20000,
"currency": "NGN",
"status": "pending",
"linked_account": null,
"meta": {
"city": "Ketu",
"state": "London"
},
"updated_at": "2023-05-16T14:44:37.000000Z",
"created_at": "2023-05-16T14:44:37.000000Z"
}
}
The value of the url
property is the generated checkout link.
You can do either of the following with it:
- Open the link in a new tab for your users to make payment
- Open the link in an iframe, if you want to stay on the same page
- Open the link in a Webview (for mobile platforms)
After a successful transaction, you'll receive the transaction object via webhook