Skip to content

April API (3.0)

Download OpenAPI description
Languages
Servers
Sandbox
https://api.sandbox.au.meetapril.io
Production
https://api.au.meetapril.io

Authentication

These endpoints provide various methods for authenticating users from a backend service.

  • POST /auth/signin Sign-in from a backend service on behalf of a consumer customer (B2C) or customer delegate (B2B)
Operations

Customers

A person or business purchasing goods or services from a merchant using Spenda to facilitate the payment. Customers are defined at the merchant level, so if an individual makes payments with multiple merchants, they will have a customer record for each of these merchants.

Spenda supports two broad categories of customers:

Consumer customers are individuals typically making purchases from the merchant via e-commerce websites. They are uniquely identified by emailAddress for a given merchant.

Organisation customers represent businesses wishing to make purchases from the merchant. They are uniquely identified by referenceCustomerId for a given merchant.

Operations

Merchants

A business or individual that uses Spenda to facilitate payments for their customers.

Operations

Payment sources

A payment source represents a reusable source of funds to use for payments.

Operations

Payment tokens

A payment token represents a single use reference to a source of funds that can be used to pay for an order.

Operations

Create Payment Token

Request

Generate a pay-in-full payment token based on the provided payment source. The token can be used to pay for an order of the given amount and currency.

Authenticated customers can only create tokens for themselves and not for other customers. All other clients may specify the customer they wish to be associated with the payment token using the Customer-Id header or by providing a customer specific payment source. If authenticating with a merchant public key, you cannot use a customer specific payment source.

For marketplace clients, you will need to indicate the merchant to create the token against using the Merchant-Id header.

Security
Marketplace API Key | Merchant Public Token | Merchant Secret Token | Customer JWT | Merchant JWT | Marketplace JWT | Admin JWT
Headers
Customer-Idstring

Perform operation in the context of the given merchant customer. Usually not required — specify only if acting on behalf of a merchant customer not implied by the credentials specified in the Authorization header.

Merchant-Idstring

Perform operation in the context of the given merchant. Usually not required — specify only if acting on behalf of a merchant not implied by the credentials specified in the Authorization header.

Bodyapplication/jsonrequired
One of:
CreateApplePayTokenobject(CreateApplePayToken1)required

Create a payment token based on an Apple Pay datagram.

CreateApplePayToken.​amountobject(CurrencyAmount)required

The amount and currency of the payment

CreateApplePayToken.​amount.​minorCurrencyUnitsinteger(int64)required

The amount in minor currency units (e.g. cents for AUD).

CreateApplePayToken.​amount.​currencystringrequired

The currency of the given amount as a 3 letter ISO code.

CreateApplePayToken.​applePayobject(EncryptedApplePay)required

Apple Pay data packet

CreateApplePayToken.​applePay.​paymentMethodobject(ApplePayPaymentMethod)required
CreateApplePayToken.​applePay.​paymentMethod.​displayNamestring
CreateApplePayToken.​applePay.​paymentMethod.​networkstring
CreateApplePayToken.​applePay.​paymentMethod.​typestring(ApplePayPaymentMethodType)
Enum"debit""credit""prepaid""store"
CreateApplePayToken.​applePay.​transactionIdentifierstring
CreateApplePayToken.​applePay.​paymentDataobject(PaymentData)
CreateApplePayToken.​surchargeRequirementSurchargeQuoted (object) or SurchargeSpecified (object)(SurchargeRequirement)
One of:

Specifies the options for surcharging, if required, defaults to no surcharge.

curl -i -X POST \
  https://api.sandbox.au.meetapril.io/tokens \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Customer-Id: string' \
  -H 'Merchant-Id: string' \
  -d '{
    "CreateApplePayToken": {
      "amount": {
        "minorCurrencyUnits": 0,
        "currency": "AUD"
      },
      "applePay": {
        "paymentMethod": {
          "displayName": "string",
          "network": "string",
          "type": "debit"
        },
        "transactionIdentifier": "string",
        "paymentData": {
          "data": "string",
          "header": {
            "publicKeyHash": "string",
            "transactionId": "string",
            "applicationData": "string",
            "ephemeralPublicKey": "string",
            "wrappedKey": "string"
          },
          "signature": "string",
          "version": "EC_v1"
        }
      },
      "surchargeRequirement": {
        "surchargeQuote": {
          "unsurchargedAmount": 0,
          "surchargeAmount": 0,
          "totalAmount": 0,
          "paymentMethod": {
            "cardAttributes": {
              "currency": "string",
              "country": "AF",
              "funding": "credit",
              "prepaid": true,
              "brand": "",
              "issuer": "string",
              "productType": "CP",
              "schemeProduct": "AC000",
              "bin": "string"
            }
          },
          "summary": "string",
          "quoteVerificationToken": "string"
        }
      }
    }
  }'

