Fetch a payment receipt for an invoice
A payment receipt is a PDF that shows the invoice rows, the date it was paid and the total paid. Quiddly generates it when you ask and returns it in the response. It is not stored, so every call generates the file again, which is expensive: do not call it in a loop.
Without a token
Section titled “Without a token”PUT /public/invoices/<payment reference>/<zip>/payment-receipt needs no
Authorization header. The invoice is found by its payment reference and the zip
code of the debtor’s invoice address.
curl -X PUT "https://$HOST/public/invoices/$PAYMENT_REFERENCE/$ZIP/payment-receipt" \ -o receipt.pdfThe response is the PDF, as an attachment.
| Answer | Reason |
|---|---|
400 Invoice does not exist | No invoice has that reference and zip code |
400 Invoice is not registered as fully paid. | The invoice is not closed. A payment takes time to register, so try again later |
403 | The authentication method for payment references is disabled or missing for the country of the invoice. Contact Quiddly support |
429 Too many attempts. Try again later. | Too many wrong zip codes for this payment reference, or from your address. Wait the number of seconds in the Retry-After header |
A debtor who is signed in can use GET /debtor/invoices/<invoice id>/payment-receipt
instead, which works the same way.
Part invoices of a part payment plan
Section titled “Part invoices of a part payment plan”The part invoices of a part payment plan all have the payment reference of the
plan. When several invoices match the reference and the zip code, Quiddly uses
the one with the highest id, which is the latest part invoice. The receipt call
then answers 400 Invoice is not registered as fully paid. whenever that part
invoice is still open, even when an earlier part invoice is paid.
Add the query parameter invoiceNumber to pick the invoice:
curl -X PUT "https://$HOST/public/invoices/$PAYMENT_REFERENCE/$ZIP/payment-receipt?invoiceNumber=$INVOICE_NUMBER" \ -o receipt.pdf