Weblutions Documentation
Weblutions Main Site Contact Us Our Discord
FaxStore IconFaxStore

Weblutions Documentation / FaxStore / Invoices API

Updated

Invoices API

By Josh M. 4 mins 35

The Invoices API for FaxStore manages invoice creation, updates, deletion, and retrieval. It streamlines the invoicing process for efficient billing and record-keeping.

Table of Contents


Get All Invoices

GET/api/invoices
Returns all invoices created in an array with an optional filter
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Query parameters
NameTypeRequiredDescription
filterStringoptionalFilter invoices for a user, or invoice status. See note below.
Responses
200OKjson
View response body
[
  {
    "id": 39,
    "userId": "183355725132050432",
    "items": "[{"title":"Test 1","url":"","description":"test description 2","price":"2.00","productId":null,"subId":null}]",
    "due": "1700006400000",
    "status": "Cancelled",
    "createdAt": "1699940740527",
    "username": "John Doe",
    "tos": "",
    "memo": "Test memo."
  },
  ...
]
404Not Foundplaintext
View response body
Invoices table not found.

Filter notes

The filter can contain a user ID or an invoice status consisting of:

  • Due

  • Overdue

  • Paid

  • Cancelled


Get Single Invoice

GET/api/invoices/:id
Returns all invoices created in an array with an optional filter.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringrequiredAn invoice ID.
Responses
200OKjson
View response body
{
  "id": 39,
  "userId": "183355725132050432",
  "items": "[{"title":"Test 1","url":"","description":"test description 2","price":"2.00","productId":null,"subId":null}]",
  "due": "1700006400000",
  "status": "Cancelled",
  "createdAt": "1699940740527",
  "username": "John Doe",
  "tos": "",
  "memo": "Test memo."
}
404Not Foundplaintext
View response body
Invoice not found.

Create Invoice

POST/api/invoices
Creates an invoice. If due is not present the due date gets set as the current time.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Request body
NameTypeRequiredDescription
userIdStringrequiredThe account ID to assign the invoice to.
usernameStringrequiredThe accounts display name for the invoice.
itemsStringrequiredA formatted JSON string for the invoice object. See note below.
dueStringoptionalA timestamp of when the invoice is due. Defaults to time of creation.
statusStringoptionalThe desired status of the invoice. Defaults to 'Due'.
tosStringoptionalAn optional set of terms to attach to the invoice.
memoStringrequiredAn optional memo to attach to the invoice.
Responses
200OKjson
View response body
{
  "id": 44,
  "userId": "183355725132050432",
  "items": "[]",
  "due": "1723782546862",
  "status": "Due",
  "createdAt": "1723782546862",
  "username": "John",
  "tos": "",
  "memo": ""
}
400Bad Requestplaintext
View response body
Missing required body items - userId, username, and items are required.
404Not Foundplaintext
View response body
Invoice not found after creation.

Invoice items Object

[{"title": "ITEM_TITLE", "description": "ITEM_DESCRIPTION", "price": "9.50", "productId": null, "subId": null}]

Delete Invoice

DELETE/api/invoices/:id
Deletes the invoice completely. This is not a recommended action. consider cancelling it.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringrequired
Responses
200OKplaintext
View response body
(no content)
404Not Foundjson
View response body
Invoice not found.

Document History

Loading version history...