# Get invoice GET https://api-sandbox.payabli.com/api/Invoice/{idInvoice} Retrieves a single invoice by ID. Reference: https://docs.payabli.com/developers/api-reference/invoice/get-invoice ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Get invoice version: endpoint_invoice.GetInvoice paths: /Invoice/{idInvoice}: get: operationId: get-invoice summary: Get invoice description: Retrieves a single invoice by ID. tags: - - subpackage_invoice parameters: - name: idInvoice in: path description: Invoice ID required: true schema: type: integer - name: requestToken in: header required: true schema: type: string responses: '200': description: Success. Fields marked optional may return `null` if not set. content: application/json: schema: $ref: '#/components/schemas/type_invoice:GetInvoiceRecord' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} components: schemas: type_invoice:InvoiceId: type: integer format: int64 type_:CustomerId: type: integer format: int64 type_:PaypointId: type: integer format: int64 type_:InvoiceNumber: type: string type_:Datenullable: type: string format: date type_:DatetimeNullable: type: string format: date-time type_:CreatedAt: type: string format: date-time type_:Invoicestatus: type: integer type_:InvoiceType: type: integer type_:Frequency: type: string enum: - value: onetime - value: weekly - value: every2weeks - value: every6months - value: monthly - value: every3months - value: annually type_:Terms: type: string type_:TermsConditions: type: string type_:Tax: type: number format: double type_:Discount: type: number format: double type_:InvoiceAmount: type: number format: double type_invoice:InvoicePaidAmount: type: number format: double type_:FreightAmount: type: number format: double type_:DutyAmount: type: number format: double type_:PurchaseOrder: type: string type_:Shippingaddress: type: string type_:Shippingaddressadditional: type: string type_:Shippingcity: type: string type_:Shippingstate: type: string type_:Shippingzip: type: string type_:ShippingFromZip: type: string type_:Shippingcountry: type: string type_:Email: type: string format: email type_:SummaryCommodityCode: type: string 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_:AdditionalDataMap: type: object additionalProperties: type: string type_:BillingAddressNullable: type: string type_:BillingAddressAddtlNullable: type: string type_:BillingCityNullable: type: string type_:BillingCountryNullable: type: string type_:PhoneNumber: type: string type_:BillingStateNullable: type: string type_:BillingZip: type: string type_:CustomerNumberNullable: type: string type_:CustomerStatus: type: integer type_:Identifierfields: type: array items: type: string type_:PayorDataResponse: type: object properties: AdditionalData: oneOf: - $ref: '#/components/schemas/type_:AdditionalDataMap' - type: 'null' BillingAddress1: oneOf: - $ref: '#/components/schemas/type_:BillingAddressNullable' - type: 'null' BillingAddress2: oneOf: - $ref: '#/components/schemas/type_:BillingAddressAddtlNullable' - type: 'null' BillingCity: oneOf: - $ref: '#/components/schemas/type_:BillingCityNullable' - type: 'null' BillingCountry: oneOf: - $ref: '#/components/schemas/type_:BillingCountryNullable' - type: 'null' BillingEmail: oneOf: - $ref: '#/components/schemas/type_:Email' - type: 'null' BillingPhone: oneOf: - $ref: '#/components/schemas/type_:PhoneNumber' - type: 'null' BillingState: oneOf: - $ref: '#/components/schemas/type_:BillingStateNullable' - type: 'null' BillingZip: oneOf: - $ref: '#/components/schemas/type_:BillingZip' - type: 'null' 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". CompanyName: type: - string - 'null' description: Customer's company name. customerId: oneOf: - $ref: '#/components/schemas/type_:CustomerId' - type: 'null' CustomerNumber: oneOf: - $ref: '#/components/schemas/type_:CustomerNumberNullable' - type: 'null' customerStatus: oneOf: - $ref: '#/components/schemas/type_:CustomerStatus' - type: 'null' description: >- Customer status. This is used to determine if the customer is active or inactive. FirstName: type: - string - 'null' description: Customer/Payor first name. Identifiers: oneOf: - $ref: '#/components/schemas/type_:Identifierfields' - type: 'null' LastName: type: - string - 'null' description: Customer/Payor last name. ShippingAddress1: oneOf: - $ref: '#/components/schemas/type_:Shippingaddress' - type: 'null' ShippingAddress2: oneOf: - $ref: '#/components/schemas/type_:Shippingaddressadditional' - type: 'null' ShippingCity: oneOf: - $ref: '#/components/schemas/type_:Shippingcity' - type: 'null' ShippingCountry: oneOf: - $ref: '#/components/schemas/type_:Shippingcountry' - type: 'null' ShippingState: oneOf: - $ref: '#/components/schemas/type_:Shippingstate' - type: 'null' ShippingZip: oneOf: - $ref: '#/components/schemas/type_:Shippingzip' - type: 'null' required: - AdditionalData - BillingAddress1 - BillingAddress2 - BillingCity - BillingCountry - BillingEmail - BillingPhone - BillingState - BillingZip - CompanyName - customerId - CustomerNumber - customerStatus - FirstName - Identifiers - LastName - ShippingAddress1 - ShippingAddress2 - ShippingCity - ShippingCountry - ShippingState - ShippingZip type_:PaylinkId: type: string type_:Source: type: string type_:GeneralEvents: type: object properties: description: type: string description: Event description. eventTime: type: string format: date-time description: Event timestamp, in UTC. extraData: type: object additionalProperties: description: Any type description: Extra data. refData: type: string description: Reference data. source: $ref: '#/components/schemas/type_:Source' description: The event source. type_:BillEvents: type: array items: $ref: '#/components/schemas/type_:GeneralEvents' 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_:Dbaname: type: string type_:Entrypointfield: type: string type_:OrgParentName: type: string type_:PairFiles: type: object properties: originalName: type: string description: Original filename zipName: type: string description: >- Filename assigned to zipped file. This is the name to use for reference in the API functions to get files in attachments. descriptor: type: string description: Descriptor of the file. type_:DocumentsRef: type: object properties: filelist: type: array items: $ref: '#/components/schemas/type_:PairFiles' description: Array of objects describing files contained in the ZIP file. zipfile: type: string description: Zip file containing attachments. type_:ExternalPaypointId: type: string type_invoice:GetInvoiceRecord: type: object properties: invoiceId: $ref: '#/components/schemas/type_invoice:InvoiceId' customerId: $ref: '#/components/schemas/type_:CustomerId' paypointId: $ref: '#/components/schemas/type_:PaypointId' invoiceNumber: $ref: '#/components/schemas/type_:InvoiceNumber' invoiceDate: $ref: '#/components/schemas/type_:Datenullable' invoiceDueDate: $ref: '#/components/schemas/type_:Datenullable' invoiceSentDate: $ref: '#/components/schemas/type_:DatetimeNullable' invoiceEndDate: $ref: '#/components/schemas/type_:Datenullable' lastPaymentDate: $ref: '#/components/schemas/type_:DatetimeNullable' createdAt: $ref: '#/components/schemas/type_:CreatedAt' invoiceStatus: $ref: '#/components/schemas/type_:Invoicestatus' invoiceType: $ref: '#/components/schemas/type_:InvoiceType' frequency: $ref: '#/components/schemas/type_:Frequency' paymentTerms: $ref: '#/components/schemas/type_:Terms' termsConditions: oneOf: - $ref: '#/components/schemas/type_:TermsConditions' - type: 'null' notes: type: - string - 'null' tax: $ref: '#/components/schemas/type_:Tax' discount: $ref: '#/components/schemas/type_:Discount' invoiceAmount: $ref: '#/components/schemas/type_:InvoiceAmount' invoicePaidAmount: $ref: '#/components/schemas/type_invoice:InvoicePaidAmount' freightAmount: $ref: '#/components/schemas/type_:FreightAmount' dutyAmount: $ref: '#/components/schemas/type_:DutyAmount' purchaseOrder: $ref: '#/components/schemas/type_:PurchaseOrder' firstName: type: string description: First name of the recipient of the invoice. lastName: type: string description: Last name of the recipient of the invoice. company: type: string description: Company name of the recipient of the invoice. shippingAddress1: $ref: '#/components/schemas/type_:Shippingaddress' shippingAddress2: $ref: '#/components/schemas/type_:Shippingaddressadditional' shippingCity: $ref: '#/components/schemas/type_:Shippingcity' shippingState: $ref: '#/components/schemas/type_:Shippingstate' shippingZip: $ref: '#/components/schemas/type_:Shippingzip' shippingFromZip: $ref: '#/components/schemas/type_:ShippingFromZip' shippingCountry: $ref: '#/components/schemas/type_:Shippingcountry' shippingEmail: $ref: '#/components/schemas/type_:Email' shippingPhone: type: string summaryCommodityCode: $ref: '#/components/schemas/type_:SummaryCommodityCode' items: type: array items: $ref: '#/components/schemas/type_:BillItem' Customer: $ref: '#/components/schemas/type_:PayorDataResponse' paylinkId: $ref: '#/components/schemas/type_:PaylinkId' billEvents: $ref: '#/components/schemas/type_:BillEvents' scheduledOptions: $ref: '#/components/schemas/type_:BillOptions' PaypointLegalname: type: string PaypointDbaname: $ref: '#/components/schemas/type_:Dbaname' PaypointEntryname: $ref: '#/components/schemas/type_:Entrypointfield' ParentOrgName: $ref: '#/components/schemas/type_:OrgParentName' AdditionalData: $ref: '#/components/schemas/type_:AdditionalDataMap' DocumentsRef: $ref: '#/components/schemas/type_:DocumentsRef' externalPaypointID: $ref: '#/components/schemas/type_:ExternalPaypointId' required: - invoiceId - customerId - paypointId - invoiceNumber - invoiceDate - invoiceDueDate - invoiceSentDate - invoiceEndDate - lastPaymentDate - createdAt - invoiceStatus - invoiceType - frequency - paymentTerms - termsConditions - notes - tax - discount - invoiceAmount - invoicePaidAmount - freightAmount - dutyAmount - purchaseOrder - shippingAddress1 - shippingAddress2 - shippingCity - shippingState - shippingZip - shippingFromZip - shippingCountry - shippingEmail - shippingPhone - summaryCommodityCode - items - Customer - paylinkId - billEvents - scheduledOptions - PaypointLegalname - PaypointDbaname - PaypointEntryname - ParentOrgName - DocumentsRef ``` ## SDK Code Examples ```python GetDetails from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.invoice.get_invoice( id_invoice=23548884, ) ``` ```typescript GetDetails import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.invoice.getInvoice(23548884); ``` ```go GetDetails import ( context "context" option "github.com/payabli/sdk-go/option" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.Invoice.GetInvoice( context.TODO(), 23548884, ) ``` ```csharp GetDetails using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Invoice.GetInvoiceAsync(23548884); ``` ```ruby GetDetails require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Invoice/23548884") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java GetDetails HttpResponse response = Unirest.get("https://api-sandbox.payabli.com/api/Invoice/23548884") .header("requestToken", "") .asString(); ``` ```php GetDetails request('GET', 'https://api-sandbox.payabli.com/api/Invoice/23548884', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift GetDetails import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Invoice/23548884")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers 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() ```