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

Query Customers

Request

Return a paginated list of matching customers.

Security
Marketplace API Key | Merchant JWT | Marketplace JWT | Admin JWT
Query
limitinteger(int32)

Maximum results per page. Default to 20, must be between 1 and 500.

pageinteger(int32)

Page number of results to show (starting at page 1).

sortstring

Comma-delimited list of fields to sort by with sort priority from first to last. Fields are sorted by their natural ordering unless prefixed with a - character.

createdAfterstring(date-time)

Return customers that were created at or after this timestamp

createdBeforestring(date-time)

Return customers that were created at or before this timestamp

emailAddressArray of strings

Filter by email address

customerIdArray of strings

Filter by customer system identifier

merchantIdArray of strings

Filter by merchant system identifier

namestring

Filter by first name, last name or organisation name

curl -i -X GET \
  'https://api.sandbox.au.meetapril.io/customers?limit=0&page=0&sort=string&createdAfter=2019-08-24T14%3A15%3A22Z&createdBefore=2019-08-24T14%3A15%3A22Z&emailAddress=string&customerId=string&merchantId=string&name=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Matching items sorted as specified

Headers
Page-Countinteger(int64)required

Total count of pages available for current query.

Total-Record-Countinteger(int64)required

Total number of records matching the query.

Bodyapplication/jsonArray [
One of:
ConsumerCustomerobject(ConsumerCustomer1)required
ConsumerCustomer.​customerIdstringrequired

System unique identifier for a merchant customer.

ConsumerCustomer.​merchantIdstringrequired

System unique identifier for a merchant.

ConsumerCustomer.​marketplaceIdstring

System unique identifier for a marketplace.

ConsumerCustomer.​referenceCustomerIdstring

A reference provided by the merchant to identify this customer. If provided, must be unique for the given merchant.

ConsumerCustomer.​emailAddressstring

Email address of the customer.

ConsumerCustomer.​givenNamestring

Restricted field - only included if caller has access.

ConsumerCustomer.​middleNamestring

Restricted field - only included if caller has access.

ConsumerCustomer.​familyNamestring

Restricted field - only included if caller has access.

ConsumerCustomer.​isVerifiedbooleanrequired

Has the phone number and email address for this customer been verified to be correct.

ConsumerCustomer.​phoneNumberstring

Phone number of the customer.

ConsumerCustomer.​createdAtstring(date-time)required

When the customer was first added to the system.

ConsumerCustomer.​updatedAtstring(date-time)required

When the customer was last updated in the system.

]
Response
application/json
[ { "ConsumerCustomer": {} } ]

Upsert Customer

Request

Create a new customer or update the details of an existing customer. For consumer customers, the email address and merchant identifier constitute the business key. For organisation customers, the customer reference id and the merchant identifier constitute the business key. If a record with the same business key already exists, then it is updated with the provided details, otherwise a new customer is added.

Security
Marketplace API Key | Merchant Secret Token
Headers
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:
UpsertConsumerCustomerobject(UpsertConsumerCustomer1)required

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

UpsertConsumerCustomer.​emailAddressstringrequired

Email address of the customer.

UpsertConsumerCustomer.​phoneNumberstring

Phone number of the customer. Note, this must be in E164 format.

UpsertConsumerCustomer.​referenceCustomerIdstring

A reference provided by the merchant to identify this customer. Must be unique for the given merchant.

UpsertConsumerCustomer.​givenNamestring
UpsertConsumerCustomer.​middleNamestring
UpsertConsumerCustomer.​familyNamestringrequired
UpsertConsumerCustomer.​isVerifiedbooleanrequired

Has the phone number and email address for this customer been verified to be correct.

UpsertConsumerCustomer.​metadataobject(JsonObject)

Additional use case data specific to individual marketplaces or target industries and applications. Format must be agreed in advance with April.

curl -i -X POST \
  https://api.sandbox.au.meetapril.io/customers \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Merchant-Id: string' \
  -d '{
    "UpsertConsumerCustomer": {
      "emailAddress": "lucy.diamond@star.com",
      "phoneNumber": "+61401234567",
      "referenceCustomerId": "CUST-48822821",
      "givenName": "string",
      "middleName": "string",
      "familyName": "string",
      "isVerified": true,
      "metadata": {}
    }
  }'

