action apideck_credit_notes_add { label: "Create Credit Note" description: "Create Credit Note" provider: apideck method: POST path: "/accounting/credit-notes" encoding: json input: { type: "object" properties: { account: { type: "object" properties: { code: { type: "string" description: "The code assigned to the account." } id: { type: "string" description: "The unique identifier for the account." } name: { type: "string" description: "The name of the account." } nominal_code: { type: "string" description: "The nominal code of the account." } } } allocations: { type: "array" items: { properties: { amount: { type: "number" description: "Amount of payment that should be attributed to this allocation. If null, the total_amount will be used." } code: { type: "string" } id: { type: "string" description: "Unique identifier of entity this payment should be attributed to." } type: { type: "string" description: "Type of entity this payment should be attributed to." enum: ["invoice", "order", "expense", "credit_memo", "over_payment", "pre_payment"] } } } } balance: { type: "number" description: "The balance reflecting any payments made against the transaction." } created_at: { type: "string" format: "date-time" description: "The date and time when the object was created." } created_by: { type: "string" description: "The user who created the object." } currency: { type: "string" description: "Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)." enum: ["UNKNOWN_CURRENCY", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRC", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMK", "ZMW", "BTC", "ETH"] } currency_rate: { type: "number" description: "Currency Exchange Rate at the time entity was recorded/generated." } customer: { type: "object" description: "The customer this entity is linked to." required: ["id"] properties: { company_name: { type: "string" description: "The company name of the customer." } display_id: { type: "string" description: "The display ID of the customer." } display_name: { type: "string" description: "The display name of the customer." } id: { type: "string" description: "The ID of the customer this entity is linked to." } name: { type: "string" description: "The name of the customer. Deprecated, use display_name instead." } } } date_issued: { type: "string" format: "date-time" description: "Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD" } date_paid: { type: "string" format: "date-time" description: "Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD" } id: { type: "string" description: "Unique identifier representing the entity" } line_items: { type: "array" items: { type: "object" properties: { code: { type: "string" description: "User defined item code" } created_at: { type: "string" format: "date-time" description: "The date and time when the object was created." } created_by: { type: "string" description: "The user who created the object." } department_id: { type: "string" description: "Department id" } description: { type: "string" description: "User defined description" } discount_amount: { type: "number" description: "Discount amount applied to the line item when supported downstream." } discount_percentage: { type: "number" description: "Discount percentage applied to the line item when supported downstream." } id: { type: "string" description: "A unique identifier for an object." } item: { type: "object" properties: { code: { type: "string" description: "User defined item code" } id: { type: "string" description: "ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item" } name: { type: "string" description: "User defined item name" } } } ledger_account: { type: "object" properties: { code: { type: "string" description: "The code assigned to the account." } id: { type: "string" description: "The unique identifier for the account." } name: { type: "string" description: "The name of the account." } nominal_code: { type: "string" description: "The nominal code of the account." } } } line_number: { type: "integer" description: "Line number in the invoice" } location_id: { type: "string" description: "Location id" } quantity: { type: "number" } row_id: { type: "string" description: "Row ID" } row_version: { type: "string" description: "A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object." } tax_amount: { type: "number" description: "Tax amount" } tax_rate: { type: "object" properties: { code: { type: "string" description: "Tax rate code" } id: { type: "string" description: "The ID of the object." } name: { type: "string" description: "Name of the tax rate" } rate: { type: "number" description: "Rate of the tax rate" } } } total_amount: { type: "number" description: "Total amount of the line item" } type: { type: "string" description: "Item type" enum: ["sales_item", "discount", "info", "sub_total"] } unit_of_measure: { type: "string" description: "Description of the unit type the item is sold as, ie: kg, hour." } unit_price: { type: "number" } updated_at: { type: "string" format: "date-time" description: "The date and time when the object was last updated." } updated_by: { type: "string" description: "The user who last updated the object." } } additionalProperties: false } } note: { type: "string" description: "Optional note to be associated with the credit note." } number: { type: "string" description: "Credit note number." } raw: { type: "boolean" } reference: { type: "string" description: "Optional reference message ie: Debit remittance detail." } remaining_credit: { type: "number" description: "Indicates the total credit amount still available to apply towards the payment." } row_version: { type: "string" description: "A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object." } status: { type: "string" description: "Status of credit notes" enum: ["draft", "authorised", "paid", "voided", "deleted"] } sub_total: { type: "number" description: "Sub-total amount, normally before tax." } tax_code: { type: "string" description: "Applicable tax id/code override if tax is not supplied on a line item basis." } tax_inclusive: { type: "boolean" description: "Amounts are including tax" } terms: { type: "string" description: "Optional terms to be associated with the credit note." } total_amount: { type: "number" description: "Amount of transaction" } total_tax: { type: "number" description: "Total tax amount applied to this invoice." } type: { type: "string" description: "Type of payment" enum: ["accounts_receivable_credit", "accounts_payable_credit"] } updated_at: { type: "string" format: "date-time" description: "The date and time when the object was last updated." } updated_by: { type: "string" description: "The user who last updated the object." } "x-apideck-app-id": { type: "string" } "x-apideck-consumer-id": { type: "string" } "x-apideck-service-id": { type: "string" } } required: ["id", "total_amount", "x-apideck-app-id", "x-apideck-consumer-id"] additionalProperties: false } output: { type: "object" required: ["data", "operation", "resource", "service", "status", "status_code"] properties: { data: { type: "object" required: ["id"] properties: { id: { type: "string" description: "The unique identifier of the resource" } } } operation: { type: "string" description: "Operation performed" } resource: { type: "string" description: "Unified API resource name" } service: { type: "string" description: "Apideck ID of service provider" } status: { type: "string" description: "HTTP Response Status" } status_code: { type: "integer" description: "HTTP Response Status Code" } } } }