APG PayAPG Paydocs

Identity

Create auth tokens

POST/auth-tokens

Mint an auth token, ask what one says about itself, or exchange a customer's for a bearer. The credential is optional, see below.

3 actionsAtknCmdExchangeAtknCmdInspectAtknCmdIssue

Permissions

Required permission
sessions:create

Requires the `create` action on `sessions` for the supplied runtime context

Request body

This body is a typed union. Pick a variant to see its fields and a matching example.

Discriminated by type
type = "AtknCmdExchange"
tokenstringrequired

The customer auth token. Sent in the body, never in a URL.

Example tok_9f2Kd8QpLzXwR4mN

curl -X POST https://api.tst.au.apgpay.dev/auth-tokens \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "AtknCmdExchange",
  "token": "tok_9f2Kd8QpLzXwR4mN"
}'

Responses

The response is a tagged shape: type is always "AtknCreateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.

Discriminated by type
type = "AtknCreateRspAttributes"

The resource that was created.

Example
{
  "type": "AtknCreateRspAttributes",
  "created": {
    "type": "AtknViewExchanged",
    "state": "Valid",
    "emailAddress": "ada@example.com",
    "customToken": "tok_9f2Kd8QpLzXwR4mN"
  }
}

Error responses