# Update bill PUT https://api-sandbox.payabli.com/api/Bill/{idBill} Content-Type: application/json Updates a bill by ID. Reference: https://docs.payabli.com/developers/api-reference/bill/update-bill ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Update bill version: endpoint_bill.EditBill paths: /Bill/{idBill}: put: operationId: edit-bill summary: Update bill description: Updates a bill by ID. tags: - - subpackage_bill parameters: - name: idBill in: path description: >- Payabli ID for the bill. Get this ID by querying `/api/Query/bills/` for the entrypoint or the organization. required: true schema: type: integer - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_bill:EditBillResponse' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/type_bill:BillOutData' components: schemas: type_:AccountingField: type: string type_:AdditionalDataString: type: string type_:FileContentFtype: type: string enum: - value: pdf - value: doc - value: docx - value: jpg - value: jpeg - value: png - value: gif - value: txt type_:FileContent: type: object properties: fContent: type: string description: >- Content of file, Base64-encoded. Ignored if furl is specified. Max upload size is 30 MB. filename: type: string description: The name of the attached file. ftype: $ref: '#/components/schemas/type_:FileContentFtype' description: The MIME type of the file (if content is provided) furl: type: string description: Optional URL provided to show or download the file remotely type_:Attachments: type: array items: $ref: '#/components/schemas/type_:FileContent' type_:Datenullable: type: string format: date type_:ItemCommodityCode: type: string type_:ItemDescription: type: string type_:ItemProductCode: type: string type_:ItemProductName: type: string type_:ItemUnitofMeasure: type: string type_:BillItem: type: object properties: itemCategories: type: array items: type: string description: Array of tags classifying item or product. itemCommodityCode: $ref: '#/components/schemas/type_:ItemCommodityCode' itemCost: type: number format: double description: Item or product price per unit. itemDescription: $ref: '#/components/schemas/type_:ItemDescription' itemMode: type: integer description: >- Internal class of item or product: value '0' is only for invoices , '1' for bills and, '2' common for both. itemProductCode: $ref: '#/components/schemas/type_:ItemProductCode' itemProductName: $ref: '#/components/schemas/type_:ItemProductName' itemQty: type: integer description: Quantity of item or product. itemTaxAmount: type: number format: double description: Tax amount applied to item or product. itemTaxRate: type: number format: double description: Tax rate applied to item or product. itemTotalAmount: type: number format: double description: Total amount in item or product. itemUnitOfMeasure: $ref: '#/components/schemas/type_:ItemUnitofMeasure' required: - itemCost type_:Billitems: type: array items: $ref: '#/components/schemas/type_:BillItem' type_:Comments: type: string type_:Frequency: type: string enum: - value: onetime - value: weekly - value: every2weeks - value: every6months - value: monthly - value: every3months - value: annually type_bill:BillOutDataScheduledOptions: type: object properties: storedMethodId: type: string description: The ID of the stored payment method to use for the bill. type_:Billstatus: type: integer type_:Terms: type: string type_:VendorNumber: type: string type_:AdditionalData: type: object additionalProperties: type: object additionalProperties: description: Any type type_:AddressNullable: type: string type_:AddressAddtlNullable: type: string type_:BankAccountHolderName: type: string type_:BankAccountHolderType: type: string enum: - value: Personal - value: Business type_:BankName: type: string type_:RoutingAccount: type: string type_:TypeAccount: type: string enum: - value: Checking - value: Savings type_:BillingData: type: object properties: accountNumber: type: string description: Account number for bank account. bankAccountFunction: type: integer description: >- Describes whether the bank account is used for deposits or withdrawals in Payabli: - `0`: Deposit - `1`: Withdrawal - `2`: Deposit and withdrawal bankAccountHolderName: $ref: '#/components/schemas/type_:BankAccountHolderName' bankAccountHolderType: $ref: '#/components/schemas/type_:BankAccountHolderType' bankName: $ref: '#/components/schemas/type_:BankName' id: type: integer description: The bank's ID in Payabli. routingAccount: $ref: '#/components/schemas/type_:RoutingAccount' typeAccount: $ref: '#/components/schemas/type_:TypeAccount' type_:Email: type: string format: email type_:Contacts: type: object properties: contactEmail: $ref: '#/components/schemas/type_:Email' description: Contact email address. contactName: type: string description: Contact name. contactPhone: type: string description: Contact phone number. contactTitle: type: string description: Contact title. additionalData: $ref: '#/components/schemas/type_:AdditionalDataString' type_:ContactsField: type: array items: $ref: '#/components/schemas/type_:Contacts' type_:VendorEin: type: string type_:LocationCode: type: string type_:Mcc: type: string type_:VendorName1: type: string type_:VendorName2: type: string type_:PayeeName: type: string type_:VendorPaymentMethodString: type: string type_:VendorPhone: type: string type_:Remitaddress1: type: string type_:Remitaddress2: type: string type_:Remitcity: type: string type_:Remitcountry: type: string type_:RemitEmail: type: string format: email type_:Remitstate: type: string type_:Remitzip: type: string type_:Vendorstatus: type: integer type_:VendorData: type: object properties: vendorNumber: $ref: '#/components/schemas/type_:VendorNumber' AdditionalData: $ref: '#/components/schemas/type_:AdditionalData' address1: $ref: '#/components/schemas/type_:AddressNullable' description: Vendor's address address2: $ref: '#/components/schemas/type_:AddressAddtlNullable' description: Additional line for vendor's address. billingData: $ref: '#/components/schemas/type_:BillingData' description: Object containing vendor's bank information. city: type: string description: Vendor's city. contacts: $ref: '#/components/schemas/type_:ContactsField' description: Array of objects describing the vendor's contacts. country: type: string description: Vendor's country. customField1: type: string description: Custom field 1 for vendor customField2: type: string description: Custom field 2 for vendor customerVendorAccount: type: string description: Account number of paypoint in the vendor side. ein: $ref: '#/components/schemas/type_:VendorEin' email: $ref: '#/components/schemas/type_:Email' description: Vendor's email address. Required for vCard. internalReferenceId: type: integer format: int64 description: Internal identifier for global vendor account. locationCode: $ref: '#/components/schemas/type_:LocationCode' mcc: $ref: '#/components/schemas/type_:Mcc' name1: $ref: '#/components/schemas/type_:VendorName1' name2: $ref: '#/components/schemas/type_:VendorName2' payeeName1: $ref: '#/components/schemas/type_:PayeeName' payeeName2: $ref: '#/components/schemas/type_:PayeeName' paymentMethod: $ref: '#/components/schemas/type_:VendorPaymentMethodString' phone: $ref: '#/components/schemas/type_:VendorPhone' remitAddress1: $ref: '#/components/schemas/type_:Remitaddress1' remitAddress2: $ref: '#/components/schemas/type_:Remitaddress2' remitCity: $ref: '#/components/schemas/type_:Remitcity' remitCountry: $ref: '#/components/schemas/type_:Remitcountry' remitEmail: $ref: '#/components/schemas/type_:RemitEmail' remitState: $ref: '#/components/schemas/type_:Remitstate' remitZip: $ref: '#/components/schemas/type_:Remitzip' state: type: string description: Vendor's state. Must be a 2 character state code. vendorStatus: $ref: '#/components/schemas/type_:Vendorstatus' zip: type: string description: Vendor's zip code. type_bill:BillOutData: type: object properties: accountingField1: $ref: '#/components/schemas/type_:AccountingField' accountingField2: $ref: '#/components/schemas/type_:AccountingField' additionalData: $ref: '#/components/schemas/type_:AdditionalDataString' attachments: $ref: '#/components/schemas/type_:Attachments' description: >- An array of bill images. Attachments aren't required, but we strongly recommend including them. Including a bill image can make payouts smoother and prevent delays. You can include either the Base64-encoded file content, or you can include an fURL to a public file. The maximum file size for image uploads is 30 MB. billDate: $ref: '#/components/schemas/type_:Datenullable' description: 'Date of bill. Accepted formats: YYYY-MM-DD, MM/DD/YYYY.' billItems: $ref: '#/components/schemas/type_:Billitems' billNumber: type: string description: Unique identifier for the bill. Required when adding a bill. comments: $ref: '#/components/schemas/type_:Comments' discount: type: number format: double description: Discount amount applied to the bill. dueDate: $ref: '#/components/schemas/type_:Datenullable' description: 'Due date of bill. Accepted formats: YYYY-MM-DD, MM/DD/YYYY.' endDate: $ref: '#/components/schemas/type_:Datenullable' description: >- End Date for scheduled bills. Applied only in `Mode` = 1. Accepted formats: YYYY-MM-DD, MM/DD/YYYY frequency: $ref: '#/components/schemas/type_:Frequency' description: Frequency for scheduled bills. Applied only in `Mode` = 1. lotNumber: type: string description: Lot number associated with the bill. mode: type: integer description: 'Bill mode: value `0` for one-time bills, `1` for scheduled bills.' netAmount: type: number format: double description: Net Amount owed in bill. Required when adding a bill. scheduledOptions: $ref: '#/components/schemas/type_bill:BillOutDataScheduledOptions' description: Options for scheduled bills. status: $ref: '#/components/schemas/type_:Billstatus' terms: $ref: '#/components/schemas/type_:Terms' totalAmount: type: number format: double description: Total amount of the bill. vendor: $ref: '#/components/schemas/type_:VendorData' description: >- The vendor associated with the bill. Although you can create a vendor in a create bill request, Payabli recommends creating a vendor separately and passing a valid `vendorNumber` here. At minimum, the `vendorNumber` is required. type_:Responsecode: type: integer type_:PageIdentifier: type: string type_:RoomIdNotInUse: type: integer format: int64 type_:IsSuccess: type: boolean type_:ResponseText: type: string type_bill:EditBillResponse: type: object properties: responseCode: $ref: '#/components/schemas/type_:Responsecode' pageIdentifier: $ref: '#/components/schemas/type_:PageIdentifier' roomId: $ref: '#/components/schemas/type_:RoomIdNotInUse' isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseText: $ref: '#/components/schemas/type_:ResponseText' responseData: type: integer description: >- If `isSuccess` = true, this contains the bill identifier. If `isSuccess` = false, this contains the reason for the error. required: - responseText ``` ## SDK Code Examples ```python UpdateBill import datetime from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.bill.edit_bill( id_bill=285, net_amount=3762.87, bill_date=datetime.date.fromisoformat( "2025-07-01", ), ) ``` ```typescript UpdateBill import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.bill.editBill(285, { netAmount: 3762.87, billDate: "2025-07-01" }); ``` ```go UpdateBill import ( context "context" option "github.com/payabli/sdk-go/option" sdkgo "github.com/payabli/sdk-go" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.Bill.EditBill( context.TODO(), 285, &sdkgo.BillOutData{ NetAmount: sdkgo.Float64( 3762.87, ), BillDate: sdkgo.Time( sdkgo.MustParseDate( "2025-07-01", ), ), }, ) ``` ```csharp UpdateBill using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Bill.EditBillAsync( 285, new BillOutData { NetAmount = 3762.87, BillDate = new DateOnly(2025, 7, 1) } ); ``` ```ruby UpdateBill require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Bill/285") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["requestToken"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"billDate\": \"2025-07-01\",\n \"netAmount\": 3762.87\n}" response = http.request(request) puts response.read_body ``` ```java UpdateBill HttpResponse response = Unirest.put("https://api-sandbox.payabli.com/api/Bill/285") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"billDate\": \"2025-07-01\",\n \"netAmount\": 3762.87\n}") .asString(); ``` ```php UpdateBill request('PUT', 'https://api-sandbox.payabli.com/api/Bill/285', [ 'body' => '{ "billDate": "2025-07-01", "netAmount": 3762.87 }', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift UpdateBill import Foundation let headers = [ "requestToken": "", "Content-Type": "application/json" ] let parameters = [ "billDate": "2025-07-01", "netAmount": 3762.87 ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Bill/285")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```