> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: addPayment(id: IdAndVersion, payment: Payment) # Method package: wixBillingBackend # Method menu location: wixBillingBackend --> Invoices --> addPayment # Method Link: https://dev.wix.com/docs/velo/apis/wix-billing-backend/invoices/add-payment.md # Method Description: Adds a payment to the invoice and reports the payment to the payment provider. The `addPayment()` function returns a Promise that resolves when the specified payment is added to the invoice with the specified ID. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Add a payment to an invoice ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { invoices } from 'wix-billing-backend'; export const addPayment = webMethod(Permissions.Anyone, (id, version, type, amount) => { const idAndVersion = { "id": id, "version": version }; const payment = { "type": type, "amount": amount, "date": Date.now() }; return invoices.addPayment(idAndVersion, payment); }); /* Promise resolves to: * { * { * "id": { * "id": "1ed3a515-24f9-4039-8937-2e69b6a2f33a", * "version": 31 * } * } * } */ ``` ## Get the invoice version and add a payment to an invoice ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { invoices } from 'wix-billing-backend'; export const addPayment = webMethod(Permissions.Anyone, (id, payment) => { return invoices.getInvoice(id) .then((result) => { return invoices.addPayment(result.id, payment); }); }); /* Promise resolves to: * { * { * "id": { * "id": "1ed3a515-24f9-4039-8937-2e69b6a2f33a", * "version": 31 * } * } * } */ ``` ---