Creates a credit note for an invoice.

Allows the creation of a credit note on an existing invoice. Can be used in the context of refunds.

PATH:

/v1/clients/{clientId}/invoices/{invoiceNumber}/credit

PATH PARAMETERS:

clientId
required

integer

Your assigned clientId.

invoiceNumber
required

string

The invoice number.

HYPERMEDIA CONTROL

AVAILABLE IN:

REQUEST BODY SCHEMA:

creditNoteNumber

string

The invoice number to use for the new credit note.

invoiceLines

array of invoiceLines

The invoice lines to credit.

id

string <= 20 characters

The id of the invoice line to credit.

unit

unit object

no description in swagger file

quantity

number double

The amount of units that is being credited from the line.

metadata

array of metadata

The metadata to add to the credit line.

key

string <= 30 characters

The key of the metadata item (Type).

value

string <= 255 characters

The value of the metadata item.

customLines

array of customLines

The custom invoice lines to add to the credit note.

productDetails

productDetails object

Information about the product.

description

string <= 255 characters

The description of the product.

productId

string <= 100 characters

The unique identifier of the product.

imageURL

string <= 512 characters

A link to the product's image.

productName

string <= 100 characters

The name of the product.

unit

unit object

no description in swagger file

quantity

number double

The quantity to show on the custom credit line.

code

string <= 16 characters

The unit code to show on the custom credit line.

netPrice

number double

Unit net price of the custom credit line.

tax

tax object

no description in swagger file

vatPercentage

number double

The VAT percentage to apply on an custom credit line.

metadata

array of metadata

Metadata.

key

string <= 30 characters

The key of the metadata item (Type).

value

string <= 255 characters

The value of the metadata item.

metadata

array of metadata

The metadata to add to the credit note.

key

string <= 30 characters

The key of the metadata item (Type).

value

string <= 255 characters

The value of the metadata item.

RESPONSES:

201 Returned when the credit note is created successfully.

RESPONSE SCHEMA:

invoiceNumber

string <= 20 characters

The unique identifier of an invoice.

invoiceDate

string date-time

Date of the invoice.

dueDate

string date-time

Date of when the invoice is due by.

createdAt

string date-time

Date and time of when the invoice was created.

updatedAt

string date-time

Date and time of when the last update to the invoice occurred, if any.

remainingAmount

number double

Amount owed. Any credited amounts are deducted.

total

total object

Total amount.

grossAmount

number double

Total amount after adding VAT.

netAmount

number double

Total amount before VAT.

creditedGrossAmount

number double

Credited amount including VAT.

currencyCode

string <= 3 characters

Currency used according to 'ISO-4217'.

paymentMeans

paymentMeans object

Information about payment reference of an invoice.

paymentId

string <= 30 characters

OCR number for this invoice. Particularly used in Nordic wire transfers.

receiverAccount

string <= 20 characters

Account number for incoming payments.

references

references object

Customer reference.

buyerReference

string <= 30 characters

A reference to the buyer.

metadata

array of metadata

Metadata.

Array () [
key

string <= 30 characters

The key of the metadata item (Type).

value

string <= 255 characters

The value of the metadata item.


]
isPaused

boolean

Whether the dunning process is put on pause or not.

pauseEndDate

string date-time

When the pause of the dunning process ends.If dunning process is not paused this will not be present.

invoiceLines

array of invoiceLines

The items that makes up the invoice. If specified on creation.Invoices might not contain any invoice lines.

Array () [
id

string <= 20 characters

Local identifier of line within this invoice.

creditType

string <= 20 characters

Only present if this invoice is a credit note.Differentiate between a invoiceLineCredit or customLineCredit.

orderDetails

orderDetails object

no description in swagger file

number

string <= 50 characters

no description in swagger file

date

string date-time

no description in swagger file

productDetails

productDetails object

Information about the product.

description

string <= 255 characters

The description of the product.

productId

string <= 100 characters

The unique identifier of the product.

imageURL

string <= 512 characters

A link to the product's image.

productName

string <= 100 characters

The name of the product.

unit

unit object

Unit information.

quantity

number double

The number of Units.

code

string <= 16 characters

The unit code.

netPrice

number double

The price of an unit before VAT.

tax

tax object

Tax Information.

vatAmount

number double

The amount of VAT.

vatPercentage

number double

The VAT percentage.

total

total object

Total amount.

grossAmount

number double

Total amount after adding VAT.

netAmount

number double

Total amount before VAT.

creditedGrossAmount

number double

Credited amount including VAT.

currencyCode

string <= 3 characters

Currency used according to 'ISO-4217'.

creditNotes

array of creditNotes

Related credit note for an invoice line.

Array () [
creditNoteNumber

string

The invoice number of the credit note.

createdAt

string date-time

The date the credit note was created.

amount

number double

Total amount credited including VAT.

quantity

number double

The quantity of units credited.

_links

array of _links

Other related API Endpoints.


]
metadata

array of metadata

Metadata for an invoice line.

Array () [
key

string <= 30 characters

The key of the metadata item (Type).

value

string <= 255 characters

The value of the metadata item.


]

]
creditNotes

