Poq.SDK.Node

Home > @poq/sdk-sfcc > CustomersClient > postCustomersByIDAuth

CustomersClient.postCustomersByIDAuth() method

Obtains a new agent on behalf token for a registered customer. Token is returned as a HTTP Authorization:Bearer response header entry. A token is created and returned to the client whenever an agent with Create_Order_On_Behalf_Of permission calls the resource for a registered customer. The token is returned in the response header as Authorization: Bearer –token–. The client has to include the token in the request header as Authorization: Bearer –token– in any follow up request, the agent will do on behalf of the customer. About the order on behalf token The token contains 3 sections: the header section (specifies token type and algorithm used) the payload section (contains customer information, client id, issue and expiration time) finally the signature section records the token signature. A token nearing its expiration time should be exchanged for a new one by calling this resource once more.

Signature:

postCustomersByIDAuth(customerId: string, options?: RequestOptions): Promise<PoqResponse<Customer>>;

Parameters

Parameter Type Description
customerId string specifies the customer to act on behalf of
options RequestOptions (Optional) Override http request option.

Returns:

Promise<PoqResponse<Customer>>