This tutorial will help you get familiar with the Galileo API. You will learn to create a simple account, activate it, simulate a transaction, send funds to another account, and freeze the account.

Before you start, see the <a href="doc:quickstart" target="_blank">Quickstart</a> to get connected to the API. You can follow this tutorial using your own backend code or the Postman API client (see <a href="doc:postman-setup" target="_blank">Postman Setup</a> for a brief introduction to the tool).

## Step 1 — Create an account and deposit funds

In this step, you will create an account and deposit funds using these endpoints:

  • <a href="ref:post_createaccount" target="_blank">Create Account</a>

  • <a href="ref:post_createpayment" target="_blank">Create Payment</a>

For code samples of each endpoint request, see the API reference documentation.

Note

The <a href="ref:post_createaccount" target="_blank">Create Account</a> endpoint can deposit funds during account creation, but it's often useful to deposit funds separately. In this tutorial, you will use the <a href="ref:post_createpayment" target="_blank">Create Payment</a> endpoint to deposit funds after you create an account.

### Create an account

  1. To create an account, send a POST request to the <a href="ref:post_createaccount" target="_blank">Create Account</a> endpoint. For all API requests in this tutorial, you'll need these credentials:

    • `apiLogin`

    • `apiTransKey`

    • `providerId`

  2. Check the output. There should be a new `pmt_ref_no` in the response data.

In JSON format, the output should look like this:



In the next step, you'll use the new account number to deposit funds into the account.

### Deposit funds

  1. To deposit funds into the account, call the <a href="ref:post_createpayment" target="_blank">Create Payment</a> endpoint using the values in this table:

ParameterValue
`accountNo`The `pmt_ref_no` from your `createAccount` call
`amount``50`
`type``RL` (indicates a Retail Load payment)

Note

When you deposit funds to an account in Sandbox and CV, the funds are not taken from a real account, but are simulated in the environment.

  1. Check the output. The `new_balance` should be `50`:



Keep your code accessible. You will use both of these endpoints in later steps.

## Step 2 — Activate the card and account

In this step, you will activate the account and card so that they can be used in transactions. Card and account statuses are independent, so you will need to activate both before you can use the card. You'll activate both with these endpoints:

  • <a href="ref:post_modifystatus" target="_blank">Modify Status</a>

  • <a href="ref:post_getcard" target="_blank">Get Card</a>

### Activate the account

  1. To activate the account, call the <a href="ref:post_modifystatus" target="_blank">Modify Status</a> with the following values:

ParameterValue
`accountNo`The `pmt_ref_no` from your `createAccount` call
`type``11` (moves the account to `status: N`). For more information on types and statuses, see the <a href="ref:api-reference-modify-status-types" target="_blank">Modify Status Types</a> enumeration.

Note

Using Modify Status type 11 to activate an account is appropriate in the sandbox, but it should not be used in <<glossary:CV>> or <<glossary:Production>>. In those cases, your accounts will be moved to Active status either when the card is activated or when an automated process activates the account.

  1. Check the output. The `account_status` should be `N`, indicating that the account is active:


  1. The account is now active but the card is not. To see the card status, call the <a href="ref:post_getcard" target="_blank">Get Card</a> endpoint with the following value:

ParameterValue
`accountNo`The `pmt_ref_no` from your `createAccount` call
  1. Check the output. The `status` should now be `W` (see <a href="ref:api-reference-card-statuses" target="_blank">Card Statuses</a> for more information):



### Activate the card

  1. To activate the card, call the <a href="ref:post_modifystatus" target="_blank">Modify Status</a> endpoint again, but change the `type` to `7`:

ParameterValue
`accountNo`The `pmt_ref_no` from your `createAccount` call
`type``7` (moves the card to `status: N`). For more information on types and statuses, see the <a href="ref:api-reference-modify-status-types" target="_blank">Modify Status Types</a> enumeration.

Note

Using Modify Status type 7 to activate a card is appropriate in the sandbox, but it should not be used in <<glossary:CV>> or <<glossary:Production>>. Instead, choose an option in <a href="doc:setting-up-a-card-program#card-activation" target="_blank">Card activation</a> in the _Setting Up a Card Program_ guide.

  1. Check the output again. The `account_status` should still be `N`:


  1. Call the <a href="ref:post_getcard" target="_blank">Get Card</a> endpoint again with the same `accountNo`.

  2. Check the output for the Get Card call. The `status` should now be `N`, indicating the card is active:



## Step 3 — Simulate a card transaction

After the account and card are active, you can simulate a card transaction. In a test environment, it is not possible to use a real transaction with a <<glossary:card network>>. Instead, you'll simulate authorization, simulate settlement, and then check the final balance with these endpoints:

  • <a href="ref:post_createsimulatedcardauth" target="_blank">Simulate Card Authorization</a>

  • <a href="ref:post_createsimulatedcardsettle" target="_blank">Simulate Card Settlement</a>

  • <a href="ref:post_getbalance" target="_blank">Get Balance</a>

### Simulate authorization

  1. To simulate the authorization of a $20 transaction, call the <a href="ref:post_createsimulatedcardauth" target="_blank">Simulate Card Authorization</a> endpoint with the following values:

ParameterValue
`accountNo`The `pmt_ref_no` from your `createAccount` call
`amount``20`
`association``visa`
`merchantName`A business name (for example, `The Toastery`).
  1. Check the output. The `auth_response_code` should be `00`:



Note

If the `auth_response_code` is `05`, it is likely that either the card or account was not properly activated (see <a href="ref:api-reference-events-authorization-response-codes" target="_blank">Authorization Response Codes</a> for more information). Make sure to pass `type: 7` and `type: 11` through the <a href="ref:post_modifystatus" target="_blank">Modify Status</a> endpoint.

