Limited Invoice

Process description

To transfer funds for provided products/services to a merchant account, an invoice must be paid.

To make a payment from the Calypso payment form, there are the following steps to be performed:

  • Send API request to create an invoice (POST https://api.calypso.finance/api/v1/invoice/single/create)
  • Copy generated invoice ID from the response
  • Send API request POST https://api.calypso.finance/api/v1/invoice and copy the data required for a user to complete this invoice payment
  • Add copied data to a payment page and share a page link with a user

Further steps to complete payment are performed by a user in the payment form.

Below is a scheme demonstrating the listed steps.

Names of requests on the scheme indicate certain payment API methods.

Create invoice request example

Example of the create invoice request:

{
  "timestamp": 13292792792,
  "account": "0xc195df92dd9db2a8f28e597981f113d6e7582f8b",
  "payload": {
    "amount": 0.001,
    "currency": "ETH",
    "description": "invoice for client 1",
    "idempotencyKey": "1be6a518-6dcd-477d-96af-dd914b1300ce",
    "type": "SINGLE"
  }
}

Invoice statuses

Diagram nodes indicate invoice statuses, arrows indicate processes a successful completion of which transfers an invoice from one status to another.

Invoice statuses

StatusDescription
PENDING_PAYMENT• A new unpaid invoice.
• Client has transferred funds, but the funds has not yet been credited to the account.
MEM_POOL_FOUNDIncoming transaction to invoice wallet is found in blockchain mempool.
PAIDInvoice is paid.
PENDING_INTERVENTION• Intervention from the merchant is awaited.
• Client transferred insufficient amount.
• Client has transferred an amount exceeding an invoice amount.
• Funds were transferred from different client accounts.
COMPLETEDFunds are transferd to merchant wallet.
ARCHIVEDInvoce is deleted by merchant.

Related Articles: