View as Markdown
Xero Accounting icon

Xero Accounting ACTION

Create Credit Note

Creates a new credit note.
  • Action
  • Writes data
  • Destructive
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Xero Accounting account once, then configure and run Create Credit Note from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "xero_accounting_api-create-credit-note",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    xero_accounting_api: { authProvisionId: "apn_xxxxxxx" },
    tenantId: "Tenant ID",
    contactId: "Contact ID",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Credit Note inputs
Property Type Description
tenantId Tenant ID string
Select an organization tenant to use, or provide a tenant ID
Required Dynamic
contactId Contact ID string
ID of the contact associated to the credit note
Optional Dynamic
contactName Contact Name string
Name of the contact associated to the credit note. If there is no contact matching this name, a new contact is created.
Optional
contactNumber Contact Number string
Number of the contact associated to the credit note. If there is no contact matching this name, a new contact is created.
Optional
type Type string
Required
date Date string
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
Optional
status Status string
Optional
lineAmountTypes Line Amount Types string
Optional
lineItems Line Items object
Optional
currencyCode Currency Code string
Currency used for the Credit Note
Optional
creditNoteNumber Credit Note Number string
ACCRECCREDIT - Unique alpha numeric code identifying credit note ( when missing will auto-generate from your Organisation Invoice Settings) ACCPAYCREDIT - non-unique alpha numeric code identifying credit note. This value will also display as Reference in the UI.
Optional
reference Reference string
ACCRECCREDIT only - additional reference number
Optional
sentToContact Sent to Contact boolean
Boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only)
Optional
currencyRate Currency Rate string
The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used
Optional
brandingThemeId Branding Theme ID string
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
xero_accounting_api-create-credit-note
Version
0.1.4
App
Xero Accounting
Authentication
OAuth
Read-only
No
Destructive
Yes
Open world
Yes