Payments Received
The Payments Received module provides access to contextual information about the current customer payment when a widget is rendered within supported payment-related pages. Widgets can retrieve payment identifiers, linked invoice references, and associated customer details for use in validations, conditional logic, and UI extensions.
- Methods
- Events
Methods
Get Customerpayment Details
Retrieves data related to the current context. This method allows your widget to fetch record details, field values, or metadata required for rendering or processing logic.
- Fetch record information
- Read field values
- Access contextual module data
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.get('customerpayment').then(function (data) {
//response Handling
}).catch(function (err) {
//error Handling
});
});
}
| Property | Request |
|---|---|
| payment_id | customerpayment.payment_id |
| payment_number | customerpayment.payment_number |
| payment_link_id | customerpayment.payment_link_id |
| created_time | customerpayment.created_time |
| updated_time | customerpayment.updated_time |
| payment_number_prefix | customerpayment.payment_number_prefix |
| payment_number_suffix | customerpayment.payment_number_suffix |
| documents | customerpayment.documents |
| customer_id | customerpayment.customer_id |
| customer_name | customerpayment.customer_name |
Show More Supported Input Keys
| Property | Request |
|---|---|
| payment_mode | customerpayment.payment_mode |
| date | customerpayment.date |
| date_formatted | customerpayment.date_formatted |
| offline_created_date_with_time | customerpayment.offline_created_date_with_time |
| offline_created_date_with_time_formatted | customerpayment.offline_created_date_with_time_formatted |
| is_pre_gst | customerpayment.is_pre_gst |
| account_id | customerpayment.account_id |
| account_name | customerpayment.account_name |
| account_type | customerpayment.account_type |
| account_type_formatted | customerpayment.account_type_formatted |
| customer_advance_account_id | customerpayment.customer_advance_account_id |
| customer_advance_account_name | customerpayment.customer_advance_account_name |
| currency_id | customerpayment.currency_id |
| currency_symbol | customerpayment.currency_symbol |
| currency_code | customerpayment.currency_code |
| exchange_rate | customerpayment.exchange_rate |
| exchange_rate_formatted | customerpayment.exchange_rate_formatted |
| amount | customerpayment.amount |
| amount_formatted | customerpayment.amount_formatted |
| unused_amount | customerpayment.unused_amount |
| unused_amount_formatted | customerpayment.unused_amount_formatted |
| bank_charges | customerpayment.bank_charges |
| bank_charges_formatted | customerpayment.bank_charges_formatted |
| tax_account_id | customerpayment.tax_account_id |
| is_client_review_settings_enabled | customerpayment.is_client_review_settings_enabled |
| place_of_supply | customerpayment.place_of_supply |
| gst_return_details | customerpayment.gst_return_details |
| gst_treatment | customerpayment.gst_treatment |
| tax_treatment | customerpayment.tax_treatment |
| gst_no | customerpayment.gst_no |
| tax_account_name | customerpayment.tax_account_name |
| tax_amount_withheld | customerpayment.tax_amount_withheld |
| tax_amount_withheld_formatted | customerpayment.tax_amount_withheld_formatted |
| discount_amount | customerpayment.discount_amount |
| discount_amount_formatted | customerpayment.discount_amount_formatted |
| description | customerpayment.description |
| product_description | customerpayment.product_description |
| reference_number | customerpayment.reference_number |
| online_transaction_id | customerpayment.online_transaction_id |
| payment_gateway | customerpayment.payment_gateway |
| payment_gateway_formatted | customerpayment.payment_gateway_formatted |
| settlement_status | customerpayment.settlement_status |
| settlement_status_formatted | customerpayment.settlement_status_formatted |
| tax_id | customerpayment.tax_id |
| tax_name | customerpayment.tax_name |
| tax_percentage | customerpayment.tax_percentage |
| tax_type | customerpayment.tax_type |
| is_advance_payment | customerpayment.is_advance_payment |
| tds_type | customerpayment.tds_type |
| tds_tax_id | customerpayment.tds_tax_id |
| branch_id | customerpayment.branch_id |
| branch_name | customerpayment.branch_name |
| invoices | customerpayment.invoices |
| payment_refunds | customerpayment.payment_refunds |
| comments | customerpayment.comments |
| template_id | customerpayment.template_id |
| template_name | customerpayment.template_name |
| page_width | customerpayment.page_width |
| page_height | customerpayment.page_height |
| orientation | customerpayment.orientation |
| template_type | customerpayment.template_type |
| template_type_formatted | customerpayment.template_type_formatted |
| attachment_name | customerpayment.attachment_name |
| can_send_in_mail | customerpayment.can_send_in_mail |
| is_payment_details_required | customerpayment.is_payment_details_required |
| custom_fields | customerpayment.custom_fields |
| custom_field_hash | customerpayment.custom_field_hash |
| imported_transactions | customerpayment.imported_transactions |
| einvoice_details | customerpayment.einvoice_details |
Set Customerpayment Details
Updates or sets data within the current context. This method allows your widget to modify field values, update state, or pass data back to the host application.
- Update field values
- Set widget or module state
- Pass data to the parent application
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.set('customerpayment.name', <value>).then(function (data) {
//response Handling
}).catch(function (err) {
//error Handling
});
});
}
| Property | Request |
|---|---|
| payment_id | customerpayment.payment_id |
| payment_number | customerpayment.payment_number |
| payment_link_id | customerpayment.payment_link_id |
| created_time | customerpayment.created_time |
| updated_time | customerpayment.updated_time |
| payment_number_prefix | customerpayment.payment_number_prefix |
| payment_number_suffix | customerpayment.payment_number_suffix |
| documents | customerpayment.documents |
| customer_id | customerpayment.customer_id |
| customer_name | customerpayment.customer_name |
Show More Supported Input Keys
| Property | Request |
|---|---|
| payment_mode | customerpayment.payment_mode |
| date | customerpayment.date |
| date_formatted | customerpayment.date_formatted |
| offline_created_date_with_time | customerpayment.offline_created_date_with_time |
| offline_created_date_with_time_formatted | customerpayment.offline_created_date_with_time_formatted |
| is_pre_gst | customerpayment.is_pre_gst |
| account_id | customerpayment.account_id |
| account_name | customerpayment.account_name |
| account_type | customerpayment.account_type |
| account_type_formatted | customerpayment.account_type_formatted |
| customer_advance_account_id | customerpayment.customer_advance_account_id |
| customer_advance_account_name | customerpayment.customer_advance_account_name |
| currency_id | customerpayment.currency_id |
| currency_symbol | customerpayment.currency_symbol |
| currency_code | customerpayment.currency_code |
| exchange_rate | customerpayment.exchange_rate |
| exchange_rate_formatted | customerpayment.exchange_rate_formatted |
| amount | customerpayment.amount |
| amount_formatted | customerpayment.amount_formatted |
| unused_amount | customerpayment.unused_amount |
| unused_amount_formatted | customerpayment.unused_amount_formatted |
| bank_charges | customerpayment.bank_charges |
| bank_charges_formatted | customerpayment.bank_charges_formatted |
| tax_account_id | customerpayment.tax_account_id |
| is_client_review_settings_enabled | customerpayment.is_client_review_settings_enabled |
| place_of_supply | customerpayment.place_of_supply |
| gst_return_details | customerpayment.gst_return_details |
| gst_treatment | customerpayment.gst_treatment |
| tax_treatment | customerpayment.tax_treatment |
| gst_no | customerpayment.gst_no |
| tax_account_name | customerpayment.tax_account_name |
| tax_amount_withheld | customerpayment.tax_amount_withheld |
| tax_amount_withheld_formatted | customerpayment.tax_amount_withheld_formatted |
| discount_amount | customerpayment.discount_amount |
| discount_amount_formatted | customerpayment.discount_amount_formatted |
| description | customerpayment.description |
| product_description | customerpayment.product_description |
| reference_number | customerpayment.reference_number |
| online_transaction_id | customerpayment.online_transaction_id |
| payment_gateway | customerpayment.payment_gateway |
| payment_gateway_formatted | customerpayment.payment_gateway_formatted |
| settlement_status | customerpayment.settlement_status |
| settlement_status_formatted | customerpayment.settlement_status_formatted |
| tax_id | customerpayment.tax_id |
| tax_name | customerpayment.tax_name |
| tax_percentage | customerpayment.tax_percentage |
| tax_type | customerpayment.tax_type |
| is_advance_payment | customerpayment.is_advance_payment |
| tds_type | customerpayment.tds_type |
| tds_tax_id | customerpayment.tds_tax_id |
| branch_id | customerpayment.branch_id |
| branch_name | customerpayment.branch_name |
| invoices | customerpayment.invoices |
| payment_refunds | customerpayment.payment_refunds |
| comments | customerpayment.comments |
| template_id | customerpayment.template_id |
| template_name | customerpayment.template_name |
| page_width | customerpayment.page_width |
| page_height | customerpayment.page_height |
| orientation | customerpayment.orientation |
| template_type | customerpayment.template_type |
| template_type_formatted | customerpayment.template_type_formatted |
| attachment_name | customerpayment.attachment_name |
| can_send_in_mail | customerpayment.can_send_in_mail |
| is_payment_details_required | customerpayment.is_payment_details_required |
| custom_fields | customerpayment.custom_fields |
| custom_field_hash | customerpayment.custom_field_hash |
| imported_transactions | customerpayment.imported_transactions |
| einvoice_details | customerpayment.einvoice_details |
Set Customerpayment customfields
Specifically designed to update custom field values within the current context. This method allows your widget to target and modify custom fields without affecting standard fields, ensuring precise data management.
- Update custom field values
- Manage user-defined data points
- Ensure targeted updates to specific fields
window.onload = function () {
ZFAPPS.extension.init().then(function(App) {
ZFAPPS.set('customerpayment.<custom_field_api_name>',<value>).then(function (data) {
//response Handling
}).catch(function (err) {
//error Handling
});
});
}
Events
CUSTOMERPAYMENT_SAVED
This event is triggered after the customerpayment record is successfully saved in your organization. You can use this event to perform post-save actions such as syncing data, triggering notifications, or updating external systems.
ZFAPPS.extension.init().then(function(App) {
App.instance.on('ON_CUSTOMERPAYMENT_SAVED').then(function(data) {
var recordId = data && data.record_id;
ZFAPPS.invoke('SHOW_NOTIFICATION', {
type: 'success',
message: 'Record saved successfully. Record ID: ' + recordId
});
console.log('Saved record ID:', recordId);
}).catch(function(err) {
console.error('Error:', err);
});
});
ON_CUSTOMERPAYMENT_CHANGE
This event is triggered whenever a supported field value is changed within the customerpayment form. The event is fired based on the configured supported keys, allowing your widget to react dynamically to user input.
ZFAPPS.extension.init().then(function(App) {
App.instance.on('ON_CUSTOMERPAYMENT_CHANGE').then(async function() {
var record = await ZFAPPS.get('customerpayment');
record = record?.['custom_fields'];
if (record.cf_special_flag) {
ZFAPPS.invoke('SHOW_NOTIFICATION', {
type: 'success',
message: 'Special option selected. Please review additional details before saving.'
});
}
}).catch(function(err) {
console.error('Error:', err);
});
});
ON_CUSTOMERPAYMENT_PRE_SAVE
This event is triggered just before the customerpayment record is saved in your organization. It allows your widget to validate data, modify field values, or perform custom checks before the save operation is completed.
ZFAPPS.extension.init().then(function(App) {
App.instance.on('ON_CUSTOMERPAYMENT_PRE_SAVE').then(async function() {
var record = await ZFAPPS.get('customerpayment');
record = record?.['custom_fields'];
if (record.cf_approval_required && !record.cf_approval_notes) {
await ZFAPPS.invoke('SHOW_NOTIFICATION', {
type: 'error',
message: 'Approval notes are required when Approval Required is selected.'
});
return {
prevent_save: true
};
}
}).catch(function(err) {
console.error('Error:', err);
});
});
ON_CUSTOMERPAYMENT_PREVIEW
This event is triggered when the preview of a customerpayment record is opened in your organization. It allows your widget to access record data and render contextual information during the preview phase.
ZFAPPS.extension.init().then(function(App) {
App.instance.on('ON_CUSTOMERPAYMENT_PREVIEW').then(async function() {
var record = await ZFAPPS.get('customerpayment');
record = record?.['custom_fields'];
if (record.cf_priority_level === 'High') {
ZFAPPS.invoke('SHOW_NOTIFICATION', {
type: 'error',
message: 'This record is marked as High Priority.'
});
}
}).catch(function(err) {
console.error('Error:', err);
});
});