Fetch Invoice
Get a single product on your Terraswitch account
GET {{ BASE_URL }}/v1/corporate/invoice/{code}
Url Parameters
Property
Data Type
Description
Example
Required
code
string
The invoice code
"TSIFFEE52E2"
Yes
import Axios from 'axios';
// set the api url
const API_URL = `${BASE_URL}/v1/corporate/invoice/${code}`;
// make request using axios
Axios({
method: "GET",
url: `${API_URL}`,
headers: {
lg: 'en',
ch: 'web'
Authorization: `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
}
}).then((resp) => {
console.log(resp)
}).catch((err) => {
console.log(err)
})
{
"error": false,
"errors": [],
"data": {
"code": "VPIB3E319FB",
"name": "NANST-INV",
"number": "NANST-00124",
"status": "pending",
"link": "https://staging-web.terraswitch.com/invoice/VPIB3E319FB",
"VAT": {
"title": "TAX",
"type": "percentage",
"value": 5
},
"summary": {
"subtotal": 4001.98,
"partialAmount": 0,
"totalAmount": 4202.08
},
"description": "Invoice for nanst limited",
"isEnabled": true,
"inflow": {
"value": 0,
"count": 0
},
"items": [
{
"label": "ITMKFMFWS",
"name": "Brown D&G Bag",
"price": 2000.99,
"quantity": 2,
"total": 4001.98
}
],
"dueAt": {
"date": "2024-01-28",
"time": "00:30:45",
"ISO": "2024-01-28T00:30:45.000Z"
},
"issuedAt": {
"date": "2024-01-13",
"time": "18:31:23",
"ISO": "2024-01-13T18:31:23.094Z"
},
"paymentLink": "",
"recipient": {
"type": "business",
"businessName": "NANST Solutions Limited",
"firstName": "Oluwatobi",
"lastName": "Immanuel",
"email": "nanst@gmail.com",
"phoneNumber": "08137031202",
"phoneCode": "+234",
"countryCode": "NG",
"address": "Alausa, Ikeja Lagos.",
"city": "Ikeja",
"state": "Lagos"
},
"createdAt": "2024-01-13T18:31:23.061Z",
"updatedAt": "2024-01-13T18:31:23.113Z"
},
"message": "successful",
"status": 200
}
Last updated