Waivpay API

Download OpenAPI specification:Download

This document entails the Waivpay APIs, split across three distinct systems, each having their own host and requiring separate credentials. These are made available by Waivpay dependent on your integration requirements.

  • Gift Cards: Open loop physical and digital cards
  • Cashback Engine/My Receipt Rewards: Cashback loyalty promotions
  • Retailer Cards: Digital retailer cards

Overview

The Gift Cards API covers the catalogue and issuance of open-loop physical and digital branded cards.

Authentication

Authentication is done with OAuth2. Firstly, this token API endpoint must be called which will return an access token to be used for every other endpoint. It will expire after 2 hours, after which a new token must be requested.

Get Token

Request a token for API authentication. Pass in your Oauth client ID and secret in as BASIC authentication values for this call. Any API versioning can be excluded for this path i.e. api/v1 etc.

Request Body schema: application/json
grant_type
required
string

OAuth2 grant type, must be client_credentials

Responses

Request samples

Content type
application/json
{
  • "grant_type": "client_credentials"
}

Response samples

Content type
application/json
{
  • "access_token": "_ZpTZO1DAhilUSkfJ6E84AGoMJZfYEdQSPyYu-3ttM8",
  • "token_type": "Bearer",
  • "expires_in": 7200,
  • "created_at": 1632451155
}

Apps

Get App

Returns app configuration

path Parameters
app_id
required
string

ID of the app being called for. This will be provided to you by Waivpay

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/apps/1 -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{
  • "identifier": "waivpay",
  • "name": "Waivpay",
  • "tiles": [
    ],
  • "locations": [
    ],
  • "delivery_options": [
    ],
  • "terms_of_use": "<p>You must be over 18 to use this app</p>",
  • "card_terms_and_conditions": "<p>Cards are valid for 36 months</p>",
  • "faqs": "<p>Is this app endorsed by the centre?<br>Yes</p>",
  • "home_page_text": "Australia's largest shopping centre",
  • "disable_parking_collection": false
}

Catalogue

The catalogue endpoint provides a list of open-loop physical and digital cards products that are available for sale. The products in this catalogue can vary in their cover designs, the minimum and maximum value, and the fees associated with the issuance of the card. All products in this catalogue can be loaded with a variable amount that is stipulated when the card is ordered.

Get Catalogue

Request a list of card products

path Parameters
app_id
required
string

ID of the app being called for. This will be provided to you by Waivpay

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/apps/1/products -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{
  • "products": [
    ]
}

Orders

API for creating card orders and taking payment

View Orders

This returns all orders for a user or external user ID, on the assumption they were provided at time of order creation

path Parameters
app_id
required
string

ID of the app being called for. This will be provided to you by Waivpay

query Parameters
user_id
string

User ID to search orders for

external_user_id
string

External user ID to search orders for

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/apps/1/orders?user_id=5
-H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{}

Create Order

The Create Order API allows for the creation and issuance of physical and digital cards. It also takes credit card details to submit payment

path Parameters
app_id
required
string

ID of the app being called for. This will be provided to you by Waivpay

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Request Body schema: application/json
email
string

Purchaser's email address

phone_number
string

Purchaser's phone number

delivery_option_id
integer

ID of delivery option, mapped to what is returned by Get App API. Required for physical card orders

user_id
integer

Optional reference to a user ID, if Waivpay app users are being used

external_user_id
string

Optional reference to refer to an external user ID, the most common use case being for apps outside of Waivpay. Will help link all orders to the same user

payment_method
string
Enum: "credit_card" "apple_pay"

Payment method, by default credit_card and not required to pass through if so

stripe_payment_method_id
string

For apple_pay payments using newer versions of Stripe SDK. This is the payment method collected on the device to be used to confirm on the backend

validate
boolean

Optional flag to just validate order, rather than persist it. No payment will be taken. Response will just include total cost if valid

credit_card_number
string

Credit card number, encrypted using eWay's client side encryption plugin

credit_card_name
string

Credit card name

