Invoice v1

All endpoints related to Invoices v1

Supported Endpoints

  • getAllInvoices(): Returns a list of all the listings created.

  • getInvoice(id): Retrieves a listing by the entered ID.

  • getOrderDeliverables(id): Creates a listing and returns the created listing.

  • createInvoice(fields): Updates a listing by the entered ID.

  • issueReplacement(id, fields): Deletes a listing by the entered ID.

  • createPayment(id): Generates a payment session for the given order.


Invoices v1

getAllInvoices()

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.invoicesv1.getAllInvoices().then((res) => {
    console.log(res)
});

getInvoice()

Type
Required
Description

id

string

✔️

ID of an invoice

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.invoicesv1.getInvoice("6666").then((res) => {
    console.log(res)
})


getOrderDeliverables()

Parameters
Type
Required
Description

id

string

✔️

ID of an invoices

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.invoicesv1.getOrderDeliverables("666").then((res) => {
    console.log(res);
}).catch((err) => {
    console.log(err);
});

createInvoice()

Parameters
Type
Required
Description

fields

object

✔️

Product's field

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.invoicesv1.createInvoice({
	"customer_email": "john@doe.com",
	"total": "4.99",
	"payment_method": "PAYPAL",
	"products": {
		"1210": {
			"quantity": 5,
			"additional_information": [
				{
					"accept_terms_and_conditions": true,
					"read_terms_and_conditions_before_accepting": true
				}
			],
			"fill_once": true
		}
	}
}).then((res) => {
    console.log(res); 
}).catch((err) => {
    console.log(err);
});

issueReplacement()

Parameters
Type
Required
Description

id

string

✔️

ID of the order you want to issue a replacement

fields

array

The listings that should be replaced. If no listings are provided, all listings will be replaced.

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.invoicesv1.issueReplacement("666", {
  "listings": [
    1,
    2,
    3
  ]
}).then((res) => {
    console.log(res)
})

createPayment()

Parameters
Type
Required
Description

id

string

✔️

Generates a payment session for the given ORDER ID.

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.invoicesv1.createPayment("4982").then((res) => {
    console.log(res)
})

Last updated