### Simulate settlement

Now that you have authorized a transaction, the next step is to settle it.

  1. Call the <a href="ref:post_createsimulatedcardsettle" target="_blank">Simulate Card Settlement</a> endpoint with the following values:

ParameterValue
`accountNo`The `pmt_ref_no` from your `createAccount` call
`association``visa`
`authId`The `authId` from your `createSimulatedCardAuth` call
  1. Check the output. The `settle_response_code` should be `00`:



### Get the balance

Check the balance to make sure the transaction went through as expected.

  1. Call the <a href="ref:post_getbalance" target="_blank">Get Balance</a> endpoint with the following value:

ParameterValue
`accountNo`The `pmt_ref_no` from your `createAccount` call
  1. Check the output. The `balance` should be `30`:



## Step 4 — Send funds between accounts

In this step, you’ll set up a second account, activate it, and send funds from the first account. Be sure to keep your account number handy. You will use these endpoints:

  • <a href="ref:post_createaccount" target="_blank">Create Account</a>

  • <a href="ref:post_modifystatus" target="_blank">Modify Status</a>

  • <a href="ref:post_createaccounttransfer" target="_blank">Create Account Transfer</a>

### Create a second new account

  1. To create a second account, call the <a href="ref:post_createaccount" target="_blank">Create Account</a>.

  2. Check the output. The status should indicate `Success`:



### Activate the receiving account and card

Activate the second account and card in the same way you activated the first account.

  1. To activate the account, call the <a href="ref:post_modifystatus" target="_blank">Modify Status</a> endpoint with the following values:

ParameterValue
`accountNo`The `pmt_ref_no` from the second account you created
`type``11` (moves the account to `status: N`)
  1. Check the output. The `account_status` should be `N`, indicating that the account is active (see <a href="ref:api-reference-account-statuses" target="_blank">Account Statuses</a> for more information):


  1. Next, activate the card. Call the <a href="ref:post_modifystatus" target="_blank">Modify Status</a> endpoint with the following values:

ParameterValue
`accountNo`The `pmt_ref_no` from the second account you created
`type``7` (moves the card to `status: N`)
  1. Check the output again. The `account_status` should be `N`:



### Transfer funds

  1. To transfer funds from the first account to the second, call the <a href="ref:post_createaccounttransfer" target="_blank">Create Account Transfer</a> endpoint with the following values:

ParameterValue
`accountNo`The `pmt_ref_no` from the first account you created
`amount``10`
`transferToAccountNo`The `pmt_ref_no` from the second account you created
  1. Check the output `response_data`:

  • The top-level `new_balance` should be `20` (this is the balance for your first account).

  • Under `transfer_to_account`, the `new_balance` should be `10` (this is the balance for your second account):


  1. You can verify the balance by sending each <<glossary:PRN>> to the <a href="ref:post_getbalance" target="_blank">Get Balance</a> endpoint. You might also try sending each PRN to <a href="ref:post_gettranshistory" target="_blank">Get Transaction History</a> to see how one account was credited and the other debited.

## Step 5 — Freeze an account

In this step, you'll freeze an account, verify that it's frozen, then unfreeze it. You will use these endpoints that you've already had practice with:

  • <a href="ref:post_modifystatus" target="_blank">Modify Status</a>

  • <a href="ref:post_createsimulatedcardauth" target="_blank">Simulate Card Authorization</a>

  • <a href="ref:post_createsimulatedcardsettle" target="_blank">Simulate Card Settlement</a>

### Freeze the account

  1. To freeze the account, call the <a href="ref:post_modifystatus" target="_blank">Modify Status</a> endpoint with the following values:

ParameterValue
`accountNo`The `pmt_ref_no` from the second account you created
`type``17` (freezes the account)
  1. Check the output. The status should indicate `Success`:



Note

When you freeze an account, the freeze is reflected in the `freeze_info` object in the <a href="ref:post_getcard" target="_blank">Get Card</a> and <a href="ref:post_getaccountcards" target="_blank">Get Account Cards</a> endpoints, and not the `status`. See <a href="ref:about-cards#freezing-cards" target="_blank">Freezing cards</a> in the _About Cards_ guide for more information.

### Test the frozen account

Try authorizing a transaction to see what happens to a frozen account.

  1. Call the <a href="ref:post_createsimulatedcardauth" target="_blank">Simulate Card Authorization</a> endpoint with the following values:

ParameterValue
`accountNo`The `pmt_ref_no` from the first account you created
`amount``10`
`association``visa`
`merchantName`A business name (for example,`The Toastery`).
  1. Check the output. The `auth_response_code` should be `57`, indicating that the transaction is not permitted (see <a href="ref:api-reference-events-authorization-response-codes" target="_blank">Authorization Response Codes</a> for more information):



### Unfreeze the account

  1. To remove the freeze from the account, call the <a href="ref:post_modifystatus" target="_blank">Modify Status</a> endpoint again, but change `type` to `18`:

ParameterValue
`accountNo`The `pmt_ref_no` from the frozen account
`type``18` (unfreezes the account)
  1. Check the output. The status should indicate `Success`:



### Test the unfrozen account

  1. Call the <a href="ref:post_createsimulatedcardauth" target="_blank">Simulate Card Authorization</a> endpoint with same following values:

ParameterValue
`accountNo`The `pmt_ref_no` from the first account you created
`amount``10`
`association``visa`
`merchantName`A business name (for example,`The Toastery`).
  1. Check the output. The `auth_response_code` should now be `00`, indicating that the transaction is authorized: