Create an external card session
Create a hosted session for collecting a counter party’s card details
without the card number passing through your backend. Returns a url
(containing an embedded, single-use session token) to redirect your end
user to, or provide recipientEmail to have HIFI email it directly.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the user.
^user_[A-Za-z0-9]+$Body
Parameters for the hosted external card collection session.
Parameters for a hosted external card collection session.
Client-supplied idempotency key for the session.
"8f14e45f-ceea-467e-adde-0f8d0f5f4b1c"
Public ID of an existing counter party (prefixed with cpty_) to attach
the card to. Omit to have the session collect a new counter party.
"cpty_7bV1aLcs3Kf9dQ2mNpXwZ"
URL to redirect to once the hosted session completes.
"https://example.com/card-onboarding/complete"
If provided, HIFI emails the hosted session link to this address.
"jane.doe@example.com"
ID of a ToS/compliance template to present during the session.
Seconds until the session expires.
300 <= x <= 6048003600
Response
Hosted external card session created successfully.
A hosted external card collection session.
Public ID of the card session (prefixed with ecs_).
"ecs_2mNpXwZ7bV1aLcs3Kf9dQ"
Public ID of the user this session belongs to (prefixed with usr_).
"usr_3Kf9dQ2mNpXwZ7bV1aLcs"
Public ID of the associated counter party, if one was supplied or has since been created.
"cpty_7bV1aLcs3Kf9dQ2mNpXwZ"
Hosted session URL, including a fragment-embedded session token. Only present on creation.
"https://dashboard.hifi.com/sandbox/external-card-sessions/ecs_2mNpXwZ7bV1aLcs3Kf9dQ?userId=usr_3Kf9dQ2mNpXwZ7bV1aLcs#sessionToken=..."
"jane.doe@example.com"
"https://example.com/card-onboarding/complete"
PENDING, PROCESSING, COMPLETED, EXPIRED "PENDING"
"2026-07-01T11:30:00.000Z"
"2026-07-01T10:30:00.000Z"
"2026-07-01T10:30:00.000Z"