Skip to main content
POST
/
suppliers
/
{supplierId}
/
credit-notes
Create supplier credit note
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({currency: '<string>'})
};

fetch('https://api.dolfinai.co/suppliers/{supplierId}/credit-notes', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "currency": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organisationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "supplierId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "documentNumber": "<string>",
  "amount": 123,
  "netAmount": 123,
  "taxAmount": 123,
  "appliedAmount": 123,
  "available": 123,
  "taxRateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "taxRateSnapshot": {
    "code": "<string>",
    "name": "<string>",
    "source": "<string>",
    "rate": 123,
    "sourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "snapshottedAt": "2023-11-07T05:31:56Z"
  },
  "originalBillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "reason": "<string>",
  "issuedAt": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "updatedAt": "2023-11-07T05:31:56Z",
  "updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Path Parameters

supplierId
string<uuid>
required

Body

application/json
currency
string
required

ISO 4217 currency code (e.g. GBP, USD, EUR).

amount

Gross (tax-inclusive) credit amount. Must be greater than zero.

taxRateId
null | string<uuid>

Optional tax rate to apply (an org rate or country default). Omit for a zero-rated credit; the net/tax split is computed from it.

originalBillId
null | string<uuid>

Optional id of the bill this credit relates to — header-level provenance only.

reason
null | string

Optional human-readable reason for the credit.

Response

Created

currency
string
required

ISO 4217 currency code (e.g. GBP, USD, EUR).

id
string<uuid>
organisationId
string<uuid>
supplierId
string<uuid>
documentNumber
null | string
amount

Gross (tax-inclusive) credit amount, always positive.

netAmount

Net (ex-tax) portion of the credit. NetAmount + TaxAmount == Amount.

taxAmount

VAT/tax portion of the credit.

appliedAmount

How much of Amount has been netted against bills.

available

Remaining credit available to apply (Amount - AppliedAmount).

taxRateId
null | string<uuid>

Soft reference to the tax rate applied. Null on a zero-rated credit.

taxRateSnapshot
null | object

Frozen copy of the tax rate applied — the source of truth. Null on a zero-rated credit.

originalBillId
null | string<uuid>

Optional id of the bill this credit relates to (header-level provenance).

reason
null | string
source
enum<string>

How the credit note was ingested: Manual or Ocr.

Available options:
Manual,
Ocr
status
enum<string>
Available options:
Draft,
Issued,
PartiallyApplied,
Applied
issuedAt
null | string<date-time>
createdAt
string<date-time>
createdBy
null | string<uuid>
updatedAt
string<date-time>
updatedBy
null | string<uuid>