Add Product

This endpoint is used to add a product details for invoice plugin

Method

POST https://api.ninjapay.me/webextension/api/v1/fiat/invoice/product

Parameters

  • name : (string, required) - The name of the product or item

  • price : (number, required) - The price of the product or item

  • description: (string) - A detailed description of the product or item

  • currency: (string) - The currency in which the price is denominated

Request Body

Body (application/json)
{
  "name": "Gift Box",
  "price": 499.5,
  "description": "A beautifully curated gift box with assorted items perfect for any occasion.",
  "currency": "INR"
}

Response

{
    "status": true,
    "data": {},
    "message": "Product details added successfully"
}

Code Example


const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'API_KEY' //Invoice key required
  },
  body: {
  "name": "Gift Box",
  "price": 499.5,
  "description": "A beautifully curated gift box with assorted items perfect for any occasion.",
  "currency": "INR"
}
};

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

Last updated