Wallet Management

Overview

Businesses can support customers and employees making purchases from just about anywhere, by creating Wallets. The following guide outlines the process for creating a Wallet, adding funds, and retrieving transactions.

Step 1. Create a Wallet

  1. Call the POST - Create Wallet endpoint.
  2. Enter a value for Name. In the example request below we name our Wallet 'Marketing'.
    1. If creating the Wallet for a Sub-Account, parse the corresponding IdentityNumber in the Headers.
  3. A successful response returns a WalletId.

REQUEST

curl --location 'https://caxapi-integration.azurewebsites.net/api//wallets' \
--header 'Content-Type: application/json' \
--header 'userapitoken: <userapitoken>' \
--header 'Authorization: Bearer <access_token>' \
--data '{
  "Name": "Marketing"
}'

RESPONSE

A successful response is shown below. Note the WalletId created on line five:

{
    "Content": {
        "Model": {
            "WalletId": 123456,
            "Name": "Marketing",
            "ApiStatusCode": 100,
            "ApiStatus": "IsValid",
            "ApiStatusDescription": "Valid Operation"
        },
        "ExpectedResponses": [
            "IsValid"
        ]
    },
    "AuthorisedClientModel": {
        "ClientId": "<clientid>",
        "ClientRef": "<clientref>",
        "ApiStatusCode": 100,
        "ApiStatus": "IsValid",
        "ApiStatusDescription": "Valid Operation"
    },
    "AuthorisedUserModel": {
        "UserId": "<userid>",
        "AppVersion": null,
        "TokenStartDate": "2023-11-13T00:00:00",
        "TokenEndDate": "2023-12-13T00:00:00",
        "LoginTimestamp": "2023-12-01T20:45:14.7858085",
        "ApiLoginType": 0,
        "ApiStatusCode": 100,
        "ApiStatus": "IsValid",
        "ApiStatusDescription": "Valid Operation"
    }
}

Step 2. Fund a Wallet

There are two options available to initiate a request to fund Wallets.

Option 1. - Using a QuoteId.

Option 2. - Drawing funds directly from the Main Balance.

Furthermore, the load operation request is split into two processes:

  1. Initiating a request to fund a Wallet.
  2. Processing a request to fund a Wallet.

Option 2. Initiate Request With a Main Balance

Use this method when there is already a Main Balance in the account holding the currency you wish to load onto the Wallet. See Main Balances section to find out which currency balances you have available.

To fund a Wallet using the Main Balance for one of the currencies held in your account:

  1. Call the POST - Initiate a Payment Request via Currency Balance for Card Quotes. endpoint.
  2. Enter the Currency.
  3. Enter the Amount.
  4. A successful response returns a ShopOrderId which is used to process the request.

REQUEST

{
    "WalletId":123456,
   /// "QuoteId":{{quoteid}}
    "Currency" : "GBP",
    "Amount" : "12345"
}

RESPONSE

The following response is returned. Note the ShopOrderID created on line 4:

{
    "Content": {
        "Model": {
            "ShopOrderId": "578a7ec6-cf4d-40c4-8f3a-fc270aa6c20f",
            "ApiStatusCode": 100,
            "ApiStatus": "IsValid",
            "ApiStatusDescription": "Valid Operation"
    }
}

2. Process a Request to Fund a Wallet

After initiating a request successfully, a ShopOrderId is used to process the request. To do so follow the instructions below:

  1. Call the POST - Process Currency Balance Payload.
  2. Parse the ShopOrderId generated in previous steps.
  3. A successful response returns a PaymentProcessId.

REQUEST

{
    "ShopOrderId":"578a7ec6-cf4d-40c4-8f3a-fc270aa6c20f"
}

RESPONSE

A successful response is shown below. Note the PaymentProcessId created on line 5:

{
    "Content": {
        "Model": {
            "PaymentProcessId": "578a7ec6-cf4d-40c4-8f3a-fc270aa6c20f",
            "ApiStatusCode": 100,
            "ApiStatus": "IsValid",
            "ApiStatusDescription": "Valid Operation"
        },

Wallet Fund Request Status

To find out the status of a fund request, call GET - Shows Status for Currency Loads. The following table shows the different statuses for funding Wallets.

Payment Status
NotProcessed
Pending
Success
Failed

Lookup Wallet Transactions

1. Using WalletId

To search transactions for a specific Wallet:

  1. Call GET - Lookup Wallet Transactions by WalletId.

2. Using WalletId and Currency

To search transactions for a specific Wallet and Currency pair:

  1. Call GET - Lookup Wallet Transactions by WalletId and Currency.

3. List Recent Wallet Transactions

To show transactions for a given Wallet:

  1. Call GET - List Recent Wallet Transactions.
  2. Enter a value for the number of transactions to retrieve.

4. Wallet Fund Requests

To show wallet fund requests within a specified date:

  1. Call GET - Retrieve Wallet Fund Requests by date.

Withdraw Balance

Balances inside a Wallet can be transferred back to the Main Account. To do so, there are two options available:

  1. Withdraw all balances. Call the POST - Withdraw all Balances endpoint.
  2. Withdraw a specific balance. Call the POST - Withdraw by WalletId endpoint.