array of creditNotes

Credit note that has been issued against an invoice.

Array () [
creditNoteNumber

string

The invoice number of the credit note.

createdAt

string date-time

The date the credit note was created.

amount

number double

Total amount credited including VAT.

quantity

number double

The quantity of units credited.

_links

array of _links

Other related API Endpoints.


]
customer

customer object

Customer Information.

customerNumber

string <= 100 characters

The unique identifier of an customer.

type

string <= 10 characters

Specifies if the customer is a "company" or a "person".

person

person object

The person that is billed in business transactions.

firstName

string <= 100 characters

First Name of the customer.

lastName

string <= 100 characters

Last name of the customer.

company

company object

The company that is billed in business transactions.

name

string <= 100 characters

Name of the company.

organizationNumber

string <= 50 characters

Organization number of the company.

phoneNumber

string <= 25 characters

Phone number for this customer.

email

string <= 100 characters

Email address for the customer.

address

address object

no description in swagger file

addressLine

string

The first line of the customer's address.

addressLine2

string

The second line of the customer's address.

addressLine3

string

The third line of the customer's address.

postalCode

string

The ZIP Code or postal code for the address.

postalPlace

string

The city for the customer's address.

countryCode

string

The country or region for the customer's address.

_links

array of _links

Links to other API endpoints which can be used to take action on this invoice.

400 Returned when the request is malformed.

RESPONSE SCHEMA:

type

string

no description in swagger file

category

string

Enum: BusinessError TechnicalError

no description in swagger file

title

string

no description in swagger file

message

string

no description in swagger file

detail

string

There is an error message.

customerFacingMessage

string

no description in swagger file

401 Returned when the request has a missing or invalid "Authorization" header.

RESPONSE SCHEMA:

type

string

no description in swagger file

category

string

Enum: BusinessError TechnicalError

no description in swagger file

title

string

no description in swagger file

message

string

no description in swagger file

detail

string

There is an error message.

customerFacingMessage

string

no description in swagger file

403 Returned when the requester is lacking permissions.

RESPONSE SCHEMA:

type

string

no description in swagger file

category

string

Enum: BusinessError TechnicalError

no description in swagger file

title

string

no description in swagger file

message

string

no description in swagger file

detail

string

There is an error message.

customerFacingMessage

string

no description in swagger file

404 Returned when the invoice is not found.

RESPONSE SCHEMA:

type

string

no description in swagger file

category

string

Enum: BusinessError TechnicalError

no description in swagger file

title

string

no description in swagger file

message

string

no description in swagger file

detail

string

There is an error message.

customerFacingMessage

string

no description in swagger file

500 Returned when some internal error happens.

RESPONSE SCHEMA:

type

string

no description in swagger file

category

string

Enum: BusinessError TechnicalError

no description in swagger file

title

string

no description in swagger file

message

string

no description in swagger file

detail

string

There is an error message.

customerFacingMessage

string

no description in swagger file

Path

post

/v1/clients/{clientId}/invoices/{invoiceNumber}/credit

Request samples

  • {
    • "creditNoteNumber": "string",
    • "invoiceLines": [ ...
      • {
        • "id": "string",
        • "unit": { ...
          • "quantity": 1.00
          },
        • "metadata": [ ...
          • {
            • "key": "string",
            • "value": "string"
            }
          ]
        }
      ],
    • "customLines": [ ...
      • {
        • "productDetails": { ...
          • "description": "string",
          • "productId": "string",
          • "imageURL": "string",
          • "productName": "string"
          },
        • "unit": { ...
          • "quantity": 1.00,
          • "code": "string",
          • "netPrice": 1.00
          },
        • "tax": { ...
          • "vatPercentage": 1.00
          },
        • "metadata": [ ...
          • {
            • "key": "string",
            • "value": "string"
            }
          ]
        }
      ],
    • "metadata": [ ...
      • {
        • "key": "string",
        • "value": "string"
        }
      ]
  • }

