SaveOrganizationEntities (POST)

Overview

This POST API can be used to capture new additions in organization details from ERP into GEP SMART to be used as reference in P2P transactions.

 

URL Format: https://<Instance>/SmartInterfaceAPI/api/Organization/OrgEntities

Request
[
   {
      "entityType": "string",
      "name": "string",
      "code": "string",
      "lobEntityCode": "string",
      "lobEntityType": "string",
      "parentEntityType": "string",
      "parentEntityCode": "string",
      "isActive": true,
      "parentEntityCodes": [
         "string"
      ],
      "isUpdateParentEntities": true,
      "isMapToAllChildEntity": true,
      "isMapToAllParentEntity": true,
      "address": {
         "addressLine1": "string",
         "addressLine2": "string",
         "addressLine3": "string",
         "city": "string",
         "stateCode": "string",
         "stateOther": "string",
         "countryCode": "string",
         "zipCode": "string",
         "faxNo": "string",
         "phoneNo": "string",
         "phoneOther": "string",
         "phoneExtension": "string",
         "phoneOtherExtension": "string",
         "county": "string",
         "poBoxNumber": "string"
      },
      "parentEntityCodeDelta": [
         {
            "entityCode": "string",
            "isActive": true
         }
      ]
   }
]

 

Response
{
   "data": null,
   "statusCode": "String",
   "errorDetails": [
      {
         "key": "string",
         "errors": [
            {
               "errorCode": "string",
               "errorDescription": "string"
            }
         ]
      }
   ],
   "successDetails": [
      {
         "key": "string"
      }
   ]
}

 

Examples

Success Scenario - Request

Below request only contains mandatory attributes:

[
   {
      "entityType": "Cost Center",
      "name": "Test-1",
      "code": "Test-1",
      "lobEntityCode": "KEU-SAP",
      "lobEntityType": "Source System",
      "parentEntityType": "Company Code",
      "isActive": true,
      "parentEntityCodes": [
         "PIES"
      ],
      "isUpdateParentEntities": false,
      "Address": {
         "AddressLine1": "REMARKABLES PARK",
         "City": "QUEENSTOWN",
         "CountryCode": "NE",
         "FaxNo": "344230666",
         "PhoneNo": "34423045",
         "StateOther": "ZA",
         "ZipCode": "00000"
      }
   }
]

 

Success Scenario – Response

{
  "data": null,
  "statusCode": "200",
  "errorDetails": [],
  "successDetails": [
    {
      "key": "Test-1|Test-1"
    }
  ]
}

 

Error Scenario 1 - Request

Below request contains a missing value of the mandatory attribute - EntityType:

[
  {
    "name": "Test-1",
    "code": "Test-1",
    "lobEntityCode": "KEU-SAP",
    "lobEntityType": "Source System",
    "parentEntityType": "Company Code",
    "isActive": true,
    "parentEntityCodes": [
      "PIES"
    ],
    "isUpdateParentEntities": false,
    "Address": {
      "AddressLine1": "REMARKABLES PARK",
      "City": "QUEENSTOWN",
      "CountryCode": "NE",
      "FaxNo": "344230666",
      "PhoneNo": "34423045",
      "StateOther": "ZA",
      "ZipCode": "00000"
    }
  }
]

 

Error Scenario 1 – Response

{
  "data": null,
  "statusCode": "400",
  "errorDetails": [
    {
      "key": "Test-1|Test-1",
      "errors": [
        {
          "errorCode": "MandatoryField",
          "errorDescription": "EntityType is Mandatory"
        }
      ]
    }
  ],
  "successDetails": []
}

Error Scenario 2 - Request

Below request contains an invalid attribute- ParentEntityType:

[
  {
    "entityType": "Cost Center",
    "name": "Entity Name_full",
    "code": "New Testing",
    "lobEntityCode": "KEU-SAP",
    "lobEntityType": "Source System",
    "parentEntityType": "testing",
    "parentEntityCode": "This is new Code for entity",
    "isActive": true,
    "parentEntityCodes": [
      "PIES"
    ],
    "isUpdateParentEntities": true,
    "isMapToAllChildEntity": true,
    "isMapToAllParentEntity": true,
    "address": {
      "addressLine1": "37398 main street",
      "addressLine2": "string",
      "addressLine3": "string",
      "city": "Sanata Clara",
      "stateCode": "CA",
      "stateOther": "string",
      "countryCode": "US",
      "zipCode": "89900",
      "faxNo": "7680090987",
      "phoneNo": "4080090000",
      "phoneOther": "N/A",
      "phoneExtension": "1224",
      "phoneOtherExtension": "2980099997",
      "county": "US",
      "poBoxNumber": "171"
    },
    "parentEntityCodeDelta": [
      {
        "entityCode": "PIES",
        "isActive": true
      }
    ]
  }
]

 

