Skip to main content
POST
/
supplier-credit-notes
/
{creditNoteId}
/
applications
Apply supplier credit to a bill
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({billId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', amount: 123})
};

fetch('https://api.dolfinai.co/supplier-credit-notes/{creditNoteId}/applications', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "currency": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "supplierCreditNoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "billId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "supplierId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amount": 123,
  "createdAt": "2023-11-07T05:31:56Z",
  "createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Path Parameters

creditNoteId
string<uuid>
required

Body

application/json
billId
string<uuid>

The bill to net this credit against. Must belong to the same supplier and currency.

amount

Amount of credit to apply. Must be > 0, <= the credit note's available balance, and <= the bill's outstanding balance.

Response

Created

currency
string
required
id
string<uuid>
supplierCreditNoteId
string<uuid>
billId
string<uuid>
supplierId
string<uuid>
amount
status
enum<string>

Applied or Reversed.

Available options:
Applied,
Reversed
createdAt
string<date-time>
createdBy
null | string<uuid>
updatedAt
string<date-time>