auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
this.invoices = JSON.parse(`[
{
"invoice_id": "2392161000000094008",
"amount_applied": 1
}
]
`);
In Zoho Books, your business is termed as an organization. If you have multiple businesses, you simply set each of those up as an individual organization. Each organization is an independent Zoho Books Organization with it’s own organization ID, base currency, time zone, language, contacts, reports, etc.
The parameter organization_id
should be sent in with every API request to identify the organization.
The organization_id
can be obtained from the GET /organizations
API’s JSON response. Alternatively, it can be obtained from the Manage Organizations page in the admin console.
ID of the customer payment to update.
Customer ID of the customer involved in the payment.
Mode through which payment is made. This can be check
, cash
, creditcard
, banktransfer
, bankremittance
, autotransaction
or others
. Max-length [100]
List of invoices associated with the payment. Each invoice object contains invoice_id
, invoice_number
, date
, invoice_amount
, amount_applied
and balance_amount
.
Amount paid in the respective payment.
Date on which payment is made. Format [yyyy-mm-dd]
async
(params, auths) => {
}
//See the API docs: https://www.zoho.com/books/api/v3/#Customer-Payments_Update_a_payment
if (!params.organization_id || !params.payment_id || !params.customer_id || !params.payment_mode || !params.invoices || !params.amount || !params.date) {
throw new Error("Must provide organization_id, payment_id, customer_id, payment_mode, invoices, amount, and date parameters.");
}
return await require("@pipedreamhq/platform").axios(this, {
method: "put",
url: `https://books.${auths.zoho_books.base_api_uri}/api/v3/customerpayments/${params.payment_id}?organization_id=${params.organization_id}`,
headers: {
Authorization: `Zoho-oauthtoken ${auths.zoho_books.oauth_access_token}`
},
data: {
customer_id: params.customer_id,
payment_mode: params.payment_mode,
amount: params.amount,
date: params.date,
reference_number: params.reference_number,
description: params.description,
invoices: params.invoices,
exchange_rate: params.exchange_rate,
bank_charges: params.bank_charges,
custom_fields: params.custom_fields,
invoice_id: params.invoice_id,
amount_applied: params.amount_applied,
tax_amount_withheld: params.tax_amount_withheld,
account_id: params.account_id
}
});