Error Scenario 2 – Response

{
  "data": null,
  "statusCode": "400",
  "errorDetails": [
    {
      "key": "Entity Name_full|New Testing",
      "errors": [
        {
          "errorCode": "DataValidation",
          "errorDescription": "Invalid Parent Entity Type. Following Parent Entity Codes are invalid"
        }
      ]
    }
  ],
  "successDetails": []
}

 

Data Elements
 

OrganizationEntity

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.1

EntityType

Yes

String(50)

Entity Type of the entity

  • Max length is 50

  • Invalid Entity Type

  • EntityType is mandatory

1.2

Name

Yes

String(100)

Name of the entity

  • Max length is 100

  • EntityName is mandatory

1.3

Code

Yes

String(50)

Code of the entity

  • Max length is 50

  • No OrgEntity Code found

  • EntityCode is mandatory

1.4

LOBEntityCode

Yes

String

Line of Business Entity Code of the entity

  • Invalid LOB Entity Code

  • LOBEntityCode is required

1.5

LOBEntityType

Yes

String

Line of Business Entity Type of the entity

  • Invalid LOB Entity Type

  • LOBEntityType is required

1.6

ParentEntityType

Yes

String(50)

Parent Entity Type of the entity

  • Max length for ParentEntityType is 50

  • ParentEntitytype is mandatory

  • Invalid Parent Entity Type

1.7

ParentEntityCode

Yes

String

Parent Entity Code of the entity

  • Max length for ParentEntityCode is 50

  • ParentEntityCode is mandatory

  • Invalid Parent Entity Code <ParentEntityCode>.

1.8

ParentEntityCodes

No

List of String

Parent Entity Codes of the entity

 

1.9

IsActive

No

Boolean

Status of the entity if active or not

 

1.10

IsUpdateParentEntities

No

Boolean

Status of the updates of parent entity if active or not

 

1.11

IsMapToAllchildEntity

No

Boolean

   

1.12

IsMapToAllParentEntity

No

Boolean

Status of the parent entity if active or not

 

1.13

Address

No

Address object

Check Data Type Address for Details

 

1.14

ParentEntityCodeDelta

No

List of ParentEntityCodeDelta object

Check Data Type ParentEntityCodeDelta for Details

 
 

Address

S.No.

Property

Required?

Data type

Description

Validations / Exceptions

1.13.1

AddressLine1

Yes

String (500)

Address line 1 of the entity

  • AddressLine1 is mandatory

  • Max length for AddressLine1 is 500

1.13.2

City

Yes

String (50)

City of the entity

  • City is mandatory

  • Max length for City is 50

1.13.3

CountryCode

Yes

String (2)

Country code of the entity

  • CountryCode is mandatory

  • Max length for CountryCode is 2

  • Invalid Country

1.13.4

StateCode

Yes

String (10)

State code of the entity

  • StateCode is mandatory

  • Max length for StateCode is 10

  • Invalid State

1.13.5

ZipCode

Yes

String (10)

Zip code of the entity

  • ZipCode is mandatory

  • Max length for ZipCode is 10

1.13.6

AddressLine2

No

String

Address line 2 of the entity

  • Max length for AddressLine2 is 500

1.13.7

AddressLine3

No

String (100)

Address line 3 of the entity

  • Max length for AddressLine3 is 100

1.13.8

FaxNo

No

String (20)

Fax number of the entity

  • Max length for FaxNo is 20

  • Special characters and spaces are not allowed for Fax number except these +(-./ )#@&

1.13.9

PhoneExtension

No

String

Phone extension of the entity

  • Max length for Phone Extension is 10

1.13.10

PhoneNo

No

String

Phone number of the entity

  • Max length for PhoneNo is 50

  • Special characters and spaces are not allowed for phone except these +(-./ )#@&

     

1.13.11

PhoneOther

No

String (20)

Phone 2 of the entity

  • Max length for PhoneOther is 20

  • Special characters and spaces are not allowed for PhoneOther except these +(-./ )#@&

1.13.12

PhoneOtherExtension

No

String

Phone 2’s extension of the entity

  • Max length for PhoneOtherExtension is 10

1.13.13

StateOther

No

String

State name (in case of others) of the entity

  • Max length for StateOther is 50

1.13.14

PoBoxNumber

No

String

   

1.13.15

County

No

String (50)

County of the address

  • Max length for County is 50

 

ParentEntityCodeDelta

S.No.

Property

Required?

Data type

Description

Validations / Exceptions

1.14.1

EntityCode

No

String

Code of the entity

 

1.14.2

IsActive

No

Boolean

Status of the entity if active or not