Hi,
Have a React site sending POST data to a whitelisted method on my custom app, I then need to parse this information to send to various databases including Frappes.
How does Frappe deal with incoming API requests if they are not made to the default Frappe endpoints such as http://xxx.xxx.xxx/api/resource/Customer
Thanks.
Kind regards,
@frappe.whitelist()
def get_due_date(posting_date, party_type, party, company=None, bill_date=None):
"""Get due date from `Payment Terms Template`"""
due_date = None
if (bill_date or posting_date) and party:
due_date = bill_date or posting_date
template_name = get_payment_terms_template(party, party_type, company)
if template_name:
due_date = get_due_date_from_template(template_name, posting_date, bill_date).strftime("%Y-%m-%d")
else:
if party_type == "Supplier":
supplier_group = frappe.get_cached_value(party_type, party, "supplier_group")
template_name = frappe.get_cached_value("Supplier Group", supplier_group, "payment_terms")
if template_name:
due_date = get_due_date_from_template(template_name, posting_date, bill_date).strftime("%Y-%m-%d")
# If due date is calculated from bill_date, check this condition
if getdate(due_date) < getdate(posting_date):
due_date = posting_date
return due_date
So this is simple RPC method where paramns are sent and accessed by name it self