Update a Bill

Facades: merchant

Overview

Updates a bill.

Parameters

ParameterDescription
billA Bill object with the parameters to update defined.
billIdThe ID of the bill to update.

Example

List<Item> items = new ArrayList<Item>();
items.add(new Item() {{
    setPrice(30.0);
    setQuantity(9);
    setDescription("product-a");
}});
items.add(new Item() {{
    setPrice(14.0);
    setQuantity(16);
    setDescription("product-b");
}});
items.add(new Item() {{
    setPrice(3.90);
    setQuantity(42);
    setDescription("product-c");
}});
items.add(new Item() {{
    setPrice(6.99);
    setQuantity(12);
    setDescription("product-d");
}});

Bill bill = new Bill("7", Currency.USD, "", items);
Bill basicBill = null;
Bill retrievedBill = null;
Bill updatedBill = null;
basicBill = bitpay.createBill(bill);
retrievedBill = bitpay.getBill(basicBill.getId());
retrievedBill.setCurrency(Currency.EUR);
retrievedBill.setName("updatedBill");
retrievedBill.getItems().add(new Item() {{
    setPrice(60.0);
    setQuantity(7);
    setDescription("product-added");
}});
updatedBill = bitpay.updateBill(retrievedBill, retrievedBill.getId());