Create or Update a Chart of Account Segment

To create a new chart of account segment or update an existing one in the AppZen System. This returns the uuid, the AppZen generated unique identifier, for this chart of account segment.

If there already exists a chart of account segment, with the given combination of  segment_code and segment_type body parameters, then the existing chart of account segment will be updated. The status in the response shows as UPDATED. For a newly created chart of account segment, the status shows as CREATED.

Request URI 

POST https://api.appzen.com/dictionary-data-services/chart-of-accounts


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

appzen_segment_type

String

It refers to the AppZen segment type. This can be LEGAL_ENTITY_SEGMENT, COMPANY_SEGMENT, ACCOUNT_SEGMENT, DEPARTMENT_SEGMENT, COST_CENTER_SEGMENT, VENDOR_SEGMENT, LOCATION_SEGMENT, USER_SEGMENT, CUSTOMER_SEGMENT, PROJECT_SEGMENT, SPEND_CATEGORY_SEGMENT, REGION_SEGMENT, INTERCOMPANY_SEGMENT
If these types are not valid in your case, you can use 'OTHER_SEGMENT ' instead.
Multiple OTHER_SEGMENT mappings may be specified if needed.

Yes

segment_type

String

It is the name of the accounting segment in the customer’s system. (company/Dept/Account) to determine the segment type in AppZen.

Yes

segment_name

String

This is the name of the segment.
Example: USA 

Yes

segment_code

String

This is the code value of the segment in your System.
Example:2099

Yes

segment_lookup_names

String

List of lookup names

No

custom_json

String

For storing any custom key-value pairs needed by your system.

No

active

Boolean

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

Default:True

No

valid_start_date

String

The valid start date.
Date should be in UTC format.
Example:2020-11-01T11:01:00Z

No

valid_end_date

String

The valid end date.
Date should be in UTC format
Example:2020-11-01T11:01:00Z

No

 

Sample Request

curl -X POST "https://api.appzen.com/dictionary-data-services/chart-of-accounts" 
      -H "accept: application/json" 
      -H "x-api-key: R7wsFxxxx" 
      -H "customer-id: 1004xxxx" 
      -H "customer-key: 15d1xxxx"
      -d "
         {
  "appzen_segment_type": "LOCATION_SEGMENT",
  "segment_type": "Location",
  "segment_name": "San Jose",
  "segment_code": "SanJose",
  "parent_segment_type": "Location",
  "parent_segment_name": "United States",
  "parent_segment_code": "USA",
  "segment_lookup_names": [
    "ca_locations",
    "hr_locations"
  ],
  "custom_json": {
    "custom_key1": "any-value1",
    "custom_key2": "any-value2"
  },
  "active": true,
  "valid_start_date": "2020-11-01T11:01:00Z",
  "valid_end_date": "2020-11-01T11:01:00Z"
}"


Sample Response

Success

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

Failure

The request fails if you enter an invalid URL.

{
  "timestamp": "2019-01-17T16: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.