Invoice v2

All endpoints related to Invoices v2

Invoices v2 is pretty much the same functionality as invoices v1 with the acceptation to extra fields.

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 v2

getAllInvoices()

Parameters
Type
Required
Description

limit

integer

Limit the number of invoices returned

page

integer

The page number you are attempting to access.

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

API.invoices.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.invoices.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.invoices.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.invoices.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.invoices.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.invoices.createPayment("4982").then((res) => {
    console.log(res)
})

Last updated