SaveContact (POST)

Overview

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

 

URL Format: https://<Instance>/SmartInterfaceAPI/api/Contact/ContactDetails
 

Request
{
"gepContactCode": 0,
"userName": "string",
"contactCode": "string",
"managerCode": [
"string"
],
"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"
},
"firstName": "string",
"lastName": "string",
"emailAddress": "string",
"authorityAmt": 0,
"isActive": true,
"isDeleted": true,
"userActivities": [{
"activityName": "NONE"
}],
"timeZone": "string",
"locationCode": "string",
"currencyCode": "string",
"UserProfileCurrencyCode": "string",
"designation": "string",
"commitmentAmount": 0,
"orgEntities": [{
"entityCode": "string",
"isDefault": true,
"entityType": "string",
"lobEntityCode": "string"
}],
"accountingEntities": [{
"entityCode": "string",
"isDefault": true,
"entityType": "string",
"lobEntityCode": "string"
}],
"contactOrgDetails": [{
"orgEntity": {
"entityCode": "string",
"isDefault": true,
"entityType": "string",
"lobEntityCode": "string"
},
"personaAndRoles": {
"personaName": "string",
"personaCode": "string",
"activities": [{
"code": "string",
"name": "string",
"description": "string"
}],
"personaDescription": "string"
},
"lobType": "string",
"isDefaultLOB": true
}],
"categories": [{
"pasCode": 0,
"isDefault": true,
"clientPasCode": "string",
"isDeleted": true
}],
"regions": [{
"regionName": "string",
"isDefault": true
}],
"lastLoginDate": "2020-01-21T11:53:45.057Z",
"personaAndRoles": {
"personaName": "string",
"personaCode": "string",
"activities": [{
"code": "string",
"name": "string",
"description": "string"
}],
"personaDescription": "string"
},
"customFields": [{
"key": "string",
"value": [
"string"
],
"subCustomField": [
null
]
}],
"ssoType": 0,
"cultureCode": "string",
"authorizeAmountForProject": 0,
"secondaryAuthorizeAmount": 0,
"secondaryAuthorizeAmountForContract": 0,
"amendmentAuthorizeAmountForContract": 0,
"workGroup": "string",
"contactManagers": [{
"managerCode": "string",
"managerType": "string"
}],
"authorityAmountDetails": [{
"documentType": "string",
"lobType": "string",
"lobEntityCode": "string",
"entityType": "string",
"entityCode": "string",
"isDeleted": true,
"amountAttributes": [{
"amountCode": "string",
"amount": 0
}]
}],
"deliverTo": {
"deliverToLocationNumber": "string",
"isDeleted": true,
"locationData": [{
"culture": "string",
"deliverToLocationName": "string",
"field": [{
"key": "string",
"fieldValue": "string"
}]
}



]
}



}

 

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

 

Additional Information

Following are the examples of CurrencyCode:

USD
EUR
GBP
ADF
ADP
AED
AFA

Note: The Valid source of the CurrencyCode has to be GEP SMART CurrencyMaster only.

Examples

Success Scenario - Request

Below request only contains the mandatory attribute(s): 

[
  {
    "UserName": "Avian_test1@gep.com",
    "ContactCode": "CM_ContactCode_2",
    "ManagerCode": [
      "MN22011605"
    ],
    "Address": {
      "CountryCode": "US"
    },
    "FirstName": "FNameMN-1",
    "LastName": "LNameMN-1",
    "EmailAddress": "pg1@gep.com"
  }
]

Success Scenario - Response

{
  "data": null,
  "statusCode": "200",
  "errorDetails": [],
  "successDetails": [
    {
      "key": "CM_ContactCode_2"
    }
  ]
}

Error Scenario 1 - Request

Below request contains a missing value of a mandatory attribute - UserName:

[
  {
    "UserName": "",
    "ContactCode": "CM_ContactCode_2",
    "ManagerCode": [
      "MN22011605"
    ],
    "Address": {
      "CountryCode": "US"
    },
    "FirstName": "FNameMN-1",
    "LastName": "LNameMN-1",
    "EmailAddress": "pg1@gep.com"
  }
]

