1. Authentication
Treek-Public
  • Authentication
    • User login with email and password
      POST
  • Orders
    • Create Order
      POST
    • List Orders
      GET
    • Order Details
      GET
    • Update Order
      PUT
    • Cancel Order
      POST
    • Reset Order
      POST
    • Get Statuses
      GET
    • Verify Item
      POST
    • Verify Order
      POST
    • Order Price
      GET
  • Shipments
    • Create Shipment
      POST
    • Return Shipment
      POST
    • Print Invoice
      GET
  • Boxes
    • Create Box
      POST
    • Get Boxes
      GET
    • Box Details
      GET
    • Update Box
      PUT
  • Merchants
    • Merchants Details
      GET
  • Profile
    • User Details
      GET
    • Update User
      PUT
    • Change Password
      PUT
  • Utilities
    • Countries List
      GET
    • Cities List
      GET
    • Couriers List
      GET
  • Warehouses
    • Warehouses List
    • Create warehouse
    • warehouse Details
  • Price Calculator
    • Price Calculator
  • Packaging Type
    • Packaging Types List
    • Packaging Type Details
  • statistics
    • Statistics
  • Schemas
    • LoginRequest
    • CreateOrderRequest
    • UpdateOrderRequest
    • Price Calculator
    • VerifyItem
    • CreateWarehouseRequest
    • Shipment Package
    • Create Reverse Shipment
    • OrderPackages
    • OrderItem
    • Order
    • City
    • Country
    • User
    • OrderItem
    • CreateOrderItemRequest
    • CalculateRatesRequest
    • BoxDimensions
    • OrderShippingRate
    • RateCalculationParams
    • Warehouse
    • Box
    • CreateBoxRequest
    • UpdateBoxRequest
    • ValidationError
    • NotFoundError
    • UnauthorizedError
    • ForbiddenError
    • PaginationMeta
    • PaginationLinks
  1. Authentication

User login with email and password

POST
https://app.gotreek.com/api/auth/login
Authentication
Last modified:2025-12-25 07:54:10
💡
Authenticate a user with email and password to get a Bearer token for API access. The token can be used to access merchant APIs and other user-specific endpoints. Access is scoped based on the user's role (admin vs merchant).
💡
Detailed description
This endpoint validates the provided email and password combination against the user database.
If the credentials are valid, the server internally calls the OAuth token endpoint to generate an access token (password grant type) and returns that token to the client.
If the credentials are invalid or if the OAuth client is not properly configured, the endpoint returns a structured JSON error response with an appropriate HTTP status code

Request

Header Params

Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Login successful - Bearer token returned
Body

🟠401
🟠422
🔴500
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://app.gotreek.com/api/auth/login' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "test",
    "password": "test"
}'
Response Response Example
200 - Success
{
    "token_type": "Bearer",
    "expires_in": 86400,
    "access_token": "_acces_token_",
    "refresh_token": "_refresh_token_"
}
Modified at 2025-12-25 07:54:10
Next
Create Order
Built with