Responses

Bodyapplication/json
One of:
BankAccountTokenobject(BankAccountToken1)required
BankAccountToken.​paymentTokenIdstringrequired
BankAccountToken.​amountobject(CurrencyAmount)required

An amount in minor current units of a given currency.

BankAccountToken.​amount.​minorCurrencyUnitsinteger(int64)required

The amount in minor currency units (e.g. cents for AUD).

BankAccountToken.​amount.​currencystringrequired

The currency of the given amount as a 3 letter ISO code.

BankAccountToken.​surchargeAmountinteger(int64)required
BankAccountToken.​emailAddressstringrequired
BankAccountToken.​agreementAcceptedbooleanrequired
BankAccountToken.​bankAccountobject(BankAccount)required
BankAccountToken.​bankAccount.​accountNamestringrequired

Name of the person or business that holds the account

BankAccountToken.​bankAccount.​bankNamestring

Name of financial institution where the account is held.

BankAccountToken.​bankAccount.​identifierAuBankAccountIdentifier (object) or HkBankAccountIdentifier (object) or HkUsdBankAccountIdentifier (object) or NzBankAccountIdentifier (object) or SgBankAccountIdentifier (object)(BankAccountIdentifier)required
One of:

Region specific identifier for the bank account.

BankAccountToken.​bankAccount.​identifier.​AuBankAccountIdentifierobject(AuBankAccountIdentifier1)required
BankAccountToken.​bankAccount.​identifier.​AuBankAccountIdentifier.​bsbstringrequired

Branch code (also known as BSB), 6 digits.

BankAccountToken.​bankAccount.​identifier.​AuBankAccountIdentifier.​accountNumberstringrequired

Account number, all digits.

BankAccountToken.​bankAccount.​currencystringrequired

3 letter ISO code indicating the currency of the bank account.

Response
application/json
{ "BankAccountToken": { "paymentTokenId": "ptkn_aZ-9VPKvllCPqGs0", "amount": {}, "surchargeAmount": 0, "emailAddress": "string", "agreementAccepted": true, "bankAccount": {} } }

Query Payment Token

Request

Get the details for a pay-in-full payment token.

Security
Marketplace API Key | Merchant Public Token | Merchant Secret Token | Customer JWT | Merchant JWT | Marketplace JWT | Admin JWT
Path
paymentTokenIdstringrequired
curl -i -X GET \
  'https://api.sandbox.au.meetapril.io/tokens/{paymentTokenId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Bodyapplication/json
paymentTokenIdstringrequired
paymentSourceIdstring
amountobject(CurrencyAmount)required

An amount in minor current units of a given currency.

amount.​minorCurrencyUnitsinteger(int64)required

The amount in minor currency units (e.g. cents for AUD).

amount.​currencystringrequired

The currency of the given amount as a 3 letter ISO code.

surchargeAmountinteger(int64)required
payTypestring(PayTypeDto)required
Enum"payplan""payinfull"
methodBankTransferTokenDetails (object) or CardTokenDetails (object) or DirectDebitTokenDetails (object) or NetworkTokenDetails (object) or PayToTokenDetails (object)(PaymentTokenMethod)required
One of:
method.​BankTransferTokenDetailsobject(BankTransferTokenDetails1)required
method.​BankTransferTokenDetails.​referencestringrequired
payPlanVariantstring(PayPlanVariant)
Enum"payplan_fortnight_25_25_25_25""payplan_4_weekly_payments""payplan_8_weekly_payments""payplan_26_fortnightly_payments""payplan_52_weekly_payments""payplan_2_monthly_payments""payplan_3_monthly_payments""payplan_4_monthly_payments""payplan_5_monthly_payments""payplan_6_monthly_payments"
Response
application/json
{ "paymentTokenId": "ptkn_aZ-9VPKvllCPqGs0", "paymentSourceId": "psrc_aZ-9UfKvllCPqGsf", "amount": { "minorCurrencyUnits": 0, "currency": "AUD" }, "surchargeAmount": 0, "payType": "payplan", "method": { "BankTransferTokenDetails": {} }, "payPlanVariant": "payplan_fortnight_25_25_25_25" }