credit_card_expiry_month
string

Credit card expiry month, in format MM

credit_card_expiry_year
string

Credit card expiry year, in format YYYY

credit_card_security_code
string

Credit card security code, encrypted using eWay's client side encryption plugin

billing_same_address
boolean
Enum: true false

Flag to indicate billing details are the same as recipient details for physical orders If this flag is true, billing_address is not required

object

Recipient address details, required for physical cards

object

Billing address details of the purchaser

Array of objects

Responses

Request samples

Content type
application/json
{
  • "email": "[email protected]",
  • "phone_number": 404123123,
  • "delivery_option_id": 2,
  • "user_id": 0,
  • "external_user_id": "string",
  • "payment_method": "credit_card",
  • "stripe_payment_method_id": "string",
  • "validate": false,
  • "credit_card_number": "124jn12knfi23if23nif23iufni",
  • "credit_card_name": "Joey Bloggs",
  • "credit_card_expiry_month": "04",
  • "credit_card_expiry_year": "2027",
  • "credit_card_security_code": "1234123r12asdfkjb13kef34f",
  • "billing_same_address": false,
  • "recipient_address": {
    },
  • "billing_address": {
    },
  • "order_items": [
    ]
}

Response samples

Content type
application/json
{
  • "order_reference": 12341234,
  • "status": "payment_approved",
  • "total_cost": 105.95,
  • "total_card_fees": 5.95,
  • "gst": 0.54,
  • "delivery_fee": 0,
  • "stripe_client_secret": "pi_3LBWJJDpqfEfiA8V2brzKEnN_secret_mPlIbgbkobfjyjR67WQTMjbOJ"
}

Cards

API for card related functions, independent of whether they are physical or digital

Card Details

Returns details for the card associated with the given card ID

Due to regulatory requirements, to pull sensitive card data, such as the PAN and CCV2, you will need to send a POST request to the private_callback_url with the following payload structure

  {
    "tokenId": "ABCD-123", // value from private_token_id in Waivpay API response
  }

The response from this request will return a response including the sensitive card data fields

  {
    "pan": "1234567890123456",
    "cvv2": "123"
  }
path Parameters
app_id
required
string

ID of the app being called for. This will be provided to you by Waivpay

card_id
required
string

The card ID, or card token as part of the digital card delivery URL e.g. app.host.com/activate/1a2b3c4d

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/apps/1/cards/512512 -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{}

Update Card

Update card details, specifically used to update delivery email of digital cards for provisioning requirements

path Parameters
app_id
required
string

ID of the app being called for. This will be provided to you by Waivpay

card_id
required
string

The card ID

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Request Body schema: application/json
email
required
string

Email of the digital card owner

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "error": "Failure updating card details with bank"
}

Card Balance

Returns available balance for the card associated with the given card ID

path Parameters
app_id
required
string

ID of the app being called for. This will be provided to you by Waivpay

card_id
required
string

The card ID

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/apps/1/cards/512512/balance -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{
  • "balance": 50.75,
  • "expiry_date": "21/07/2023"
}

Card Transactions

Returns list of transactions for the card associated with the given card ID

path Parameters
app_id
required
string

ID of the app being called for. This will be provided to you by Waivpay

card_id
required
string

The card ID

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/apps/1/cards/512512/transactions -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{
  • "transactions": [
    ]
}

Search Cards

Returns details for the cards associated with the given mobile number

path Parameters
app_id
required
string

ID of the app being called for. This will be provided to you by Waivpay

card_id
required
string

The card ID

query Parameters
mobile_number
required
string

Mobile number to search for cards

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/apps/1/cards?mobile_number=0404123123 -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{}

Activate Card

Regardless of whether the card is physical or digital, this will put the card into an active state so funds can be spent. Digital cards of $200 or more will also require a pin to be set for use with contactless payments

path Parameters
app_id
required
string

ID of the app being called for. This will be provided to you by Waivpay

card_id
required
string

The card ID

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Request Body schema: application/json
required
pin
number

