Skip to content

Latest commit

 

History

History
834 lines (752 loc) · 131 KB

README.md

File metadata and controls

834 lines (752 loc) · 131 KB

CreditNotes

(accounting.credit_notes)

Overview

Available Operations

  • list - List Credit Notes
  • create - Create Credit Note
  • get - Get Credit Note
  • update - Update Credit Note
  • delete - Delete Credit Note

list

List Credit Notes

Example Usage

import apideck_unify
from apideck_unify import Apideck
import dateutil.parser
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.accounting.credit_notes.list(service_id="salesforce", filter_={
        "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"),
    }, sort={
        "by": apideck_unify.CreditNotesSortBy.UPDATED_AT,
        "direction": apideck_unify.SortDirection.DESC,
    }, pass_through={
        "search": "San Francisco",
    }, fields="id,updated_at")

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description Example
raw Optional[bool] Include raw response. Mostly used for debugging purposes
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
cursor OptionalNullable[str] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response.
limit Optional[int] Number of results to return. Minimum 1, Maximum 200, Default 20
filter_ Optional[models.CreditNotesFilter] Apply filters {
"updated_since": "2020-09-30T07:43:32.000Z"
}
sort Optional[models.CreditNotesSort] Apply sorting {
"by": "updated_at",
"direction": "desc"
}
pass_through Dict[str, Any] Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads {
"search": "San Francisco"
}
fields OptionalNullable[str] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: fields=name,email,addresses.city

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
id,updated_at
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingCreditNotesAllResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

create

Create Credit Note

Example Usage

import apideck_unify
from apideck_unify import Apideck
import dateutil.parser
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.accounting.credit_notes.create(total_amount=49.99, service_id="salesforce", number="OIT00546", customer={
        "id": "12345",
        "display_name": "Windsurf Shop",
        "email": "boring@boring.com",
    }, company_id="12345", currency=apideck_unify.Currency.USD, currency_rate=0.69, tax_inclusive=True, sub_total=27500, total_tax=2500, tax_code="1234", balance=27500, remaining_credit=27500, status=apideck_unify.CreditNoteStatus.AUTHORISED, reference="123456", date_issued=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), date_paid=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), type_=apideck_unify.CreditNoteType.ACCOUNTS_RECEIVABLE_CREDIT, account={
        "id": "123456",
        "nominal_code": "N091",
        "code": "453",
    }, line_items=[
        {
            "id": "12345",
            "row_id": "12345",
            "code": "120-C",
            "line_number": 1,
            "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
            "type": apideck_unify.InvoiceLineItemType.SALES_ITEM,
            "tax_amount": 27500,
            "total_amount": 27500,
            "quantity": 1,
            "unit_price": 27500.5,
            "unit_of_measure": "pc.",
            "discount_percentage": 0.01,
            "discount_amount": 19.99,
            "location_id": "1234",
            "department_id": "1234",
            "item": {
                "id": "12344",
                "code": "120-C",
                "name": "Model Y",
            },
            "tax_rate": {
                "id": "123456",
                "rate": 10,
            },
            "tracking_categories": [
                {
                    "id": "123456",
                    "name": "New York",
                },
                {
                    "id": "123456",
                    "name": "New York",
                },
            ],
            "ledger_account": {
                "id": "123456",
                "nominal_code": "N091",
                "code": "453",
            },
            "custom_fields": [
                {
                    "id": "2389328923893298",
                    "name": "employee_level",
                    "description": "Employee Level",
                    "value": "Uses Salesforce and Marketo",
                },
            ],
            "row_version": "1-12345",
        },
    ], allocations=[

    ], note="Some notes about this credit note", terms="Some terms about this credit note", billing_address={
        "id": "123",
        "type": apideck_unify.Type.PRIMARY,
        "string": "25 Spring Street, Blackburn, VIC 3130",
        "name": "HQ US",
        "line1": "Main street",
        "line2": "apt #",
        "line3": "Suite #",
        "line4": "delivery instructions",
        "street_number": "25",
        "city": "San Francisco",
        "state": "CA",
        "postal_code": "94104",
        "country": "US",
        "latitude": "40.759211",
        "longitude": "-73.984638",
        "county": "Santa Clara",
        "contact_name": "Elon Musk",
        "salutation": "Mr",
        "phone_number": "111-111-1111",
        "fax": "122-111-1111",
        "email": "elon@musk.com",
        "website": "https://elonmusk.com",
        "notes": "Address notes or delivery instructions.",
        "row_version": "1-12345",
    }, shipping_address={
        "id": "123",
        "type": apideck_unify.Type.PRIMARY,
        "string": "25 Spring Street, Blackburn, VIC 3130",
        "name": "HQ US",
        "line1": "Main street",
        "line2": "apt #",
        "line3": "Suite #",
        "line4": "delivery instructions",
        "street_number": "25",
        "city": "San Francisco",
        "state": "CA",
        "postal_code": "94104",
        "country": "US",
        "latitude": "40.759211",
        "longitude": "-73.984638",
        "county": "Santa Clara",
        "contact_name": "Elon Musk",
        "salutation": "Mr",
        "phone_number": "111-111-1111",
        "fax": "122-111-1111",
        "email": "elon@musk.com",
        "website": "https://elonmusk.com",
        "notes": "Address notes or delivery instructions.",
        "row_version": "1-12345",
    }, tracking_categories=[
        {
            "id": "123456",
            "name": "New York",
        },
        {
            "id": "123456",
            "name": "New York",
        },
        {
            "id": "123456",
            "name": "New York",
        },
    ], custom_fields=[
        {
            "id": "2389328923893298",
            "name": "employee_level",
            "description": "Employee Level",
            "value": "Uses Salesforce and Marketo",
        },
        {
            "id": "2389328923893298",
            "name": "employee_level",
            "description": "Employee Level",
            "value": 10,
        },
        {
            "id": "2389328923893298",
            "name": "employee_level",
            "description": "Employee Level",
            "value": "Uses Salesforce and Marketo",
        },
    ], row_version="1-12345", pass_through=[
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
    ])

    assert res.create_credit_note_response is not None

    # Handle response
    print(res.create_credit_note_response)

