Getting Purchase Refund List
Function: purchase_refund_list()
Purpose
This function is used to retrieve a list of all purchase refunds. By calling this endpoint or SDK method, businesses can view comprehensive refund data, enabling them to track reimbursement activities, reconcile financial transactions, and ensure accuracy in return/refund workflows.
Parameters
No input parameters are required for this function.
Use Case
Use this function when you need a consolidated overview of all purchase refunds within the system. This is particularly useful for financial audits, refund trend analysis, or verifying that refunds have been recorded correctly after product returns. It helps ensure consistency and completeness of refund records, aiding in financial management and customer support operations.
def purchase_refund_list():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.purchase_refunds.list()
print("Response:", response)
except ABException as ab:
print("Error:", ab)
print("Error Details:", ab.get_errors())
print("Raw Response:", ab.raw_response)
public function purchaseRefundList()
{
try {
$response = $this->purchaseRefundService->readAll('v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
A list containing information about all available purchase refunds, including details such as refund IDs, associated purchase information, amounts, and statuses.
PurchaseRefundsListDTO(
purchaseRefunds=[
PurchaseRefundDTO(
status=STATUS,
id=PURCHASE_REFUND_ID_1,
date=DATE_1,
alternateDate=ALTERNATE_DATE_1,
amount=AMOUNT_1,
reference=REFERENCE_1,
note=NOTE_1,
paymentMethod=PAYMENT_METHOD_1,
paymentProcessor=PAYMENT_PROCESSOR_1,
creditNoteId=CREDIT_NOTE_ID_1,
createdBy=CREATED_BY_1,
createdOn=CREATED_ON_1,
lastUpdatedBy=LAST_UPDATED_BY_1,
lastUpdatedOn=LAST_UPDATED_ON_1,
uuid=UUID_1,
version=VERSION_1,
customAttributes=[
{
'name': CUSTOM_ATTRIBUTE_NAME_1_1,
'value': CUSTOM_ATTRIBUTE_VALUE_1_1
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_2,
'value': CUSTOM_ATTRIBUTE_VALUE_1_2
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_3,
'value': CUSTOM_ATTRIBUTE_VALUE_1_3
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_4,
'value': CUSTOM_ATTRIBUTE_VALUE_1_4
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_5,
'value': CUSTOM_ATTRIBUTE_VALUE_1_5
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_6,
'value': CUSTOM_ATTRIBUTE_VALUE_1_6
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_7,
'value': CUSTOM_ATTRIBUTE_VALUE_1_7
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_8,
'value': CUSTOM_ATTRIBUTE_VALUE_1_8
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_9,
'value': CUSTOM_ATTRIBUTE_VALUE_1_9
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_10,
'value': CUSTOM_ATTRIBUTE_VALUE_1_10
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_11,
'value': CUSTOM_ATTRIBUTE_VALUE_1_11
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_12,
'value': CUSTOM_ATTRIBUTE_VALUE_1_12
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_13,
'value': CUSTOM_ATTRIBUTE_VALUE_1_13
}
]
),
PurchaseRefundDTO(
status=STATUS,
id=PURCHASE_REFUND_ID_2,
date=DATE_2,
alternateDate=ALTERNATE_DATE_2,
amount=AMOUNT_2,
reference=REFERENCE_2,
note=NOTE_2,
paymentMethod=PAYMENT_METHOD_2,
paymentProcessor=PAYMENT_PROCESSOR_2,
creditNoteId=CREDIT_NOTE_ID_2,
createdBy=CREATED_BY_2,
createdOn=CREATED_ON_2,
lastUpdatedBy=LAST_UPDATED_BY_2,
lastUpdatedOn=LAST_UPDATED_ON_2,
uuid=UUID_2,
version=VERSION_2,
customAttributes=[
{
'name': CUSTOM_ATTRIBUTE_NAME_2_1,
'value': CUSTOM_ATTRIBUTE_VALUE_2_1
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_2,
'value': CUSTOM_ATTRIBUTE_VALUE_2_2
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_3,
'value': CUSTOM_ATTRIBUTE_VALUE_2_3
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_4,
'value': CUSTOM_ATTRIBUTE_VALUE_2_4
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_5,
'value': CUSTOM_ATTRIBUTE_VALUE_2_5
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_6,
'value': CUSTOM_ATTRIBUTE_VALUE_2_6
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_7,
'value': CUSTOM_ATTRIBUTE_VALUE_2_7
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_8,
'value': CUSTOM_ATTRIBUTE_VALUE_2_8
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_9,
'value': CUSTOM_ATTRIBUTE_VALUE_2_9
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_10,
'value': CUSTOM_ATTRIBUTE_VALUE_2_10
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_11,
'value': CUSTOM_ATTRIBUTE_VALUE_2_11
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_12,
'value': CUSTOM_ATTRIBUTE_VALUE_2_12
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_13,
'value': CUSTOM_ATTRIBUTE_VALUE_2_13
}
]
)
],
pagination=PaginationDTO(
records=TOTAL_RECORDS,
limit=LIMIT,
offset=OFFSET,
previousPage=PREVIOUS_PAGE,
nextPage=NEXT_PAGE
)
)
PurchaseRefundsListDTO(
purchaseRefunds=[
PurchaseRefundDTO(
status=STATUS,
id=PURCHASE_REFUND_ID_1,
date=DATE_1,
alternateDate=ALTERNATE_DATE_1,
amount=AMOUNT_1,
reference=REFERENCE_1,
note=NOTE_1,
paymentMethod=PAYMENT_METHOD_1,
paymentProcessor=PAYMENT_PROCESSOR_1,
creditNoteId=CREDIT_NOTE_ID_1,
createdBy=CREATED_BY_1,
createdOn=CREATED_ON_1,
lastUpdatedBy=LAST_UPDATED_BY_1,
lastUpdatedOn=LAST_UPDATED_ON_1,
uuid=UUID_1,
version=VERSION_1,
customAttributes=[
{
'name': CUSTOM_ATTRIBUTE_NAME_1_1,
'value': CUSTOM_ATTRIBUTE_VALUE_1_1
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_2,
'value': CUSTOM_ATTRIBUTE_VALUE_1_2
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_3,
'value': CUSTOM_ATTRIBUTE_VALUE_1_3
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_4,
'value': CUSTOM_ATTRIBUTE_VALUE_1_4
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_5,
'value': CUSTOM_ATTRIBUTE_VALUE_1_5
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_6,
'value': CUSTOM_ATTRIBUTE_VALUE_1_6
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_7,
'value': CUSTOM_ATTRIBUTE_VALUE_1_7
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_8,
'value': CUSTOM_ATTRIBUTE_VALUE_1_8
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_9,
'value': CUSTOM_ATTRIBUTE_VALUE_1_9
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_10,
'value': CUSTOM_ATTRIBUTE_VALUE_1_10
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_11,
'value': CUSTOM_ATTRIBUTE_VALUE_1_11
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_12,
'value': CUSTOM_ATTRIBUTE_VALUE_1_12
},
{
'name': CUSTOM_ATTRIBUTE_NAME_1_13,
'value': CUSTOM_ATTRIBUTE_VALUE_1_13
}
]
),
PurchaseRefundDTO(
status=STATUS,
id=PURCHASE_REFUND_ID_2,
date=DATE_2,
alternateDate=ALTERNATE_DATE_2,
amount=AMOUNT_2,
reference=REFERENCE_2,
note=NOTE_2,
paymentMethod=PAYMENT_METHOD_2,
paymentProcessor=PAYMENT_PROCESSOR_2,
creditNoteId=CREDIT_NOTE_ID_2,
createdBy=CREATED_BY_2,
createdOn=CREATED_ON_2,
lastUpdatedBy=LAST_UPDATED_BY_2,
lastUpdatedOn=LAST_UPDATED_ON_2,
uuid=UUID_2,
version=VERSION_2,
customAttributes=[
{
'name': CUSTOM_ATTRIBUTE_NAME_2_1,
'value': CUSTOM_ATTRIBUTE_VALUE_2_1
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_2,
'value': CUSTOM_ATTRIBUTE_VALUE_2_2
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_3,
'value': CUSTOM_ATTRIBUTE_VALUE_2_3
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_4,
'value': CUSTOM_ATTRIBUTE_VALUE_2_4
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_5,
'value': CUSTOM_ATTRIBUTE_VALUE_2_5
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_6,
'value': CUSTOM_ATTRIBUTE_VALUE_2_6
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_7,
'value': CUSTOM_ATTRIBUTE_VALUE_2_7
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_8,
'value': CUSTOM_ATTRIBUTE_VALUE_2_8
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_9,
'value': CUSTOM_ATTRIBUTE_VALUE_2_9
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_10,
'value': CUSTOM_ATTRIBUTE_VALUE_2_10
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_11,
'value': CUSTOM_ATTRIBUTE_VALUE_2_11
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_12,
'value': CUSTOM_ATTRIBUTE_VALUE_2_12
},
{
'name': CUSTOM_ATTRIBUTE_NAME_2_13,
'value': CUSTOM_ATTRIBUTE_VALUE_2_13
}
]
)
],
pagination=PaginationDTO(
records=TOTAL_RECORDS,
limit=LIMIT,
offset=OFFSET,
previousPage=PREVIOUS_PAGE,
nextPage=NEXT_PAGE
)
)
{
"purchase_refunds": [
{
"status": "STATUS",
"id": "PURCHASE_REFUND_ID",
"date": "DATE",
"alternate_date": "ALTERNATE_DATE",
"amount": "AMOUNT",
"reference": "REFERENCE",
"note": "NOTE",
"payment_method": "PAYMENT_METHOD",
"payment_processor": "PAYMENT_PROCESSOR",
"credit_note_id": "CREDIT_NOTE_ID",
"created_by": "CREATED_BY",
"created_on": "CREATED_ON",
"last_updated_by": "LAST_UPDATED_BY",
"last_updated_on": "LAST_UPDATED_ON",
"uuid": "UUID",
"version": "VERSION",
"custom_attributes": [
{
"name": "CUSTOM_ATTRIBUTE_NAME_1",
"value": "CUSTOM_ATTRIBUTE_VALUE_1"
}
]
},
{
"status": "STATUS",
"id": "PURCHASE_REFUND_ID",
"date": "DATE",
"alternate_date": "ALTERNATE_DATE",
"amount": "AMOUNT",
"reference": "REFERENCE",
"note": "NOTE",
"payment_method": "PAYMENT_METHOD",
"payment_processor": "PAYMENT_PROCESSOR",
"credit_note_id": "CREDIT_NOTE_ID",
"created_by": "CREATED_BY",
"created_on": "CREATED_ON",
"last_updated_by": "LAST_UPDATED_BY",
"last_updated_on": "LAST_UPDATED_ON",
"uuid": "UUID",
"version": "VERSION",
"custom_attributes": [
{
"name": "CUSTOM_ATTRIBUTE_NAME_1",
"value": "CUSTOM_ATTRIBUTE_VALUE_1"
}
]
}
],
"pagination": {
"records": "PAGINATION_RECORDS",
"limit": "PAGINATION_LIMIT",
"offset": "PAGINATION_OFFSET",
"previous_page": "PREVIOUS_PAGE",
"next_page": "NEXT_PAGE"
}
}
Getting Specific Purchase Refund Details
Function: purchase_refund_details()
Purpose
This function retrieves detailed information about a specific purchase refund by its unique identifier (ID). It is crucial for gaining insights into the refund's status, amounts, and any related metadata, enabling businesses to validate the refund process and maintain accurate financial records.
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
| purchase_refund_id |
String |
The unique identifier of the purchase refund. |
Use Case
Use this function when you need detailed information about a particular purchase refund for instance, to confirm the refund amount, verify its current status, or perform an audit. It ensures traceability and accurate financial management by providing specific data points related to the refund transaction.
def purchase_refund_details():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.purchase_refunds.details(id="REFUND_ID")
print("Response:", response)
return response
except ABException as ab:
print("Error:", ab)
print("Error Details:", ab.get_errors())
print("Raw Response:", ab.raw_response)
public function purchaseRefundDetails()
{
$id = "REFUND_ID";
try {
$response = $this->purchaseRefundService->readDetails($id, 'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
A response object providing the details of the specified purchase refund, including its status, amount, currency, and timestamps. Ensure the refund ID used is valid and that the requesting user or system has the appropriate permissions to access refund details.
PurchaseRefundsDetailsDTO(
purchaseRefund=PurchaseRefundDTO(
status='STATUS',
id='PURCHASE_REFUND_ID',
date='DATE',
alternateDate='ALTERNATE_DATE',
amount='AMOUNT',
reference='REFERENCE',
note='NOTE',
paymentMethod='PAYMENT_METHOD',
paymentProcessor='PAYMENT_PROCESSOR',
creditNoteId='CREDIT_NOTE_ID',
createdBy='CREATED_BY',
createdOn='CREATED_ON',
lastUpdatedBy='LAST_UPDATED_BY',
lastUpdatedOn='LAST_UPDATED_ON',
uuid='UUID',
version='VERSION',
customAttributes=[
{
'name': 'CUSTOM_ATTRIBUTE_NAME_1',
'value': 'CUSTOM_ATTRIBUTE_VALUE_1'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_2',
'value': 'CUSTOM_ATTRIBUTE_VALUE_2'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_3',
'value': 'CUSTOM_ATTRIBUTE_VALUE_3'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_4',
'value': 'CUSTOM_ATTRIBUTE_VALUE_4'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_5',
'value': 'CUSTOM_ATTRIBUTE_VALUE_5'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_6',
'value': 'CUSTOM_ATTRIBUTE_VALUE_6'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_7',
'value': 'CUSTOM_ATTRIBUTE_VALUE_7'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_8',
'value': 'CUSTOM_ATTRIBUTE_VALUE_8'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_9',
'value': 'CUSTOM_ATTRIBUTE_VALUE_9'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_10',
'value': 'CUSTOM_ATTRIBUTE_VALUE_10'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_11',
'value': 'CUSTOM_ATTRIBUTE_VALUE_11'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_12',
'value': 'CUSTOM_ATTRIBUTE_VALUE_12'
},
{
'name': 'CUSTOM_ATTRIBUTE_NAME_13',
'value': 'CUSTOM_ATTRIBUTE_VALUE_13'
}
]
)
)
{
"purchase_refund": {
"status": "STATUS",
"id": "PURCHASE_REFUND_ID",
"date": "DATE",
"alternate_date": "ALTERNATE_DATE",
"amount": "AMOUNT",
"reference": "REFERENCE",
"note": "NOTE",
"payment_method": "PAYMENT_METHOD",
"payment_processor": "PAYMENT_PROCESSOR",
"credit_note_id": "CREDIT_NOTE_ID",
"created_by": "CREATED_BY",
"created_on": "CREATED_ON",
"last_updated_by": "LAST_UPDATED_BY",
"last_updated_on": "LAST_UPDATED_ON",
"uuid": "UUID",
"version": "VERSION",
"custom_attributes": [
{
"name": "CUSTOM_ATTRIBUTE_NAME_1",
"value": "CUSTOM_ATTRIBUTE_VALUE_1"
}
]
}
Getting Purchase Refund List for an Specific Account
Function: purchase_refund_list_account()
Purpose
This function retrieves the purchase refund details associated with a specific account using the account's unique identifier (ID). It provides insights into the refunds tied to an account, including refund amounts, statuses, and related purchase information, enabling accurate financial tracking and account management.
Parameters
| Parameter | Type | Description |
|---|---|---|
| account_id | String | The unique identifier of the account for which purchase refunds need to be retrieved. |
Use Case
Use this function when you need to fetch all refund details linked to a specific account. This is particularly useful for account audits, tracking refunds issued to customers, or reconciling account-level refund transactions with financial records.
def purchase_refund_list_account():
SDKConfig.PRINT_REQUEST_DATA = False
SDKConfig.PRINT_RAW_RESPONSE = False
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
try:
response = exsited_sdk.purchase_refunds.account_details(id="ACCOUNT_ID")
print("Response:", response)
return response
except ABException as ab:
print("Error:", ab)
print("Error Details:", ab.get_errors())
print("Raw Response:", ab.raw_response)
public function purchaseRefundListAccount()
{
$accountId = "ACCOUNT_ID";
try {
$response = $this->purchaseRefundService->readAccountPurchaseRefunds($accountId, 'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
A response object containing the refund details for the specified account, including refund IDs, amounts, statuses, and purchase references.
PurchaseRefundsAccountDetailsDTO(
account=PurchaseRefundsListDTO(
purchaseRefunds=[
PurchaseRefundDTO(
status='STATUS',
id='PURCHASE_REFUND_ID',
date='DATE',
alternateDate='ALTERNATE_DATE',
amount='AMOUNT',
reference='REFERENCE',
note='NOTE',
paymentMethod='PAYMENT_METHOD',
paymentProcessor='PAYMENT_PROCESSOR',
creditNoteId='CREDIT_NOTE_ID',
createdBy='CREATED_BY',
createdOn='CREATED_ON',
lastUpdatedBy='LAST_UPDATED_BY',
lastUpdatedOn='LAST_UPDATED_ON',
uuid='UUID',
version='VERSION',
customAttributes=[
{
'name': 'ATTRIBUTE_NAME_1',
'value': 'ATTRIBUTE_VALUE_1'
},
{
'name': 'ATTRIBUTE_NAME_2',
'value': 'ATTRIBUTE_VALUE_2'
},
{
'name': 'ATTRIBUTE_NAME_3',
'value': 'ATTRIBUTE_VALUE_3'
},
{
'name': 'ATTRIBUTE_NAME_4',
'value': 'ATTRIBUTE_VALUE_4'
},
{
'name': 'ATTRIBUTE_NAME_5',
'value': 'ATTRIBUTE_VALUE_5'
},
{
'name': 'ATTRIBUTE_NAME_6',
'value': 'ATTRIBUTE_VALUE_6'
},
{
'name': 'ATTRIBUTE_NAME_7',
'value': 'ATTRIBUTE_VALUE_7'
},
{
'name': 'ATTRIBUTE_NAME_8',
'value': 'ATTRIBUTE_VALUE_8'
},
{
'name': 'ATTRIBUTE_NAME_9',
'value': 'ATTRIBUTE_VALUE_9'
},
{
'name': 'ATTRIBUTE_NAME_10',
'value': 'ATTRIBUTE_VALUE_10'
},
{
'name': 'ATTRIBUTE_NAME_11',
'value': 'ATTRIBUTE_VALUE_11'
},
{
'name': 'ATTRIBUTE_NAME_12',
'value': 'ATTRIBUTE_VALUE_12'
},
{
'name': 'ATTRIBUTE_NAME_13',
'value': 'ATTRIBUTE_VALUE_13'
},
{
'name': 'ATTRIBUTE_NAME_14',
'value': 'ATTRIBUTE_VALUE_14'
}
]
)
],
pagination=PaginationDTO(
records='TOTAL_RECORDS',
limit='LIMIT',
offset='OFFSET',
previousPage='PREVIOUS_PAGE',
nextPage='NEXT_PAGE'
)
)
)
{
"account": {
"purchase_refunds": [
{
"status": "STATUS",
"id": "PURCHASE_REFUND_ID",
"date": "DATE",
"alternate_date": "ALTERNATE_DATE",
"amount": "AMOUNT",
"reference": "REFERENCE",
"note": "NOTE",
"payment_method": "PAYMENT_METHOD",
"payment_processor": "PAYMENT_PROCESSOR",
"credit_note_id": "CREDIT_NOTE_ID",
"created_by": "CREATED_BY",
"created_on": "CREATED_ON",
"last_updated_by": "LAST_UPDATED_BY",
"last_updated_on": "LAST_UPDATED_ON",
"uuid": "UUID",
"version": "VERSION",
"custom_attributes": [
{
"name": "CUSTOM_ATTRIBUTE_NAME",
"value": "CUSTOM_ATTRIBUTE_VALUE"
}
]
}
],
"pagination": {
"records": "RECORDS",
"limit": "LIMIT",
"offset": "OFFSET",
"previous_page": "PREVIOUS_PAGE",
"next_page": "NEXT_PAGE"
}
},
Deleting Purchase Refund
Function: purchase_refund_delete()
Purpose
This API deletes an existing purchase refund record from the system. A purchase refund represents a transaction where funds are returned to the buyer for previously purchased goods or services. Using this endpoint, users can permanently remove a refund record that is no longer required or was created in error. Once deleted, the purchase refund will no longer appear in listings or reports, ensuring that only valid refund transactions remain in the system. This helps maintain accurate financial data and reduces clutter in refund records.
Parameters
| parameter | type | description |
|---|---|---|
| purchase_refund_id | string | Unique identifier of the purchase refund record to be deleted. |
Use Case
This API is typically used when a purchase refund was created incorrectly, duplicated, or needs to be removed from the system after a reconciliation or audit process. For example, a finance manager may identify an erroneous refund entry during an accounting review and use this API to delete it. The API ensures that no refund data remains once deleted, providing a clean and accurate view of financial transactions. The following code snippets demonstrate how to delete a purchase refund record using both Python and PHP SDKs.
def purchase_refund_delete():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.purchase_refunds.delete(id='{{purchase_refund_id_placeholder}}')
print(response)
return response
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function deletePurchaseRefund()
{
$id = "{{purchase_refund_id}}";
try {
$response = $this->purchaseRefundService->delete($id, 'v3');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
A successful deletion returns an HTTP 204 No Content status code, indicating that the purchase refund has been successfully deleted and there is no response body. The SDK wraps this into a simple response object showing success status and code for confirmation. This ensures that the deletion operation completed successfully without returning additional data. Users can use the response to verify that the refund record has been removed from the system.
{
"success": true,
"status_code": 204
}
{
"success": true,
"status_code": 204
}