Response samples

201400401403404500
  • {
    • "invoiceNumber": "string",
    • "invoiceDate": "string",
    • "dueDate": "string",
    • "createdAt": "string",
    • "updatedAt": "string",
    • "remainingAmount": 1.00,
    • "total": { ...
      • "grossAmount": 1.00,
      • "netAmount": 1.00,
      • "creditedGrossAmount": 1.00,
      • "currencyCode": "string"
      },
    • "paymentMeans": { ...
      • "paymentId": "string",
      • "receiverAccount": "string"
      },
    • "references": { ...
      • "buyerReference": "string"
      },
    • "metadata": [ ...
      • {
        • "key": "string",
        • "value": "string"
        }
      ],
    • "isPaused": true,
    • "pauseEndDate": "string",
    • "invoiceLines": [ ...
      • {
        • "id": "string",
        • "creditType": "string",
        • "orderDetails": { ...
          • "number": "string",
          • "date": "string"
          },
        • "productDetails": { ...
          • "description": "string",
          • "productId": "string",
          • "imageURL": "string",
          • "productName": "string"
          },
        • "unit": { ...
          • "quantity": 1.00,
          • "code": "string",
          • "netPrice": 1.00
          },
        • "tax": { ...
          • "vatAmount": 1.00,
          • "vatPercentage": 1.00
          },
        • "total": { ...
          • "grossAmount": 1.00,
          • "netAmount": 1.00,
          • "creditedGrossAmount": 1.00,
          • "currencyCode": "string"
          },
        • "creditNotes": [ ...
          • {
            • "creditNoteNumber": "string",
            • "createdAt": "string",
            • "amount": 1.00,
            • "quantity": 1.00,
            • "_links": [ ...
              • {
                • "method": "string",
                • "href": "string",
                • "rel": "string",
                • "target": "string"
                }
              ]
            }
          ],
        • "metadata": [ ...
          • {
            • "key": "string",
            • "value": "string"
            }
          ]
        }
      ],
    • "creditNotes": [ ...
      • {
        • "creditNoteNumber": "string",
        • "createdAt": "string",
        • "amount": 1.00,
        • "quantity": 1.00,
        • "_links": [ ...
          • {
            • "method": "string",
            • "href": "string",
            • "rel": "string",
            • "target": "string"
            }
          ]
        }
      ],
    • "customer": { ...
      • "customerNumber": "string",
      • "type": "string",
      • "person": { ...
        • "firstName": "string",
        • "lastName": "string"
        },
      • "company": { ...
        • "name": "string",
        • "organizationNumber": "string"
        },
      • "phoneNumber": "string",
      • "email": "string",
      • "address": { ...
        • "addressLine": "string",
        • "addressLine2": "string",
        • "addressLine3": "string",
        • "postalCode": "string",
        • "postalPlace": "string",
        • "countryCode": "string"
        }
      },
    • "_links": [ ...
      • {
        • "method": "string",
        • "href": "string",
        • "rel": "string",
        • "target": "string"
        }
      ]
    }
  • {
    • "type": "string",
    • "category": "string",
    • "title": "string",
    • "message": "string",
    • "detail": "string",
    • "customerFacingMessage": "string"
    }
  • {
    • "type": "string",
    • "category": "string",
    • "title": "string",
    • "message": "string",
    • "detail": "string",
    • "customerFacingMessage": "string"
    }
  • {
    • "type": "string",
    • "category": "string",
    • "title": "string",
    • "message": "string",
    • "detail": "string",
    • "customerFacingMessage": "string"
    }
  • {
    • "type": "string",
    • "category": "string",
    • "title": "string",
    • "message": "string",
    • "detail": "string",
    • "customerFacingMessage": "string"
    }
  • {
    • "type": "string",
    • "category": "string",
    • "title": "string",
    • "message": "string",
    • "detail": "string",
    • "customerFacingMessage": "string"
    }