younifyd
Menu

Create Invoices

Creates one or more sales invoices or purchase bills

PUT/Invoices

Use it in a workflow

  1. Add a step and choose the Xero connector.
  2. Pick the Create Invoices action (under Xero).
  3. Fill in the fields below, then reference the result from later steps as {{createInvoices.response.data}}.

Request

Query parameters

summarizeErrorsboolean

If false return 200 OK and mix of successfully created objects and any with validation errors

Default false

unitdpinteger

e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

Headers

xero-tenant-idstringrequired

Xero identifier for Tenant

Idempotency-Keystring

This allows you to safely retry requests without the risk of duplicate processing. 128 character max.

Request body

Enter the body as JSON in the step's Body field.

paginationobject
pageinteger
pageSizeinteger
pageCountinteger
itemCountinteger
Warningsarray<object>

Displays array of warning messages from the API

Messagestring

Validation error message

Invoicesarray<object>
Typestring

See Invoice Types

One ofACCPAYACCPAYCREDITAPOVERPAYMENTAPPREPAYMENTACCRECACCRECCREDITAROVERPAYMENTARPREPAYMENT

Contactobject40 fields
LineItemsarray<object>18 fields

See LineItems

Datestring

Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation

DueDatestring

Date invoice is due – YYYY-MM-DD

LineAmountTypesstring

Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount Types

One ofExclusiveInclusiveNoTax

InvoiceNumberstring

ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255)

Referencestring

ACCREC only – additional reference number

BrandingThemeIDstring (uuid)

See BrandingThemes

Urlstring

URL link to a source document – shown as “Go to [appName]” in the Xero app

CurrencyCodestring

3 letter alpha code for the currency – see list of currency codes

One ofAEDAFNALLAMDANGAOAARSAUDAWGAZNBAMBBDBDTBGNBHDBIFBMDBNDBOBBRLBSDBTNBWPBYNBYRBZDCADCDFCHFCLFCLPCNYCOPCRCCUCCUPCVECZKDJFDKK

CurrencyRatenumber (double)

The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6])

Statusstring

See Invoice Status Codes

One ofDRAFTSUBMITTEDDELETEDAUTHORISEDPAIDVOIDED

SentToContactboolean

Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved

ExpectedPaymentDatestring

Shown on sales invoices (Accounts Receivable) when this has been set

PlannedPaymentDatestring

Shown on bills (Accounts Payable) when this has been set

CISDeductionnumber (double)

CIS deduction for UK contractors

CISRatenumber (double)

CIS Deduction rate for the organisation

SubTotalnumber (double)

Total of invoice excluding taxes

TotalTaxnumber (double)

Total tax on invoice

Totalnumber (double)

Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts

TotalDiscountnumber (double)

Total of discounts applied on the invoice line items

InvoiceIDstring (uuid)

Xero generated unique identifier for invoice

RepeatingInvoiceIDstring (uuid)

Xero generated unique identifier for repeating invoices

HasAttachmentsboolean

boolean to indicate if an invoice has an attachment

Default "false"

IsDiscountedboolean

boolean to indicate if an invoice has a discount

Paymentsarray<object>29 fields

See Payments

Prepaymentsarray<object>23 fields

See Prepayments

Overpaymentsarray<object>21 fields

See Overpayments

AmountDuenumber (double)

Amount remaining to be paid on invoice

AmountPaidnumber (double)

Sum of payments received for invoice

FullyPaidOnDatestring

The date the invoice was fully paid. Only returned on fully paid invoices

AmountCreditednumber (double)

Sum of all credit notes, over-payments and pre-payments applied to invoice

UpdatedDateUTCstring

UTC timestamp of last update to the invoice

UpdatedDateUTCStringstring

UTC ISO-8601 formatted timestamp of last update to the invoice

CreditNotesarray<object>

Details of credit notes that have been applied to an invoice

Attachmentsarray<object>6 fields

Displays array of attachments from the API