PIN for digital cards

Responses

Request samples

Content type
application/json
{
  • "pin": 1234
}

Response samples

Content type
application/json
{
  • "error": "Card not found"
}

Provision Card

Enables digital cards to be added to Google Pay/Apple wallet from an app. Apple wallets require extra certificate information as described in request body below

path Parameters
app_id
required
string

ID of the app being called for. This will be provided to you by Waivpay

card_id
required
string

The card ID

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Request Body schema: application/json
required
wallet_type
required
string
Enum: "android" "ios"

Whether the app is provisioning into Apple or Google Play wallet

nonce
string

Value generated in Xcode for provisioning, only required for ios

nonce_signature
string

Value generated in Xcode for provisioning, only required for ios

certificate_leaf
string

Value generated in Xcode for provisioning, only required for ios

certificate_root
any

Value generated in Xcode for provisioning, only required for ios

Responses

Request samples

Content type
application/json
{
  • "wallet_type": "android",
  • "nonce": "abc100",
  • "nonce_signature": "abc100",
  • "certificate_leaf": "MIIabc100=",
  • "certificate_root": "MIIabc100="
}

Response samples

Content type
application/json
{
  • "error": "Email required for provisioning to wallet"
}

Overview

The direct Gift Cards API covers the catalogue and issuance of open-loop physical and digital branded cards directly through float invoicess.

Authentication

Authentication is done with OAuth2. Firstly, this token API endpoint must be called which will return an access token to be used for every other endpoint. It will expire after 2 hours, after which a new token must be requested.

Get Token

Request a token for API authentication. Pass in your Oauth client ID and secret in as BASIC authentication values for this call. Any API versioning can be excluded for this path i.e. api/v1 etc.

Request Body schema: application/json
grant_type
required
string

OAuth2 grant type, must be client_credentials

Responses

Request samples

Content type
application/json
{
  • "grant_type": "client_credentials"
}

Response samples

Content type
application/json
{
  • "access_token": "_ZpTZO1DAhilUSkfJ6E84AGoMJZfYEdQSPyYu-3ttM8",
  • "token_type": "Bearer",
  • "expires_in": 7200,
  • "created_at": 1632451155
}

Products

The products endpoint provides a list of open-loop physical and digital cards products that are available for sale. The products in this catalogue can vary in their cover designs, the minimum and maximum value, and the fees associated with the issuance of the card. All products in this catalogue can be loaded with a variable amount that is stipulated when the card is ordered.

Get Products

Request a list of card products

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/products -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{
  • "products": [
    ]
}

Invoices

The invoices endpoint provides a list invoices that can be used to make purchases with.

Get Invoices

Request a list of invoices

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/invoices -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{
  • "invoices": [
    ]
}

Loads

The loads endpoint provides ability to order a card, either physical or digital. It supports payment by invoice

Load card

Creates a transaction for a card

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Request Body schema: application/json
amount
required
decimal

Amount to load on card

product_id
number

Product ID. Only required for digital products

card_number
string

Card number. Only required for physical products. Product will be determined from this card number

payment_method
required
string
Value: "invoice"

Payment method

object

Invoice payment method object

delivery_first_name
string

First name of recipient. Required for digital mastercards

delivery_last_name
string

Last name of recipient. Required for digital mastercards

delivery_sms_number
string

Mobile number of recipient. Required for digital mastercards

transaction_reference
string

Optional reference for the transaction

Responses

Request samples

Content type
application/json
{
  • "amount": 50,
  • "product_id": 125,
  • "card_number": 20123123123,
  • "payment_method": "invoice",
  • "invoice": {
    },
  • "delivery_first_name": "Joey",
  • "delivery_last_name": "Bloggs",
  • "delivery_sms_number": 404123123,
  • "transaction_reference": "Order 1234"
}

Response samples

Content type
application/json
{
  • "id": 1008,
  • "status": "paid",
  • "total_paid": 7.5,
  • "total_value": 5,
  • "total_fees": 2.5,
  • "created_at": "2024-04-12T15:30:10.698+10:00",
  • "transaction_reference": "Order 1234"
}

