Login a user into their delivery.com account.

Request

HTTP Request

POST /customer/auth?

Resource Information

Parameter Value
Response Format JSON
Authentication password flow – client_id AND client_secret
Rate Limited. Yes

Authentication

This endpoint uses password flow. Your API partner account must have been granted password flow authentication. All API partners are strongly encouraged to apply for password flow.

Pass in both the client_id and client_secret. View your API credentials by logging into your API Partner Account.

Example Request

https://api.delivery.com/customer/auth?username={username}@delivery.com&password={password}&grant_type=password&client_id={client_id}&client_secret={client_secret}&scope=global

You will need to update the parameters accordingly.

Parameters

All parameter keys should be lowercase; parameter values should all be UTF-8 and URL-encoded.

Parameter Name Type Description
Required Parameters
username string Email address of user logging in.
password string Password of user logging in.
grant_type string Set to password.
client_id string Api client_id string
client_secret string Api client_secret string
scope string Set to global. This is required – otherwise oauth authentication will fail.

Response

{
  "access_token": "oDTUN25CLWyELpFKeWE0pHxMKjABCDEFGHIJKLMNO",
  "token_type": "bearer",
  "expires": 1470677249,
  "expires_in": 7776000,
  "refresh_token": "H5LnFUHVPUbnDDNoZPKBsCABCDEFGHIJKLMNOu",
  "user": {
    "email": "superman@delivery.com",
    "first_name": "Clark",
    "last_name": "Kent",
    "delivery_points": 2450,
    "life_time_delivery_points": 2450,
    "customer_id": 13880***,
    "human_id": 138****,
    "roles": [
      "USER",
    ],
    "life_time_orders_count": 2,
    "sms_notify": true,
    "life_time_orders_count_per_vertical": {
      "alcohol": 4,
      "food": 0,
      "groceries": 0,
      "laundry": 0
    },
    "account_integrations": []
  },
  "userAddress": {
    "location_id": 3048802,
    "street": "1001 Avenue of the Americas",
    "city": "New York",
    "state": "NY",
    "phone": "6097317150",
    "zip_code": "10018",
    "cross_streets": null,
    "unit_number": "Floor 15 / Delivery.com",
    "instructions": "",
    "company": null,
    "longitude": -73.986455,
    "latitude": 40.751824,
    "date_last_used": "2016-04-29T16:33:23+0000"
  },
  "user_payments": {
    "credit_balance": {
      "id": null,
      "value": 0
    },
    "gift_cards": [],
    "total_credit": 0
  },
  "third_party_auth": "",
  "uid": ""
}