Skip to main content

invoice

๐Ÿงพ Invoice Setupโ€‹

The Longswipe platform allows users to create invoices on behalf of merchants. Once an invoice is submitted, the merchant can review and either approve or reject it. Only approved invoices can be paid and processed.

This setup ensures that merchants maintain full control over which invoices they accept, helping to prevent fraudulent or unauthorized billing. The invoice can be approved from the merchant dahsboard or with api key


Add Invoice Currencyโ€‹

๐Ÿ’ก Note: Invoice currencies are the currencies that users can select when creating invoices. Merchants must first add these currencies before users can use them.

To configure accepted currencies for invoicing:

  1. Click on Invoices in the sidebar.

Invoices Sidebar

  1. Click the Add Accepted Currency button at the top-right corner.
  2. In the modal, select the currency you want to allow.
  3. Click Set Currency to confirm.

Add Invoice Currency


๐Ÿงพ Invoice Workflowโ€‹

  1. A user creates an invoice and submits it to a merchant.
  2. The merchant receives a notification and can:
    • Approve the invoice, making it payable.
    • Reject the invoice, preventing any payment.
  3. Once approved, the invoice becomes active and visible for payment processing.

Create Invoiceโ€‹

POST /merchant-integrations-server/create-invoice

You can allow your users, staff or customers to send you invoices using this endpoint, it will enable you generate vouchers for them easily, allowing them redeem it to their desired accounts.

Request Bodyโ€‹

{
"currencyAbbreviation": "string",
"dueDate": "string",
"email": "string",
"fullName": "string",
"invoiceDate": "string",
"invoiceItems": [
{
"description": "string",
"quantity": 0,
"unitPrice": 0
}
],
"merchantCode": "string",
"blockchainNetworkAbbreviation": "string"
}

Responseโ€‹

{
"code": 0,
"message": "string",
"status": "string"
}

Fetch Invoicesโ€‹

GET /merchant-integrations-server/fetch-invoice

Retrieve a paginated list of invoices.

Query Parametersโ€‹

  • page: Page number (default: 1)
  • limit: Items per page (default: 10)
  • filter: Approved, Pending, Rejected

Responseโ€‹

{
"code": 0,
"data": {
"invoices": [
{
"blockchainNetwork": {
"blockExplorerUrl": "string",
"chainID": "string",
"id": "string",
"networkName": "string"
},
"createdAt": "string",
"currency": {
"abbrev": "string",
"currencyType": "string",
"id": "string",
"image": "string",
"isActive": true,
"name": "string",
"symbol": "string"
},
"dueDate": "string",
"id": "string",
"invoiceDate": "string",
"invoiceItems": [
{
"createdAt": "string",
"description": "string",
"id": "string",
"quantity": 0,
"totalPrice": 0,
"unitPrice": 0,
"updatedAt": "string"
}
],
"invoiceNumber": "string",
"merchantUser": {
"email": "string",
"id": "string",
"name": "string"
},
"status": "string",
"totalAmount": 0,
"updatedAt": "string",
"userId": "string"
}
],
"total": 0
},
"message": "string",
"status": "string"
}

Approve Invoiceโ€‹

POST /merchant-integrations-server/approve-invoice

Use endpoint to approve invoice.

Request Bodyโ€‹

{
"invoiceID": "string",
"onChain": "boolean"
}

Responseโ€‹

{
"message": "string",
"code": 200,
"status": "string"
}