CAS Restful API Base (1.1.0)

Download OpenAPI specification:Download

Description

Changelog

The full changelog can be found here:

View changelog

Overview

This is the specification for a restful API for interfacing with the CAS payment gateway and customer information vault (CIV), enabling:

  • purchases
  • preauthorisations & completions
  • refunds by audit
  • standalone refunds
  • voids by audit
  • lookups of individual transactions
  • credit card tokenisation

This specification conforms to the OpenAPI standard. There exist a number of tools to generate code stubs from an an OpenAPI specification, such as OpenAPI Generator and Swagger Codegen.

This API loosely conforms to the HAL standard. The only deviation from HAL is that the link relation types used in the _links response fields have been simplified without the use of CURIES.

The API is only intended for use by a backend server. It should not be used by the frontend of a website. Please contact CAS if you have any questions or for frontend payment and tokenisation options.

Correlation IDs

In every request made to the API (other than lookups), a correlation ID must be supplied by the client. This ID should be uniquely generated for each request. Every response for these operations (again excepting lookups) will contain the correlation ID of the corresponding request. This allows for asynchronous requests to be matched with their responses on the client side.

Transactions

Correlation IDs perform an additional role of ensuring idempotency in the case of transaction operations.

For transaction operations, correlation IDs must at least be uniquely generated for each merchant ID, although it is recommended to use a globally unique format such as UUID. If a transaction request times out or recieves a 5XX response, the correlation ID can be used to identify and lookup the status of any transaction that may have been created by the request. If that lookup returns a 404 Not Found response, the original transaction was not processed and it is safe to be retried (remember to use a different X-Correlation-Id).

Note that while the correlation ID can temporarily be used to identify a transaction, it is only cached in the gateway for a limited time (usually 24 hours). In all normal cases, the audit should be used to identify a transaction.

Tokenisation

As tokenisation operations are much lower risk than transaction operations, correlation IDs cannot be used in the same way. If the server times out or a 5XX response is recieved, simply perform a lookup on the relevant endpoint to see whether the previous request succeeded or not.

For example, if a POST request to /customers returns a 5XX HTTP status code or times out, make a GET request to /customers, optionally searching by the details of the new customer, to see whether or not the new customer was created.

Character sets

The API only accepts a restricted set of ASCII characters in all string fields, as shown in the pattern validation of this specification. Accepted characters include all lower and upper case letters, all numeric digits, the space character, and the following punctuation: !#$%&()*+,-./:;<=>?@[]^_`{|}~.

The X-Correlation-Id field has a more restricted character set, excluding most punctuation and the space character.

KVP key names have a more restricted character set again, allowing only letters, digits and the underscore ( _ ) and period ( . ) characters.

API Versioning

The API will be updated over time to fix issues and introduce new functionality. To reflect this, each version is given a version number comprised of three parts: major, minor, and patch version.

  • A major update is one in which existing functionality of the API is changed or removed in a breaking way as defined below.
  • A minor update is one in which new functionality is introduced or existing functionality is augmented in non-breaking ways.
  • A patch update is one in which only minor or error fixing changes are made. For example, the version number 1.4.2 denotes major version 1, minor version 4, and patch 2.

The major version number of the API is reflected in the URI. For example, the major version 1 of the API will use a URI similar to http://api.cardaccess.com.au/live/etx/txn/v1.

Updates to the API are separated into non-breaking and breaking changes depending on how they affect the functionality of the API; see below for their definitions. Non-breaking changes involve changing only the minor or patch version numbers; these changes may be applied to the API at any time and do not require introducing a new URI. Breaking changes will always be associated with changing the major version number, and thus using a different URI to the previous version. When a breaking change is introduced, the previous major version of the API will continue to be supported for a reasonable period of time. Clients will be notified of the date after which the old version will no longer be available and that a new version has been released.

Non-breaking changes

Non breaking changes may be implemented on existing versions of this API. Clients should ensure that their applications can handle the following types of non-breaking change without prior notice:

Endpoints

  • Addition of a new endpoint.
  • Addition of a new HTTP method to an existing endpoint.
  • Addition of a new optional query parameter to an existing HTTP method.
  • Update of an existing query parameter from required to optional.

Request body

  • Addition of a new optional field.
  • Addition of a new supported value in an existing field.
  • Update of an existing field from required to optional.

Response body

  • Addition of a new field.
  • Addition of a new value to an existing field where no definitive list of values has previously been specified.
  • Addition of a new value to an existing field where a definitive list of values has been specified and one of the specified values is unknown or Unknown. In this case, the client application should treat any unrecognised value as being equivalent to unknown or Unknown.
  • A value of -99 in status.gateway_status_code is considered equivalent to unknown, and so addition of a new supported value to this field is considered non-breaking. An unrecognised value for this field should be treated as equivalent to -99.
  • Update to the value of a field ending in _message. Message text is intended for human interpretation; system logic should depend on the similar field ending in _code.
  • Update to the order of fields.
  • Update to the overall response length.

