Get Invoice by ID

This endpoint is used to get invoice details by ID for invoice plugin

Method

GET https://api.ninjapay.me/webextension/api/v1/fiat/invoice/{id}

Request Parameter

  • id (number): - Invoice ID

Response

{
    "status": true,
    "data": {
        "invoice_uuid": "89691435",
        "business_logo": "https://awesomecompany.com",
        "business_name": "Awesome Company",
        "phone": "234567890",
        "email": "sample@gmail.com",
        "billing_address": "123 Main Street",
        "state": "Telangana",
        "country": "USA",
        "city": "Hyderabad",
        "zipcode": "12345",
        "default_currency": "USD",
        "enable_qr": true,
        "redirect_url": "",
        "include_invoice_id": true,
        "webhook_url": "",
        "terms_condition_url": "https://google.com",
        "terms_message": "",
        "custom_thanks_message": "Thank you for your payment!",
        "custom_button_text": "",
        "green_donation_link": "",
        "donation_percentage": "0.00",
        "donation_message": "",
        "invoice_date": "2024-08-08T00:00:00.000Z",
        "created_at": "2024-08-08T10:33:59.000Z",
        "updated_at": "2024-08-08T10:33:59.000Z",
        "is_active": true,
        "theme_color": "",
        "documents": {
            "doc_1": {
                "title": "PAN",
                "value": "HG297323"
            },
            "doc_2": {
                "title": "GST",
                "value": "76YHGF67656"
            }
        },
        "tax_details": {
            "tax_title": "GST",
            "tax_percentage": 18,
            "tax_country": "India",
            "is_all_states": true,
            "tax_states": []
        },
        "phone_code": "+1",
        "invoice_template_uuid": "89691435",
        "client_details": {
            "name": "Aman A",
            "phone_code": "91",
            "phone": "9876543211",
            "email": "aman2@gmail.com",
            "website": "https://amanwebsite.com",
            "street_address": "1234 Elm Street",
            "state": "Maharashtra",
            "city": "Mumbai",
            "country": "India",
            "zip_code": "400001",
            "details": [
                {
                    "PAN": "ABCDE1234F"
                },
                {
                    "GST": "27ABCDE1234F1Z5"
                }
            ]
        },
        "total": "599.50",
        "net_total": "599.50",
        "allow_partial": false,
        "allow_tip": false,
        "due_date": "2024-08-10T00:00:00.000Z",
        "note_to_customer": "Kindly pay before due date!",
        "tracking_number": "",
        "tracking_url": "",
        "extras": {
            "key1": "value1",
            "key2": "value2"
        },
        "received_amount": "0.00",
        "due_amount": "599.50",
        "tip_amount": "0.00",
        "created": "2024-08-08T10:33:59.000Z",
        "updated": "2024-08-08T10:33:59.000Z",
        "product_details": [
            {
                "name": "Orange Gift Box",
                "price": "599.50",
                "description": "",
                "logo": "",
                "product_created_at": "2024-08-07T11:53:03.000Z",
                "currency": "INR",
                "quantity": 1,
                "amount": 599.5,
                "final": 599.5
            }
        ],
        "invoice_id": "151",
        "status": "PENDING",
        "share_link": "https://www.ninjapay.me/invoice/89691435",
        "funding_source": "",
        "total_details": [
            {
                "title": "Discount",
                "amount": 0,
                "percentage": 0
            },
            {
                "title": "Shipping",
                "amount": 0,
                "percentage": 0
            },
            {
                "title": "Total GST",
                "amount": 0,
                "percentage": 0
            },
            {
                "title": "TDS",
                "amount": 0,
                "percentage": 0
            }
        ],
        "linkid": "RTLmfsS5HTWxWFelfyNhLkr",
        "super_orderid": "FT_RTPL_SOaMz7Sep31V6CAa8jaWlU"
    },
    "message": "Invoice retrieved successfully"
}

Code Example


const options = {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'API_KEY' //Invoice key required
  }
};

fetch('https://api.ninjapay.me/webextension/api/v1/fiat/invoice/{id}', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
  

Last updated