auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
this.lineitems = JSON.parse(`[
{
"item_id": "2392161000000075001"
}
]`);
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 to whom the sales order has to be created.
async
(params, auths) => {
}
//See the API docs: https://www.zoho.com/books/api/v3/#Sales-Order_Create_a_sales_order
if (!params.organization_id || !params.customer_id || !params.line_items) {
throw new Error("Must provide organization_id, customer_id, and line_items parameters.");
}
return await require("@pipedreamhq/platform").axios(this, {
method: "post",
url: `https://books.${auths.zoho_books.base_api_uri}/api/v3/salesorders?organization_id=${params.organization_id}`,
headers: {
Authorization: `Zoho-oauthtoken ${auths.zoho_books.oauth_access_token}`,
},
data:{
customer_id: params.customer_id,
contact_persons: params.contact_persons,
date: params.date,
shipment_date: params.shipment_date,
custom_fields: params.custom_fields,
place_of_supply: params.place_of_supply,
salesperson_id: params.salesperson_id,
merchant_id: params.merchant_id,
gst_treatment: params.gst_treatment,
gst_no: params.gst_no,
is_inclusive_tax: params.is_inclusive_tax,
line_items: params.line_items,
notes: params.notes,
terms: params.terms,
billing_address_id: params.billing_address_id,
shipping_address_id: params.shipping_address_id,
crm_owner_id: params.crm_owner_id,
crm_custom_reference_id: params.crm_custom_reference_id,
vat_treatment: params.vat_treatment,
tax_treatment: params.tax_treatment,
salesorder_number: params.salesorder_number,
reference_number: params.reference_number,
is_update_customer: params.is_update_customer,
discount: params.discount,
exchange_rate: params.exchange_rate,
salesperson_name: params.salesperson_name,
notes_default: params.notes_default,
terms_default: params.terms_default,
tax_id: params.tax_id,
tax_authority_id: params.tax_authority_id,
tax_exemption_id: params.tax_exemption_id,
tax_authority_name: params.tax_authority_name,
tax_exemption_code: params.tax_exemption_code,
avatax_exempt_no: params.avatax_exempt_no,
avatax_use_code: params.avatax_use_code,
shipping_charge: params.shipping_charge,
adjustment: params.adjustment,
delivery_method: params.delivery_method,
estimate_id: params.estimate_id,
is_discount_before_tax: params.is_discount_before_tax,
discount_type: params.discount_type,
adjustment_description: params.adjustment_description,
pricebook_id: params.pricebook_id,
template_id: params.template_id,
documents: params.documents,
zcrm_potential_id: params.zcrm_potential_id,
zcrm_potential_name: params.zcrm_potential_name
},
params: {
ignore_auto_number_generation: params.ignore_auto_number_generation,
can_send_in_mail: params.can_send_in_mail,
totalFiles: params.totalFiles,
doc: params.doc
}
})