POST
/
connect
/
tariff
/
token
curl --request POST \
  --url https://api.flatpeak.com/connect/tariff/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "direction": "IMPORT",
  "type": "COMMODITY",
  "callback_uri": "https://webhook.site/4623e56fc5c1",
  "connect_web_uri": "http://localhost:7070",
  "customer_id": "cus_65e421d1daa4a24082b4f590",
  "customer_reference_id": "CUS0123456789",
  "location_id": "loc_641b90b758fb8e6293716e40",
  "location_reference_id": "LOC0123456789",
  "tariff_id": "trf_6597ef46529ab4467502af0b",
  "postal_address": {
    "address_line1": "1-3",
    "address_line2": "Strand",
    "city": "London",
    "state": "Greater London",
    "post_code": "WC2N 5EH",
    "country_code": "GB"
  }
}'
{
  "connect_token": "cot_65df3e949a785c52283026ec",
  "expires_in": 86400,
  "live_mode": true
}
When you want to enable a customer to view the summary of their tariff anywhere in your app, update it or even revoke tariff access, specify a location_id in the request body. When you launch Connect, it will return the summary screen enabling tariff connection management.

Authorizations

Authorization
string
header
required

Authenticate with bearer_token you obtained from /login endpoint.

Body

application/json

Connect init session data.

Response

200
application/json

Connect token object

The response is of type object.