Request header

  • Addition of a new optional request header.

Response header

  • Addition of a new response header.

Security

  • Addition of a new alternate security scheme.

Breaking Changes

Breaking changes will only be implemented in new major versions of this API. The following types of changes are considered breaking and do not need to be handled by client applications:

Endpoints

  • Deletion of an existing endpoint.
  • Deletion of an existing HTTP method from an existing endpoint.
  • Addition of a new required query string parameter to an existing HTTP method.

Request body

  • Addition of a new required field.
  • Deletion of a field.
  • Deletion of a supported value in an existing field.
  • Update to the minimum or maximum length of a field or field name where a minimum or maximum length has previously been specified.
  • Update to the type of an existing field.
  • Update to the format or pattern of an existing field where a format or pattern has previously been specified.

Response body

  • Deletion of a field.
  • Addition of a new supported value for an existing field where a definitive list of values has previously been specified and none of the specified values are unknown or Unknown.
  • A value of -99 in status.gateway_status_code is considered equivalent to unknown, and so addition of a new supported value to this field is considered non-breaking.
  • Update to the minimum or maximum length of a field or field name where a minimum or maximum length has previously been specified.
  • Update to the type of an existing field.
  • Update to the format or pattern of an existing field where a format or pattern has previously been specified.

Request header

  • Addition of a new required request header.

Response header

  • Deletion of a response header.

Response status code

  • Addition of a new HTTP status code response.
  • Deletion of an existing HTTP status code response.

Security

  • Addition of a new required security scheme.
  • Update to an existing security scheme.
  • Deletion of an existing security scheme.

Other

  • Addition of any new request validation which changes the logic of the API. For example, a new validation which changes whether a request is accepted or rejected is considered a breaking change.

Plugins

The behaviour of the API can be modified in fixed ways using plugins. Please contact CAS if you want to enable or configure any of these plugins.

Transaction Surcharges

Set a percentage surcharge to be added onto any payment transactions (purchases, preauthorisations and completions). The surcharge can be configured as a default percentage or specified for each payment method and card type.

In addition to modifying the total amount of the transaction, the following KVPs are added to describe the surcharge details:

Key Example Description
CAS.REQUEST.KVP.SURCHARGE.ORIGINAL_AMOUNT 2000 Original amount in cents as submitted in the transaction
CAS.REQUEST.KVP.SURCHARGE.PERCENT 1.5 Percentage surcharge configured for this card type
CAS.REQUEST.KVP.SURCHARGE.ADDED_AMOUNT 30 Surcharge amount in cents
CAS.REQUEST.KVP.SURCHARGE.TOTAL_AMOUNT 2030 Total amount in cents including surcharge

Transactions

Identification

Transactions are stored in the gateway and identified by their audit (also referred to as audit number). Each successful transaction request will create a new audit of the pertinent type: purchase, preauthorisation, completion, standalone refund, refund by audit, and void. Completions, refunds by audit and voids act on and refer back to the original transaciton, but are still considered individual transactions themselves. Merchants should record the audit for each transaction as a permanent reference for later refunds etc. CAS staff require the audit to identify a transaction when providing support.

HTTP Response Codes

A 2XX HTTP response code does not denote an approved transaction. It merely denotes that a response was received from the gateway.

In most cases, the status.transaction_status_code field can be used to determine the outcome of the transaction request. If its value is approved, the transaction has been approved. If its value is declined, the transaction has been declined. A value of pending denotes that the transaction is a direct debit transaction and is waiting for confirmation from the acquirer; This will usually take multiple working days. If its value is error, the fields status.gateway_status_code and status.acquirer.response_code can be used to diagnose the issue.

A 4XX HTTP response code denotes an improper request. The transaction is never approved.

In the event of a 5XX HTTP response code for a transaction request, it is strongly recommended that a lookup be called on either the audit, if given, or the idempotency key. An error may have occurred at any point in the chain between the client and the acquirer, so the transaction may have been approved or declined. If the lookup does not also return an error, it will show the status of the transaction. If the lookup returns a 404 HTTP response code, then the transaction was not processed and it can safely be reattempted.

Lookup by audit

Lookup the details of an existing transaction.

Authorizations:
HTTPBasic
path Parameters
audit
required
integer [ 1 .. 2147483647 ]
Examples: 123456

Audit of the transaction.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
audit
required
integer [ 1 .. 2147483647 ]

The audit of this transaction.

gateway_timestamp
required
string <date-time>

Timestamp as recorded by the gateway in ISO8601 date-time format; Sydney time (changes with daylight savings).

For transaction requests, this is approximated by the API. The exact gateway timestamp will only be returned in a lookup operation.

required
object

Information describing the merchant.

required
object

KVPs associated with the transaction.