Overview

Cashback Engine is a platform for providing cashback and various loyalty promotions

Authentication

Authentication is done with OAuth2. Firstly, this token API endpoint must be called which will return an access token to be used for every other endpoint. It will expire after 2 hours, after which a new token must be requested.

Get Token

Request a token for API authentication. Pass in your Oauth client ID and secret in as BASIC authentication values for this call. Any API versioning can be excluded for this path i.e. api/v1 etc.

Request Body schema: application/json
grant_type
required
string

OAuth2 grant type, must be client_credentials

Responses

Request samples

Content type
application/json
{
  • "grant_type": "client_credentials"
}

Response samples

Content type
application/json
{
  • "access_token": "_ZpTZO1DAhilUSkfJ6E84AGoMJZfYEdQSPyYu-3ttM8",
  • "token_type": "Bearer",
  • "expires_in": 7200,
  • "created_at": 1632451155
}

Promotions

Promotions are the core configuration for how promotions are run

List Promotions

Request a list of promotions for an organisation

path Parameters
organisation_id
required
integer

ID of the organisation. This will be provided to you by Waivpay

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/organisations/1/promotions -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{
  • "promotions": [
    ]
}

Get Promotion

Returns information about a specific promotion. Not all information may be required, see notes for more extensive description of promotion config that is returned.

path Parameters
organisation_id
required
integer

ID of organisation. This will be provided to you by Waivpay

promotion_id
required
integer

ID of the promotion

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/organisations/1/promotions/6 -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{}

BSB

Provides basic validation for BSB numbers for delivery addresses

Validate BSB

Validates BSB data primarily for delivery addresses. Will return bank information if found. If not found, does not mean is invalid but may be worth double checking if has been entered correctly

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Request Body schema: application/json
required
bsb
required
integer

BSB to validate

Responses

Request samples

Content type
application/json
{
  • "bsb": 123123
}

Response samples

Content type
application/json
{
  • "bank_name": "Commonwealth Bank"
}

Claims

Search Claims

Returns a list of claims matching the provided external user ID. This ID is optionally given to a claim on creation

query Parameters
external_user_id
required
string

External user ID to return claims for

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/claims?external_user_id=1241 -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{
  • "claims": [
    ]
}

Get Claim

Returns information and status about a specific claim, using the claim ID given to the user at time of claim

path Parameters
promotion_id
required
integer

ID of the promotion

claim_id
required
integer

ID of the claim, given and emailed to user at time of successful claim submission

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Responses

Request samples

curl -X GET https://<host>/promotions/8/claims/424124122 -H 'Authorization: Bearer <access_token>'

Response samples

Content type
application/json
{
  • "claim": {
    }
}

Upload File

This uploads a file to the platform, returning a file ID, that is passed along with the data in the Create Claim endpoint

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Content-Type
required
string

multipart/form-data

Request Body schema: multipart/form-data
required
file
file

File passed in as multipart/form-data. Supported file types are standard image formats and PDF

Responses

Request samples

curl -X POST https://<host>/claims/file_uploads -F 'file=/Users/dev/images/test.png'
-H 'Authorization: Bearer <access_token>;Content-Type: multipart/form-data'

Response samples

Content type
application/json
{
  • "file_id": 14142323,
  • "filename": "receipt.png"
}

Create Claim

The claims API allows for submissions to a promotion. Some of the data required is based off specific promotion configuration, particularly the custom fields section. File custom fields require the File Upload API to be utilised prior to submitting a claim

path Parameters
promotion_id
required
integer

ID of the promotion

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Request Body schema: application/json
required
product_id
integer

Product ID the claim is for, if promotion has more than one product configured. IDs can be found in promotion configuration

fulfilment_type_id
integer

Fulfilment Type ID the claim is for, if product has more than one fulfilment type configured. IDs can be found in promotion configuration

external_user_id
string

