POST
/
credit_notes
Create credit note
curl --request POST \
  --url https://api.withorb.com/v1/credit_notes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "line_items": [
    {
      "invoice_line_item_id": "4khy3nwzktxv7",
      "amount": "<string>",
      "start_date": "2023-09-22",
      "end_date": "2023-09-22"
    }
  ],
  "reason": "duplicate",
  "memo": "An optional memo for my credit note.",
  "start_date": "2023-09-22",
  "end_date": "2023-09-22"
}'
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "voided_at": "2023-11-07T05:31:56Z",
  "credit_note_number": "<string>",
  "invoice_id": "<string>",
  "memo": "<string>",
  "reason": "Duplicate",
  "type": "refund",
  "subtotal": "<string>",
  "total": "<string>",
  "customer": {
    "id": "<string>",
    "external_customer_id": "<string>"
  },
  "credit_note_pdf": "<string>",
  "minimum_amount_refunded": "<string>",
  "discounts": [],
  "maximum_amount_adjustment": {
    "discount_type": "percentage",
    "percentage_discount": 123,
    "amount_applied": "<string>",
    "reason": "<string>",
    "applies_to_prices": [
      {
        "id": "<string>",
        "name": "<string>"
      }
    ]
  },
  "line_items": [
    {
      "id": "<string>",
      "name": "<string>",
      "subtotal": "<string>",
      "amount": "<string>",
      "quantity": 123,
      "discounts": [],
      "tax_amounts": [
        {
          "tax_rate_description": "<string>",
          "tax_rate_percentage": "<string>",
          "amount": "<string>"
        }
      ],
      "item_id": "<string>",
      "start_time_inclusive": "2023-11-07T05:31:56Z",
      "end_time_exclusive": "2023-11-07T05:31:56Z"
    }
  ]
}

Authorizations

Authorization
string
header
required

API Keys can be issued in the Orb's web application.

Body

application/json
line_items
CreditNoteLineItemParams · object[]
required
Minimum length: 1
reason
enum<string>
required

An optional reason for the credit note.

Available options:
duplicate,
fraudulent,
order_change,
product_unsatisfactory
Examples:

"duplicate"

"fraudulent"

"order_change"

"product_unsatisfactory"

memo
string | null

An optional memo to attach to the credit note.

Examples:

"An optional memo for my credit note."

start_date
string<date> | null

A date string to specify the global credit note service period start date in the customer's timezone. This will be applied to all line items that don't have their own individual service periods specified. If not provided, line items will use their original invoice line item service periods. This date is inclusive.

Examples:

"2023-09-22"

end_date
string<date> | null

A date string to specify the global credit note service period end date in the customer's timezone. This will be applied to all line items that don't have their own individual service periods specified. If not provided, line items will use their original invoice line item service periods. This date is inclusive.

Examples:

"2023-09-22"

Response

Created

The Credit Note resource represents a credit that has been applied to a particular invoice.

id
string
required

The Orb id of this credit note.

created_at
string<date-time>
required

The creation time of the resource in Orb.

voided_at
string<date-time> | null
required

The time at which the credit note was voided in Orb, if applicable.

credit_note_number
string
required

The unique identifier for credit notes.

invoice_id
string
required

The id of the invoice resource that this credit note is applied to.

memo
string | null
required

An optional memo supplied on the credit note.

reason
enum<string> | null
required
Available options:
Duplicate,
Fraudulent,
Order change,
Product unsatisfactory
type
enum<string>
required
Available options:
refund,
adjustment
subtotal
string
required

The total prior to any creditable invoice-level discounts or minimums.

total
string
required

The total including creditable invoice-level discounts or minimums, and tax.

customer
object
required
credit_note_pdf
string | null
required

A URL to a PDF of the credit note.

minimum_amount_refunded
string | null
required

Any credited amount from the applied minimum on the invoice.

maximum_amount_adjustment
object | null
required

The maximum amount applied on the original invoice

line_items
CreditNoteLineItem · object[]
required

All of the line items associated with this credit note.

discounts
CreditNoteDiscount · object[]

Any discounts applied on the original invoice.