APG PayAPG Paydocs

Simulations

Create simulations

POST/simulations

Make the platform act as a card network or issuer would: authorise, clear, refund or dispute a card payment, replay an issuer message, or process the queued ones. Test environments only.

6 actionsSimCmdCardAuthorisationSimCmdCardClearingSimCmdCardRefundSimCmdDisputeSimCmdIssuerMessageSimCmdIssuerMessageProcessing

Permissions

Required permission
simulations:create

Requires the `create` action on `simulations` 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 = "SimCmdCardAuthorisation"
providerIdentifierstringrequired

The card's identifier at the provider, providerIdentifier on the card, not its dcard_ id.

An amount in minor current units of a given currency.

merchantNamestringrequired

The merchant the purchase was made at, as it would appear on a statement.

Example Ada Lovelace

merchantCategoryCodestringrequired

The merchant's category code, four digits. Decides which limits and fees apply.

curl -X POST https://api.tst.au.apgpay.dev/simulations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "SimCmdCardAuthorisation",
  "providerIdentifier": "string",
  "amount": {
    "type": "IsoCurrencyAmount",
    "minorCurrencyUnits": 1250,
    "currency": "AUD"
  },
  "merchantName": "Ada Lovelace",
  "merchantCategoryCode": "string"
}'

Responses

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

Discriminated by type
type = "SimCreateRspAttributes"

The resource that was created.

Example
{
  "type": "SimCreateRspAttributes",
  "created": {
    "type": "SimViewCardAuthorised",
    "transactionReference": "your-own-reference",
    "authorisationId": "string",
    "succeeded": true,
    "message": "string"
  }
}

Error responses