Create a Bill

Create a bill

Bills are payment requests addressed to specific buyers. Bill line items have fixed prices, typically denominated in fiat currency.

POST /bills

Facade POS

HTTP Request

// Create a list of items to add in the bill
List<Item> items = new List<Item>();
items.Add(new Item(){Price = 30.0, Quantity = 9, Description = "product-a"});
items.Add(new Item(){Price = 14.0, Quantity = 16, Description = "product-b"});
items.Add(new Item(){Price = 3.90, Quantity = 42, Description = "product-c"});
items.Add(new Item(){Price = 6.99, Quantity = 12, Description = "product-d"});

Bill bill = new Bill()
{
    Number = "1",
    Currency = Currency.USD,
    Email = "example!@example!.com",
    Items = items
};

bill = bitpay.CreateBill(bill).Result;

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"
    }
}