MMelo Developers

Quickstart

Authenticate, request a quote, and create your first Melo delivery.

This guide walks through the shortest successful integration path. You need a client ID, client secret, an active warehouse, and enough merchant balance to pay for the delivery.

1. Get an access token

Request an access token
curl --request POST \
  --url https://api.melo.delivery/v1/auth/token \
  --header 'Content-Type: application/json' \
  --data '{
    "grant_type": "client_credentials",
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET"
  }'

The response contains a bearer token valid for one hour:

{
  "access_token": "eyJhbGciOi...",
  "token_type": "Bearer",
  "expires_in": 3600
}

Store the token in memory and request a new one before it expires. Never expose the client secret in browser or mobile code.

2. Find an active warehouse

curl --request GET \
  --url 'https://api.melo.delivery/v1/warehouses?status=ACTIVE' \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'

Copy the id of the warehouse you want to use as the pickup point.

3. Request delivery options

curl --request POST \
  --url https://api.melo.delivery/v1/options \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "destinationLocation": {
      "lat": 41.7151,
      "lng": 44.8271,
      "display_name": "12 Rustaveli Avenue, Tbilisi",
      "city": "Tbilisi"
    },
    "warehouseId": "11111111-1111-4111-8111-111111111111",
    "parcelSize": "SMALL",
    "isFragile": false,
    "isPerishable": false,
    "deliveryType": "DOOR_TO_DOOR"
  }'

Save the response id as the matchmakingId. Choose one of the keys returned inside products as the productKey.

4. Create and pay for the transfer

curl --request POST \
  --url https://api.melo.delivery/v1/transfer \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "matchmakingId": "22222222-2222-4222-8222-222222222222",
    "productKey": "YOUR_PRODUCT_KEY",
    "description": "One small package",
    "recipientInfo": {
      "firstName": "Nino",
      "lastName": "Beridze",
      "phone": "+995555123456"
    }
  }'

This operation charges your balance

Creating a transfer also pays for it from the merchant balance. Make sure you have selected the intended quote product before sending the request.

5. Track the transfer

curl --request GET \
  --url https://api.melo.delivery/v1/transfer/33333333-3333-4333-8333-333333333333 \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'

The state field is one of inProgress, completed, or failed.

On this page