younifyd
Menu

Update Or Create Credit Notes

Updates or creates one or more credit notes

POST/CreditNotes

Use it in a workflow

  1. Add a step and choose the Xero connector.
  2. Pick the Update Or Create Credit Notes action (under Xero).
  3. Fill in the fields below, then reference the result from later steps as {{updateOrCreateCreditNotes.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

CreditNotesarray<object>
Typestring

See Credit Note Types

One ofACCPAYCREDITACCRECCREDIT

Contactobject40 fields
Datestring

The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation

DueDatestring

Date invoice is due – YYYY-MM-DD

Statusstring

See Credit Note Status Codes

One ofDRAFTSUBMITTEDDELETEDAUTHORISEDPAIDVOIDED

LineAmountTypesstring

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

One ofExclusiveInclusiveNoTax

LineItemsarray<object>18 fields

See Invoice Line Items

SubTotalnumber (double)

The subtotal of the credit note excluding taxes

TotalTaxnumber (double)

The total tax on the credit note

Totalnumber (double)

The total of the Credit Note(subtotal + total tax)

CISDeductionnumber (double)

CIS deduction for UK contractors

CISRatenumber (double)

CIS Deduction rate for the organisation

UpdatedDateUTCstring

UTC timestamp of last update to the credit note

UpdatedDateUTCStringstring

UTC ISO-8601 formatted timestamp of last update to the credit note

CurrencyCodestring

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

One ofAEDAFNALLAMDANGAOAARSAUDAWGAZNBAMBBDBDTBGNBHDBIFBMDBNDBOBBRLBSDBTNBWPBYNBYRBZDCADCDFCHFCLFCLPCNYCOPCRCCUCCUPCVECZKDJFDKK

FullyPaidOnDatestring

Date when credit note was fully paid(UTC format)

CreditNoteIDstring (uuid)

Xero generated unique identifier

CreditNoteNumberstring

ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings)

Referencestring

ACCRECCREDIT only – additional reference number

SentToContactboolean

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

CurrencyRatenumber (double)

The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used

RemainingCreditnumber (double)

The remaining credit balance on the Credit Note

Allocationsarray<object>10 fields

See Allocations

AppliedAmountnumber (double)

The amount of applied to an invoice

Paymentsarray<object>29 fields

See Payments

BrandingThemeIDstring (uuid)

See BrandingThemes

StatusAttributeStringstring

A string to indicate if a invoice status

HasAttachmentsboolean

boolean to indicate if a credit note has an attachment

Default "false"

HasErrorsboolean

A boolean to indicate if a credit note has an validation errors

Default "false"

ValidationErrorsarray<object>1 fields

Displays array of validation error messages from the API

Warningsarray<object>1 fields

Displays array of warning messages from the API

InvoiceAddressesarray<object>9 fields

An array of addresses used to auto calculate sales tax

json
{
  "pagination": {
    "page": 0,
    "pageSize": 0,
    "pageCount": 0,
    "itemCount": 0
  },
  "Warnings": [
    {
      "Message": "string"
    }
  ],
  "CreditNotes": [
    {
      "Type": "ACCPAYCREDIT",
      "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"
      },
      "Date": "string",
      "DueDate": "string",
      "Status": "DRAFT",
      "LineAmountTypes": "Exclusive",
      "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
            }
          ]
        }
      ],
      "SubTotal": 0,
      "TotalTax": 0,
      "Total": 0,
      "CISDeduction": 0,
      "CISRate": 0
    }
  ]
}

Response

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

paginationobject
pageinteger
pageSizeinteger
pageCountinteger
itemCountinteger
Warningsarray<object>

Displays array of warning messages from the API

Messagestring

Validation error message

CreditNotesarray<object>
Typestring

See Credit Note Types

One ofACCPAYCREDITACCRECCREDIT

Contactobject40 fields
Datestring

The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation

DueDatestring

Date invoice is due – YYYY-MM-DD

Statusstring

See Credit Note Status Codes

One ofDRAFTSUBMITTEDDELETEDAUTHORISEDPAIDVOIDED

LineAmountTypesstring

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

One ofExclusiveInclusiveNoTax

LineItemsarray<object>18 fields

See Invoice Line Items

SubTotalnumber (double)

The subtotal of the credit note excluding taxes

TotalTaxnumber (double)

The total tax on the credit note

Totalnumber (double)

The total of the Credit Note(subtotal + total tax)

CISDeductionnumber (double)

CIS deduction for UK contractors

CISRatenumber (double)

CIS Deduction rate for the organisation

UpdatedDateUTCstring

UTC timestamp of last update to the credit note

UpdatedDateUTCStringstring

UTC ISO-8601 formatted timestamp of last update to the credit note

CurrencyCodestring

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

One ofAEDAFNALLAMDANGAOAARSAUDAWGAZNBAMBBDBDTBGNBHDBIFBMDBNDBOBBRLBSDBTNBWPBYNBYRBZDCADCDFCHFCLFCLPCNYCOPCRCCUCCUPCVECZKDJFDKK

FullyPaidOnDatestring

Date when credit note was fully paid(UTC format)

CreditNoteIDstring (uuid)

Xero generated unique identifier

CreditNoteNumberstring

ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings)

Referencestring

ACCRECCREDIT only – additional reference number

SentToContactboolean

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

CurrencyRatenumber (double)

The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used

RemainingCreditnumber (double)

The remaining credit balance on the Credit Note

Allocationsarray<object>10 fields

See Allocations

AppliedAmountnumber (double)

The amount of applied to an invoice

Paymentsarray<object>29 fields

See Payments

BrandingThemeIDstring (uuid)

See BrandingThemes

StatusAttributeStringstring

A string to indicate if a invoice status

HasAttachmentsboolean

boolean to indicate if a credit note has an attachment

Default "false"

HasErrorsboolean

A boolean to indicate if a credit note has an validation errors

Default "false"

ValidationErrorsarray<object>1 fields

Displays array of validation error messages from the API

Warningsarray<object>1 fields

Displays array of warning messages from the API

InvoiceAddressesarray<object>9 fields

An array of addresses used to auto calculate sales tax

json
{
  "pagination": {
    "page": 0,
    "pageSize": 0,
    "pageCount": 0,
    "itemCount": 0
  },
  "Warnings": [
    {
      "Message": "string"
    }
  ],
  "CreditNotes": [
    {
      "Type": "ACCPAYCREDIT",
      "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"
      },
      "Date": "string",
      "DueDate": "string",
      "Status": "DRAFT",
      "LineAmountTypes": "Exclusive",
      "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
            }
          ]
        }
      ],
      "SubTotal": 0,
      "TotalTax": 0,
      "Total": 0,
      "CISDeduction": 0,
      "CISRate": 0
    }
  ]
}

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