User endpoint API v2

This page describes the user endpoint, which can be used to log in a user and retrieve their address and payment information from your SAP Commerce Cloud service.

With this endpoint, you can:

  • Log in a user and retrieve their access token.

  • Get, update and delete the stored addresses for a given user.

  • Get, update and delete the stored payment methods for a given user.

POST

Log in and get the user’s access token

Logs in a user and obtains the access token of the user.

Request URL

/.rest/ecommerce/v2/users/{userId}/accessToken

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

SAP Commerce Cloud

connectionName

required

The connection name.

query

string

SAP Commerce Cloud

userId

required

The user ID.

path

string

SAP Commerce Cloud

password

required

The user password.

form

string

SAP Commerce Cloud

Create user addresses

Creates the addresses of a user.

Request URL

/.rest/ecommerce/v2/users/{userId}/addresses

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

SAP Commerce Cloud

connectionName

required

The connection name.

query

string

SAP Commerce Cloud

userId

required

The user ID.

path

string

SAP Commerce Cloud

accessToken

required

The user’s access token.

header

string

SAP Commerce Cloud

GET

Get user addresses

Obtains the stored addresses of a user.

Request URL

/.rest/ecommerce/v2/users/{userId}/addresses

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

SAP Commerce Cloud

connectionName

required

The connection name.

query

string

SAP Commerce Cloud

userId

required

The user ID.

path

string

SAP Commerce Cloud

accessToken

required

The user’s access token.

header

string

SAP Commerce Cloud

Get payment methods

Obtains the payment methods of a user.

Request URL

/.rest/ecommerce/v2/users/{userId}/paymentMethods

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

SAP Commerce Cloud

connectionName

required

The connection name.

query

string

SAP Commerce Cloud

userId

required

The user ID.

path

string

SAP Commerce Cloud

accessToken

required

The user’s access token.

header

string

SAP Commerce Cloud

PUT

Update user addresses

Updates the addresses of a user.

Request URL

/.rest/ecommerce/v2/users/{userId}/addresses/{addressId}

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

SAP Commerce Cloud

connectionName

required

The connection name.

query

string

SAP Commerce Cloud

userId

required

The user ID.

path

string

SAP Commerce Cloud

addressId

required

The address ID.

path

string

SAP Commerce Cloud

accessToken

required

The user’s access token.

header

string

SAP Commerce Cloud

Update payment methods

Updates the payment methods of a user.

Request URL

/.rest/ecommerce/v2/users/{userId}/paymentMethods/{paymentMethodId}

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

SAP Commerce Cloud

connectionName

required

The connection name.

query

string

SAP Commerce Cloud

userId

required

The user ID.

path

string

SAP Commerce Cloud

paymentMethodId

required

The address ID.

path

string

SAP Commerce Cloud

accessToken

required

The user’s access token.

header

string

SAP Commerce Cloud

DELETE

Remove user addresses

Deletes the addresses of a user.

Request URL

/.rest/ecommerce/v2/users/{userId}/addresses/{addressId}

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

SAP Commerce Cloud

connectionName

required

The connection name.

query

string

SAP Commerce Cloud

userId

required

The user ID.

path

string

SAP Commerce Cloud

addressId

required

The address ID.

path

string

SAP Commerce Cloud

accessToken

required

The user’s access token.

header

string

SAP Commerce Cloud

Remove payment methods

Deletes the payment methods of a user.

Request URL

/.rest/ecommerce/v2/users/{userId}/paymentMethods/{paymentMethodId}

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

SAP Commerce Cloud

connectionName

required

The connection name.

query

string

SAP Commerce Cloud

userId

required

The user ID.

path

string

SAP Commerce Cloud

paymentMethodId

required

The address ID.

path

string

SAP Commerce Cloud

accessToken

required

The user’s access token.

header

string

SAP Commerce Cloud

Feedback