Skip to main content

Customer Login

The POST endpoint allows a customer to log in and submit their cart details.

Endpoint

  • URL: /customer/login
  • Method: POST

Authentication

  • Header: accessToken
  • Type: Bearer Token
  • Value: <ACCESS-TOKEN>

Request Headers

HeaderTypeDescription
Content-TypestringMust be application/json.
accessTokenstringAccess token for authentication. (required)

Request Body

The request body should include the customer's email and optionally the cart items they wish to submit. The structure is as follows:

FieldTypeDescription
emailstringThe customer's email address.
cartobjectThe customer's cart, containing items.

Cart Object:

FieldTypeDescription
itemsarrayA list of items in the cart.

Items Array:

Each item in the items array can include:

FieldTypeDescription
skustringStock Keeping Unit identifier for the product.
uomstringUnit of Measure for the product, e.g., "CS".
quantitynumberQuantity of the item being purchased.

Sample Request Body

{
"email": "jrandazzo@anadigics.com",
"cart": {
"items": [
{
"sku": "MAR 2930",
"uom": "CS",
"quantity": 3
}
]
}
}

Response

  • Status Code: 200 OK

Sample Response Body

{
"success": true,
"code": "<one_time_login_code>"
}

Success Response Fields

FieldTypeDescription
successbooleanIndicates the success status of the login attempt, typically true for successful login.
codestringA one-time login code provided to the customer upon successful login.

Error Responses

Status CodeDescription
400Bad Request: Invalid input data.
401Unauthorized: Access token is invalid or missing.
403Forbidden: Invalid email or other login credentials.
500Internal Server Error: An error occurred on the server.

Notes

  • Ensure the email and cart details are correctly entered in the body of the request.
  • Provide a valid and active access token in the request header to authenticate your request.
  • The one-time login code can be used for subsequent authentication or operations.