Credit_Notes table

Column Type

Id

Integer

Url

URI

Contact_Id

String

Contact

URI

Due_Value

Decimal

Updated_At

Timestamp

Payment_Terms_In_Days

Integer

Due_On

String

Omit_Header

Boolean

Dated_On

String

Reference

String

Status

String

Currency

String

Total_Value

Decimal

Involves_Sales_Tax

Boolean

Exchange_Rate

Decimal

Net_Value

Decimal

Is_Interim_Uk_Vat

Boolean

Refunded_Value

Decimal

Long_Status

String

Created_At

Timestamp

Bank_Account_Id

String

Bank_Account

String

Contact_Name

String

Sales_Tax_Value

Decimal

Refunded_On

String

Comments

String

Second_Sales_Tax_Value

Decimal

Credit_Note_Items

Array

Examples

SELECT
    *
FROM
    Credit_Notes
WHERE
    Status <> 'Refunded'

INSERT INTO
    Credit_Notes (Contact, Dated_On, Currency, Credit_Note_Items)
VALUES
    (
        'https://api.freeagent.com/v2/contacts/18494140',
        '2024-11-27',
        'GBP',
        '[{"item_type":"Days","quantity":"1","price":"-999.99","description":"Consultancy Days"}]'
    )

UPDATE Credit_Notes
SET
    Credit_Note_Items = '[{"item_type":"Days","quantity":"4","price":"-999.99","description":"Consultancy Days"},{"item_type":"Hours","quantity":"32","price":"-172.22","description":"Developer Hours"}]'
WHERE
    Id = '73934615'

DELETE FROM Credit_Notes
WHERE
    Id = '73934615'