Prerequisites
Before you begin, ensure that you’ve:- Created an API key with access to your payments.
- Created a
webhook subscription that
includes the
cpn.document.availablenotification type, or thecpn.document.*wildcard.
Steps
1
Wait for the document available webhook
When the BFI sends a payment receipt, CPN sends a
A
cpn.document.available
webhook. The notification object contains the document id and the
paymentId it belongs to.documentType of PROOF_OF_PAYMENT identifies the payment receipt.2
List the documents for a payment (optional)
If you missed the webhook, or want to check whether a receipt is available, call
the list documents endpoint
with the payment ID. The list is empty until the BFI sends a document.
3
Download the receipt
Call the download a document
endpoint with the document ID. The response is the PDF file, returned as an
attachment named CPN fetches the file from the BFI each time you download it. A
<paymentId>_proof_of_payment.pdf.400 status with
error code 291100 means too many downloads are in progress, so avoid
downloading many documents at once. Retry the request later after that error or
a 502 status.In the sandbox environment, set the
ORIGINATOR_NAME field to
PaymentWithDocument when you create a payment to receive a test receipt
after the payment completes. See magic values for
testing.