Parameters

Parameter Type Required Description Example
total_amount float ✔️ Amount of transaction 49.99
raw Optional[bool] Include raw response. Mostly used for debugging purposes
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
number OptionalNullable[str] Credit note number. OIT00546
customer OptionalNullable[models.LinkedCustomerInput] The customer this entity is linked to.
company_id OptionalNullable[str] The company or subsidiary id the transaction belongs to 12345
currency OptionalNullable[models.Currency] Indicates the associated currency for an amount of money. Values correspond to ISO 4217. USD
currency_rate OptionalNullable[float] Currency Exchange Rate at the time entity was recorded/generated. 0.69
tax_inclusive OptionalNullable[bool] Amounts are including tax true
sub_total OptionalNullable[float] Sub-total amount, normally before tax. 27500
total_tax OptionalNullable[float] Total tax amount applied to this invoice. 2500
tax_code OptionalNullable[str] Applicable tax id/code override if tax is not supplied on a line item basis. 1234
balance OptionalNullable[float] The balance reflecting any payments made against the transaction. 27500
remaining_credit OptionalNullable[float] Indicates the total credit amount still available to apply towards the payment. 27500
status Optional[models.CreditNoteStatus] Status of credit notes authorised
reference OptionalNullable[str] Optional reference message ie: Debit remittance detail. 123456
date_issued date Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD 2021-05-01T12:00:00.000Z
date_paid date Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD 2021-05-01T12:00:00.000Z
type Optional[models.CreditNoteType] Type of payment accounts_receivable_credit
account OptionalNullable[models.LinkedLedgerAccountInput] N/A
line_items List[models.InvoiceLineItemInput] N/A
allocations List[models.AllocationInput] N/A
note OptionalNullable[str] Optional note to be associated with the credit note. Some notes about this credit note
terms OptionalNullable[str] Optional terms to be associated with the credit note. Some terms about this credit note
billing_address Optional[models.Address] N/A
shipping_address Optional[models.Address] N/A
tracking_categories List[models.LinkedTrackingCategory] A list of linked tracking categories.
custom_fields List[models.CustomField] N/A
row_version OptionalNullable[str] A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. 1-12345
pass_through List[models.PassThroughBody] The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingCreditNotesAddResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

