curl --request POST \
--url https://b.anny.co/api/v1/connection-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "connection-tokens",
"attributes": {}
}
}
'{
"data": {
"type": "connection-tokens",
"attributes": {
"secret": "pst_test_abc123"
}
}
}Terminal Payments
Create connection token
Creates a short-lived Stripe Terminal SDK connection token.
Pass the returned secret to the Stripe Terminal SDK’s fetchToken callback to initialize a terminal session. Tokens are single-use and short-lived — always request a fresh token; never cache.
If no payment-account relationship is provided, the organization’s default payment account is used. Optionally scope the token to a specific location via the location relationship.
SDK initialization example (Dart):
await StripeTerminal.instance.initialize(
fetchToken: () async {
final res = await dio.post('/api/v1/connection-tokens', data: {
'data': {'type': 'connection-tokens', 'attributes': {}},
});
return res.data['data']['attributes']['secret'];
},
);
POST
/
api
/
v1
/
connection-tokens
curl --request POST \
--url https://b.anny.co/api/v1/connection-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "connection-tokens",
"attributes": {}
}
}
'{
"data": {
"type": "connection-tokens",
"attributes": {
"secret": "pst_test_abc123"
}
}
}