Pay Payment Link
Endpoint for paying a Payment Link.
info
This endpoint does not use an API Key. Send the session_token obtained from the Get Public response as the Authorization header instead. The session token is scoped to the specific Payment Link it was issued for.
This endpoint is rate limited by IP address.
POST /api/v1/groups/{group_id}/payment-links/{payment_link_id}/pay
Request Parameters
| Name | Description | Type | Required |
|---|---|---|---|
| token | Payment token received by the tokenizer to pay for the Payment Link. | string | Required |
| billing_address | Billing address of the end-user. | object | Required |
| billing_address.first_name | First name of the end-user. | string | Required |
| billing_address.last_name | Last name of the end-user. | string | Required |
| billing_address.company | Company of the end-user. | string | |
| billing_address.line_1 | First address line of the end-user. | string | Required |
| billing_address.line_2 | Second address line of the end-user. | string | |
| billing_address.city | City of the end-user. | string | Required |
| billing_address.subdivision | State/province/county of the end-user. | string | Required |
| billing_address.postal_code | Postal code / ZIP code of the end-user. | string | Required |
| billing_address.country | Country of the end-user. | string | Required |
| billing_address.email | Email address of the end-user. | string | Required |
| billing_address.phone | Phone number of the end-user. | string |
Response
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request / Validation error, or the Payment Link is no longer available |
| 403 | The session token does not belong to this Payment Link |
| 500 | Internal Error |
Example Usage
- JavaScript
- Python
- Go
pay.js
var headers = new Headers();
headers.append('Authorization', 'SESSION_TOKEN');
var requestOptions = {
method: 'POST',
headers: headers,
redirect: 'follow',
body: {
// request body data
}
};
const group_id = '';
const payment_link_id = '';
const url = `https://api.reverepayments.dev/api/v1/groups/${group_id}/payment-links/${payment_link_id}/pay`;
fetch(url, requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));
pay.py
import requests
group_id = ""
payment_link_id = ""
url = "https://api.reverepayments.dev/api/v1/groups/"+group_id+"/payment-links/"+payment_link_id+"/pay"
headers = {
'Authorization': 'SESSION_TOKEN'
}
response = requests.request("POST", url, headers=headers, json={
// request body data
})
print(response.text)
pay.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
const group_id = ""
const payment_link_id = ""
url := "https://api.reverepayments.dev/api/v1/groups/" + group_id + "/payment-links/" + payment_link_id + "/pay"
client := &http.Client{}
body := bytes.NewBuffer(nil)
_ = json.NewEncoder(body).Encode(map[string]any{
// body data
})
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Authorization", "SESSION_TOKEN")
res, _ := client.Do(req)
defer res.Body.Close()
bytes, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(string(bytes))
}
Example Request
{
"token": "9d3edfce-3029-40ad-bfcc-467a49f2d5ea",
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"line_1": "E 123 22",
"city": "Brooklyn",
"subdivision": "NY",
"postal_code": "11001",
"country": "US",
"email": "test@example.com"
}
}
Example Success Response
{
"id": "7e44c370-078e-4fa3-9909-bdd8554eb068",
"status": "paid",
"transaction_status": "pending",
"redirect_url": "https://example.com/thank-you"
}