get

Get Credit Note

Example Usage

from apideck_unify import Apideck
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.accounting.credit_notes.get(id="<id>", service_id="salesforce", fields="id,updated_at")

    assert res.get_credit_note_response is not None

    # Handle response
    print(res.get_credit_note_response)

Parameters

Parameter Type Required Description Example
id str ✔️ ID of the record you are acting upon.
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
raw Optional[bool] Include raw response. Mostly used for debugging purposes
fields OptionalNullable[str] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: fields=name,email,addresses.city

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
id,updated_at
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingCreditNotesOneResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

update

Update Credit Note

Example Usage

import apideck_unify
from apideck_unify import Apideck
import dateutil.parser
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.accounting.credit_notes.update(id="<id>", total_amount=49.99, service_id="salesforce", number="OIT00546", customer={
        "id": "12345",
        "display_name": "Windsurf Shop",
        "email": "boring@boring.com",
    }, company_id="12345", currency=apideck_unify.Currency.USD, currency_rate=0.69, tax_inclusive=True, sub_total=27500, total_tax=2500, tax_code="1234", balance=27500, remaining_credit=27500, status=apideck_unify.CreditNoteStatus.AUTHORISED, reference="123456", date_issued=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), date_paid=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), type_=apideck_unify.CreditNoteType.ACCOUNTS_RECEIVABLE_CREDIT, account={
        "id": "123456",
        "nominal_code": "N091",
        "code": "453",
    }, line_items=[
        {
            "id": "12345",
            "row_id": "12345",
            "code": "120-C",
            "line_number": 1,
            "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
            "type": apideck_unify.InvoiceLineItemType.SALES_ITEM,
            "tax_amount": 27500,
            "total_amount": 27500,
            "quantity": 1,
            "unit_price": 27500.5,
            "unit_of_measure": "pc.",
            "discount_percentage": 0.01,
            "discount_amount": 19.99,
            "location_id": "1234",
            "department_id": "1234",
            "item": {
                "id": "12344",
                "code": "120-C",
                "name": "Model Y",
            },
            "tax_rate": {
                "id": "123456",
                "rate": 10,
            },
            "tracking_categories": [
                {
                    "id": "123456",
                    "name": "New York",
                },
                {
                    "id": "123456",
                    "name": "New York",
                },
            ],
            "ledger_account": {
                "id": "123456",
                "nominal_code": "N091",
                "code": "453",
            },
            "custom_fields": [
                {
                    "id": "2389328923893298",
                    "name": "employee_level",
                    "description": "Employee Level",
                },
            ],
            "row_version": "1-12345",
        },
        {
            "id": "12345",
            "row_id": "12345",
            "code": "120-C",
            "line_number": 1,
            "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
            "type": apideck_unify.InvoiceLineItemType.SALES_ITEM,
            "tax_amount": 27500,
            "total_amount": 27500,
            "quantity": 1,
            "unit_price": 27500.5,
            "unit_of_measure": "pc.",
            "discount_percentage": 0.01,
            "discount_amount": 19.99,
            "location_id": "1234",
            "department_id": "1234",
            "item": {
                "id": "12344",
                "code": "120-C",
                "name": "Model Y",
            },
            "tax_rate": {
                "id": "123456",
                "rate": 10,
            },
            "tracking_categories": [
                {
                    "id": "123456",
                    "name": "New York",
                },
            ],
            "ledger_account": {
                "id": "123456",
                "nominal_code": "N091",
                "code": "453",
            },
            "custom_fields": [
                {
                    "id": "2389328923893298",
                    "name": "employee_level",
                    "description": "Employee Level",
                    "value": "Uses Salesforce and Marketo",
                },
                {
                    "id": "2389328923893298",
                    "name": "employee_level",
                    "description": "Employee Level",
                },
                {
                    "id": "2389328923893298",
                    "name": "employee_level",
                    "description": "Employee Level",
                    "value": 10,
                },
            ],
            "row_version": "1-12345",
        },
        {
            "id": "12345",
            "row_id": "12345",
            "code": "120-C",
            "line_number": 1,
            "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
            "type": apideck_unify.InvoiceLineItemType.SALES_ITEM,
            "tax_amount": 27500,
            "total_amount": 27500,
            "quantity": 1,
            "unit_price": 27500.5,
            "unit_of_measure": "pc.",
            "discount_percentage": 0.01,
            "discount_amount": 19.99,
            "location_id": "1234",
            "department_id": "1234",
            "item": {
                "id": "12344",
                "code": "120-C",
                "name": "Model Y",
            },
            "tax_rate": {
                "id": "123456",
                "rate": 10,
            },
            "tracking_categories": [

            ],
            "ledger_account": {
                "id": "123456",
                "nominal_code": "N091",
                "code": "453",
            },
            "custom_fields": [

            ],
            "row_version": "1-12345",
        },
    ], allocations=[
        {
            "id": "123456",
            "amount": 49.99,
            "allocation_id": "123456",
        },
        {
            "id": "123456",
            "amount": 49.99,
            "allocation_id": "123456",
        },
        {
            "id": "123456",
            "amount": 49.99,
            "allocation_id": "123456",
        },
    ], note="Some notes about this credit note", terms="Some terms about this credit note", billing_address={
        "id": "123",
        "type": apideck_unify.Type.PRIMARY,
        "string": "25 Spring Street, Blackburn, VIC 3130",
        "name": "HQ US",
        "line1": "Main street",
        "line2": "apt #",
        "line3": "Suite #",
        "line4": "delivery instructions",
        "street_number": "25",
        "city": "San Francisco",
        "state": "CA",
        "postal_code": "94104",
        "country": "US",
        "latitude": "40.759211",
        "longitude": "-73.984638",
        "county": "Santa Clara",
        "contact_name": "Elon Musk",
        "salutation": "Mr",
        "phone_number": "111-111-1111",
        "fax": "122-111-1111",
        "email": "elon@musk.com",
        "website": "https://elonmusk.com",
        "notes": "Address notes or delivery instructions.",
        "row_version": "1-12345",
    }, shipping_address={
        "id": "123",
        "type": apideck_unify.Type.PRIMARY,
        "string": "25 Spring Street, Blackburn, VIC 3130",
        "name": "HQ US",
        "line1": "Main street",
        "line2": "apt #",
        "line3": "Suite #",
        "line4": "delivery instructions",
        "street_number": "25",
        "city": "San Francisco",
        "state": "CA",
        "postal_code": "94104",
        "country": "US",
        "latitude": "40.759211",
        "longitude": "-73.984638",
        "county": "Santa Clara",
        "contact_name": "Elon Musk",
        "salutation": "Mr",
        "phone_number": "111-111-1111",
        "fax": "122-111-1111",
        "email": "elon@musk.com",
        "website": "https://elonmusk.com",
        "notes": "Address notes or delivery instructions.",
        "row_version": "1-12345",
    }, tracking_categories=[
        {
            "id": "123456",
            "name": "New York",
        },
        {
            "id": "123456",
            "name": "New York",
        },
        {
            "id": "123456",
            "name": "New York",
        },
    ], custom_fields=[
        {
            "id": "2389328923893298",
            "name": "employee_level",
            "description": "Employee Level",
            "value": True,
        },
    ], row_version="1-12345", pass_through=[
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [
                {
                    "path": "$.nested.property",
                    "value": {
                        "TaxClassificationRef": {
                            "value": "EUC-99990201-V1-00020000",
                        },
                    },
                },
            ],
        },
        {
            "service_id": "<id>",
            "extend_paths": [

            ],
        },
    ])

    assert res.update_credit_note_response is not None

    # Handle response
    print(res.update_credit_note_response)

