Create bill
POST /bills
Facade POS
POS
HTTP Request
Example code to create bill
let basicBillUsd;
let items = [];
let item = new BillItem();
item.price = 30;
item.quantity = 9;
item.description = "Test Item 1";
items.push(item);
item.price = 13.7;
item.quantity = 18;
item.description = "Test Item 2";
items.push(item);
let bill = new BitPaySDKLight.Models.Bill("bill1234-ABCD", Currencies.USD, "", items);
bill.email = "joh[email protected]";
basicBillUsd = await client.CreateBill(bill);
HTTP Response
{
"facade": "pos/bill",
"data": {
"status": "draft",
"url": "https://bitpay.com/bill?id=X6KJbe9RxAGWNReCwd1xRw&resource=bills",
"number": "bill1234-ABCD",
"createdDate": "2021-05-21T09:48:02.373Z",
"dueDate": "2021-05-31T00:00:00.000Z",
"currency": "USD",
"email": "[email protected]",
"cc": [
"[email protected]"
],
"passProcessingFee": true,
"id": "X6KJbe9RxAGWNReCwd1xRw",
"items": [
{
"id": "EL4vx41Nxc5RYhbqDthjE",
"description": "Test Item 1",
"price": 6,
"quantity": 1
},
{
"id": "6spPADZ2h6MfADvnhfsuBt",
"description": "Test Item 2",
"price": 4,
"quantity": 1
}
],
"token": "qVVgRARN6fKtNZ7Tcq6qpoPBBE3NxdrmdMD883RyMK4Pf8EHENKVxCXhRwyynWveo"
}
}