@robinpath/invoice
0.1.1Node.jsPublicInvoice module for RobinPath.
Invoice
Invoice module for RobinPath.
Package: @robinpath/invoice | Category: Finance | Type: Integration
Authentication
No authentication required. All functions are available immediately.
Use Cases
Use the invoice module when you need to:
- createInvoice -- Use
invoice.createInvoiceto perform this operation - addLineItem -- Use
invoice.addLineItemto perform this operation - removeLineItem -- Use
invoice.removeLineItemto perform this operation - calculateTotals -- Use
invoice.calculateTotalsto perform this operation - addDiscount -- Use
invoice.addDiscountto perform this operation
Quick Reference
| Function | Description | Returns |
|---|---|---|
createInvoice | createInvoice | object |
addLineItem | addLineItem | object |
removeLineItem | removeLineItem | object |
setCompanyInfo | setCompanyInfo | object |
setClientInfo | setClientInfo | object |
calculateTotals | calculateTotals | object |
addDiscount | addDiscount | object |
addNote | addNote | object |
setPaymentTerms | setPaymentTerms | object |
setCurrency | setCurrency | object |
formatInvoice | formatInvoice | object |
duplicateInvoice | duplicateInvoice | object |
markAsPaid | markAsPaid | object |
generateInvoiceNumber | generateInvoiceNumber | object |
Functions
createInvoice
createInvoice
Module: invoice | Returns: object -- API response.
invoice.createInvoice
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
addLineItem
addLineItem
Module: invoice | Returns: object -- API response.
invoice.addLineItem
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
removeLineItem
removeLineItem
Module: invoice | Returns: object -- API response.
invoice.removeLineItem
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
setCompanyInfo
setCompanyInfo
Module: invoice | Returns: object -- API response.
invoice.setCompanyInfo
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
setClientInfo
setClientInfo
Module: invoice | Returns: object -- API response.
invoice.setClientInfo
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
calculateTotals
calculateTotals
Module: invoice | Returns: object -- API response.
invoice.calculateTotals
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
addDiscount
addDiscount
Module: invoice | Returns: object -- API response.
invoice.addDiscount
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
addNote
addNote
Module: invoice | Returns: object -- API response.
invoice.addNote
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
setPaymentTerms
setPaymentTerms
Module: invoice | Returns: object -- API response.
invoice.setPaymentTerms
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
setCurrency
setCurrency
Module: invoice | Returns: object -- API response.
invoice.setCurrency
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
formatInvoice
formatInvoice
Module: invoice | Returns: object -- API response.
invoice.formatInvoice
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
duplicateInvoice
duplicateInvoice
Module: invoice | Returns: object -- API response.
invoice.duplicateInvoice
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
markAsPaid
markAsPaid
Module: invoice | Returns: object -- API response.
invoice.markAsPaid
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
generateInvoiceNumber
generateInvoiceNumber
Module: invoice | Returns: object -- API response.
invoice.generateInvoiceNumber
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
Error Handling
All functions throw on failure. Common errors:
| Error | Cause |
|---|---|
Invoice: "..." not configured. Call invoice.setCredentials first. | Check the error message for details |
@desc "Create invoice and validate result"
do
set $result as invoice.createInvoice
if $result != null
print "Success"
else
print "No result"
end
enddo
Recipes
1. Create a new item with createInvoice
Create a new resource and capture the result.
set $result as invoice.createInvoice
print "Created: " + $result
2. Multi-step Invoice workflow
Chain multiple invoice operations together.
@desc "Create invoice, add line item, and more"
do
set $r_createInvoice as invoice.createInvoice
set $r_addLineItem as invoice.addLineItem
set $r_removeLineItem as invoice.removeLineItem
print "All operations complete"
enddo
3. Safe createInvoice with validation
Check results before proceeding.
@desc "Create invoice and validate result"
do
set $result as invoice.createInvoice
if $result != null
print "Success: " + $result
else
print "Operation returned no data"
end
enddo
Related Modules
- quickbooks -- QuickBooks module for complementary functionality
- xero -- Xero module for complementary functionality
- freshbooks -- FreshBooks module for complementary functionality
- json -- JSON module for complementary functionality
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | 1 months ago |
$ robinpath add @robinpath/invoice