Calculate Surcharge

Request

Calculates the surcharged amounts for the specified payment type.

Security
Marketplace API Key | Merchant Public Token | Merchant Secret Token | Customer JWT | Merchant JWT | Marketplace JWT | Admin JWT
Path
merchantIdstringrequired
Bodyapplication/jsonrequired
One of:
PaymentSurchargeRequestobject(PaymentSurchargeRequest1)required
PaymentSurchargeRequest.​paymentobject(PaymentDescriptor_Vault)required

Details of the payment that will be surcharged.

PaymentSurchargeRequest.​payment.​formPayInFull (object) or PayPlan (object)(PaymentForm_Vault)required
One of:

The payment form (eg pay in full).

PaymentSurchargeRequest.​payment.​form.​PayInFullobject(PayInFull1)required

Indicates a payment that is paid off in full at the time of the order.

PaymentSurchargeRequest.​payment.​customerTypestring(PaymentCustomerType)required

The payment customer type (eg organisation).

Enum"Consumer""Organisation"
PaymentSurchargeRequest.​payment.​amountobject(PaymentAmount)required

The payment amount.

PaymentSurchargeRequest.​payment.​amount.​amountinteger(int64)required

The amount of the payment in minor currency units (eg cents for AUD)

PaymentSurchargeRequest.​payment.​amount.​currencystringrequired

The currency of the payment

PaymentSurchargeRequest.​payment.​methodApplePay (object) or BankTransfer (object) or Card (object) or DirectDebit (object) or GooglePay (object) or SavedPaymentSource (object)(PaymentMethod_Vault)required
One of:

The payment method (eg by card).

PaymentSurchargeRequest.​payment.​method.​ApplePayobject(ApplePay2)required

Payment method is based on an Apple Pay datagram.

PaymentSurchargeRequest.​payment.​method.​ApplePay.​applePayobject(EncryptedApplePay)required

Apple Pay data packet

curl -i -X POST \
  'https://api.sandbox.au.meetapril.io/tokens/{merchantId}/surchargequote' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "PaymentSurchargeRequest": {
      "payment": {
        "form": {
          "PayInFull": {}
        },
        "customerType": "Consumer",
        "amount": {
          "amount": 0,
          "currency": "AUD"
        },
        "method": {
          "ApplePay": {
            "applePay": {
              "paymentMethod": {
                "displayName": "string",
                "network": "string",
                "type": "debit"
              },
              "transactionIdentifier": "string",
              "paymentData": {
                "data": "string",
                "header": {},
                "signature": "string",
                "version": "EC_v1"
              }
            }
          }
        }
      }
    }
  }'

Responses

Bodyapplication/json
One of:
PaymentSurchargeResponseobject(PaymentSurchargeResponse1)required
PaymentSurchargeResponse.​surchargeQuoteobject(SurchargeQuote)required

A surcharge quote for the proposed payment in CalculateSurchargeRequest.PaymentSurchargeRequest

PaymentSurchargeResponse.​surchargeQuote.​unsurchargedAmountinteger(int64)required

Describes the surcharging quote resulting from a backend calculation based on configured rates. The amount prior to surcharging, in minor currency units (e.g. cents for AUD).

PaymentSurchargeResponse.​surchargeQuote.​surchargeAmountinteger(int64)required

The amount of the surcharge, in minor currency units (e.g. cents for AUD).

PaymentSurchargeResponse.​surchargeQuote.​totalAmountinteger(int64)required

The total amount including the surcharge, in minor currency units (e.g. cents for AUD).

PaymentSurchargeResponse.​surchargeQuote.​paymentMethodApplePay (object) or BankTransfer (object) or Card (object) or DirectDebit (object) or GooglePay (object) or PayTo (object) or SavedPaymentSource (object)(PaymentMethod)required
One of:

Payment method is via ApplePay.

PaymentSurchargeResponse.​surchargeQuote.​paymentMethod.​cardAttributesobject(CardAttributes)required

