curl --request POST 'https://api.subtotal.com/link-tokens' \
--header "X-Api-Key: $SUBTOTAL_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"customer_id":"customer-example-001","email":"consumer@example.com","expires_in_days":30}'
{
"customer_id": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"link_token": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Link Tokens
Create Link Token
Create a durable customer-scoped Subtotal Link token
POST
/
link-tokens
curl --request POST 'https://api.subtotal.com/link-tokens' \
--header "X-Api-Key: $SUBTOTAL_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"customer_id":"customer-example-001","email":"consumer@example.com","expires_in_days":30}'
{
"customer_id": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"link_token": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create tokens only from your backend with
X-Api-Key or an OAuth access token with connections:write. Your client must be active.
X-Subtotal-Idempotency-Key is optional. Include it to return the same token when retrying an identical request. Without it, each successful request creates a new token.
Returns link_token, not a URL or a separate token ID. See Customer Link tokens for URL construction, reuse, and retry behavior.
curl --request POST 'https://api.subtotal.com/link-tokens' \
--header "X-Api-Key: $SUBTOTAL_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"customer_id":"customer-example-001","email":"consumer@example.com","expires_in_days":30}'
Body
application/json
A unique identifier used to map connections to customer records in external systems.
Required string length:
1 - 64The customer's email address
Maximum string length:
254The customer's mobile phone number
Maximum string length:
16Client-defined attribution tags recorded when the connection is created, for grouping connection metrics — e.g. {"campaign": "summer_sweeps", "program": "loyalty"}. Names and values are opaque to Subtotal and are never interpreted. At most 10 tags; names up to 64 characters, values up to 256. Intended for campaign and source metadata — do not put consumer PII in tags.
Show child attributes
Show child attributes
Number of whole days before the link token expires.
Required range:
1 <= x <= 365