Create or Update a Payment Term

To create a new payment term or update an existing one in the AppZen System. This returns the uuid, the unique identifier, for this payment term.

If there already exists a payment term with the given id body parameter, then the existing payment term will be updated. The status in the response shows as UPDATED
. For a newly created payment term, the status shows as CREATED.


Request URI 

POST https://api.appzen.com/dictionary-data-services/payment-term


Header Parameters

Name Type Description Required
x-api-key String The x-api-key provided to authorize the request. Yes
customer-id String The Customer ID provided to authorize the request. Yes
customer-key String  The Customer Key provided to authorize the request. Yes


Body Parameters

Name Type Description Required

name

String

The name of the payment term in your System.
Example: 'Net45'

Yes

id

String

The internal unique id from your System.
Example: Net45 payment term is uniquely identified by your System as 'N45_1233'.

Yes

active

Boolean

This shows if the payment term is active or not in your System.

Example: True or False.

 No

code

String

It refers to the AppZen Code. This code can be: NONE_PAYMENT_TERM_CODE, NET, EOM, FOM, PIA, CWO, DOR

If these codes are not valid in your case, you can use the 'id' field above instead.

No

date

String

The creation date of the payment term. The Date should be in the UTC format.
Example:2020-11-01T11:01:00Z

No

discounts

N/A

This is the root element to hold discount fields.

N/A

discount_days

Integer

The number of days in which the payment will actually qualify for a discount.
Example: For 2%Net10, it will have a value '10' in this field.

Yes*

discount_percent

Integer

It shows the percent value of the discount.
Example: 2% Net10 payment term will have a value of '2' in this field.

Yes*

discount_amount

Integer

It tells if this payment qualifies for a discount by the amount.

Yes*

num_days

Integer

The number of days for the term.
Example: Net45 will have 45 as the value of this field.

No

num_grace_days

Integer

The total number of grace days available for the payment.
Example: 0

No

custom_json

N/A

For storing any custom values needed by your system.

No

*One of the three between discount_days, discount_percent, discount_amount must be specified for discount to be picked up. We are not throwing exception in our API processing yet, if neither is specified.

Sample Request

curl -X POST "https://api.appzen.com/dictionary-data-services/payment-term" 
-H "accept: application/json" 
-H "x-api-key: R7wsFxxxx" 
-H "customer-id: 1004xxxx" 
-H "customer-key: 15d1xxxx"
-H "Content-Type: application/json" 
-d 
"{
  "name": "NET 30",
  "id": "8900012",
  "active": true,
  "code": "NET",
  "date": "2020-11-01T11:01:00Z",
  "discounts": [
    {
      "discount_days": 0,
      "discount_percent": 0,
      "discount_amount": 0
    }
  ],
  "num_days": 30,
  "num_grace_days": 0,
  "custom_json": {}
}"


Sample Response

Success

{
    "uuid": "5fc03087-d265-11e7-b8c6-83e29cd24f4c",
    "status": "UPDATED"
}  

Failure

The request fails if you enter an invalid URL.

{
  "timestamp": "2023-01-15T16:12:45.977+0000",
  "status": 404,
  "error": "Not Found",
  "message": "Error code : 17e3338d - The resource you specified cannot be not found"
}   


Response Code

Response Code Description
200 The request is successful.
201 The request is successful.

400

The request failed due to a malformed request syntax. Check the requested URL, including the parameters.

401

The request failed due to an authorization issue. For example, the Customer Key could be missing or invalid.

403

The request failed due to a permission issue. The x-api key may not have permission to perform the request. 

404

The request failed as the resource is not found. Check the requested URL.

500

The request failed due to an AppZen server issue. 


See Also

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.