paypal-invoices
An api wrapper for paypal 2.0 invoices.
Installing
npm i paypal-invoices
Getting Started
const { Invoices } = require('paypal-invoices')
const invoice = {...}
const main = async () => {
const api = new Invoices(CLIENT_ID, CLIENT_SECRET)
try {
await api.initialize();
} catch (e) {
console.log("Could not initialize");
return;
}
const invoiceNum = await api.generateInvoiceNumber();
const link = await api.createDraftInvoice();
const invoiceDraft = await api.getInvoiceByLink(link);
await api.sendInvoice(invoiceDraft.id);
};
main();
PayPal official docs
Roadmap
-
Remove Axios dependency (?)
-
OAuth token
-
Generate invoice number
-
Create draft invoice
-
List invoices
-
Delete invoice
-
Fully update invoice
-
Show invoice details
-
Cancel sent invoice
-
Generate QR code
-
Record payment for invoice
-
Delete external payment
-
Record refund for invoice
-
Delete external refund
-
Send invoice reminder
-
Send invoice
-
Search invoices
-
Templates
- Create template
- List templates
- Delete template
- Fully update template
- Show template details
-
Common Object Definitions
- 202_response
- address_details
- address_portable
- address_portable_postal_code_validation
- aggregated_discount
- amount_range
- amount_summary_detail
- amount_with_breakdown
- billing_info
- business_name
- business_name_validation
- configuration
- contact_information
- country_code
- currency_code
- custom_amount
- date_no_time
- date_range
- date_time
- date_time_range
detail- discount
- email_address
- error
- error_details
- field
- file_reference
- invoice
- invoice_creation_flow
invoice_detail- invoice_number
invoice_payment_term- invoice_status
- invoicer_info
- invoices
- item
- language
- link_description
- metadata
- money
name- name_validation
- notification
- partial_payment
- payment_detail
- payment_method
- payment_reference
- payment_term
- payment_term_type
- payment_type
- payments
- percentage
phone- phone_detail
- phone_type
- qr_config
- recipient_info
- refund_detail
- refund_reference
- refunds
- search_data
- shipping_cost
- tax
- template
- template_configuration
- template_detail
- template_display_preference
- template_info
- template_item_field
- template_item_setting
- template_metadata
- template_settings
- template_subtotal_field
- template_subtotal_setting
- templates
- unit_of_measure
Post-Complete Roadmap
Dependencies