Error Scenario 1 - Response 

{
  "data": null,
  "statusCode": "400",
  "errorDetails": [
    {
      "key": "CM_ContactCode_2",
      "errors": [
        {
          "errorCode": "MandatoryField",
          "errorDescription": "UserName is Mandatory"
        }
      ]
    }
  ],
  "successDetails": []
}

Error Scenario 2 - Request

Below request contains a missing value of an optional attribute - RegionName: 

[
  {
    "UserName": "userMNAvad111@gep.com",
    "ContactCode": "CM_ContactCode_2",
    "ManagerCode": [
      "MN22011605"
    ],
    "Address": {
      "AddressLine1": "Smith Villa",
      "AddressLine2": "thane belapur road",
      "AddressLine3": "78",
      "City": "thane",
      "StateCode": "TX",
      "StateOther": "NUiversity",
      "CountryCode": "US",
      "ZipCode": "",
      "FaxNo": "233-900-0898",
      "PhoneNo": "61372100",
      "PhoneOther": "233-900-4567",
      "PhoneExtension": "1234",
      "PhoneOtherExtension": "4556",
      "County": "blast county"
    },
    "FirstName": "FNameMN-1",
    "LastName": "LNameMN-1",
    "EmailAddress": "pg1@gep.com",
    "AuthorityAmt": 1,
    "IsActive": false,
    "IsDeleted": false,
    "UserActivities": [
      {
        "ActivityName": "ADMINISTRATION"
      }
    ],
    "TimeZone": "Eastern Standard Time",
    "Designation": "new",
    "CommitmentAmount": 6000,
    "Regions": [
      {
        "IsDefault": false,
        "WorkGroup": 2
      }
    ]
  }
]

Error Scenario 2 - Response

{
  "data": null,
  "statusCode": "400",
  "errorDetails": [
    {
      "key": "CM_ContactCode_2",
      "errors": [
        {
          "errorCode": "Exception",
          "errorDescription": "Object reference not set to an instance of an object."
        }
      ]
    }
  ],
  "successDetails": []
}

 

Data Elements
 

Buyer Contact

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.1

ContactCode

Yes

String

Contact Code

  • Max length is 50

  • No Contact Code found

  • Could not process the data since the user and the manager are the same.

  • Multiple users ([username(s)]) are mapped with the same contact code : [ContactCode]

1.2

UserName

Yes

String

User Name of entity

  • Max length is 100

  • Invalid User Name

  • Different user with the same Username already exists.

  • UserName already exists for another user.

1.3

FirstName

Yes

String

First Name of the entity

  • Max length is 50

  • FirstName is mandatory

1.4

LastName

Yes

String

Last Name of the entity

  • Max length is 30

  • Last Name is mandatory

1.5

EmailAddress

Yes

String

Email Address of the entity

  • Invalid Email Address

  • Email Address is mandatory

1.6

Address

No

List of Address object

Check Data Type Address for details

Address is Mandatory. [This would only be applicable only in a new user creation]

1.7

AuthorityAmt

No

Decimal

Authority Amount of the entity

 

1.8

IsActive

No

Boolean

  • Status of the entity if they are active or not.

     

  • If not passed, the value will be considered false.

     

 

1.9

IsDeleted

No

Boolean

Status of the entity if they are to be visible or not on the application.

 

1.10

UserActivities

No

List of Activity object

Check Data Type Activity for details

 

1.11

TimeZone

No

String

Time Zone of the entity

  • Max length is 100

  • Invalid Time Zone

1.12

LocationCode

No

String

Location Code of the entity

  • Max length is 50

1.13

CurrencyCode

No

String

Currency Code of the entity

 

  UserProfileCurrencyCode No String Currency Code of the User’s Profile
  • Invalid user profile currency code

  • If this field is not provided or provided as null/empty in request during user creation, then the default domain currency is set against the user profile otherwise if the valid value is provided then that value will be set

  • If this field is not provided or provided as null/empty in request during user updation, then the existing currency for that user is retained otherwise if the valid value is provided then that value will be updated