This includes KVPs submitted in the request by the merchant and those generated by the gateway in the response.

Direct debit transactions may not return any KVPs. In that case, simply perform a lookup on the audit to get any required KVPs.

required
object

Details about the transaction.

required
object

The status of the transaction.

required
object

The hyperlinks to operations associated with this response.

Links are generated and returned dynamically depending on the result of the transaction request. The API will attempt to return all valid links and no invalid links, but this is not guaranteed.

Response samples

Content type
application/json
{
  • "audit": 123456,
  • "gateway_timestamp": "2024-03-26T12:14:51+11:00",
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CAS.REQUEST.KVP.CUSTOMER.pmt_no": "123456789",
    • "CAS.RESPONSE.KVP.EXAMPLE": "some response data"
    },
  • "transaction": {
    • "reference": "2873eadd-fe37-4b17-adf2-adee3f5ea7ee",
    • "transaction_type": "purchase",
    • "target_audit": 123123,
    • "amount_details": {
      • "total_amount": "500",
      • "currency": "AUD"
      },
    • "payment_method": {
      • "creditcard": {
        • "pan": "4000XXXXXXXX0002",
        • "type": ""
        }
      },
    • "directdebit_mode": "debit"
    },
  • "status": {
    • "gateway_status_code": 0,
    • "gateway_status_message": "Transaction successfully processed by gateway.",
    • "transaction_status_code": "approved",
    • "acquirer": {
      • "response_code": "00",
      • "response_message": "Approved",
      • "settlement_date": "2024-03-26",
      • "authorisation_code": "12345",
      • "preauthorisation_code": "12345"
      }
    },
}

Purchase

Make a purchase request.

Authorizations:
HTTPBasic
header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Request Body schema: application/json
required
required
object

Information describing the merchant.

object
Default: {}

KVPs associated with the transaction.

KVPs submitted in a request may have the prefix CAS.REQUEST.KVP. prepended to the key by the gateway. For example, if a request is submitted with the KVP "CUSTOMER.full_name": "John Smith", the response will include the KVP "CAS.REQUEST.KVP.CUSTOMER.full_name": "John Smith".

Each KVP key must be at most 64 characters long and use only the following characters:

  • A-Z
  • a-z
  • 0-9
  • . (period)
  • _ (underscore)
required
object

Details about the transaction.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
audit
required
integer [ 1 .. 2147483647 ]

The audit of this transaction.

gateway_timestamp
required
string <date-time>

Timestamp as recorded by the gateway in ISO8601 date-time format; Sydney time (changes with daylight savings).

For transaction requests, this is approximated by the API. The exact gateway timestamp will only be returned in a lookup operation.

required
object

Information describing the merchant.

required
object

KVPs associated with the transaction.

This includes KVPs submitted in the request by the merchant and those generated by the gateway in the response.

Direct debit transactions may not return any KVPs. In that case, simply perform a lookup on the audit to get any required KVPs.

required
object

The status of the transaction.

required
object

The hyperlinks to operations associated with this response.

Links are generated and returned dynamically depending on the result of the transaction request. The API will attempt to return all valid links and no invalid links, but this is not guaranteed.

Request samples

Content type
application/json
{
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CUSTOMER.pmt_no": "123456789"
    },
  • "transaction": {
    • "reference": "2873eadd-fe37-4b17-adf2-adee3f5ea7ee",
    • "amount_details": {
      • "total_amount": "500",
      • "currency": "AUD"
      },
    • "payment_method": {
      • "creditcard": {
        • "pan": "4000000000000002",
        • "expiry_date": "0224",
        • "cvv": "567"
        }
      }
    }
}

Response samples

Content type
application/json
{
  • "audit": 123456,
  • "gateway_timestamp": "2024-03-26T12:14:51+11:00",
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CAS.REQUEST.KVP.CUSTOMER.pmt_no": "123456789",
    • "CAS.RESPONSE.KVP.EXAMPLE": "some response data"
    },
  • "status": {
    • "gateway_status_code": 0,
    • "gateway_status_message": "Transaction successfully processed by gateway.",
    • "transaction_status_code": "approved",
    • "acquirer": {
      • "response_code": "00",
      • "response_message": "Approved",
      • "settlement_date": "2024-03-26",
      • "authorisation_code": "12345"
      }
    },
}

Preauthorisation

Make a preauthorisation request.

Authorizations:
HTTPBasic
header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Request Body schema: application/json
required
required
object

Information describing the merchant.

object
Default: {}

KVPs associated with the transaction.

KVPs submitted in a request may have the prefix CAS.REQUEST.KVP. prepended to the key by the gateway. For example, if a request is submitted with the KVP "CUSTOMER.full_name": "John Smith", the response will include the KVP "CAS.REQUEST.KVP.CUSTOMER.full_name": "John Smith".

