(accounting.refunds)
- list - List Refunds
- create - Create Refund
- get - Get Refund
- update - Update Refund
- delete - Delete Refund
List Refunds
import apideck_unify
from apideck_unify import Apideck
from apideck_unify.utils import parse_datetime
import os
with Apideck(
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:
res = apideck.accounting.refunds.list(raw=False, service_id="salesforce", limit=20, filter_={
"updated_since": parse_datetime("2020-09-30T07:43:32.000Z"),
"customer_id": "123abc",
}, sort={
"by": apideck_unify.RefundsSortBy.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()| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
raw |
Optional[bool] | ➖ | Include raw response. Mostly used for debugging purposes | |
consumer_id |
Optional[str] | ➖ | ID of the consumer which you want to get or push data from | test-consumer |
app_id |
Optional[str] | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
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.RefundsFilter] | ➖ | Apply filters | { "updated_since": "2020-09-30T07:43:32.000Z", "customer_id": "123abc" } |
sort |
Optional[models.RefundsSort] | ➖ | 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.cityIn 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. |
models.AccountingRefundsAllResponse
| 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 Refund
import apideck_unify
from apideck_unify import Apideck
from apideck_unify.utils import parse_datetime
from datetime import date
import os
with Apideck(
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:
res = apideck.accounting.refunds.create(total_amount=49.99, raw=False, service_id="salesforce", number="RF-00001", customer=None, company_id="12345", currency=apideck_unify.Currency.USD, currency_rate=0.69, tax_inclusive=True, sub_total=250, total_tax=25, refund_date=parse_datetime("2021-05-01T12:00:00.000Z"), status=apideck_unify.RefundStatus.PAID, type_=apideck_unify.RefundType.REFUND_RECEIPT, payment_method="cash", payment_method_reference="123456", payment_method_id="12345", account={
"id": "123456",
"name": "Bank account",
"nominal_code": "N091",
"code": "453",
"parent_id": "123456",
"display_id": "123456",
}, 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,
"service_date": date.fromisoformat("2024-01-15"),
"category_id": "12345",
"location_id": "12345",
"department_id": "12345",
"subsidiary_id": "12345",
"shipping_id": "12345",
"memo": "Some memo",
"prepaid": True,
"item": {
"id": "12344",
"code": "120-C",
"name": "Model Y",
},
"tax_applicable_on": "Domestic_Purchase_of_Goods_and_Services",
"tax_recoverability": "Fully_Recoverable",
"tax_method": "Due_to_Supplier",
"worktags": [
{
"id": "123456",
"value": "New York",
},
],
"tax_rate": {
"id": "123456",
"code": "N-T",
"rate": 10,
},
"tracking_categories": [
{
"id": "123456",
"code": "100",
"name": "New York",
"parent_id": "123456",
"parent_name": "New York",
},
],
"ledger_account": {
"id": "123456",
"name": "Bank account",
"nominal_code": "N091",
"code": "453",
"parent_id": "123456",
"display_id": "123456",
},
"custom_fields": [
{
"id": "2389328923893298",
"name": "employee_level",
"description": "Employee Level",
"value": "Uses Salesforce and Marketo",
},
],
"row_version": "1-12345",
},
], allocations=[
{
"id": "123456",
"amount": 49.99,
"allocation_id": "123456",
},
], tax_code="1234", discount_percentage=5.5, discount_amount=25, note="Refund for returned items", customer_memo="Thank you for your business and have a great day!", reference="REF-123456", 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",
"line5": "Attention: Finance Dept",
"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",
"line5": "Attention: Finance Dept",
"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",
}, department={
"display_id": "123456",
"name": "Acme Inc.",
}, location={
"id": "123456",
"display_id": "123456",
"name": "New York Office",
}, tracking_categories=[
{
"id": "123456",
"code": "100",
"name": "New York",
"parent_id": "123456",
"parent_name": "New York",
},
], custom_fields=[
{
"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",
},
},
},
],
},
])
assert res.create_refund_response is not None
# Handle response
print(res.create_refund_response)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
total_amount |
Nullable[float] | ✔️ | The total amount of the transaction or record | 49.99 |
raw |
Optional[bool] | ➖ | Include raw response. Mostly used for debugging purposes | |
consumer_id |
Optional[str] | ➖ | ID of the consumer which you want to get or push data from | test-consumer |
app_id |
Optional[str] | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
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] | ➖ | Reference number for the refund. | RF-00001 |
customer |
OptionalNullable[models.LinkedCustomerInput] | ➖ | The customer this entity is linked to. | |
company_id |
OptionalNullable[str] | ➖ | The company 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] | ➖ | Subtotal amount, normally before tax. | 250 |
total_tax |
OptionalNullable[float] | ➖ | Total tax amount applied to this transaction. | 25 |
refund_date |
date | ➖ | The date of the refund - YYYY-MM-DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z |
status |
Optional[models.RefundStatus] | ➖ | Status of refund. Maps to: QBO (limited status), NetSuite CashRefund status, Sage Intacct state (draft/posted/voided), Zoho Books vis_state. | paid |
type |
Optional[models.RefundType] | ➖ | Type of refund. refund_receipt for itemized refunds with product/service lines and payment (QBO RefundReceipt, NetSuite CashRefund). cash_refund for cash-out refunds with GL distribution or allocations (Sage Intacct). credit_note_refund for refunds applied against a credit note (Zoho Books). |
refund_receipt |
payment_method |
OptionalNullable[str] | ➖ | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash |
payment_method_reference |
OptionalNullable[str] | ➖ | Optional reference message returned by payment method on processing | 123456 |
payment_method_id |
OptionalNullable[str] | ➖ | A unique identifier for an object. | 12345 |
account |
OptionalNullable[models.LinkedLedgerAccount] | ➖ | N/A | |
line_items |
List[models.InvoiceLineItemInput] | ➖ | Line items for itemized refunds (type: refund_receipt). Used when the refund includes product/service details with quantities and pricing. Supported by QBO RefundReceipt and NetSuite CashRefund. | |
allocations |
List[models.AllocationInput] | ➖ | Allocations linking refund to existing documents (invoices, credit notes, overpayments). Used for credit_note_refund and cash_refund types where the refund is applied against prior transactions. Supported by Sage Intacct and Zoho Books. | |
tax_code |
OptionalNullable[str] | ➖ | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 |
discount_percentage |
OptionalNullable[float] | ➖ | Discount percentage applied to this refund. | 5.5 |
discount_amount |
OptionalNullable[float] | ➖ | Discount amount applied to this refund. | 25 |
note |
OptionalNullable[str] | ➖ | Optional note to be associated with the refund. | Refund for returned items |
customer_memo |
OptionalNullable[str] | ➖ | Customer memo | Thank you for your business and have a great day! |
reference |
OptionalNullable[str] | ➖ | Optional reference message for the refund. | REF-123456 |
billing_address |
Optional[models.Address] | ➖ | N/A | |
shipping_address |
Optional[models.Address] | ➖ | N/A | |
department |
OptionalNullable[models.LinkedDepartmentInput] | ➖ | N/A | |
location |
OptionalNullable[models.LinkedLocationInput] | ➖ | N/A | |
tracking_categories |
List[Nullable[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. |
models.AccountingRefundsAddResponse
| 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 Refund
from apideck_unify import Apideck
import os
with Apideck(
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:
res = apideck.accounting.refunds.get(id="<id>", service_id="salesforce", raw=False, fields="id,updated_at")
assert res.get_refund_response is not None
# Handle response
print(res.get_refund_response)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
id |
str | ✔️ | ID of the record you are acting upon. | |
consumer_id |
Optional[str] | ➖ | ID of the consumer which you want to get or push data from | test-consumer |
app_id |
Optional[str] | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
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.cityIn 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. |
models.AccountingRefundsOneResponse
| 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 Refund
import apideck_unify
from apideck_unify import Apideck
from apideck_unify.utils import parse_datetime
from datetime import date
import os
with Apideck(
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:
res = apideck.accounting.refunds.update(id="<id>", total_amount=49.99, service_id="salesforce", raw=False, number="RF-00001", 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=250, total_tax=25, refund_date=parse_datetime("2021-05-01T12:00:00.000Z"), status=apideck_unify.RefundStatus.PAID, type_=apideck_unify.RefundType.REFUND_RECEIPT, payment_method="cash", payment_method_reference="123456", payment_method_id="12345", account={
"id": "123456",
"name": "Bank account",
"nominal_code": "N091",
"code": "453",
"parent_id": "123456",
"display_id": "123456",
}, 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,
"service_date": date.fromisoformat("2024-01-15"),
"category_id": "12345",
"location_id": "12345",
"department_id": "12345",
"subsidiary_id": "12345",
"shipping_id": "12345",
"memo": "Some memo",
"prepaid": True,
"item": {
"id": "12344",
"code": "120-C",
"name": "Model Y",
},
"tax_applicable_on": "Domestic_Purchase_of_Goods_and_Services",
"tax_recoverability": "Fully_Recoverable",
"tax_method": "Due_to_Supplier",
"worktags": [
{
"id": "123456",
"value": "New York",
},
],
"tax_rate": {
"id": "123456",
"code": "N-T",
"rate": 10,
},
"tracking_categories": [
{
"id": "123456",
"code": "100",
"name": "New York",
"parent_id": "123456",
"parent_name": "New York",
},
],
"ledger_account": {
"id": "123456",
"name": "Bank account",
"nominal_code": "N091",
"code": "453",
"parent_id": "123456",
"display_id": "123456",
},
"custom_fields": [
{
"id": "2389328923893298",
"name": "employee_level",
"description": "Employee Level",
"value": "Uses Salesforce and Marketo",
},
],
"row_version": "1-12345",
},
], allocations=[
{
"id": "123456",
"amount": 49.99,
"allocation_id": "123456",
},
], tax_code="1234", discount_percentage=5.5, discount_amount=25, note="Refund for returned items", customer_memo="Thank you for your business and have a great day!", reference="REF-123456", 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",
"line5": "Attention: Finance Dept",
"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",
"line5": "Attention: Finance Dept",
"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",
}, department={
"display_id": "123456",
"name": "Acme Inc.",
}, location={
"id": "123456",
"display_id": "123456",
"name": "New York Office",
}, tracking_categories=[
{
"id": "123456",
"code": "100",
"name": "New York",
"parent_id": "123456",
"parent_name": "New York",
},
], custom_fields=[
{
"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",
},
},
},
],
},
])
assert res.update_refund_response is not None
# Handle response
print(res.update_refund_response)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
id |
str | ✔️ | ID of the record you are acting upon. | |
total_amount |
Nullable[float] | ✔️ | The total amount of the transaction or record | 49.99 |
consumer_id |
Optional[str] | ➖ | ID of the consumer which you want to get or push data from | test-consumer |
app_id |
Optional[str] | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
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] | ➖ | Reference number for the refund. | RF-00001 |
customer |
OptionalNullable[models.LinkedCustomerInput] | ➖ | The customer this entity is linked to. | |
company_id |
OptionalNullable[str] | ➖ | The company 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] | ➖ | Subtotal amount, normally before tax. | 250 |
total_tax |
OptionalNullable[float] | ➖ | Total tax amount applied to this transaction. | 25 |
refund_date |
date | ➖ | The date of the refund - YYYY-MM-DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z |
status |
Optional[models.RefundStatus] | ➖ | Status of refund. Maps to: QBO (limited status), NetSuite CashRefund status, Sage Intacct state (draft/posted/voided), Zoho Books vis_state. | paid |
type |
Optional[models.RefundType] | ➖ | Type of refund. refund_receipt for itemized refunds with product/service lines and payment (QBO RefundReceipt, NetSuite CashRefund). cash_refund for cash-out refunds with GL distribution or allocations (Sage Intacct). credit_note_refund for refunds applied against a credit note (Zoho Books). |
refund_receipt |
payment_method |
OptionalNullable[str] | ➖ | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash |
payment_method_reference |
OptionalNullable[str] | ➖ | Optional reference message returned by payment method on processing | 123456 |
payment_method_id |
OptionalNullable[str] | ➖ | A unique identifier for an object. | 12345 |
account |
OptionalNullable[models.LinkedLedgerAccount] | ➖ | N/A | |
line_items |
List[models.InvoiceLineItemInput] | ➖ | Line items for itemized refunds (type: refund_receipt). Used when the refund includes product/service details with quantities and pricing. Supported by QBO RefundReceipt and NetSuite CashRefund. | |
allocations |
List[models.AllocationInput] | ➖ | Allocations linking refund to existing documents (invoices, credit notes, overpayments). Used for credit_note_refund and cash_refund types where the refund is applied against prior transactions. Supported by Sage Intacct and Zoho Books. | |
tax_code |
OptionalNullable[str] | ➖ | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 |
discount_percentage |
OptionalNullable[float] | ➖ | Discount percentage applied to this refund. | 5.5 |
discount_amount |
OptionalNullable[float] | ➖ | Discount amount applied to this refund. | 25 |
note |
OptionalNullable[str] | ➖ | Optional note to be associated with the refund. | Refund for returned items |
customer_memo |
OptionalNullable[str] | ➖ | Customer memo | Thank you for your business and have a great day! |
reference |
OptionalNullable[str] | ➖ | Optional reference message for the refund. | REF-123456 |
billing_address |
Optional[models.Address] | ➖ | N/A | |
shipping_address |
Optional[models.Address] | ➖ | N/A | |
department |
OptionalNullable[models.LinkedDepartmentInput] | ➖ | N/A | |
location |
OptionalNullable[models.LinkedLocationInput] | ➖ | N/A | |
tracking_categories |
List[Nullable[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. |
models.AccountingRefundsUpdateResponse
| 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 Refund
from apideck_unify import Apideck
import os
with Apideck(
consumer_id="test-consumer",
app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
api_key=os.getenv("APIDECK_API_KEY", ""),
) as apideck:
res = apideck.accounting.refunds.delete(id="<id>", service_id="salesforce", raw=False)
assert res.delete_refund_response is not None
# Handle response
print(res.delete_refund_response)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
id |
str | ✔️ | ID of the record you are acting upon. | |
consumer_id |
Optional[str] | ➖ | ID of the consumer which you want to get or push data from | test-consumer |
app_id |
Optional[str] | ➖ | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
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. |
models.AccountingRefundsDeleteResponse
| 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 | */* |