Responses

Bodyapplication/json
customerIdstringrequired
merchantIdstringrequired
Response
application/json
{ "customerId": "cust_aZ-9UfKvllCPqGsa", "merchantId": "mcht_aZ-9UfKvllCPqGsZ" }

Get Customer

Request

Return details of a customer.

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

Responses

Bodyapplication/json
One of:
ConsumerCustomerobject(ConsumerCustomer1)required
ConsumerCustomer.​customerIdstringrequired

System unique identifier for a merchant customer.

ConsumerCustomer.​merchantIdstringrequired

System unique identifier for a merchant.

ConsumerCustomer.​marketplaceIdstring

System unique identifier for a marketplace.

ConsumerCustomer.​referenceCustomerIdstring

A reference provided by the merchant to identify this customer. If provided, must be unique for the given merchant.

ConsumerCustomer.​emailAddressstring

Email address of the customer.

ConsumerCustomer.​givenNamestring

Restricted field - only included if caller has access.

ConsumerCustomer.​middleNamestring

Restricted field - only included if caller has access.

ConsumerCustomer.​familyNamestring

Restricted field - only included if caller has access.

ConsumerCustomer.​isVerifiedbooleanrequired

Has the phone number and email address for this customer been verified to be correct.

ConsumerCustomer.​phoneNumberstring

Phone number of the customer.

ConsumerCustomer.​createdAtstring(date-time)required

When the customer was first added to the system.

ConsumerCustomer.​updatedAtstring(date-time)required

When the customer was last updated in the system.

