Credit Notes

Credit Note object

Attributes

id string

Unique object's identifier.

invoice string

The ID of the invoice that was discounted. In read resources this field is expandable, returns the invoice object.

number number

A unique, identifying number that appears on credit note header sent to the customer of this credit note. It's automatically assigned.

document string

The ID of the document type for this credit note.

date date

Closing date of the credit note. Typically this is the date on which credit note is generated.

lines list

The list of line items for this credit note.

amount decimal

Taxable subtotal of this credit note.

exempt decimal

Non taxable subtotal of this credit note.

tax decimal

Tax amount of this credit note.

tax_percent decimal

Tax rate to this credit note.

subtotal decimal

Sum of amount and exempt of this credit note.

total decimal

Sum of subtotal and taxes to this invoice.

discount decimal

Discount amount applicable to subtotal to this invoice.

discount_scheme string

Scheme of the discount, one of $ or %.

local_file url

URL to local format when document type of this credit note belong to a tax agency.

internal_note string

An internal note to provide additional information about credit adjustment.

note string

A note or reason for the customer of this credit note.

tax_agency object

An object with key pairs for particular tax agency properties.

status string

Status of this credit note, one of draft or finalized.

user string

Email of the user that created this credit note.

created datetime

Date and time of the creation of this credit note.

updated datetime

Date and time of the last update of this credit note.

Create a credit note

POST https://api.piriod.com/creditnotes/

This endpoint creates a credit note with status draft for a given invoice. After create the credit note use Finalize a credit note resource for finish credit note.

Request Body

Name
Type
Description

invoice

string

The id of the invoice to be discounted.

document

string

The id of the document type of this credit note.

date

string

Closing date of this credit note.

lines

array

The list of line items for this credit note.

{
  "id": "cre_Vy3nz4tVzf4wN6pnfW",
  "invoice": "inv_AsTY9J7C12iAD9Zc1J",
  "lines": [
    {
      "id": "lin_580fAdPNAAR9wSkcac",
      "amount": 840.34,
      "description": null,
      "discount": 0,
      "discount_scheme": "%",
      "exempt": false,
      "name": "test",
      "quantity": 1,
      "tax": null,
      "tax_percent": null,
      "total": 840,
      "created": "2021-03-29T18:35:55.405022-03:00",
      "updated": "2021-03-29T18:35:55.405108-03:00"
    }
  ],
  "amount": 840,
  "date": "2021-03-29",
  "discount": 0,
  "discount_scheme": "%",
  "exempt": 0,
  "document": "US3",
  "internal_note": "",
  "local_file": null,
  "note": "Amount error",
  "number": 25,
  "status": "draft",
  "subtotal": 840,
  "tax": 0,
  "tax_percent": 0,
  "tax_agency": {},
  "total": 1000,
  "imported": false,
  "created": "2021-03-29T18:35:55.374815-03:00",
  "updated": "2021-03-29T18:36:32.150613-03:00"
}

Retrieve a credit note

GET https://api.piriod.com/creditnotes/{id}/

This endpoint retrieves a credit note object.

Path Parameters

Name
Type
Description

id

string

The id of the credit note object.

Destroy a credit note

DELETE https://api.piriod.com/creditnotes/{id}/

Destroy a credit note object. Only credit notes with status draft are destroyed.

Path Parameters

Name
Type
Description

id

string

The id of the credit note object.

Finalize a credit note

GET https://api.piriod.com/creditnotes/{id}/finalize/

This endpoint finalize a credit note. When the credit note is finalized, it is validated with the tax agency, if the credit note document type has tax regulations, you will no longer be able to update your data. The status attribute of the credit note object will become to finalized. The local_file attribute of the credit note object will have a url to get the file that was sent to the tax agency, normally it is a file with an .xml extension.

Path Parameters

Name
Type
Description

id

string

The id of credit note object.

{
  "id": "cre_Vy3nz4tVzf4wN6pnfW",
  "invoice": "inv_AsTY9J7C12iAD9Zc1J",
  "lines": [
    {
      "id": "lin_580fAdPNAAR9wSkcac",
      "amount": 840.34,
      "description": null,
      "discount": 0,
      "discount_scheme": "%",
      "exempt": false,
      "name": "test",
      "quantity": 1,
      "tax": null,
      "tax_percent": null,
      "total": 840,
      "created": "2021-03-29T18:35:55.405022-03:00",
      "updated": "2021-03-29T18:35:55.405108-03:00"
    }
  ],
  "amount": 840,
  "date": "2021-03-29",
  "discount": 0,
  "discount_scheme": "%",
  "exempt": 0,
  "document": "US3",
  "internal_note": "",
  "local_file": null,
  "note": "Amount error",
  "number": 25,
  "status": "finalized",
  "subtotal": 840,
  "tax": 0,
  "tax_percent": 0,
  "tax_agency": {},
  "total": 1000,
  "imported": false,
  "created": "2021-03-29T18:35:55.374815-03:00",
  "updated": "2021-03-29T18:36:32.150613-03:00"
}

Retrieve a credit note PDF

GET https://api.piriod.com/creditnotes/{id}/pdf/

This endpoint retrieves a PDF representation of the credit note. Returns a Blob encoded in Base64.

Path Parameters

Name
Type
Description

id

string

The id of credit note object.

Last updated