# Update invoice PUT https://api-sandbox.payabli.com/api/Invoice/{idInvoice} Content-Type: application/json Updates details for a single invoice in an entrypoint. Reference: https://docs.payabli.com/developers/api-reference/invoice/update-invoice ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Update invoice version: endpoint_invoice.EditInvoice paths: /Invoice/{idInvoice}: put: operationId: edit-invoice summary: Update invoice description: Updates details for a single invoice in an entrypoint. tags: - - subpackage_invoice parameters: - name: idInvoice in: path description: Invoice ID required: true schema: type: integer - name: forceCustomerCreation in: query description: >- When `true`, the request creates a new customer record, regardless of whether customer identifiers match an existing customer. required: false schema: type: boolean default: false - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_invoice:InvoiceResponseWithoutData' '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_invoice:InvoiceDataRequest' components: schemas: type_:AdditionalData: type: object additionalProperties: type: object additionalProperties: description: Any type type_:BillingAddressNullable: type: string type_:BillingAddressAddtlNullable: type: string type_:BillingCityNullable: type: string type_:BillingCountryNullable: type: string type_:Email: type: string format: email type_:PhoneNumber: type: string type_:BillingStateNullable: type: string type_:BillingZip: type: string type_:CustomerId: type: integer format: int64 type_:CustomerNumberNullable: type: string type_:Identifierfields: type: array items: type: string type_:Shippingaddress: type: string type_:Shippingaddressadditional: type: string type_:Shippingcity: type: string type_:Shippingcountry: type: string type_:Shippingstate: type: string type_:Shippingzip: type: string type_:PayorDataRequest: type: object properties: additionalData: $ref: '#/components/schemas/type_:AdditionalData' billingAddress1: $ref: '#/components/schemas/type_:BillingAddressNullable' billingAddress2: $ref: '#/components/schemas/type_:BillingAddressAddtlNullable' billingCity: $ref: '#/components/schemas/type_:BillingCityNullable' billingCountry: $ref: '#/components/schemas/type_:BillingCountryNullable' billingEmail: $ref: '#/components/schemas/type_:Email' billingPhone: $ref: '#/components/schemas/type_:PhoneNumber' billingState: $ref: '#/components/schemas/type_:BillingStateNullable' billingZip: $ref: '#/components/schemas/type_:BillingZip' description: >- Customer's billing ZIP code. For Pay In functions, this field supports 5-digit and 9-digit ZIP codes and alphanumeric Canadian postal codes. For example: "37615-1234" or "37615". company: type: string description: Customer's company name. customerId: $ref: '#/components/schemas/type_:CustomerId' customerNumber: $ref: '#/components/schemas/type_:CustomerNumberNullable' firstName: type: string description: Customer/Payor first name. identifierFields: $ref: '#/components/schemas/type_:Identifierfields' lastName: type: string description: Customer/Payor last name. shippingAddress1: $ref: '#/components/schemas/type_:Shippingaddress' shippingAddress2: $ref: '#/components/schemas/type_:Shippingaddressadditional' shippingCity: $ref: '#/components/schemas/type_:Shippingcity' shippingCountry: $ref: '#/components/schemas/type_:Shippingcountry' shippingState: $ref: '#/components/schemas/type_:Shippingstate' shippingZip: $ref: '#/components/schemas/type_:Shippingzip' type_:AdditionalDataMap: type: object additionalProperties: 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_:Discount: type: number format: double type_:DutyAmount: type: number format: double type_:FreightAmount: type: number format: double type_:Frequency: type: string enum: - value: onetime - value: weekly - value: every2weeks - value: every6months - value: monthly - value: every3months - value: annually type_:InvoiceAmount: type: number format: double type_:Datenullable: type: string format: date type_:InvoiceNumber: type: string type_:Invoicestatus: type: integer type_:InvoiceType: type: integer 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_:BillDataPaymentTerms: type: string enum: - value: PIA - value: CIA - value: UR - value: NET10 - value: NET20 - value: NET30 - value: NET45 - value: NET60 - value: NET90 - value: EOM - value: MFI - value: 5MFI - value: 10MFI - value: 15MFI - value: 20MFI - value: 2/10NET30 - value: UF - value: 10UF - value: 20UF - value: 25UF - value: 50UF type_:PurchaseOrder: type: string type_:ShippingFromZip: type: string type_:SummaryCommodityCode: type: string type_:Tax: type: number format: double type_:TermsConditions: type: string type_:BillData: type: object properties: AdditionalData: $ref: '#/components/schemas/type_:AdditionalDataMap' attachments: $ref: '#/components/schemas/type_:Attachments' company: type: string description: Company name of the recipient of the invoice. discount: $ref: '#/components/schemas/type_:Discount' dutyAmount: $ref: '#/components/schemas/type_:DutyAmount' firstName: type: string description: First name of the recipient of the invoice. freightAmount: $ref: '#/components/schemas/type_:FreightAmount' frequency: $ref: '#/components/schemas/type_:Frequency' description: Frequency of scheduled invoice. invoiceAmount: $ref: '#/components/schemas/type_:InvoiceAmount' invoiceDate: $ref: '#/components/schemas/type_:Datenullable' description: 'Invoice date in any of the accepted formats: YYYY-MM-DD, MM/DD/YYYY.' invoiceDueDate: $ref: '#/components/schemas/type_:Datenullable' description: >- Invoice due date in one of the accepted formats: YYYY-MM-DD, MM/DD/YYYY. invoiceEndDate: $ref: '#/components/schemas/type_:Datenullable' description: >- Indicate the date to finish a scheduled invoice cycle (`invoiceType`` = 1) in any of the accepted formats: YYYY-MM-DD, MM/DD/YYYY. invoiceNumber: $ref: '#/components/schemas/type_:InvoiceNumber' description: Invoice number. Identifies the invoice under a paypoint. invoiceStatus: $ref: '#/components/schemas/type_:Invoicestatus' invoiceType: $ref: '#/components/schemas/type_:InvoiceType' items: type: array items: $ref: '#/components/schemas/type_:BillItem' description: Array of line items included in the invoice. lastName: type: string description: Last name of the recipient of the invoice. notes: type: string description: Notes included in the invoice. paymentTerms: $ref: '#/components/schemas/type_:BillDataPaymentTerms' purchaseOrder: $ref: '#/components/schemas/type_:PurchaseOrder' shippingAddress1: $ref: '#/components/schemas/type_:Shippingaddress' shippingAddress2: $ref: '#/components/schemas/type_:Shippingaddressadditional' shippingCity: $ref: '#/components/schemas/type_:Shippingcity' shippingCountry: $ref: '#/components/schemas/type_:Shippingcountry' shippingEmail: $ref: '#/components/schemas/type_:Email' description: Shipping recipient's contact email address. shippingFromZip: $ref: '#/components/schemas/type_:ShippingFromZip' shippingPhone: type: string description: Recipient phone number. shippingState: $ref: '#/components/schemas/type_:Shippingstate' shippingZip: $ref: '#/components/schemas/type_:Shippingzip' summaryCommodityCode: $ref: '#/components/schemas/type_:SummaryCommodityCode' tax: $ref: '#/components/schemas/type_:Tax' termsConditions: $ref: '#/components/schemas/type_:TermsConditions' type_:BillOptions: type: object properties: includePaylink: type: boolean description: Flag to indicate if the scheduled invoice includes a payment link. includePdf: type: boolean description: >- Flag to indicate if the scheduled invoice includes a PDF version of invoice type_invoice:InvoiceDataRequest: type: object properties: customerData: $ref: '#/components/schemas/type_:PayorDataRequest' description: >- Object describing the customer/payor. Required for POST requests. Which fields are required depends on the paypoint's custom identifier settings. invoiceData: $ref: '#/components/schemas/type_:BillData' description: Object describing the invoice. Required for POST requests. scheduledOptions: $ref: '#/components/schemas/type_:BillOptions' description: Object with options for scheduled invoices. type_:IsSuccess: type: boolean type_:Responsecode: type: integer type_:Responsedatanonobject: oneOf: - type: string - type: integer type_:ResponseText: type: string type_:PageIdentifier: type: string type_:RoomIdNotInUse: type: integer format: int64 type_invoice:InvoiceResponseWithoutData: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseCode: $ref: '#/components/schemas/type_:Responsecode' responseData: $ref: '#/components/schemas/type_:Responsedatanonobject' description: >- If `isSuccess` = true, this contains the identifier of the invoice. If `isSuccess` = false, this contains the reason for the failure. responseText: $ref: '#/components/schemas/type_:ResponseText' pageidentifier: oneOf: - $ref: '#/components/schemas/type_:PageIdentifier' - type: 'null' roomId: $ref: '#/components/schemas/type_:RoomIdNotInUse' required: - isSuccess - responseCode - responseData - responseText - pageidentifier - roomId ``` ## SDK Code Examples ```python UpdateInvoice import datetime from payabli import BillData, BillItem, payabli client = payabli( api_key="YOUR_API_KEY", ) client.invoice.edit_invoice( id_invoice=332, invoice_data=BillData( items=[ BillItem( item_product_name="Deposit", item_description="Deposit for trip planning", item_cost=882.37, item_qty=1, ) ], invoice_date=datetime.date.fromisoformat( "2025-10-19", ), invoice_amount=982.37, invoice_number="INV-6", ), ) ``` ```typescript UpdateInvoice import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.invoice.editInvoice(332, { body: { invoiceData: { items: [{ itemProductName: "Deposit", itemDescription: "Deposit for trip planning", itemCost: 882.37, itemQty: 1 }], invoiceDate: "2025-10-19", invoiceAmount: 982.37, invoiceNumber: "INV-6" } } }); ``` ```go UpdateInvoice 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.Invoice.EditInvoice( context.TODO(), 332, &sdkgo.EditInvoiceRequest{ Body: &sdkgo.InvoiceDataRequest{ InvoiceData: &sdkgo.BillData{ Items: []*sdkgo.BillItem{ &sdkgo.BillItem{ ItemProductName: sdkgo.String( "Deposit", ), ItemDescription: sdkgo.String( "Deposit for trip planning", ), ItemCost: 882.37, ItemQty: sdkgo.Int( 1, ), }, }, InvoiceDate: sdkgo.Time( sdkgo.MustParseDate( "2025-10-19", ), ), InvoiceAmount: sdkgo.Float64( 982.37, ), InvoiceNumber: sdkgo.String( "INV-6", ), }, }, }, ) ``` ```csharp UpdateInvoice using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Invoice.EditInvoiceAsync( 332, new EditInvoiceRequest { Body = new InvoiceDataRequest { InvoiceData = new BillData { Items = new List() { new BillItem { ItemProductName = "Deposit", ItemDescription = "Deposit for trip planning", ItemCost = 882.37, ItemQty = 1, }, }, InvoiceDate = new DateOnly(2025, 10, 19), InvoiceAmount = 982.37, InvoiceNumber = "INV-6", }, }, } ); ``` ```ruby UpdateInvoice require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Invoice/332") 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 \"invoiceData\": {\n \"invoiceAmount\": 982.37,\n \"invoiceDate\": \"2025-10-19\",\n \"invoiceNumber\": \"INV-6\",\n \"items\": [\n {\n \"itemCost\": 882.37,\n \"itemDescription\": \"Deposit for trip planning\",\n \"itemProductName\": \"Deposit\",\n \"itemQty\": 1\n }\n ]\n }\n}" response = http.request(request) puts response.read_body ``` ```java UpdateInvoice HttpResponse response = Unirest.put("https://api-sandbox.payabli.com/api/Invoice/332") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"invoiceData\": {\n \"invoiceAmount\": 982.37,\n \"invoiceDate\": \"2025-10-19\",\n \"invoiceNumber\": \"INV-6\",\n \"items\": [\n {\n \"itemCost\": 882.37,\n \"itemDescription\": \"Deposit for trip planning\",\n \"itemProductName\": \"Deposit\",\n \"itemQty\": 1\n }\n ]\n }\n}") .asString(); ``` ```php UpdateInvoice request('PUT', 'https://api-sandbox.payabli.com/api/Invoice/332', [ 'body' => '{ "invoiceData": { "invoiceAmount": 982.37, "invoiceDate": "2025-10-19", "invoiceNumber": "INV-6", "items": [ { "itemCost": 882.37, "itemDescription": "Deposit for trip planning", "itemProductName": "Deposit", "itemQty": 1 } ] } }', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift UpdateInvoice import Foundation let headers = [ "requestToken": "", "Content-Type": "application/json" ] let parameters = ["invoiceData": [ "invoiceAmount": 982.37, "invoiceDate": "2025-10-19", "invoiceNumber": "INV-6", "items": [ [ "itemCost": 882.37, "itemDescription": "Deposit for trip planning", "itemProductName": "Deposit", "itemQty": 1 ] ] ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Invoice/332")! 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() ```