In the API, an invoice is a payment link — the endpoints and field names below say
paymentLink. Same thing; this guide says “invoice” because that’s what your customer sees.Before you start: You need a sandbox API key and a customer to bill. The Quickstart covers both — this guide picks up the same example. Requests below use
https://rest.staging.nickel.com.Create the customer
Every invoice belongs to a customer. Create one with
POST /customer if they don’t exist yet:feePassthroughPercent echoes your organization’s setting, not anything you sent: it’s the share of the card processing fee your customers cover. This sandbox organization passes 50% through (a new organization starts at 100) — you’ll see that 50% again when we read the payment’s charged amount below.If your account has QuickBooks Online connected, pass
"syncToQbo": true to also create the customer in QuickBooks. See QuickBooks for exactly what does and doesn’t sync.Create the invoice
Create the invoice with A few optional fields let you control checkout per invoice —
POST /paymentLink. The name is what your customer sees — an invoice number works well:creditCardEnabled and achEnabled toggle payment methods, amountEditable lets the customer change the amount (useful for deposits), and feePassthroughPercent sets how much of the card processing fee the customer covers. Omit them to inherit your customer and organization settings.Attach the invoice PDF (optional)
If you generate a PDF for the invoice, attach it so your customer can view and download it on the payment page. It’s two calls: upload the file, then attach it by ID.Upload the PDF as Then attach it by sending the file’s The response is the updated invoice.
multipart/form-data to POST /file with type=INVOICE_PDF (PDFs up to 10MB):id — not the key, and not the file itself — to POST /paymentLink/{paymentLinkId}/uploadPdf as JSON:Files can only be attached by the API key that uploaded them — use the same key for both calls.
Troubleshooting PDF attachment
Troubleshooting PDF attachment
| Response | Cause |
|---|---|
404 File not found | No file exists with that fileId. Check that you’re passing the id from the POST /file response (not the key or a URL). |
403 | The file was uploaded with a different API key than the one making this request. Upload and attach with the same key. |
400 fileId is required | The request body didn’t include a fileId — this usually means the PDF was sent directly to this endpoint instead of to POST /file first. |
400 File must be of type INVOICE_PDF | The file was uploaded with a different type. Re-upload it with type=INVOICE_PDF. |
Send it
Email the invoice to your customer with
POST /paymentLink/{paymentLinkId}/send. Nickel sends a payment request email with your branding and the link:Your customer pays
The email links to the hosted checkout page (the invoice’s
url). Your customer sees the invoice details and the attached PDF, and pays by card or bank transfer (ACH) — whichever you’ve left enabled. If you pass part of the card fee through, the checkout shows the customer their share as a line item before they confirm.You don’t need to build anything for this step.Get notified when the payment lands
Subscribe to webhooks and listen for Reading the money fields:
payment.made. The event tells you which payment changed; fetch the full details with GET /payment/{paymentId}:amountInCents is the invoice amount (3.50), and chargedAmountInCents is what the customer’s card was actually charged ($122.30 — the invoice plus their half of the fee, since this account passes 50% through).Confirm the invoice is settled
The invoice tracks its own progress — fetch it any time with
GET /paymentLink/{paymentLinkId}:completedAmountCents climbs as payments come in, and status flips from ACTIVE to COMPLETED when the invoice is fully paid.Record offline payments (optional)
If the customer pays outside Nickel — a mailed check, cash — close the invoice with
POST /paymentLink/{paymentLinkId}/markPaid (no request body). It returns the invoice with status: "COMPLETED", and no money moves.Payments on API-created invoices are never recorded in QuickBooks by Nickel, even with the integration connected — book them yourself without double-entry risk. Details in QuickBooks.
Where to go next
Refund or void a payment
Give money back the right way — and know when it’s fee-free.
Track your payouts
Match Nickel payments to the deposits on your bank statement.
Webhook events
Every event you can subscribe to, and how delivery works.
Charge customers automatically
Skip the waiting — pay invoices from an authorization on file.
