Invite a supplier user

Invite an invitable supplier given by the PIM Product 360 supplier id to the PIM Supplier Portal together with supplier user data. The given user data is used to create the user as supplier administrator in case the supplier is in an invitable state (inivitation not iniated yet for that supplier).

Please have a look at the diagram below to understand the response behavior for different scenarios.

You may want to execute a Rest api call Get a list of invitable suppliers in advance to determine whether it makes sense to execute the call with a specific supplier.

HTTP Method Type

PUT

Resource URL

/invitable-suppliers/{hpmSupplierId}/users/

Parameters

Parameter

Type

Required

Description

{hpmSupplierId}

URL Path Parameter

yes

specifies the HPM supplier id.

user object

JSON (Request Entity)

yes

User object which sets the attributes of the user to invite.

The following diagram describes the request object in UML:

images/download/attachments/12125245/hsx_user_object.png

The following data describes the request object in JSON format

{
"email":"happy@hsx.com",
"firstName":"Happy",
"lastName":"Gilmore",
"language":"en_US"
}

Example Usage:

PUT http://localhost:9090/hsx/rest/invitable-suppliers/1768/users HTTP/1.1
{
"email":"happy@hsx.com",
"firstName":"Happy",
"lastName":"Gilmore",
"language":"en_US"
}

Response

Example Response Header

HTTP/1.1 202 Accepted
Server: Apache-Coyote/1.1
Content-Length: 0
Date: Wed, 20 Jun 2012 08:53:34 GMT

Return Codes

Description

HTTP 202 Status Code

The invitation of the user was successful.

HTTP 400 Status Code

INVALID_LANGUAGE_CODE

Invalid locale format: xxx.

HTTP 400 Status Code

EMAIL_ALREADY_IN_USE

Email already in use.

HTTP 400 Status Code

ALREADY_INVITED

The supplier xxx already has been invited.

HTTP 400 Status Code

The supplier xxx cannot be invited because no catalog has been assigned.

HTTP 404 Status Code

INVALID_SUPPLIER_ID

No invitable supplier with id=xxx found.

Decisiondiagram: Is user invitable?

images/download/attachments/111937316/user_invitation_decision_diagram.png