Create a relationship

post

/crmRestApi/resources/11.13.18.05/contacts/{PartyNumber}/child/Relationship

Request

Path Parameters
  • The alternate key identifier for the contact party. The profile option HZ_GENERATE_PARTY_NUMBER controls whether the attribute value can be system generated or user-provided during create. Review and update the value for this attribute using the Setup and Maintenance work area, Manage Trading Community Common Profile Options task. Inactive records can't be updated.
Header Parameters
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
  • Contains one of the following values: true or false. If true, the server performs an Upsert operation instead of a Create operation. During an Upsert operation, the server attempts to find an existing resource that matches the payload. If a match is found, the server updates the existing resource instead of creating a new one. If not found or false (default), the server performs a Create operation. Note that the Upsert operation isn't supported for date-effective REST resources.
Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
Show Source
  • Title: Comments
    Maximum Length: 2000
    User comments for the relationship.
  • Default Value: 0
    The unique identifier of the conflict. This number is used by mobile or portable applications that consume the web service.
  • Title: Created by Application
    Maximum Length: 30
    Default Value: HZ_WS
    The application module that created the relationship record. The default value for CreatedByModule is HZ_WS for all Web service based creation. A list of accepted values is defined in the lookup type HZ_CREATED_BY_MODULES. Review and update the value for this attribute using the Setup and Maintenance task work area, Manage Trading Community Common Lookups task.
  • Title: Dependent Indicator
    Maximum Length: 1
    Default Value: N
    Indicates whether one party is a dependent on another.
  • Title: To Date
    The date when the relationship ends.
  • Title: Head of Household Indicator
    Maximum Length: 1
    Default Value: N
    Indicates whether a person is the head of the household that he belongs to.
  • Title: Influence Level
    The sales contact's influence in a buying relationship. Sample values are Inner Circle, Political structure, None.
  • Maximum Length: 100
    The definition of the job name.
  • Maximum Length: 900
    The definition of the job package.
  • The primary key identifier of the contact, in this relationship. One of ObjectPartyId, ObjectPartyNumber and ObjectSourceSystem along with ObjectSourceSystemReferenceValue combination is used to identify the contact party of the relationship.
  • Title: Object Registry ID
    Maximum Length: 30
    The unique alternate identifier for the relationship of the contact party. One of ObjectPartyId, ObjectPartyNumber and ObjectSourceSystem along with ObjectSourceSystemReferenceValue combination is used to identify the object party of the relationship.
  • Title: Object Source System
    The name of external source system for the contact party in the relationship, which are defined by an admin as part of system setup. One of ObjectPartyId, ObjectPartyNumber and ObjectSourceSystem along with ObjectSourceSystemReferenceValue combination is used to identify the object party of the relationship. A list of accepted values should be pre-defined in the lookup type HZ_ORIG_SYSTEMS_VL. Review and update the value for this attribute using the Setup and Maintenance work area, Manage Trading Community Source Systems task.
  • Title: Object Source System Reference
    The unique identifier from external source system for the relationship of the contact party. One of ObjectPartyId, ObjectPartyNumber and ObjectSourceSystem along with ObjectSourceSystemReferenceValue combination is used to identify the contact party of the relationship.
  • Maximum Length: 30
    The source table name of the object party in this relationship.
  • Maximum Length: 30
    The object type of the contact.
  • Maximum Length: 30
    The usage code of object party in the relationship.
  • The number used to implement locking. This number is incremented every time that the row is updated. The number is compared at the start and end of a transaction to determine whether another session has updated the row.
  • Title: Ownership Percentage
    The percentage of the child entity owned by the parent entity.
  • Maximum Length: 10
    Default Value: false
    Indicates whether this contact person is primary contact for the customer. Accepted values are Y and N. Default value is N.
  • Maximum Length: 10
    Default Value: false
    Indicates whether this customer is primary customer for the contact. Accepted values are Y and N. Default value is N.
  • Title: Relationship Code
    Maximum Length: 30
    The code indicating whether the relationship is a forward or a backward relationship. A list of accepted relationship values is defined in the lookup PARTY_RELATIONS_TYPE. Review and update the value for this attribute using the Setup and Maintenance work area, Manage Relationship Lookups.
  • The unique identifier of the relationship record.
  • The name of external source system for the relationship, which are defined by an Admin as part of system setup.
  • The unique identifier of the relationship from the external source system.
  • Title: Relationship Type
    Maximum Length: 30
    The type of relationship of a contact party, such as CUSTOMER_SUPPLIER. A list of accepted relationship type values is defined in the lookup HZ_RELATIONSHIP_TYPE. Review and update the value for this attribute using the Setup and Maintenance work area, Manage Relationship Lookups task.
  • The unique identifier of the request.
  • Title: Role
    The role between the subject and object party.
  • Title: From Date
    Date on which this relationship becomes active.
  • The primary key identifier of the subject in this relationship. One of SubjectPartyId, SubjectPartyNumber and SubjectSourceSystem along with SubjectSourceSystemReferenceValue combination is used to identify the subject party of the relationship.
  • Title: Subject Registry ID
    Maximum Length: 30
    The alternate unique identifier for the subject party of the relationship. One of SubjectPartyId, SubjectPartyNumber and SubjectSourceSystem along with SubjectSourceSystemReferenceValue combination is used to identify the subject party of the relationship.
  • Title: Subject Source System
    The name of external source system for the subject party in the relationship, which are defined by an Admin as part of system setup. One of SubjectPartyId, SubjectPartyNumber and SubjectSourceSystem along with SubjectSourceSystemReferenceValue combination is used to identify the subject party of the relationship. A list of accepted values should be predefined in the lookup type HZ_ORIG_SYSTEMS_VL. Review and update the value for this attribute using the Setup and Maintenance work area, Manage Trading Community Source Systems task.
  • Title: Subject Source System Reference
    The unique identifier from external source system for the subject party in the relationship. One of SubjectPartyId, SubjectPartyNumber and SubjectSourceSystem along with SubjectSourceSystemReferenceValue combination is used to identify the subject party of the relationship.
  • Maximum Length: 30
    The source table of the subject.
  • Maximum Length: 30
    The subject type of the contact.
  • Maximum Length: 30
    The usage code of subject party in the contact.
