cimplify
API reference

Places

Address autocomplete and place lookup, fronted by Google Places. Reuse a `sessionToken` across consecutive autocomplete calls and the final details call to keep billing on a single Places session.

The session field is intentionally sessionToken (camelCase) on both endpoints. The server renames it from session_token via #[serde(rename = "sessionToken")].

POST /api/v1/places/autocomplete

Predictions for a partial address. Inputs shorter than 3 characters short-circuit to an empty predictions array without hitting the upstream provider.

Body

FieldTypeDescription
inputstringUser-typed query. Required.
sessionTokenstringCaller-generated UUID; reuse it for the matching /details call.

Request

cURL
curl -X POST https://api.cimplify.io/api/v1/places/autocomplete \
  -H "X-Public-Key: pk_test_your_publishable_key" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "12 Independence",
    "sessionToken": "5b1f9d80-2c70-4f2c-bf61-a0e6fa6b02a1"
  }'

Response

{
  "success": true,
  "data": {
    "predictions": [
      {
        "place_id": "ChIJ…",
        "description": "12 Independence Avenue, Accra, Ghana",
        "main_text": "12 Independence Avenue",
        "secondary_text": "Accra, Ghana"
      }
    ]
  }
}

POST /api/v1/places/details

Resolve a place_id to a structured address, lat/lng, and viewport. Pass the same sessionToken used for the autocomplete call to share billing on a single Places session.

Body

FieldTypeDescription
place_idstringFrom predictions[].place_id. Required.
sessionTokenstringOptional. Same token as the autocomplete request.

Request

cURL
curl -X POST https://api.cimplify.io/api/v1/places/details \
  -H "X-Public-Key: pk_test_your_publishable_key" \
  -H "Content-Type: application/json" \
  -d '{
    "place_id": "ChIJ…",
    "sessionToken": "5b1f9d80-2c70-4f2c-bf61-a0e6fa6b02a1"
  }'

Response

{
  "success": true,
  "data": {
    "place_id": "ChIJ…",
    "formatted_address": "12 Independence Avenue, Accra, Ghana",
    "components": {
      "street_address": "12 Independence Avenue",
      "city": "Accra",
      "region": "Greater Accra",
      "country": "GH",
      "postal_code": null
    },
    "location": { "lat": 5.5557, "lng": -0.1963 }
  }
}

Errors

  • 500 INTERNAL: Places integration not configured for this environment (no Google credentials).

  • 503 SERVICE_UNAVAILABLE: upstream Places returned an error.

  • Checkout Drop the resolved address into address_info on the checkout body.

On this page