Skip to main content
Aria Knowledge Central

create_payment_terms_m Sample Call and Response

This example shows a call to create_payment_terms_m that creates a new set of payment terms defining when invoices become past due and how prompt-payment discounts apply. It is based on methods_m_r73.yml, Admin Tools API.

This example covers the core due-date and discount configuration for standard net payment terms; it does not cover the EAN/GLN location-based terms variant, surcharge mapping, or the payment reminder template array, since those represent a different, more specialized configuration path.

Sample call

{
  "rest_call": "create_payment_terms_m",
  "output_format": "json",
  "client_no": 10023,
  "auth_key": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
  "pmt_terms_name": "Net 30 Standard",
  "client_pmt_term_id": "NET30-STD",
  "pmt_terms_description": "Standard net thirty day payment terms",
  "days_until_due": 30,
  "days_until_due_method": "Invoice",
  "discount_percent": 2,
  "discount_period": 10,
  "pmt_terms_type": 0,
  "auto_bill_orders": true
}

The fields rest_call and output_format are REST-layer additions that sit outside the method’s own documented arguments in the yml; you supply rest_call with the method name and output_format with json to request a JSON response. The required fields are pmt_terms_name, pmt_terms_description, and days_until_due, along with the standard client_no and auth_key credentials. The days_until_due_method value of "Invoice" indicates that the thirty day due period counts from the invoice date rather than from the end of the current month. The discount_percent value of 2 offers a two percent prompt-payment discount, and because it is populated, discount_period is also populated at 10, meaning payment must arrive within ten days of invoicing to qualify; the yml requires that discount_period stay null whenever discount_percent is null, and vice versa. The pmt_terms_type value of 0 selects Net Terms rather than the EAN/GLN variant (value 1), and auto_bill_orders is set to true so that orders under this payment term are billed immediately upon generation. This example omits the optional bill_lag_days, surcharge_applicable, surcharge_no, pmt_reminder, pmt_reminder_active_accts_only, functional_acct_group_no, and pmt_reminder_row fields.

Sample response

{
  "error_code": 0,
  "error_msg": "OK",
  "payment_terms_no": 6104
}

An error_code value of zero, together with an error_msg value of "OK", indicates that Aria created the payment terms successfully. The payment_terms_no value is the Aria-assigned unique identifier for the newly created payment terms. This example does not attempt to show a failure response, such as one where discount_period was supplied without discount_percent.

TOP
  • Was this article helpful?