Skip to main content
POST
/
payments
/
bank-validation
/
truelayer
/
callback
Exchange TrueLayer auth code for tokens
curl --request POST \
  --url https://prod-api.pcxpay.com/v1/payments/bank-validation/truelayer/callback \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <x-api-key>' \
  --data '
{
  "code": "<string>",
  "state": "<string>"
}
'
{
  "success": true,
  "access_token": "<string>",
  "refresh_token": "<string>",
  "expires_in": 123,
  "user_id": "<string>",
  "message": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.pcxpay.com/llms.txt

Use this file to discover all available pages before exploring further.

Headers

Authorization
string
default:NONE
required

Bearer JWT for user-facing flows (Bearer eyJraWQ...), or the literal string NONE when authenticating via API key.

Example:

"Bearer eyJraWQ..."

X-Api-Key
string
default:NONE
required

API key for server-to-server flows, or the literal string NONE when authenticating via JWT.

Example:

"pcx_abc123_xxxx"

Body

application/json
code
string
required

Authorization code from TrueLayer redirect

state
string

User ID passed as state parameter

Response

Token exchange successful

success
boolean
access_token
string
refresh_token
string
expires_in
integer
user_id
string
message
string