The attributes of the specified card.

PaymentSurchargeResponse.​surchargeQuote.​paymentMethod.​cardAttributes.​currencystring

Currency of the card.

PaymentSurchargeResponse.​surchargeQuote.​paymentMethod.​cardAttributes.​countrystring(IsoCountry)

Country of issue of the card as a ISO-3166-1 alpha-2 code.

Enum"AF""AX""AL""DZ""AS""AD""AO""AI""AQ""AG"
PaymentSurchargeResponse.​surchargeQuote.​paymentMethod.​cardAttributes.​fundingstring(CardFunding)required

The type of funding of the card, eg credit.

Enum"credit""debit""chargecard""prepaid""deferreddebit""unknown"
PaymentSurchargeResponse.​surchargeQuote.​paymentMethod.​cardAttributes.​prepaidboolean

Whether the card is prepaid (not specified if unknown).

PaymentSurchargeResponse.​surchargeQuote.​paymentMethod.​cardAttributes.​brandstring(CardBrand)

The brand of the card, eg Visa.

Enum"""American Express""MasterCard""Visa""Diners Club""Discover""UnionPay""Maestro""Elo""Mir"
PaymentSurchargeResponse.​surchargeQuote.​paymentMethod.​cardAttributes.​issuerstringrequired

The name of the card issuer.

PaymentSurchargeResponse.​surchargeQuote.​paymentMethod.​cardAttributes.​productTypestring(ProductType)

The product type of the card, if known (eg wallet payments may not know this).

Enum"CP""CN"
PaymentSurchargeResponse.​surchargeQuote.​paymentMethod.​cardAttributes.​schemeProductstring(SchemeProduct)

The scheme product code applying to the card, if known (eg wallet payments may not know this).

Enum"AC000""ACMCW""ACMCY""ACMNW""AS000""AX000""BC000""BCVIY""DC000""DCCC0"
PaymentSurchargeResponse.​surchargeQuote.​paymentMethod.​cardAttributes.​binstring

The BIN of the card, if known.

PaymentSurchargeResponse.​surchargeQuote.​summarystringrequired

A free-form text description of the surcharge (eg '1% + $0.30 for Visa').

PaymentSurchargeResponse.​surchargeQuote.​quoteVerificationTokenstringrequired

Verification token for the surcharge quote.

Response
application/json
{ "PaymentSurchargeResponse": { "surchargeQuote": {} } }

Pay plans

A pay plan represents a payment where the Spenda platform has extended a loan to make a purchase that the customer pays back over one or more instalments.

  • POST /payplans/offer Create a pay plan offer for a registered and KYC'd merchant customer
  • GET /payplans Return a paginated list of matching pay plans
  • POST /payplans Create a pay plan and payment token from a successful pay plan offer
  • GET /payplans/{payPlanId} Return details of a pay plan
  • POST /payplans/max Return the maximum loan amount the given customer is currently eligible for
  • POST /payplans/parameters Calculate the pay plan parameters for the given amount and list of variants
Operations

Orders

An order captures the details of the goods or services that the customer is purchasing from the merchant.

Operations

Simulation

Sandbox only endpoints for simulating external events such as a bank transfer.

  • POST /simulation Sandbox only endpoint to simulate external events such as a bank transfer being performed
Operations

Transactions

A transaction is a payment from the perspective of a merchant. The transaction shows how much the merchant will be paid, if they have been paid already and whether there have been any refunds.

Operations

Marketplaces

A B2B2C setup where an entity with business customers (sub-merchants) uses Spenda to facilitate payments for their customers' customers.

Operations

Webhooks

Webhooks are a mechanism where merchants and marketplaces can register an endpoints against one or more events. When these events occur, a POST HTTP request is made to the registered endpoint with the event details.

  • GET /webhooks Return a paginated list of matching webhook subscriptions
  • POST /webhooks Create a new webhook subscription
  • GET /webhooks/{id} Return details of a webhook subscription
  • PATCH /webhooks/{id} Update an existing webhook subscription
Operations

Loans

Loans are payment products where credit is extended by a loan facility to a borrower. The borrower can be either an individual or a business depending on the loan product in question.

Operations

Card issuer

Endpoints related to the issuing of digital cards, typically associated with a trade account based loan.

Operations

PayTo

Operations