Each KVP key must be at most 64 characters long and use only the following characters:

  • A-Z
  • a-z
  • 0-9
  • . (period)
  • _ (underscore)
required
object

Details about the transaction.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
audit
required
integer [ 1 .. 2147483647 ]

The audit of this transaction.

gateway_timestamp
required
string <date-time>

Timestamp as recorded by the gateway in ISO8601 date-time format; Sydney time (changes with daylight savings).

For transaction requests, this is approximated by the API. The exact gateway timestamp will only be returned in a lookup operation.

required
object

Information describing the merchant.

required
object

KVPs associated with the transaction.

This includes KVPs submitted in the request by the merchant and those generated by the gateway in the response.

Direct debit transactions may not return any KVPs. In that case, simply perform a lookup on the audit to get any required KVPs.

required
object

The status of the transaction.

required
object

The hyperlinks to operations associated with this response.

Links are generated and returned dynamically depending on the result of the transaction request. The API will attempt to return all valid links and no invalid links, but this is not guaranteed.

Request samples

Content type
application/json
{
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CUSTOMER.pmt_no": "123456789"
    },
  • "transaction": {
    • "reference": "2873eadd-fe37-4b17-adf2-adee3f5ea7ee",
    • "amount_details": {
      • "total_amount": "500",
      • "currency": "AUD"
      },
    • "payment_method": {
      • "creditcard": {
        • "pan": "4000000000000002",
        • "expiry_date": "0224",
        • "cvv": "567"
        }
      }
    }
}

Response samples

Content type
application/json
{
  • "audit": 123456,
  • "gateway_timestamp": "2024-03-26T12:14:51+11:00",
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CAS.REQUEST.KVP.CUSTOMER.pmt_no": "123456789",
    • "CAS.RESPONSE.KVP.EXAMPLE": "some response data"
    },
  • "status": {
    • "gateway_status_code": 0,
    • "gateway_status_message": "Transaction successfully processed by gateway.",
    • "transaction_status_code": "approved",
    • "acquirer": {
      • "response_code": "00",
      • "response_message": "Approved",
      • "settlement_date": "2024-03-26",
      • "authorisation_code": "12345",
      • "preauthorisation_code": "12345"
      }
    },
}

Completion

Make a completion request on an existing preuathorisation.

Authorizations:
HTTPBasic
path Parameters
audit
required
integer [ 1 .. 2147483647 ]
Examples: 123456

Audit of the transaction.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Request Body schema: application/json
required
required
object

Information describing the merchant.

object
Default: {}

KVPs associated with the transaction.

KVPs submitted in a request may have the prefix CAS.REQUEST.KVP. prepended to the key by the gateway. For example, if a request is submitted with the KVP "CUSTOMER.full_name": "John Smith", the response will include the KVP "CAS.REQUEST.KVP.CUSTOMER.full_name": "John Smith".

Each KVP key must be at most 64 characters long and use only the following characters:

  • A-Z
  • a-z
  • 0-9
  • . (period)
  • _ (underscore)
required
object

Details about the transaction.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
audit
required
integer [ 1 .. 2147483647 ]

The audit of this transaction.

gateway_timestamp
required
string <date-time>

Timestamp as recorded by the gateway in ISO8601 date-time format; Sydney time (changes with daylight savings).

For transaction requests, this is approximated by the API. The exact gateway timestamp will only be returned in a lookup operation.

required
object

Information describing the merchant.

required
object

KVPs associated with the transaction.

This includes KVPs submitted in the request by the merchant and those generated by the gateway in the response.

Direct debit transactions may not return any KVPs. In that case, simply perform a lookup on the audit to get any required KVPs.

required
object

The status of the transaction.

required
object

The hyperlinks to operations associated with this response.

Links are generated and returned dynamically depending on the result of the transaction request. The API will attempt to return all valid links and no invalid links, but this is not guaranteed.

Request samples

Content type
application/json
{
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CUSTOMER.pmt_no": "123456789"
    },
  • "transaction": {
    • "reference": "2873eadd-fe37-4b17-adf2-adee3f5ea7ee",
    • "amount_details": {
      • "total_amount": "500",
      • "currency": "AUD"
      }
    }
}

Response samples

Content type
application/json
{
  • "audit": 123456,
  • "gateway_timestamp": "2024-03-26T12:14:51+11:00",
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CAS.REQUEST.KVP.CUSTOMER.pmt_no": "123456789",
    • "CAS.RESPONSE.KVP.EXAMPLE": "some response data"
    },
  • "status": {
    • "gateway_status_code": 0,
    • "gateway_status_message": "Transaction successfully processed by gateway.",
    • "transaction_status_code": "approved",
    • "acquirer": {
      • "response_code": "00",
      • "response_message": "Approved",
      • "settlement_date": "2024-03-26",
      • "authorisation_code": "12345"
      }
    },
}

Refund by audit

Make a refund request on an existing transaction.

