# Create invoice POST https://api-sandbox.payabli.com/api/Invoice/{entry} Content-Type: application/json Creates an invoice in an entrypoint. Reference: https://docs.payabli.com/developers/api-reference/invoice/add-invoice ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Add invoice version: endpoint_invoice.AddInvoice paths: /Invoice/{entry}: post: operationId: add-invoice summary: Add invoice description: Creates an invoice in an entrypoint. tags: - - subpackage_invoice parameters: - name: entry in: path description: >- The paypoint's entrypoint identifier. [Learn more](/developers/api-reference/api-overview#entrypoint-vs-entry) required: true schema: type: string - name: forceCustomerCreation in: query required: false schema: $ref: '#/components/schemas/type_:ForceCustomerCreation' - name: requestToken in: header required: true schema: type: string - name: idempotencyKey in: header required: false schema: $ref: '#/components/schemas/type_:IdempotencyKey' 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_:ForceCustomerCreation: type: boolean type_:IdempotencyKey: type: string 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 AddInvoice import datetime from payabli import BillData, BillItem, PayorDataRequest, payabli client = payabli( api_key="YOUR_API_KEY", ) client.invoice.add_invoice( entry="8cfec329267", customer_data=PayorDataRequest( first_name="Tamara", last_name="Bagratoni", customer_number="3", ), invoice_data=BillData( items=[ BillItem( item_product_name="Adventure Consult", item_description="Consultation for Georgian tours", item_cost=100.0, item_qty=1, item_mode=1, item_total_amount=1.0, ), BillItem( item_product_name="Deposit ", item_description="Deposit for trip planning", item_cost=882.37, item_qty=1, item_total_amount=1.0, ), ], invoice_date=datetime.date.fromisoformat( "2025-10-19", ), invoice_type=0, invoice_status=1, frequency="onetime", invoice_amount=982.37, discount=10.0, invoice_number="INV-3", ), ) ``` ```typescript AddInvoice import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.invoice.addInvoice("8cfec329267", { body: { customerData: { firstName: "Tamara", lastName: "Bagratoni", customerNumber: "3" }, invoiceData: { items: [{ itemProductName: "Adventure Consult", itemDescription: "Consultation for Georgian tours", itemCost: 100, itemQty: 1, itemMode: 1, itemTotalAmount: 1 }, { itemProductName: "Deposit ", itemDescription: "Deposit for trip planning", itemCost: 882.37, itemQty: 1, itemTotalAmount: 1 }], invoiceDate: "2025-10-19", invoiceType: 0, invoiceStatus: 1, frequency: "onetime", invoiceAmount: 982.37, discount: 10, invoiceNumber: "INV-3" } } }); ``` ```go AddInvoice 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.AddInvoice( context.TODO(), "8cfec329267", &sdkgo.AddInvoiceRequest{ Body: &sdkgo.InvoiceDataRequest{ CustomerData: &sdkgo.PayorDataRequest{ FirstName: sdkgo.String( "Tamara", ), LastName: sdkgo.String( "Bagratoni", ), CustomerNumber: sdkgo.String( "3", ), }, InvoiceData: &sdkgo.BillData{ Items: []*sdkgo.BillItem{ &sdkgo.BillItem{ ItemProductName: sdkgo.String( "Adventure Consult", ), ItemDescription: sdkgo.String( "Consultation for Georgian tours", ), ItemCost: 100, ItemQty: sdkgo.Int( 1, ), ItemMode: sdkgo.Int( 1, ), ItemTotalAmount: sdkgo.Float64( 1, ), }, &sdkgo.BillItem{ ItemProductName: sdkgo.String( "Deposit ", ), ItemDescription: sdkgo.String( "Deposit for trip planning", ), ItemCost: 882.37, ItemQty: sdkgo.Int( 1, ), ItemTotalAmount: sdkgo.Float64( 1, ), }, }, InvoiceDate: sdkgo.Time( sdkgo.MustParseDate( "2025-10-19", ), ), InvoiceType: sdkgo.Int( 0, ), InvoiceStatus: sdkgo.Int( 1, ), Frequency: sdkgo.FrequencyOneTime, InvoiceAmount: sdkgo.Float64( 982.37, ), Discount: sdkgo.Float64( 10, ), InvoiceNumber: sdkgo.String( "INV-3", ), }, }, }, ) ``` ```csharp AddInvoice using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Invoice.AddInvoiceAsync( "8cfec329267", new AddInvoiceRequest { Body = new InvoiceDataRequest { CustomerData = new PayorDataRequest { FirstName = "Tamara", LastName = "Bagratoni", CustomerNumber = "3", }, InvoiceData = new BillData { Items = new List() { new BillItem { ItemProductName = "Adventure Consult", ItemDescription = "Consultation for Georgian tours", ItemCost = 100, ItemQty = 1, ItemMode = 1, ItemTotalAmount = 1, }, new BillItem { ItemProductName = "Deposit ", ItemDescription = "Deposit for trip planning", ItemCost = 882.37, ItemQty = 1, ItemTotalAmount = 1, }, }, InvoiceDate = new DateOnly(2025, 10, 19), InvoiceType = 0, InvoiceStatus = 1, Frequency = Frequency.OneTime, InvoiceAmount = 982.37, Discount = 10, InvoiceNumber = "INV-3", }, }, } ); ``` ```ruby AddInvoice require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Invoice/8cfec329267") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["requestToken"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"customerData\": {\n \"customerNumber\": \"3\",\n \"firstName\": \"Tamara\",\n \"lastName\": \"Bagratoni\"\n },\n \"invoiceData\": {\n \"discount\": 10,\n \"frequency\": \"onetime\",\n \"invoiceAmount\": 982.37,\n \"invoiceDate\": \"2025-10-19\",\n \"invoiceNumber\": \"INV-3\",\n \"invoiceStatus\": 1,\n \"invoiceType\": 0,\n \"items\": [\n {\n \"itemCost\": 100,\n \"itemDescription\": \"Consultation for Georgian tours\",\n \"itemMode\": 1,\n \"itemProductName\": \"Adventure Consult\",\n \"itemQty\": 1,\n \"itemTotalAmount\": 1\n },\n {\n \"itemCost\": 882.37,\n \"itemDescription\": \"Deposit for trip planning\",\n \"itemProductName\": \"Deposit \",\n \"itemQty\": 1,\n \"itemTotalAmount\": 1\n }\n ]\n }\n}" response = http.request(request) puts response.read_body ``` ```java AddInvoice HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/Invoice/8cfec329267") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"customerData\": {\n \"customerNumber\": \"3\",\n \"firstName\": \"Tamara\",\n \"lastName\": \"Bagratoni\"\n },\n \"invoiceData\": {\n \"discount\": 10,\n \"frequency\": \"onetime\",\n \"invoiceAmount\": 982.37,\n \"invoiceDate\": \"2025-10-19\",\n \"invoiceNumber\": \"INV-3\",\n \"invoiceStatus\": 1,\n \"invoiceType\": 0,\n \"items\": [\n {\n \"itemCost\": 100,\n \"itemDescription\": \"Consultation for Georgian tours\",\n \"itemMode\": 1,\n \"itemProductName\": \"Adventure Consult\",\n \"itemQty\": 1,\n \"itemTotalAmount\": 1\n },\n {\n \"itemCost\": 882.37,\n \"itemDescription\": \"Deposit for trip planning\",\n \"itemProductName\": \"Deposit \",\n \"itemQty\": 1,\n \"itemTotalAmount\": 1\n }\n ]\n }\n}") .asString(); ``` ```php AddInvoice request('POST', 'https://api-sandbox.payabli.com/api/Invoice/8cfec329267', [ 'body' => '{ "customerData": { "customerNumber": "3", "firstName": "Tamara", "lastName": "Bagratoni" }, "invoiceData": { "discount": 10, "frequency": "onetime", "invoiceAmount": 982.37, "invoiceDate": "2025-10-19", "invoiceNumber": "INV-3", "invoiceStatus": 1, "invoiceType": 0, "items": [ { "itemCost": 100, "itemDescription": "Consultation for Georgian tours", "itemMode": 1, "itemProductName": "Adventure Consult", "itemQty": 1, "itemTotalAmount": 1 }, { "itemCost": 882.37, "itemDescription": "Deposit for trip planning", "itemProductName": "Deposit ", "itemQty": 1, "itemTotalAmount": 1 } ] } }', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift AddInvoice import Foundation let headers = [ "requestToken": "", "Content-Type": "application/json" ] let parameters = [ "customerData": [ "customerNumber": "3", "firstName": "Tamara", "lastName": "Bagratoni" ], "invoiceData": [ "discount": 10, "frequency": "onetime", "invoiceAmount": 982.37, "invoiceDate": "2025-10-19", "invoiceNumber": "INV-3", "invoiceStatus": 1, "invoiceType": 0, "items": [ [ "itemCost": 100, "itemDescription": "Consultation for Georgian tours", "itemMode": 1, "itemProductName": "Adventure Consult", "itemQty": 1, "itemTotalAmount": 1 ], [ "itemCost": 882.37, "itemDescription": "Deposit for trip planning", "itemProductName": "Deposit ", "itemQty": 1, "itemTotalAmount": 1 ] ] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Invoice/8cfec329267")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" 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() ```