Update a Bill

Update a bill

PUT /bills/:billid

Facade MERCHANT

HTTP Request

Body

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

var bill = new Bill()
{
    Number = "6", 
    Currency = Currency.USD,
    Email = "", //email address mandatory
    Items = items,
    Name = "basicBill"
};
var basicBill = bitpay.CreateBill(bill);
var retrievedBill = bitpay.GetBill(basicBill.Id);
retrievedBill.Currency = Currency.EUR;
retrievedBill.Name = "updatedBill";
retrievedBill.Items.Add(new Item(){Price = 60.0, Quantity = 7, Description = "product-added"});
    
var updatedBill = bitpay.UpdateBill(retrievedBill, retrievedBill.Id);

HTTP Response

{
  "facade": "merchant/bill",
  "data": {
    "url": "https://bitpay.com/bill?id=3Zpmji8bRKxWJo2NJbWX5H&resource=bills",
    "number": "bill1234-EFGH",
    "createdDate": "2021-05-21T09:51:04.126Z",
    "dueDate": "2021-05-31T00:00:00.000Z",
    "currency": "USD",
    "name": "John Doe",
    "address1": "2630 Hegal Place",
    "address2": "Apt 42",
    "city": "Alexandria",
    "state": "VA",
    "zip": "23242",
    "country": "US",
    "email": "[email protected]",
    "cc": [
      "[email protected]"
    ],
    "phone": "555-123-456",
    "passProcessingFee": true,
    "emailBill": true,
    "id": "3Zpmji8bRKxWJo2NJbWX5H",
    "merchant": "7HyKWn3d4xdhAMQYAEVxVq",
    "items": [
      {
        "id": "8vXbhqWDL1A9F66ZwJAiyJ",
        "description": "Test Item 1",
        "price": 6,
        "quantity": 1
      },
      {
        "id": "WmgAaPiyuY9L6vBX7KvF2R",
        "description": "Test Item 2",
        "price": 4,
        "quantity": 1
      },
      {
        "id": "89xhSLYPnLDBczsQHCvJ2D",
        "description": "Test Item 3",
        "price": 5,
        "quantity": 1
      }
    ],
    "token": "7dnoyMe27VDKY1WNrCTqgK5RWbEi4XkvBSUTTwET6XnNYfWKYdrnSyg7myn7oc3vms"
  }
}