Create Invoice

Steps

  1. Merchant's backend sends request to Get List Available Currency to be set on Invoice.

  2. Merchant's backend sends request to Create Invoice API in order to retrieve payment URL.

  3. Share the payment URL to Customer and then wait for them to proceed to payment.

  4. Merchant gets callback of payment status changes and need to handle it accordingly.

Merchant can also use other API endpoints to manage Invoice. For example to Get List & Detail Invoice as needed.

Host URL

Get Available Currency API

Request :

Endpoint : /v1/invoices/available-currecny

HTTP Method : GET

Header :

Authorization: Basic ENCODED_KEY

ENCODED_KEY value is result of Base64Encode("apiKey"+":"+"secretKey")

Response :

Sample Success Response :

HTTP Status Code : 200

"data": [
    {
        "id": "a19a5c32-27f6-46f9-a236-87a808052565",
        "priority": 1,
        "currencyId": "69ee6a50-0242-41db-aa17-fc75fe33306c",
        "status": 1,
        "code": "TRX",
        "name": "Tron",
        "imageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1958.png",
        "description": null,
        "decimal": 6,
        "precision": 2,
        "contractAddress": null,
        "blockchainCode": "TRON",
        "baseCurrency": "USD",
        "minPrice": 5
    },
    {
        "id": "79cb792a-8ae4-4d98-9681-b58b81467027",
        "priority": 3,
        "currencyId": "c8393ce1-75ed-4189-a352-b07dc8fd15d6",
        "status": 1,
        "code": "USDT_TRC20",
        "name": "Tether USD TRC 20",
        "imageUrl": "https://nusagate.s3.amazonaws.com/USDT/1642988151838%20-%20usdt.png",
        "description": null,
        "decimal": 6,
        "precision": 3,
        "contractAddress": "TXLAQ63Xg1NAzckPwKHvzw7CSEmLMEqcdj",
        "blockchainCode": "TRON",
        "baseCurrency": "USD",
        "minPrice": 10
    }
],
"meta": {
    "message": "Get available currency success",
    "statusCode": 200,
    "totalData": 0,
    "page": 1,
    "perPage": 10,
    "totalPage": 1
}

Response JSON Body Details :

Create Invoice API

Request :

Endpoint : /v1/invoices

HTTP Method : POST

Header :

Accept : application/json

Content-Type:application/json

Authorization: Basic ENCODED_KEY

ENCODED_KEY value is result of Base64Encode("apiKey"+":"+"secretKey")

Request JSON Body :

{
  "externalId": "ECOMM_123456",
  "description": "invoice example description",
  "price": "12000000",
  "dueDate": "2022-02-07T19:26:07.255Z",
  "email": "customernusagate@example.com",
  "phoneNumber": "085875517882",
  "payCurrency": "ETH"
}

Fee Calculation:

transaction fee = 0.8 * invoice_amount

Example :

Invoice Amount : 5 ETH

Merchant's balance : 0.2 * 5 ETH = 1 ETH

Note : Merchant is able to custom transaction fee by contact Our Support

Request JSON Body Details :

Response :

Sample Success Response :

HTTP Status Code : 200

{
  "data": {
    "id": "854e7b3f-ba8f-4696-8766-734ec42e1cbf",
    "slug": "INV-220207672-TJBXYY",
    "type": "INVOICE_API",
    "externalId": "ECOMM_123456",
    "description": "...",
    "dueDate": "2022-02-07T19:26:07.255Z",
    "expiredAmountAt": "2022-02-07T19:31:07.255Z",
    "email": "customernusagate@example.com",
    "phoneNumber": "085875517882",
    "payCurrency": "ETH",
    "paymentLink": "https://checkout.dev.nusagate.com/?id=854e7b3f-ba8f-4696-8766-734ec42e1cbf",
    "baseCurrency": "IDR",
    "price": 12000000,
    "amount": 0.269045,
    "paymentType": "DIRECT",
    "fee": "0.0000",
    "paidAt": null,
    "completedAt": null,
    "details": null,
    "createdAt": "2022-02-07T06:11:33.343Z",
    "updatedAt": "2022-02-07T06:11:33.343Z",
    "status": "UNPAID"
  },
  "meta": {
    "message": "Create invoice success",
    "statusCode": 201
  }
}

Response JSON Body Details :

Last updated