Login a customer

Request

Logs in a customer.

Security
SecretApiKey or JWT or PublishableApiKey
Bodyapplication/jsonrequired

AuthenticationToken resource.

usernamestringrequired

Username associated with the authentication token.

passwordstring, (password)write-onlyrequired

Password associated with the authentication token.

modestring

Specifies the authentication verification method. The password token requires the user to enter a password to log in. The passwordless token, requires a secret API key to log in. To obtain an API key, see Manage API keys.

Value:"password"
Discriminator
otpRequiredboolean

Specifies if a One-Time Password (OTP) is required to exchange the authentication token.

expiredTimestring, (date-time)

Date and time when the token expired.

curl -i -X POST \
  https://www.rebilly.com/_mock/catalog/all/authentication-tokens \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "username": "string",
    "password": "pa$$word",
    "mode": "password",
    "otpRequired": true,
    "credentialId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
    "expiredTime": "2019-08-24T14:15:22Z"
  }'

Responses

Login successful.

Headers
Locationstring, (uri)

Location of the related resource.

Example:"https://api.rebilly.com/example"
X-RateLimit-Limitinteger

Total number of rate limit tokens for this request within a rate limit period. For more information, see Rate limits.

Example:3600
X-RateLimit-Remaininginteger

Remaining number of rate limit tokens for this request within the rate limit period. For example, in the sandbox environment, rate limits for non-GET endpoints are set at 3000 requests per 10 minutes.

Example:3600
Bodyapplication/json
usernamestringrequired

Username of the customer who is associated with the authentication token.

customerIdstring, <= 50 characters(CustomerId)read-only

ID of the customer resource.

Example:"cus_0YV7DDSDD1C8DA64KHH2W33CPF"
tokenstringread-only

ID of the authentication token.

otpRequiredboolean

Specifies if a One-Time Password (OTP) is required to exchange the authentication token.

credentialIdstring, <= 50 characters(ResourceId)read-only

ID of the user associated with the authentication token.

Example:"4f6cf35x-2c4y-483z-a0a9-158621f77a21"
expiredTimestring or null, (date-time)

Date and time when the token expired.

Response
{ "username": "string", "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF", "token": "string", "otpRequired": true, "credentialId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21", "expiredTime": "2019-08-24T14:15:22Z", "_links": [ {} ] }