APG PayAPG Paydocs

Card issuer

Create cards

POST/cards

Issue a digital card against a loan. The network is selected by the body's type.

2 actionsCardCmdCreateMastercardCardCmdCreateUatp

Permissions

Required permission
creditCards:create

Requires the `create` action on `creditCards` 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 = "CardCmdCreateMastercard"
loanIdLoanIdrequired

The loan the card draws against.

Example loan_9f2Kd8QpLzXw

What a card is issued with.

curl -X POST https://api.tst.au.apgpay.dev/cards \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "CardCmdCreateMastercard",
  "loanId": "loan_9f2Kd8QpLzXw",
  "spec": {
    "type": "CardSpecAttributes",
    "cardUser": {
      "type": "CardUserAttributes",
      "name": "Ada Lovelace",
      "emailAddress": "ada@example.com",
      "phoneNumber": "+61400000000"
    },
    "creator": "string",
    "validFrom": "2026-08-19T04:21:07Z",
    "validTo": "2026-08-19T04:21:07Z",
    "limits": {
      "type": "CardLimitsAttributes",
      "currency": "AUD",
      "cardLimit": 500000,
      "transactionLimit": 500000
    },
    "usage": "Single",
    "currencies": [
      "AUD"
    ],
    "metadata": {
      "yourKey": {}
    }
  }
}'

Responses

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

Discriminated by type
type = "CardCreateRspAttributes"

The resource that was created.

Example
{
  "type": "CardCreateRspAttributes",
  "created": {
    "type": "CardViewAttributes",
    "cardId": "dcard_9f2Kd8QpLzXw",
    "cardType": "Virtual",
    "status": "Active",
    "card": {
      "type": "CardRedactedAttributes",
      "last4": "4242",
      "bin": "424242",
      "brand": "Visa",
      "expiryMonth": 6,
      "expiryYear": 2029
    },
    "cardUser": {
      "type": "CardUserAttributes",
      "name": "Ada Lovelace",
      "emailAddress": "ada@example.com",
      "phoneNumber": "+61400000000"
    },
    "amounts": {
      "type": "CardAmountsAttributes",
      "currency": "AUD",
      "cardLimit": 500000,
      "transactionLimit": 500000,
      "available": 1250
    },
    "validFrom": "2026-08-19T04:21:07Z",
    "validTo": "2026-08-19T04:21:07Z",
    "usage": "Single",
    "currencies": [
      "AUD"
    ],
    "synonyms": [
      "string"
    ],
    "creator": "string",
    "providerIdentifier": "string",
    "metadata": {
      "yourKey": {}
    },
    "createdAt": "2026-08-19T04:21:07Z"
  }
}

Error responses