APG PayAPG Paydocs

Payment tokens

Create surcharge quotes

POST/surcharge-quotes

Ask what a payment would cost. The way you identify the method is selected by the body's type.

3 actionsSrchqCmdForAccountSrchqCmdForCardSrchqCmdForSavedSource

Permissions

Required permission
paymentTokens:create

Requires the `create` action on `paymentTokens` 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 = "SrchqCmdForAccount"
merchantIdMchtIdrequired

Identifier of a merchant.

Example mcht_9f2Kd8QpLzXw

An amount in minor current units of a given currency.

methodSrchqAccountMethodrequired
DirectDebitPayToBankTransferUnknown
customerTypeSrchqCustomerTyperequired
ConsumerOrganisationUnknown
curl -X POST https://api.tst.au.apgpay.dev/surcharge-quotes \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "SrchqCmdForAccount",
  "merchantId": "mcht_9f2Kd8QpLzXw",
  "amount": {
    "type": "IsoCurrencyAmount",
    "minorCurrencyUnits": 1250,
    "currency": "AUD"
  },
  "method": "DirectDebit",
  "form": {
    "type": "SrchqFormPayInFull"
  },
  "customerType": "Consumer"
}'

Responses

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

Discriminated by type
type = "SrchqCreateRspAttributes"

The resource that was created.

Example
{
  "type": "SrchqCreateRspAttributes",
  "created": {
    "type": "SrchqViewAttributes",
    "surchargeQuoteId": "srchq_9f2Kd8QpLzXw",
    "merchantId": "mcht_9f2Kd8QpLzXw",
    "amounts": {
      "type": "SrchqAmountsAttributes",
      "currency": "AUD",
      "amount": 1250,
      "surcharge": 1250,
      "total": 1250
    },
    "summary": "string",
    "method": {
      "type": "SrchqMethodApplePay",
      "card": {
        "type": "SrchqCardAttributesAttributes",
        "currency": "AUD",
        "country": "AU",
        "brand": "Visa",
        "funding": "Credit",
        "prepaid": true,
        "issuer": "string",
        "bin": "424242",
        "productType": "Consumer",
        "schemeProduct": "MasterCardCrPer"
      }
    }
  }
}

Error responses