Multiple partial refunds can be made on the same transaction, but the total refunded amount can never exceed the original transaction amount.

Authorizations:
HTTPBasic
path Parameters
audit
required
integer [ 1 .. 2147483647 ]
Examples: 123456

Audit of the transaction.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Request Body schema: application/json
required
required
object

Information describing the merchant.

object
Default: {}

KVPs associated with the transaction.

KVPs submitted in a request may have the prefix CAS.REQUEST.KVP. prepended to the key by the gateway. For example, if a request is submitted with the KVP "CUSTOMER.full_name": "John Smith", the response will include the KVP "CAS.REQUEST.KVP.CUSTOMER.full_name": "John Smith".

Each KVP key must be at most 64 characters long and use only the following characters:

  • A-Z
  • a-z
  • 0-9
  • . (period)
  • _ (underscore)
required
object

Details about the transaction.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
audit
required
integer [ 1 .. 2147483647 ]

The audit of this transaction.

gateway_timestamp
required
string <date-time>

Timestamp as recorded by the gateway in ISO8601 date-time format; Sydney time (changes with daylight savings).

For transaction requests, this is approximated by the API. The exact gateway timestamp will only be returned in a lookup operation.

required
object

Information describing the merchant.

required
object

KVPs associated with the transaction.

This includes KVPs submitted in the request by the merchant and those generated by the gateway in the response.

Direct debit transactions may not return any KVPs. In that case, simply perform a lookup on the audit to get any required KVPs.

required
object

The status of the transaction.

required
object

The hyperlinks to operations associated with this response.

Links are generated and returned dynamically depending on the result of the transaction request. The API will attempt to return all valid links and no invalid links, but this is not guaranteed.

Request samples

Content type
application/json
{
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CUSTOMER.pmt_no": "123456789"
    },
  • "transaction": {
    • "reference": "2873eadd-fe37-4b17-adf2-adee3f5ea7ee",
    • "amount_details": {
      • "total_amount": "500",
      • "currency": "AUD"
      }
    }
}

Response samples

Content type
application/json
{
  • "audit": 123456,
  • "gateway_timestamp": "2024-03-26T12:14:51+11:00",
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CAS.REQUEST.KVP.CUSTOMER.pmt_no": "123456789",
    • "CAS.RESPONSE.KVP.EXAMPLE": "some response data"
    },
  • "status": {
    • "gateway_status_code": 0,
    • "gateway_status_message": "Transaction successfully processed by gateway.",
    • "transaction_status_code": "approved",
    • "acquirer": {
      • "response_code": "00",
      • "response_message": "Approved",
      • "settlement_date": "2024-03-26",
      • "authorisation_code": "12345"
      }
    },
}

Standalone refund

Make a refund request without reference to a previous transaction.

This operation is not recommended, as without reference to the original transaction it is possible to refund more than the original amount. Instead, refund by audit is recommended.

Authorizations:
HTTPBasic
header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Request Body schema: application/json
required
required
object

Information describing the merchant.

object
Default: {}

KVPs associated with the transaction.

KVPs submitted in a request may have the prefix CAS.REQUEST.KVP. prepended to the key by the gateway. For example, if a request is submitted with the KVP "CUSTOMER.full_name": "John Smith", the response will include the KVP "CAS.REQUEST.KVP.CUSTOMER.full_name": "John Smith".

Each KVP key must be at most 64 characters long and use only the following characters:

  • A-Z
  • a-z
  • 0-9
  • . (period)
  • _ (underscore)
required
object

Details about the transaction.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
audit
required
integer [ 1 .. 2147483647 ]

The audit of this transaction.

gateway_timestamp
required
string <date-time>

Timestamp as recorded by the gateway in ISO8601 date-time format; Sydney time (changes with daylight savings).

For transaction requests, this is approximated by the API. The exact gateway timestamp will only be returned in a lookup operation.

required
object

Information describing the merchant.

required
object

KVPs associated with the transaction.

This includes KVPs submitted in the request by the merchant and those generated by the gateway in the response.

Direct debit transactions may not return any KVPs. In that case, simply perform a lookup on the audit to get any required KVPs.

required
object

The status of the transaction.

required
object

The hyperlinks to operations associated with this response.

Links are generated and returned dynamically depending on the result of the transaction request. The API will attempt to return all valid links and no invalid links, but this is not guaranteed.

Request samples

Content type
application/json
{
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CUSTOMER.pmt_no": "123456789"
    },
  • "transaction": {
    • "reference": "2873eadd-fe37-4b17-adf2-adee3f5ea7ee",
    • "amount_details": {
      • "total_amount": "500",
      • "currency": "AUD"
      },
    • "payment_method": {
      • "creditcard": {
        • "pan": "4000000000000002",
        • "expiry_date": "0224",
        • "cvv": "567"
        }
      }
    }
}

Response samples