1.14

Designation

No

String

Designation of the entity

  • Max length is 100

1.15

CommitmentAmount

No

Decimal

Commitment Amount of the entity

 

1.16

OrgEntities

No

List of OrgEntity object

Check Data Type OrgEntity for details

 

1.17

AccountingEntities

No

List of OrgEntity object

Check Data Type OrgEntity for details

 

1.18

ContactOrgDetails

No

List of ContactOrgDetails object

Check Data Type ContactDetails for details

 

1.19

Categories

No

List of PAS object

Check Data Type PAS for details

 

1.20

Regions

No

List of Regions object

Check Data Type Regions for details

 

1.21

LastLoginDate

No

DateTime

 

 

1.22

PersonaAndRoles

No

List of PersonaAndRoles object

Check Data Type PersonaAndDetails for details

 

1.23

CustomFields

No

List of CustomField object

Check Data Type CustomField for details

 

1.24

SSOType

No

Int

SSO Type

  • Invalid SSO Type

1.25

CultureCode

No

String

Culture Code

 

1.26

AuthorizeAmountForProject

No

Decimal

Authorize Amount for Project

 

1.27

SecondaryAuthorizeAmount

No

Decimal

Secondary Authorize Amount

 

1.28

SecondaryAuthorizeAmountForContract

No

Decimal

Secondary Authorize Amount for Contract

 

1.29

AmendmentAuthorizeAmountForContract

No

Decimal

Amendment Authorize Amount for Contract

 

1.30

WorkGroup

No

String

Work Group of the entity

 

1.31

ContactManagers

No

List of ContactManager object

Check Data Type ContactManager for details

 

1.32

GEPContactCode

No

Long

GEP Contact Code of the entity

 

This field is only available on Outbound and not on Inbound

 

1.33

ManagerCode

No

List of String

Manager Code

  • Invalid Manager Code

  • Multiple Managers are not allowed

  • Could not process the data since the user and the manager are the same

 

 

Address

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.6.1

AddressLine1

Yes

String (500)

Address line 1 of the entity

  • AddressLine1 is mandatory

  • Max length for AddressLine1 is 500

1.6.2

City

Yes

String (50)

City of the entity

  • City is mandatory

  • Max length for City is 50

1.6.3

StateCode

Yes

String (10)

State code of the entity

  • StateCode is mandatory

  • Max length for StateCode is 10

  • Invalid State

1.6.4

CountryCode

Yes

String (2)

Country code of the entity

  • CountryCode is mandatory

  • Max length for CountryCode is 2

  • Invalid Country Code

1.6.5

ZipCode

Yes

String (10)

Zip code of the entity

  • ZipCode is mandatory

  • Max length for ZipCode is 10

1.6.6

AddressLine2

No

String

Address line 2 of the entity

  • Max length for AddressLine2 is 500

1.6.7

AddressLine3

No

String (100)

Address line 3 of the entity

  • Max length for AddressLine3 is 100

1.6.8

StateOther

No

String

State name (in case of others) of the entity

  • Max length for State other is 50

1.6.9

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.6.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.6.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.6.12

PhoneExtension

No

String

Phone extension of the entity

  • Max length for PhoneExtension is 10

1.6.13

PhoneOtherExtension

No

String

Phone 2’s extension of the entity

  • Max length for PhoneOtherExtension is 10

1.6.14

County

No

String (50)

County of the address

  • Max length for County is 50

1.6.15

PoBoxNumber

No

String

 

 

 

 

UserActivities

S.No.

Property

Required?

Data type

Description

Validations / Exceptions

1.10.1

ActivityName

No

Activities Enum

One of the following values will be provided in this field; “NONE”, “ADMINISTRATION”, “HOME”, “VIEW_GEPICENTER etc.

 

 

 

 

OrgEntities

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.16.1

EntityCode

No

String

Entity Code of entity

  • Invalid Org Entity Code

1.16.2

IsDefault

No

Boolean

Status of the entity if this is default or not

  • Multiple default Org Entities are not allowed

1.16.3

EntityType

No

String

Entity Type of entity

  • Either Entity Type is missing or Invalid Entity Type for entities

1.16.4

LOBEntityCode

No

String

LOB Entity Code of entity

 

 

AccountingEntities

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.17.1

EntityCode

No

String

Entity Code of entity

  • Invalid Accounting Org Entity Code

1.17.2

IsDefault

No

Boolean

Status of the entity if this is default or not

 

1.17.3

EntityType

No

String

Entity Type of entity

 

1.17.4

LOBEntityCode

No

String

LOB Entity Code of entity

 

 

 

ContactOrgDetails

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.18.1

OrgEntities

No

List of OrgEntity object

Check Data Type OrgEntity for details

  • Invalid Org Entity Code

 

1.18.2

PersonaAndRoles

No

List of PersonaAndRoles object

Check Data Type PersonaAndDetails for details

 

1.18.3

LobType

No

String

LOB Type of entity

  • LOB Type should be either Belonging or Serving

  • Multiple Blank LOB Type Is not valid for contact code

1.18.4

IsDefaultLOB

No

Boolean

Status of the entity if this is default LOB or not

  • If LOB Type is serving: Multiple Default Serving LOB are not allowed for contact code.

  • If LOB Type is belonging: Multiple Default Belonging LOB is not allowed for one contact code.

 

 

 

Categories

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.19.1

PasCode

No

Long

PAS Code of entity

  • Category Is Invalid

1.19.2

IsDefault

No

Boolean

Status of the entity if this is default or not

  • Multiple default Categories not allowed

1.19.3

ClientPasCode

No

String

Client Pas Code of entity

 

1.19.4

IsDeleted

No

Boolean

Status of the entity if they are to be visible or not on the application

 

 

 

Regions

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.20.1

RegionName

No

String

Region name of entity

  • Region is invalid

1.20.2

IsDefault

No

Boolean

Status of the entity if this is default or not

  • Multiple default Regions not allowed

 

 

PersonaAndRoles

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.22.1

PersonaName

No

String

Name of the entity

 

1.22.2

PersonaCode

No

String

Persona Code of the entity

  • Invalid Persona Code

1.22.3

Activities

No

List of UserActivity object

Check data type UserActivity for details

 

1.22.4

PersonaDescription

No

String

Persona Description of entity

 

 

 

Activities

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.22.3.1

Code

No

String

Code of the entity

  • Invalid Activity Code

1.22.3.2

Name

No

String

Name of the entity

 

1.22.3.3

Description

No

String

Description of the entity

 

 

 

CustomFields

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.23.1

Key

No

String

Key of the entity

  • Custom Field is invalid if key is not User Business Unit

  • if key is User Business Unit:

  • Business Units code is invalid

  • Custom fields Key text is empty

1.23.2

Value

No

List of String

Value of the entity

  • Custom field has invalid values

  • Custom field cannot have multiple values

1.23.3

SubCustomField

No

List of CustomField object

Check data Type Custom fields for details

 

 

 

ContactManagers

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.31.1

ManagerCode

No

String

Manager Code

Could not process the data since the user and the manager are the same

1.31.2

ManagerType

No

String

Manager Type

 

 

 

Deliver To

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.31.1

DeliverToLocationNumber

No

String

Deliver To Location Number

 

1.31.2

LocationCode

No

String

location code

 

 

IsDeleted

No boolean IsDeleted  
 

Location Data

No List Of Location Data Check data type Location Data for details  

 

 

Location Data

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.31.1

Culture

No

String

Culture Code

Invalid Culture 

1.31.2

DeliverToLocationName

No

String

DeliverToLocationName

 

 

Field

No List Of Field Objects Check data type Location Data for details  

 

 

Field

S.No.

Property

Required?

Data type

Description

Validations/Exceptions

1.31.1

Key

No

String

This key should be configured in the master table, else will get an error

Invalid Key

1.31.2

FieldValue

No

String

FieldValue