An optional external user ID reference that can later be used to search for claims

fields
required
object

This is a key/value pair object, where the keys correspond to the custom field IDs. These are found in the promotion configuration. The values are the user value for these inputs

required
object

Holder for all delivery fields, can differ based off fulfilment type

Responses

Request samples

Content type
application/json
{
  • "product_id": 3,
  • "fulfilment_type_id": 2,
  • "external_user_id": 151412,
  • "fields": {
    },
  • "delivery": {
    }
}

Response samples

Content type
application/json
{
  • "claim_id": 14142323
}

Update Fulfilment Details

This API allows claims that have been marked as fulfilment_failed to be updated with new details for fulfilment to be retried. This is primarily used for bank_transfer claims that have bounced due to incorrect bank details.

It is worth noting that it is possible this action will result in a decline of a claim. For example, if a claim is being updated with new bank details, but the new bank account has reached a claim limit, it may decline the claim depending on the promotion rules/setup. In this instance it will return a 400 response with a Claim Declined error message.

path Parameters
promotion_id
required
integer

ID of the promotion

claim_id
required
integer

ID of the claim, given and emailed to user at time of successful claim submission

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Request Body schema: application/json
required
email
required
email

Claimant's email. Is delivery email for digital_gift fulfilments and is used for tracking and status updates for all claim types

name
required
string

Claimant's name

account_name
string

Claimant's bank account name, required for bank_transfer fulfilments

bsb
number

Claimant's bank account BSB, required for bank_transfer fulfilments

account_number
number

Claimant's bank account number, required for bank_transfer fulfilments

Responses

Request samples

Content type
application/json
{
  • "email": "[email protected]",
  • "name": "Joey Bloggs",
  • "account_name": "Joey Bloggs",
  • "bsb": 123123,
  • "account_number": 12341234
}

Response samples

Content type
application/json
{
  • "error": "Invalid parameters",
  • "error_detail": "Email can't be blank"
}

Support Requests

Create Support Request

This API is used for creating support requests. It generates an email to be sent to the promotion's support email. Support is then continued through this email channel

header Parameters
Authorization
required
string

Your OAuth Bearer token in the format Bearer <access_token>

Request Body schema: application/json
required
promotion_id
required
integer

ID of the promotion the support request is associated with

name
required
string

Name of the person submitting request

email
required
email

Email of the person submitting request

phone_number
required
string

Phone number of the person submitting request

claim_id
string

Claim ID if known

category
string

Category of the support request. Required if promotion has support categories set up

message
string

Message of the support request. Required if promotion has no support categories set up

Responses

Request samples

Content type
application/json
{
  • "promotion_id": 123,
  • "name": "Joey Bloggs",
  • "email": "[email protected]",
  • "phone_number": "0404123123",
  • "claim_id": "47181234",
  • "category": "I received wrong amount",
  • "message": "Hi, I received wrong rebate amount"
}

Response samples

Content type
application/json
{
  • "message": "Invalid parameters",
  • "error_detail": {
    }
}

Claim Webhooks

A webhook can be set up in order to notify of status changes to claims instead of using the standard system email flow. The status changes included are pending, approved, declined, fulfilled and fulfilment_failed.

Payload

If configured, the webhook will send a POST request to the desired endpoint with the following payload:

  {
    "claim_id": "12341234",
    "external_user_id": "123",
    "promotion_id": 10,
    "event_id": "168",
    "event_timestamp": "2022-05-04T00:53:29Z",
    "status": "approved",
    "reason": "",
    "update_fulfilment_url": "https://<host>/update_claim?token=123666123"
  }

reason is only provided for declined status changes. While update_fulfilment_url is a URL provided only for fulfilment_failed status changes. This is when payment has bounced, and the link provides a means to update bank account details.

Security

The request will pass an X-Waivpay-Signature header which is generated by hashing the payload using HMACSHA256 and an agreed secret key, and encoding the result in base64. When receiving webhook requests, caculate this hash and match with the header to confirm requests are valid and coming from Waivpay.