Parameters

Parameter Type Required Description Example
id str ✔️ ID of the record you are acting upon.
total_amount float ✔️ Amount of transaction 49.99
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
raw Optional[bool] Include raw response. Mostly used for debugging purposes
number OptionalNullable[str] Credit note number. OIT00546
customer OptionalNullable[models.LinkedCustomerInput] The customer this entity is linked to.
company_id OptionalNullable[str] The company or subsidiary id the transaction belongs to 12345
currency OptionalNullable[models.Currency] Indicates the associated currency for an amount of money. Values correspond to ISO 4217. USD
currency_rate OptionalNullable[float] Currency Exchange Rate at the time entity was recorded/generated. 0.69
tax_inclusive OptionalNullable[bool] Amounts are including tax true
sub_total OptionalNullable[float] Sub-total amount, normally before tax. 27500
total_tax OptionalNullable[float] Total tax amount applied to this invoice. 2500
tax_code OptionalNullable[str] Applicable tax id/code override if tax is not supplied on a line item basis. 1234
balance OptionalNullable[float] The balance reflecting any payments made against the transaction. 27500
remaining_credit OptionalNullable[float] Indicates the total credit amount still available to apply towards the payment. 27500
status Optional[models.CreditNoteStatus] Status of credit notes authorised
reference OptionalNullable[str] Optional reference message ie: Debit remittance detail. 123456
date_issued date Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD 2021-05-01T12:00:00.000Z
date_paid date Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD 2021-05-01T12:00:00.000Z
type Optional[models.CreditNoteType] Type of payment accounts_receivable_credit
account OptionalNullable[models.LinkedLedgerAccountInput] N/A
line_items List[models.InvoiceLineItemInput] N/A
allocations List[models.AllocationInput] N/A
note OptionalNullable[str] Optional note to be associated with the credit note. Some notes about this credit note
terms OptionalNullable[str] Optional terms to be associated with the credit note. Some terms about this credit note
billing_address Optional[models.Address] N/A
shipping_address Optional[models.Address] N/A
tracking_categories List[models.LinkedTrackingCategory] A list of linked tracking categories.
custom_fields List[models.CustomField] N/A
row_version OptionalNullable[str] A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. 1-12345
pass_through List[models.PassThroughBody] The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingCreditNotesUpdateResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*

delete

Delete Credit Note

Example Usage

from apideck_unify import Apideck
import os

with Apideck(
    api_key=os.getenv("APIDECK_API_KEY", ""),
    consumer_id="test-consumer",
    app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
) as apideck:

    res = apideck.accounting.credit_notes.delete(id="<id>", service_id="salesforce")

    assert res.delete_credit_note_response is not None

    # Handle response
    print(res.delete_credit_note_response)

Parameters

Parameter Type Required Description Example
id str ✔️ ID of the record you are acting upon.
service_id Optional[str] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
raw Optional[bool] Include raw response. Mostly used for debugging purposes
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AccountingCreditNotesDeleteResponse

Errors

Error Type Status Code Content Type
models.BadRequestResponse 400 application/json
models.UnauthorizedResponse 401 application/json
models.PaymentRequiredResponse 402 application/json
models.NotFoundResponse 404 application/json
models.UnprocessableResponse 422 application/json
models.APIError 4XX, 5XX */*