Response
application/json
{ "ConsumerCustomer": { "customerId": "cust_aZ-9UfKvllCPqGsa", "merchantId": "mcht_aZ-9UfKvllCPqGsZ", "marketplaceId": "mktp_aZ-9UfKvllCPqGsi", "referenceCustomerId": "CUST-48822821", "emailAddress": "lucy.diamond@star.com", "givenName": "string", "middleName": "string", "familyName": "string", "isVerified": true, "phoneNumber": "+61401234567", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" } }

Kyc Customer

Request

Perform a Know Your Customer (KYC) check on a consumer customer. The response may indicate that more details are required in which case subsequent calls with the additional details can be made. See Know Your Customer for more details.

Alpha release - Consider this endpoint experimental and very likely to change in future.

Security
Marketplace API Key | Merchant Secret Token | Customer JWT
Headers
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:
KycConsumerCustomerobject(KycConsumerCustomer1)required
KycConsumerCustomer.​emailAddressstringrequired

The customer's email address.

KycConsumerCustomer.​phoneNumberstringrequired

The customer's phone number.

KycConsumerCustomer.​ipAddressstringrequired

IP address that the customer is operating from.

KycConsumerCustomer.​customerIdentificationobject(CustomerIdentificationMandatory)required

Identification information for the customer.

KycConsumerCustomer.​customerIdentification.​nameobject(CustomerIdentificationName)required

The customer's name

KycConsumerCustomer.​customerIdentification.​name.​givenNamestring

The customer's given name

KycConsumerCustomer.​customerIdentification.​name.​middleNamestring

The customer's middle name

KycConsumerCustomer.​customerIdentification.​name.​familyNamestringrequired

The customer's family name

KycConsumerCustomer.​customerIdentification.​dateOfBirthstring(date)required

The customer's date of birth

KycConsumerCustomer.​customerIdentification.​addressobject(CustomerIdentificationAddress)required

The customer's address

KycConsumerCustomer.​customerIdentification.​address.​addressstringrequired

Full form address, populated from the componentised version if an independent version of the string is not available

KycConsumerCustomer.​customerIdentification.​address.​componentisedobject(ComponentisedAddress)

Componentised version of the customer address

KycConsumerCustomer.​customerIdentification.​address.​addressIdentifierstring

Machine-generated opaque address identifier

KycConsumerCustomer.​customerIdentification.​driversLicenceobject(CustomerIdentificationDriversLicence)

The customer's drivers licence details (assumes Australia)

KycConsumerCustomer.​customerIdentification.​passportobject(CustomerIdentificationPassport)

The customer's passport details (assumes Australia)

KycConsumerCustomer.​customerIdentification.​driversLicenceWithVersionobject(CustomerIdentificationDriversLicenceWithVersion)

The customer's drivers licence details with version number (used in NZ)

KycConsumerCustomer.​customerIdentification.​passportWithExpiryobject(CustomerIdentificationPassportWithExpiry)

The customer's passport details with expiry date (used in NZ)

KycConsumerCustomer.​isCustomerVerifiedbooleanrequired

Whether the customer's email and phone number have already been verified by the merchant, for example via one-time-password or other 2FA means.

KycConsumerCustomer.​referenceCustomerIdstring

Identifier for the given customer in the source system.

curl -i -X POST \
  https://api.sandbox.au.meetapril.io/customers/kyc \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Merchant-Id: string' \
  -d '{
    "KycConsumerCustomer": {
      "emailAddress": "lucy.diamond@star.com",
      "phoneNumber": "+61401234567",
      "ipAddress": "string",
      "customerIdentification": {
        "name": {
          "givenName": "string",
          "middleName": "string",
          "familyName": "string"
        },
        "dateOfBirth": "2019-08-24",
        "address": {
          "address": "string",
          "componentised": {
            "unitNumber": "string",
            "streetNumber": "string",
            "streetName": "string",
            "streetType": "string",
            "suburb": "string",
            "city": "string",
            "postcode": "string",
            "state": "string",
            "country": "string"
          },
          "addressIdentifier": "string"
        },
        "driversLicence": {
          "number": "string",
          "state": "string",
          "documentNumber": "string"
        },
        "passport": {
          "number": "string",
          "country": "string"
        },
        "driversLicenceWithVersion": {
          "number": "string",
          "versionNumber": "string"
        },
        "passportWithExpiry": {
          "number": "string",
          "expiryDate": "string"
        }
      },
      "isCustomerVerified": true,
      "referenceCustomerId": "string"
    }
  }'

Responses

Bodyapplication/json
One of:
ConsumerCustomerKycResultobject(ConsumerCustomerKycResult1)required
ConsumerCustomerKycResult.​payTypeEligibilityobject(KycPayTypeEligibility)required

Provides the KYC status information for the customer.

ConsumerCustomerKycResult.​payTypeEligibility.​eligibilitystring(CustomerIdentificationOutcome)required

The KYC status of the customer

Enum"allow""deny""idwithoutdocument""idwithdocument"
ConsumerCustomerKycResult.​payTypeEligibility.​idDocOptionsArray of objects(IdDocOption)

For eligibility = IdWithDocument, details which ID document options are allowed

ConsumerCustomerKycResult.​payTypeEligibility.​messagestring

An explanatory message associated with error conditions

Response
application/json
{ "ConsumerCustomerKycResult": { "payTypeEligibility": {} } }

Query Customer Delegates

Request

Return a paginated list of matching customer delegates.

Security
Marketplace API Key | Merchant Secret Token | Merchant JWT | Marketplace JWT | Admin JWT | Customer JWT
Query
limitinteger(int32)

Maximum results per page. Default to 20, must be between 1 and 500.

pageinteger(int32)

Page number of results to show (starting at page 1).

sortstring

Comma-delimited list of fields to sort by with sort priority from first to last. Fields are sorted by their natural ordering unless prefixed with a - character.

createdAfterstring(date-time)

Return customer delegates that were created at or after this timestamp

createdBeforestring(date-time)

Return customer delegates that were created at or before this timestamp

emailAddressArray of strings

Filter by customer delegate email address

customerDelegateIdArray of strings

Filter by customer delegate system identifier

customerIdArray of strings

Filter by customer system identifier

merchantIdArray of strings

Filter by merchant system identifier

nameArray of strings

Filter by name of the delegate

curl -i -X GET \
  'https://api.sandbox.au.meetapril.io/customers/delegates?limit=0&page=0&sort=string&createdAfter=2019-08-24T14%3A15%3A22Z&createdBefore=2019-08-24T14%3A15%3A22Z&emailAddress=string&customerDelegateId=string&customerId=string&merchantId=string&name=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Matching items sorted as specified

Headers
Page-Countinteger(int64)required

Total count of pages available for current query.

Total-Record-Countinteger(int64)required

Total number of records matching the query.

Bodyapplication/jsonArray [
customerDelegateIdstringrequired

System unique identifier for the customer delegate.

delegateEmailAddressstringrequired

Email address of the customer delegate.

delegatePhoneNumberstring

Phone number of the customer delegate.

delegateNamestring

Name of the customer delegate.

linkedCustomersArray of ConsumerCustomer (object) or OrganisationCustomer (object)(MerchantCustomerResponse)

Customers associated with this delegate.

customerAttributesArray of objects(CustomerAttributes)
createdAtstring(date-time)required
]
Response
application/json
[ { "customerDelegateId": "custd_aZ-9VPKvllCPqGs2", "delegateEmailAddress": "lucy.diamond@star.com", "delegatePhoneNumber": "+61401234567", "delegateName": "string", "linkedCustomers": [], "customerAttributes": [], "createdAt": "2019-08-24T14:15:22Z" } ]

Get Customer Delegate

Request

Return details of a customer delegate.

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

Responses

Bodyapplication/json
customerDelegateIdstringrequired

System unique identifier for the customer delegate.

delegateEmailAddressstringrequired

Email address of the customer delegate.

delegatePhoneNumberstring

Phone number of the customer delegate.

delegateNamestring

Name of the customer delegate.

linkedCustomersArray of ConsumerCustomer (object) or OrganisationCustomer (object)(MerchantCustomerResponse)

Customers associated with this delegate.

customerAttributesArray of objects(CustomerAttributes)
createdAtstring(date-time)required
Response
application/json
{ "customerDelegateId": "custd_aZ-9VPKvllCPqGs2", "delegateEmailAddress": "lucy.diamond@star.com", "delegatePhoneNumber": "+61401234567", "delegateName": "string", "linkedCustomers": [ {} ], "customerAttributes": [ {} ], "createdAt": "2019-08-24T14:15:22Z" }

Delete Customer Delegate

Request

Delete a customer delegate.

Security
Marketplace API Key | Merchant Secret Token | Merchant JWT | Marketplace JWT | Admin JWT | Customer JWT
Path
customerDelegateIdstringrequired
curl -i -X DELETE \
  'https://api.sandbox.au.meetapril.io/customers/delegates/{customerDelegateId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Response
No content

Update Customer Delegate

Request

Various actions for updating a customer delegate such as linking to a new customer.

Security
Marketplace API Key | Merchant Secret Token | Merchant JWT | Marketplace JWT | Admin JWT | Customer JWT
Path
customerDelegateIdstringrequired
Bodyapplication/jsonrequired
One of:
LinkCustomerToDelegateobject(LinkCustomerToDelegate1)required

Link this customer delegate with the given merchant customer. Payment sources saved against a delegate will be available when signing in on behalf of any customers the delegate is linked to.

LinkCustomerToDelegate.​customerIdstringrequired

System unique identifier for the customer

curl -i -X PATCH \
  'https://api.sandbox.au.meetapril.io/customers/delegates/{customerDelegateId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "LinkCustomerToDelegate": {
      "customerId": "cust_aZ-9UfKvllCPqGsa"
    }
  }'

Responses

Bodyapplication/json
customerDelegateIdstringrequired

System unique identifier for the customer delegate.

delegateEmailAddressstringrequired

Email address of the customer delegate.

delegatePhoneNumberstring

Phone number of the customer delegate.

delegateNamestring

Name of the customer delegate.

linkedCustomersArray of ConsumerCustomer (object) or OrganisationCustomer (object)(MerchantCustomerResponse)

Customers associated with this delegate.

customerAttributesArray of objects(CustomerAttributes)
createdAtstring(date-time)required
Response
application/json
{ "customerDelegateId": "custd_aZ-9VPKvllCPqGs2", "delegateEmailAddress": "lucy.diamond@star.com", "delegatePhoneNumber": "+61401234567", "delegateName": "string", "linkedCustomers": [ {} ], "customerAttributes": [ {} ], "createdAt": "2019-08-24T14:15:22Z" }

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

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