HasErrorsboolean

A boolean to indicate if a invoice has an validation errors

Default "false"

StatusAttributeStringstring

A string to indicate if a invoice status

ValidationErrorsarray<object>1 fields

Displays array of validation error messages from the API

json
{
  "pagination": {
    "page": 0,
    "pageSize": 0,
    "pageCount": 0,
    "itemCount": 0
  },
  "Warnings": [
    {
      "Message": "string"
    }
  ],
  "Invoices": [
    {
      "Type": "ACCPAY",
      "Contact": {
        "ContactID": "00000000-0000-0000-0000-000000000000",
        "MergedToContactID": "00000000-0000-0000-0000-000000000000",
        "ContactNumber": "string",
        "AccountNumber": "string",
        "ContactStatus": "ACTIVE",
        "Name": "string",
        "FirstName": "string",
        "LastName": "string",
        "CompanyNumber": "string",
        "EmailAddress": "string",
        "ContactPersons": [
          {
            "FirstName": "string",
            "LastName": "string",
            "EmailAddress": "string",
            "IncludeInEmails": false
          }
        ],
        "BankAccountDetails": "string"
      },
      "LineItems": [
        {
          "LineItemID": "00000000-0000-0000-0000-000000000000",
          "Description": "string",
          "Quantity": 0,
          "UnitAmount": 0,
          "ItemCode": "string",
          "AccountCode": "string",
          "AccountID": "00000000-0000-0000-0000-000000000000",
          "TaxType": "string",
          "TaxAmount": 0,
          "Item": {
            "Code": "string",
            "Name": "string",
            "ItemID": "00000000-0000-0000-0000-000000000000"
          },
          "LineAmount": 0,
          "Tracking": [
            {
              "TrackingCategoryID": null,
              "TrackingOptionID": null,
              "Name": null,
              "Option": null
            }
          ]
        }
      ],
      "Date": "string",
      "DueDate": "string",
      "LineAmountTypes": "Exclusive",
      "InvoiceNumber": "string",
      "Reference": "string",
      "BrandingThemeID": "00000000-0000-0000-0000-000000000000",
      "Url": "string",
      "CurrencyCode": "AED",
      "CurrencyRate": 0
    }
  ]
}

Response

Returns 200 with an object. Read it in later steps with {{createInvoices.response.data.<field>}}.

paginationobject
pageinteger
pageSizeinteger
pageCountinteger
itemCountinteger
Warningsarray<object>

Displays array of warning messages from the API

Messagestring

Validation error message

Invoicesarray<object>
Typestring

See Invoice Types

One ofACCPAYACCPAYCREDITAPOVERPAYMENTAPPREPAYMENTACCRECACCRECCREDITAROVERPAYMENTARPREPAYMENT

Contactobject40 fields
LineItemsarray<object>18 fields

See LineItems

Datestring

Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation

DueDatestring

Date invoice is due – YYYY-MM-DD

LineAmountTypesstring

Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount Types

One ofExclusiveInclusiveNoTax

InvoiceNumberstring

ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255)

Referencestring

ACCREC only – additional reference number

BrandingThemeIDstring (uuid)

See BrandingThemes

Urlstring

URL link to a source document – shown as “Go to [appName]” in the Xero app

CurrencyCodestring

3 letter alpha code for the currency – see list of currency codes

One ofAEDAFNALLAMDANGAOAARSAUDAWGAZNBAMBBDBDTBGNBHDBIFBMDBNDBOBBRLBSDBTNBWPBYNBYRBZDCADCDFCHFCLFCLPCNYCOPCRCCUCCUPCVECZKDJFDKK

CurrencyRatenumber (double)

The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6])

Statusstring

See Invoice Status Codes

One ofDRAFTSUBMITTEDDELETEDAUTHORISEDPAIDVOIDED

SentToContactboolean

Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved

ExpectedPaymentDatestring

Shown on sales invoices (Accounts Receivable) when this has been set

