APG PayAPG Paydocs

Payment tokens

Get payment token

GET/payment-tokens/{paymentTokenId}
Request
GEThttps://api.tst.au.apgpay.dev/payment-tokens/{paymentTokenId}
curl -X GET https://api.tst.au.apgpay.dev/payment-tokens/{paymentTokenId} \
  -H "Authorization: Bearer $API_KEY"

Return one payment token.

Permissions

Required permission
paymentTokens:query

Requires the `query` action on `paymentTokens` for the supplied runtime context

Path parameters

paymentTokenIdstring
required

Responses

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

Discriminated by type
type = "PtknViewAttributes"
paymentTokenIdPtknIdrequired

Identifier of a payment token.

Example ptkn_9f2Kd8QpLzXw

sourceIdPsrcId

The stored source this token was made from. Absent for a bank transfer and for a network token, which have no stored source.

Example psrc_9f2Kd8QpLzXw

What a payment token charges. Both are in the single currency given here.

Whether this token pays in full or funds a plan, and which plan.

What this token pays with. Decision 2: the method lives here and nowhere else, so everything downstream can refer to the token.

Example
{
  "type": "PtknViewAttributes",
  "paymentTokenId": "ptkn_9f2Kd8QpLzXw",
  "sourceId": "psrc_9f2Kd8QpLzXw",
  "amounts": {
    "type": "PtknAmountsAttributes",
    "currency": "AUD",
    "amount": 1250,
    "surcharge": 1250
  },
  "paymentType": {
    "type": "PtknTypePayInFull"
  },
  "method": {
    "type": "PtknMethodBankTransfer",
    "reference": "your-own-reference"
  }
}

Error responses