Skip to main content
On a Merchant of Record (MoR) workspace, Payrails issues an invoice for each payment in its own name. Two endpoints give your backend access to these invoices for an execution: Use them to show an invoice in your own customer account or to attach it to your support and accounting records.

List the invoices of an execution

Call the list with the workflow code and the execution ID of the payment:
The response lists the invoices of the execution, newest first:
The invoice amount is the payment amount. The PDF shows it together with any refunds.
Payrails creates the invoice shortly after the payment. Right after a payment, the list can be empty. Call the list again a little later. An empty list is a valid response, and the invoice appears in it once Payrails has created it.

Download an invoice as PDF

Pass the invoice ID from the list:
A successful call returns 200 with the application/pdf media type and the PDF as the response body. Save the body to a file or pass the bytes on to your own storage. The invoice contains the name and address of the customer. Treat the PDF as personal data and don’t log the response body.

Refunds

A refund updates the invoice of the payment. The PDF of that same invoice shows the credited amount, and the list keeps one entry per invoice.

Errors

A retry is safe: both endpoints only read data.
Last modified on November 30, 2026