Upload Attachment
Endpoint for attaching a PDF document to a Payment Link. The end-user can view and download it on the public payment page.
info
Please be aware that this endpoint requires a Manage Payment Links API Key.
A Payment Link can have only one attachment. Uploading a new file replaces the existing one. Only Active Payment Links that have not expired can be updated.
POST
/api/v1/groups/{group_id}/payment-links/{payment_link_id}/attachment
Request Parameters
The request body must be sent as multipart/form-data.
| Name | Description | Type | Required |
|---|---|---|---|
| file | The PDF file. The file part's Content-Type must be application/pdf. Maximum size is 10 MB. | file | Required |
| display_name | Name of the document shown to the end-user and used as the download filename. Defaults to the uploaded file's name. | string |
Response
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request / Validation error (e.g. not a PDF, file too large, Payment Link is not Active or expired) |
| 404 | Payment Link not found |
| 500 | Internal Error |
Example Usage
- JavaScript
- Python
- Go
uploadAttachment.js
var headers = new Headers();
headers.append('Authorization', 'API_KEY');
// file: a PDF File or Blob with type 'application/pdf'
var formData = new FormData();
formData.append('file', file, 'contract.pdf');
formData.append('display_name', 'Service contract.pdf');
var requestOptions = {
method: 'POST',
headers: headers,
redirect: 'follow',
body: formData
};
const group_id = '';
const payment_link_id = '';
const url = `https://api.reverepayments.dev/api/v1/groups/${group_id}/payment-links/${payment_link_id}/attachment`;
fetch(url, requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));
uploadAttachment.py
import requests
group_id = ""
payment_link_id = ""
url = "https://api.reverepayments.dev/api/v1/groups/"+group_id+"/payment-links/"+payment_link_id+"/attachment"
headers = {
'Authorization': 'API_KEY'
}
with open("contract.pdf", "rb") as f:
response = requests.request("POST", url, headers=headers,
files={'file': ('contract.pdf', f, 'application/pdf')},
data={'display_name': 'Service contract.pdf'})
print(response.text)
uploadAttachment.go
package main
import (
"bytes"
"fmt"
"io"
"mime/multipart"
"net/http"
"net/textproto"
"os"
)
func main() {
const group_id = ""
const payment_link_id = ""
url := "https://api.reverepayments.dev/api/v1/groups/" + group_id + "/payment-links/" + payment_link_id + "/attachment"
file, err := os.Open("contract.pdf")
if err != nil {
fmt.Println(err.Error())
return
}
defer file.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
// the file part must have the application/pdf Content-Type
partHeader := textproto.MIMEHeader{}
partHeader.Set("Content-Disposition", `form-data; name="file"; filename="contract.pdf"`)
partHeader.Set("Content-Type", "application/pdf")
part, _ := writer.CreatePart(partHeader)
_, _ = io.Copy(part, file)
_ = writer.WriteField("display_name", "Service contract.pdf")
_ = writer.Close()
client := &http.Client{}
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Authorization", "API_KEY")
req.Header.Add("Content-Type", writer.FormDataContentType())
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 Success Response
{
"id": "7e44c370-078e-4fa3-9909-bdd8554eb068",
"group_id": "8059f5c6-e1cd-4e46-9196-1d7e47401a3e",
"title": "Consulting session",
"description": "1 hour consulting session",
"amount_mode": "fixed",
"amount": 15000,
"settings": {},
"currency": "USD",
"card_enabled": true,
"ach_enabled": true,
"processor_id": "fbf2e44a-eed6-426f-b0e2-a3a5b34377c0",
"expires_at": "2027-12-18T00:00:00Z",
"expires_on": "2027-12-18T00:00:00Z",
"redirect_url": "https://example.com/thank-you",
"status": "active",
"url": "https://merchant.reverepayments.dev/payment-links/7e44c370-078e-4fa3-9909-bdd8554eb068",
"created_at": "2026-11-18T14:27:10.661796389Z",
"updated_at": "2026-11-18T14:35:22.481203Z",
"has_attachment": true,
"attachment_display_name": "Service contract.pdf"
}