PlannedPaymentDatestring

Shown on bills (Accounts Payable) when this has been set

CISDeductionnumber (double)

CIS deduction for UK contractors

CISRatenumber (double)

CIS Deduction rate for the organisation

SubTotalnumber (double)

Total of invoice excluding taxes

TotalTaxnumber (double)

Total tax on invoice

Totalnumber (double)

Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts

TotalDiscountnumber (double)

Total of discounts applied on the invoice line items

InvoiceIDstring (uuid)

Xero generated unique identifier for invoice

RepeatingInvoiceIDstring (uuid)

Xero generated unique identifier for repeating invoices

HasAttachmentsboolean

boolean to indicate if an invoice has an attachment

Default "false"

IsDiscountedboolean

boolean to indicate if an invoice has a discount

Paymentsarray<object>29 fields

See Payments

Prepaymentsarray<object>23 fields

See Prepayments

Overpaymentsarray<object>21 fields

See Overpayments

AmountDuenumber (double)

Amount remaining to be paid on invoice

AmountPaidnumber (double)

Sum of payments received for invoice

FullyPaidOnDatestring

The date the invoice was fully paid. Only returned on fully paid invoices

AmountCreditednumber (double)

Sum of all credit notes, over-payments and pre-payments applied to invoice

UpdatedDateUTCstring

UTC timestamp of last update to the invoice

UpdatedDateUTCStringstring

UTC ISO-8601 formatted timestamp of last update to the invoice

CreditNotesarray<object>

Details of credit notes that have been applied to an invoice

Attachmentsarray<object>6 fields

Displays array of attachments from the API

HasErrorsboolean

A boolean to indicate if a invoice has an validation errors

Default "false"

StatusAttributeStringstring

A string to indicate if a invoice status

ValidationErrorsarray<object>1 fields

Displays array of validation error messages from the API

json
{
  "pagination": {
    "page": 0,
    "pageSize": 0,
    "pageCount": 0,
    "itemCount": 0
  },
  "Warnings": [
    {
      "Message": "string"
    }
  ],
  "Invoices": [
    {
      "Type": "ACCPAY",
      "Contact": {
        "ContactID": "00000000-0000-0000-0000-000000000000",
        "MergedToContactID": "00000000-0000-0000-0000-000000000000",
        "ContactNumber": "string",
        "AccountNumber": "string",
        "ContactStatus": "ACTIVE",
        "Name": "string",
        "FirstName": "string",
        "LastName": "string",
        "CompanyNumber": "string",
        "EmailAddress": "string",
        "ContactPersons": [
          {
            "FirstName": "string",
            "LastName": "string",
            "EmailAddress": "string",
            "IncludeInEmails": false
          }
        ],
        "BankAccountDetails": "string"
      },
      "LineItems": [
        {
          "LineItemID": "00000000-0000-0000-0000-000000000000",
          "Description": "string",
          "Quantity": 0,
          "UnitAmount": 0,
          "ItemCode": "string",
          "AccountCode": "string",
          "AccountID": "00000000-0000-0000-0000-000000000000",
          "TaxType": "string",
          "TaxAmount": 0,
          "Item": {
            "Code": "string",
            "Name": "string",
            "ItemID": "00000000-0000-0000-0000-000000000000"
          },
          "LineAmount": 0,
          "Tracking": [
            {
              "TrackingCategoryID": null,
              "TrackingOptionID": null,
              "Name": null,
              "Option": null
            }
          ]
        }
      ],
      "Date": "string",
      "DueDate": "string",
      "LineAmountTypes": "Exclusive",
      "InvoiceNumber": "string",
      "Reference": "string",
      "BrandingThemeID": "00000000-0000-0000-0000-000000000000",
      "Url": "string",
      "CurrencyCode": "AED",
      "CurrencyRate": 0
    }
  ]
}

Need more? See the Xero guide for connection setup and behaviour shared by every action.