Content type
application/json
{
  • "audit": 123456,
  • "gateway_timestamp": "2024-03-26T12:14:51+11:00",
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CAS.REQUEST.KVP.CUSTOMER.pmt_no": "123456789",
    • "CAS.RESPONSE.KVP.EXAMPLE": "some response data"
    },
  • "status": {
    • "gateway_status_code": 0,
    • "gateway_status_message": "Transaction successfully processed by gateway.",
    • "transaction_status_code": "approved",
    • "acquirer": {
      • "response_code": "00",
      • "response_message": "Approved",
      • "settlement_date": "2024-03-26",
      • "authorisation_code": "12345"
      }
    },
}

Void

Make a void request on an existing transaction.

Authorizations:
HTTPBasic
path Parameters
audit
required
integer [ 1 .. 2147483647 ]
Examples: 123456

Audit of the transaction.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Request Body schema: application/json
required
required
object

Information describing the merchant.

object
Default: {}

KVPs associated with the transaction.

KVPs submitted in a request may have the prefix CAS.REQUEST.KVP. prepended to the key by the gateway. For example, if a request is submitted with the KVP "CUSTOMER.full_name": "John Smith", the response will include the KVP "CAS.REQUEST.KVP.CUSTOMER.full_name": "John Smith".

Each KVP key must be at most 64 characters long and use only the following characters:

  • A-Z
  • a-z
  • 0-9
  • . (period)
  • _ (underscore)
required
object

Details about the transaction.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
audit
required
integer [ 1 .. 2147483647 ]

The audit of this transaction.

gateway_timestamp
required
string <date-time>

Timestamp as recorded by the gateway in ISO8601 date-time format; Sydney time (changes with daylight savings).

For transaction requests, this is approximated by the API. The exact gateway timestamp will only be returned in a lookup operation.

required
object

Information describing the merchant.

required
object

KVPs associated with the transaction.

This includes KVPs submitted in the request by the merchant and those generated by the gateway in the response.

Direct debit transactions may not return any KVPs. In that case, simply perform a lookup on the audit to get any required KVPs.

required
object

The status of the transaction.

required
object

The hyperlinks to operations associated with this response.

Links are generated and returned dynamically depending on the result of the transaction request. The API will attempt to return all valid links and no invalid links, but this is not guaranteed.

Request samples

Content type
application/json
{
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CUSTOMER.pmt_no": "123456789"
    },
  • "transaction": {
    • "reference": "2873eadd-fe37-4b17-adf2-adee3f5ea7ee"
    }
}

Response samples

Content type
application/json
{
  • "audit": 123456,
  • "gateway_timestamp": "2024-03-26T12:14:51+11:00",
  • "merchant": {
    • "id": 2004
    },
  • "kvps": {
    • "CAS.REQUEST.KVP.CUSTOMER.pmt_no": "123456789",
    • "CAS.RESPONSE.KVP.EXAMPLE": "some response data"
    },
  • "status": {
    • "gateway_status_code": 0,
    • "gateway_status_message": "Transaction successfully processed by gateway.",
    • "transaction_status_code": "approved",
    • "acquirer": {
      • "response_code": "00",
      • "response_message": "Approved",
      • "settlement_date": "2024-03-26",
      • "authorisation_code": "12345"
      }
    },
  • "_links": {}
}

Tokenisation

Overview

Tokenisation is only available to merchants with the CIV product. Please contact CAS for more information or to request use of this product.

A token, also known as a registered account, is a stored payment method which can be used in later transactions. Sensitive payment information is stored in the customer information vault (CIV), and identified by the token ID. The Virtual PAN (VPAN) can then be used in place of the payment information when performing transactions on CAS systems.

Each token is owned by a customer. Customers usually correspond with the real customers of a merchant, but may be used as an arbitrary collection of tokens. A customer may have zero, one or many tokens.

Currently tokens can store either credit card or bank account details, however the tokenisation system has the capability to store other customer information. Please contact CAS if you have a use for storing extended information.

Lookup or create customer

Lookup or create a customer.

If the reference field matches an existing customer, no customer will be created and the details of the matching customer will be returned in the response instead. Note that the existing customer may not have the same name as given in the request; in this case, the existing name will be preserved and the new name will be ignored

Authorizations:
HTTPBasic
query Parameters
merchant_id
integer [ 1 .. 2147483647 ]
Examples: merchant_id=2004

Merchant ID from which to access customer data.

Defaults to the merchant ID to which your user is assigned.