Back to Top

Response

Supported Media Types

Default Response

The following table describes the default response for this task.
Headers
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
Body ()
Root Schema : contacts-Relationship-item-response
Type: object
Show Source
  • Title: Backward Role
    Read Only: true
    The backward relationship code used to describe relationships. For example, SUPPLIER_OF.
  • Title: Comments
    Maximum Length: 2000
    User comments for the relationship.
  • Default Value: 0
    The unique identifier of the conflict. This number is used by mobile or portable applications that consume the web service.
  • Title: Created By
    Read Only: true
    Maximum Length: 64
    The user who created the relationship record.
  • Title: Created by Application
    Maximum Length: 30
    Default Value: HZ_WS
    The application module that created the relationship record. The default value for CreatedByModule is HZ_WS for all Web service based creation. A list of accepted values is defined in the lookup type HZ_CREATED_BY_MODULES. Review and update the value for this attribute using the Setup and Maintenance task work area, Manage Trading Community Common Lookups task.
  • Title: Creation Date
    Read Only: true
    The date and time when the relationship record was created.
  • Title: Dependent Indicator
    Maximum Length: 1
    Default Value: N
    Indicates whether one party is a dependent on another.
  • Read Only: true
    Maximum Length: 30
    The record validated by DIRECTION_CODE lookup type. P for Parent, C for Child, and N for Not Directional.
  • Title: To Date
    The date when the relationship ends.
  • Title: Head of Household Indicator
    Maximum Length: 1
    Default Value: N
    Indicates whether a person is the head of the household that he belongs to.
  • Title: Influence Level
    The sales contact's influence in a buying relationship. Sample values are Inner Circle, Political structure, None.
  • Maximum Length: 100
    The definition of the job name.
  • Maximum Length: 900
    The definition of the job package.
  • Title: Last Updated Date
    Read Only: true
    The date and time when the relationship data was last updated.
  • Title: Last Updated By
    Read Only: true
    Maximum Length: 64
    The user who last updated the relationship record.
  • Title: Last Update Login
    Read Only: true
    Maximum Length: 32
    The session login associated to the user who last updated the relationship record.
  • Links
  • The primary key identifier of the contact, in this relationship. One of ObjectPartyId, ObjectPartyNumber and ObjectSourceSystem along with ObjectSourceSystemReferenceValue combination is used to identify the contact party of the relationship.
  • Title: Object Party Name
    Read Only: true
    Maximum Length: 360
    The name of the object party of the relationship.
  • Title: Object Registry ID
    Maximum Length: 30
    The unique alternate identifier for the relationship of the contact party. One of ObjectPartyId, ObjectPartyNumber and ObjectSourceSystem along with ObjectSourceSystemReferenceValue combination is used to identify the object party of the relationship.
  • Title: Object Source System
    The name of external source system for the contact party in the relationship, which are defined by an admin as part of system setup. One of ObjectPartyId, ObjectPartyNumber and ObjectSourceSystem along with ObjectSourceSystemReferenceValue combination is used to identify the object party of the relationship. A list of accepted values should be pre-defined in the lookup type HZ_ORIG_SYSTEMS_VL. Review and update the value for this attribute using the Setup and Maintenance work area, Manage Trading Community Source Systems task.
  • Title: Object Source System Reference
    The unique identifier from external source system for the relationship of the contact party. One of ObjectPartyId, ObjectPartyNumber and ObjectSourceSystem along with ObjectSourceSystemReferenceValue combination is used to identify the contact party of the relationship.
  • Maximum Length: 30
    The source table name of the object party in this relationship.
  • Maximum Length: 30
    The object type of the contact.
  • Maximum Length: 30
    The usage code of object party in the relationship.
  • The number used to implement locking. This number is incremented every time that the row is updated. The number is compared at the start and end of a transaction to determine whether another session has updated the row.
  • Read Only: true
    The attribute is used to implement optimistic locking. This number is incremented every time that the row is updated. The number is compared at the start and end of a transaction to detect whether another session has updated the row since it was last queried.
  • Read Only: true
    The number to implement optimistic locking. This number is incremented every time that the row is updated. The number is compared at the start and end of a transaction to detect whether another session has updated the row since it was queried.
  • Read Only: true
    The unique identifier of the party.
  • Read Only: true
    The alternate unique identifier of the party.
  • Title: Ownership Percentage
    The percentage of the child entity owned by the parent entity.
  • Maximum Length: 10
    Default Value: false
    Indicates whether this contact person is primary contact for the customer. Accepted values are Y and N. Default value is N.
  • Maximum Length: 10
    Default Value: false
    Indicates whether this customer is primary customer for the contact. Accepted values are Y and N. Default value is N.
  • Title: Relationship Code
    Maximum Length: 30
    The code indicating whether the relationship is a forward or a backward relationship. A list of accepted relationship values is defined in the lookup PARTY_RELATIONS_TYPE. Review and update the value for this attribute using the Setup and Maintenance work area, Manage Relationship Lookups.
  • Read Only: true
    The unique identifier of the relationship.
  • The unique identifier of the relationship record.
  • The name of external source system for the relationship, which are defined by an Admin as part of system setup.
  • The unique identifier of the relationship from the external source system.
  • Title: Relationship Type
    Maximum Length: 30
    The type of relationship of a contact party, such as CUSTOMER_SUPPLIER. A list of accepted relationship type values is defined in the lookup HZ_RELATIONSHIP_TYPE. Review and update the value for this attribute using the Setup and Maintenance work area, Manage Relationship Lookups task.
  • The unique identifier of the request.
  • Title: Role
    The role between the subject and object party.
  • Read Only: true
    Maximum Length: 255
    Default Value: HZ_PARTIES
    The name of the table that holds the record data and is referenced to manage source system reference.
  • Title: From Date
    Date on which this relationship becomes active.
  • Read Only: true
    Maximum Length: 1
    Default Value: A
    The status of the relationship. Indicates if this is an active or inactive relationship. The values A indicate an active relationship and I an inactive relationship. This is an internal column and user is not expected to pass in a value. A list of accepted values is defined in the lookup HZ_STATUS. Review and update the values for this attribute using the Setup and Maintenance work area, Manage Standard Lookups task.
  • The primary key identifier of the subject in this relationship. One of SubjectPartyId, SubjectPartyNumber and SubjectSourceSystem along with SubjectSourceSystemReferenceValue combination is used to identify the subject party of the relationship.
  • Title: Subject Party Name
    Read Only: true
    Maximum Length: 360
    The name of the subject party.
  • Title: Subject Registry ID
    Maximum Length: 30
    The alternate unique identifier for the subject party of the relationship. One of SubjectPartyId, SubjectPartyNumber and SubjectSourceSystem along with SubjectSourceSystemReferenceValue combination is used to identify the subject party of the relationship.
  • Title: Subject Source System
    The name of external source system for the subject party in the relationship, which are defined by an Admin as part of system setup. One of SubjectPartyId, SubjectPartyNumber and SubjectSourceSystem along with SubjectSourceSystemReferenceValue combination is used to identify the subject party of the relationship. A list of accepted values should be predefined in the lookup type HZ_ORIG_SYSTEMS_VL. Review and update the value for this attribute using the Setup and Maintenance work area, Manage Trading Community Source Systems task.
  • Title: Subject Source System Reference
    The unique identifier from external source system for the subject party in the relationship. One of SubjectPartyId, SubjectPartyNumber and SubjectSourceSystem along with SubjectSourceSystemReferenceValue combination is used to identify the subject party of the relationship.
  • Maximum Length: 30
    The source table of the subject.
  • Maximum Length: 30
    The subject type of the contact.
  • Maximum Length: 30
    The usage code of subject party in the contact.
Back to Top

Examples

The following example shows how to create a relationship by submitting a post request on the REST resource using cURL.

cURL Command

curl -u <username:password> \ -X POST -d @example_request_payload.json

Example of Request Body

The following shows an example of the request body in JSON format.

{
    "ObjectPartyNumber": "CDRM_336952",
    "RelationshipType": "CONTACT",
    "RelationshipCode": "CONTACT_OF",
    "CreatedByModule": "HZ_WS"
}

Example of Response Body

The following shows an example of the response body in JSON format.

{
    "PartyId": 300100046397299,
    "PartyNumber": "CDRM_336953",
    "FirstName": "Larry",
    "LastName": "Dickson",
    "ContactName": "Larry Dickson",
    "Type": "ZCA_CONTACT",
    "CreatedByModule": "HZ_WS",
    "Relationship": [
        {
            "RelationshipType": "CONTACT",
            "RelationshipCode": "CONTACT_OF",
            "StartDate": "2015-01-19",
            "EndDate": "4712-12-31",
            "CreatedByModule": "HZ_WS",
            "SubjectPartyNumber": "CDRM_336953",
            "ObjectPartyNumber": "CDRM_336952"
        },...
       ...
    }
Back to Top