API Documentation
Introduction
API endpoints
Get Started
Base API Url is https://wallet-api.finup.io/
All API keys, links, logos, IDs are not real and are provided for example.
Authentication
Create Invoice and Delete Invoice endpoint are authenticated using API keys
and picked up from headers.
{
"Authorization": "xdOGy...psPqSt"
}
Examples
Here are some quick examples to show you how easy it is to use out API:
Create new invoice example
Learn more about creating invoices here.
createInvoice.js
import axios from 'axios';
(async () => {
const baseUrl = "https://wallet-api.finup.io";
const headers = {
"Authorization": "xdOGy...psPqSt", // Replace this
"Content-Type": "application/json"
}
const body = {
"walletCurrency": "USD",
"invoiceAmount": 100,
"invoiceCurrency": "USD",
"additionalData": {
"...": "..." // Any your additional data
},
"urlReturn": "https://www.google.com/", // URL to which the "Back" button will lead to
"urlSuccess": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", // URL to which the user will be redirected upon successful payment
"type": "Regular"
};
const createInvoiceData = await axios.post(baseUrl + "/invoice", body, { headers: headers }); // Creating new invoice
console.log(createInvoiceData.data); // { "account": "12312312", "invoiceAmount": 100, "type": "Invoice", ... }
})
Creating P2P invoice example
This is the same as the previous example, only the type must be "P2P"
. Also make sure you add the correct addresses. Learn more about P2P invoices here.
const body = {
// ...
"type": "P2P"
}
// ...
Get invoice example
Learn more about getting invoices here.
getInvoice.js
import axios from 'axios';
(async () => {
const baseUrl = "https://wallet-api.finup.io";
const headers = {
"Authorization": "Bearer eyJasga111111", // Replace this
"Content-Type": "application/json"
}
const params = {
"id": "74e283b6-...-822f3623f59c"
};
const createInvoiceData = await axios.get(baseUrl + "/invoice", { headers: headers, params: params }); // Creating new invoice
console.log(createInvoiceData.data); // { "account": "12312312", "invoiceAmount": 100, "type": "Invoice", ... }
})
Auto Redirect
Learn more about auto redirect here.