This field can be a source of 403: Forbidden errors if improperly set. Most merchants should use the default; please contact CAS if you are unsure of your merchant ID configuration or require assistance.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Request Body schema: application/json
required
reference
required
string [ 1 .. 50 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Unique reference for the customer.

name
required
string [ 1 .. 60 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Customer name.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
id
required
integer [ 1 .. 2147483647 ]

Customer ID.

name
required
string [ 1 .. 60 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Customer name.

reference
required
string [ 1 .. 50 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Unique reference for the customer.

required
object

The hyperlinks associated with this customer.

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
id
required
integer [ 1 .. 2147483647 ]

Customer ID.

name
required
string [ 1 .. 60 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Customer name.

reference
required
string [ 1 .. 50 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Unique reference for the customer.

required
object

The hyperlinks associated with this customer.

Request samples

Content type
application/json
{
  • "reference": "078dec88-a5bf-4cfd-85bd-7a1974ae3712",
  • "name": "John Smith"
}

Response samples

Content type
application/json
{}

Lookup customer

Lookup the details of a customer.

Authorizations:
HTTPBasic
path Parameters
customer_id
required
integer [ 1 .. 2147483647 ]
Examples: 34567

Customer ID.

query Parameters
merchant_id
integer [ 1 .. 2147483647 ]
Examples: merchant_id=2004

Merchant ID from which to access customer data.

Defaults to the merchant ID to which your user is assigned.

This field can be a source of 403: Forbidden errors if improperly set. Most merchants should use the default; please contact CAS if you are unsure of your merchant ID configuration or require assistance.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
id
required
integer [ 1 .. 2147483647 ]

Customer ID.

name
required
string [ 1 .. 60 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Customer name.

reference
required
string [ 1 .. 50 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Unique reference for the customer.

required
object

The hyperlinks associated with this customer.

Response samples

Content type
application/json
{}

Update customer

Update the details of a customer.

Authorizations:
HTTPBasic
path Parameters
customer_id
required
integer [ 1 .. 2147483647 ]
Examples: 34567

Customer ID.

query Parameters
merchant_id
integer [ 1 .. 2147483647 ]
Examples: merchant_id=2004

Merchant ID from which to access customer data.

Defaults to the merchant ID to which your user is assigned.

This field can be a source of 403: Forbidden errors if improperly set. Most merchants should use the default; please contact CAS if you are unsure of your merchant ID configuration or require assistance.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Request Body schema: application/json
required
reference
string [ 1 .. 50 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Unique reference for the customer.

name
string [ 1 .. 60 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Customer name.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
id
required
integer [ 1 .. 2147483647 ]

Customer ID.

name
required
string [ 1 .. 60 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Customer name.

reference
required
string [ 1 .. 50 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Unique reference for the customer.

required
object

The hyperlinks associated with this customer.

Request samples

Content type
application/json
{
  • "reference": "078dec88-a5bf-4cfd-85bd-7a1974ae3712",
  • "name": "John Smith"
}

Response samples

Content type
application/json
{}

Delete customer

Delete a customer.

Authorizations:
HTTPBasic
path Parameters
customer_id
required
integer [ 1 .. 2147483647 ]
Examples: 34567

Customer ID.

query Parameters
merchant_id
integer [ 1 .. 2147483647 ]
Examples: merchant_id=2004

Merchant ID from which to access customer data.

Defaults to the merchant ID to which your user is assigned.

This field can be a source of 403: Forbidden errors if improperly set. Most merchants should use the default; please contact CAS if you are unsure of your merchant ID configuration or require assistance.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Responses

Response samples

Content type
application/json
{
  • "errors": [
    • {
      • "error_code": "string",
      • "error_message": "string",
      • "location": [
        • "string"
        ]
      }
    ]
}

Create token

Create a new token for this customer.

Authorizations:
HTTPBasic
path Parameters
customer_id
required
integer [ 1 .. 2147483647 ]
Examples: 34567

Customer ID.

query Parameters
merchant_id
integer [ 1 .. 2147483647 ]
Examples: merchant_id=2004

Merchant ID from which to access customer data.

Defaults to the merchant ID to which your user is assigned.

This field can be a source of 403: Forbidden errors if improperly set. Most merchants should use the default; please contact CAS if you are unsure of your merchant ID configuration or require assistance.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Request Body schema: application/json
required
preferred_name
required
string [ 1 .. 50 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Unique name of the token. This must be unique per customer.

active
required
boolean

Whether or not this token is active.

required
object

Tokenised account.

CAS supports a number of different tokenisation account types. Please contact CAS if you would like to store and use information other than credit card details.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
id
required
integer [ 1 .. 2147483647 ]

Token account ID.

virtual_pan
required
string [ 13 .. 19 ] characters ^[0-9]*$

Virtual PAN identifying a tokenised customer account.

preferred_name
required
string [ 1 .. 50 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Unique name of the token. This must be unique per customer.

active
required
boolean

Whether or not this token is active.

required
object

Tokenised account.

CAS supports a number of different tokenisation account types. Please contact CAS if you would like to store and use information other than credit card details.

required
object

The hyperlinks associated with this token.

Request samples

Content type
application/json
{
  • "preferred_name": "b327170c-6a9f-4f34-b32a-7202f7e52aae",
  • "active": true,
  • "account": {
    • "general_creditcard": {
      • "CARD.PAN": "4000000000000002",
      • "CARD.EXPIRY": "0224",
      • "CARD.NAME": "John Smith"
      }
    }
}

Response samples

Content type
application/json
{}

Lookup token

Lookup the details of a token.

Authorizations:
HTTPBasic
path Parameters
customer_id
required
integer [ 1 .. 2147483647 ]
Examples: 34567

Customer ID.

token_id
required
integer [ 1 .. 2147483647 ]
Examples: 456789

Token ID.

query Parameters
merchant_id
integer [ 1 .. 2147483647 ]
Examples: merchant_id=2004

Merchant ID from which to access customer data.

Defaults to the merchant ID to which your user is assigned.

This field can be a source of 403: Forbidden errors if improperly set. Most merchants should use the default; please contact CAS if you are unsure of your merchant ID configuration or require assistance.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
id
required
integer [ 1 .. 2147483647 ]

Token account ID.

virtual_pan
required
string [ 13 .. 19 ] characters ^[0-9]*$

Virtual PAN identifying a tokenised customer account.

preferred_name
required
string [ 1 .. 50 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Unique name of the token. This must be unique per customer.

active
required
boolean

Whether or not this token is active.

required
object

Tokenised account.

CAS supports a number of different tokenisation account types. Please contact CAS if you would like to store and use information other than credit card details.

required
object

The hyperlinks associated with this token.

Response samples

Content type
application/json
{}

Update token

Update the detials of a token.

Authorizations:
HTTPBasic
path Parameters
customer_id
required
integer [ 1 .. 2147483647 ]
Examples: 34567

Customer ID.

token_id
required
integer [ 1 .. 2147483647 ]
Examples: 456789

Token ID.

query Parameters
merchant_id
integer [ 1 .. 2147483647 ]
Examples: merchant_id=2004

Merchant ID from which to access customer data.

Defaults to the merchant ID to which your user is assigned.

This field can be a source of 403: Forbidden errors if improperly set. Most merchants should use the default; please contact CAS if you are unsure of your merchant ID configuration or require assistance.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Request Body schema: application/json
required
preferred_name
string [ 1 .. 50 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Unique name of the token. This must be unique per customer.

active
boolean

Whether or not this token is active.

object

Tokenised account.

CAS supports a number of different tokenisation account types. Please contact CAS if you would like to store and use information other than credit card details.

Responses

Response Headers
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Example: "48ac4691-c203-4391-a5cc-52285b8f9c15"

The correlation ID that was submitted in the request headers.

Response Schema: application/json
id
required
integer [ 1 .. 2147483647 ]

Token account ID.

virtual_pan
required
string [ 13 .. 19 ] characters ^[0-9]*$

Virtual PAN identifying a tokenised customer account.

preferred_name
required
string [ 1 .. 50 ] characters ^[a-zA-Z0-9!#\$%&\(\)\*\+,\-\./:;<=>\?@\[\]\^...

Unique name of the token. This must be unique per customer.

active
required
boolean

Whether or not this token is active.

required
object

Tokenised account.

CAS supports a number of different tokenisation account types. Please contact CAS if you would like to store and use information other than credit card details.

required
object

The hyperlinks associated with this token.

Request samples

Content type
application/json
{
  • "preferred_name": "b327170c-6a9f-4f34-b32a-7202f7e52aae",
  • "active": true,
  • "account": {
    • "general_creditcard": {
      • "CARD.PAN": "4000000000000002",
      • "CARD.EXPIRY": "0224",
      • "CARD.NAME": "John Smith"
      }
    }
}

Response samples

Content type
application/json
{}

Delete token

Delete a token.

Authorizations:
HTTPBasic
path Parameters
customer_id
required
integer [ 1 .. 2147483647 ]
Examples: 34567

Customer ID.

token_id
required
integer [ 1 .. 2147483647 ]
Examples: 456789

Token ID.

query Parameters
merchant_id
integer [ 1 .. 2147483647 ]
Examples: merchant_id=2004

Merchant ID from which to access customer data.

Defaults to the merchant ID to which your user is assigned.

This field can be a source of 403: Forbidden errors if improperly set. Most merchants should use the default; please contact CAS if you are unsure of your merchant ID configuration or require assistance.

header Parameters
x-correlation-id
required
string [ 1 .. 128 ] characters ^[a-zA-Z0-9\+\-_:\.,]*$
Examples: 48ac4691-c203-4391-a5cc-52285b8f9c15

Correlation ID. Must be uniquely generated for each request.

Uniquely identifies this request-response pair. In operations which create a transaction, it also ensures idempotency.

Responses

Response samples

Content type
application/json
{
  • "errors": [
    • {
      • "error_code": "string",
      • "error_message": "string",
      • "location": [
        • "string"
        ]
      }
    ]
}

Crab icon by Freepik - Flaticon