This guide explains how to test Corporate Credit (CC) transactions in the <<glossary:CV>> environment using the Program API. Do not follow this procedure to test in <<glossary:Production>>.

Along with this guide you might want to read these:

  • <a href="doc:corporate-credit" target="_blank">**Corporate Credit**</a> — Explanation of what Corporate Credit is, with use cases.

  • <a href="doc:creating-corporate-credit-accounts" target="_blank">**Creating Corporate Credit Accounts**</a> — Properties of CC accounts and how to set them up.

  • <a href="page:corporate-credit-limit-transaction-examples" target="_blank">**Corporate Credit Transaction Examples**</a> — How various Corporate Credit transaction types look in the ledger.

In this scenario you will:

  1. Create a CC funding account

  2. Set a credit limit

  3. Create one or more CC spending accounts

  4. Simulate a card authorization and settlement

  5. View the authorization/settlement as well as the funding transactions

  6. Adjust the available credit

Remember that the CV environment runs on <a href="ref:galileo-system-time" target="_blank">Galileo system time</a>.

<!--As desired, download Galileo's Postman collection from the <a href="doc:postman-setup" target="_blank">Postman Setup</a> page by clicking the **Run in Postman** button. -->

## Set up the products

Work with Galileo to set up your CC funding and CC spending products in CV. Galileo recommends that you configure all of the settings that you intend to use in Production.

#### CC funding product

At minimum, the funding product should have these characteristics:

  • Product otype 0

  • Product category 32

#### CC spending product

At minimum, the spending product should have this characteristic:

  • Product category 33

## Create the accounts

Follow these steps to create a CC funding and a CC spending account.

### Create the CC funding account

  1. Call <a href="ref:post_createaccount" target="_blank">Create Account</a> with these parameters:

ParameterValue
`firstName``CC Funding`
`lastName``Account1`
`prodId`CC funding product ID
`businessName`_Required_ if `prodId` is a business product.
  1. In the response, capture the `pmt_ref_no` (PRN) for future use.

### Activate the CC funding account

  1. Check the status of the CC funding account by calling <a href="ref:post_verifyaccount" target="_blank">Verify Account</a> with this parameter:

    • `accountNo:` PRN of the CC funding account

  2. If the `account_status` is not `N`, activate the CC funding account by calling <a href="ref:post_modifystatus" target="_blank">Modify Status</a> with these parameters:

ParameterValue
`accountNo``pmt_ref_no` of the CC funding account
`type``1`

### Set the credit limit on the funding account

To set the credit limit on the CC funding account, call <a href="page:corporate-credit-limits-endpoint-reference#post-set-corporate-credit" target="_blank">Set Corporate Credit</a> with these parameters:

ParameterValue
`accountNo``pmt_ref_no` of the CC funding account
`amount``1000`

### Create a CC spending account

  1. Call <a href="ref:post_createaccount" target="_blank">Create Account</a> with these parameters.

ParameterValue
`firstName``Jane`
`lastName``Schmidt`
`prodId`CC spending product ID
`businessName`_Required_ if `prodId` is a business product.
`fundingAccountNo``pmt_ref_no` of the CC funding account
  1. Capture the these values from the response:

    • `pmt_ref_no`

    • `card_id` (CAD)

    • Last four digits of `card_number`

    • `expiry_date`

    • `card_security_code`

  2. As desired, create a second CC spending account, such as a card with a different CC spending account product ID.

### Activate the spending card

  1. After creating the CC spending card, call <a href="ref:post_activatecard" target="_blank">Activate Card</a> with these parameters (See <a href="doc:setting-up-a-card-program#card-activation" target="_blank">Card activation</a> in _Setting Up a Card Program_ for information about other activation options.):

ParameterValue
`accountNo`PRN or CAD of the CC spending account
`cardExpiryDate``expiry_date` as `YYYY-MM`
`cardSecurityCode``card_security_code` (In CV it is always 123)
`cardNumberLastFour`_Optional_. Last four digits of _card_number_. If there is more than one card associated with the PRN, you must populate this parameter.
  1. To verify that the card has been activated, call <a href="ref:post_getcard" target="_blank">Get Card</a> with the PRN or CAD of the card for `accountNo`. Inside the `embossed_cards` object you should see `status: N`.

### View account relationship

To see the relationship between the CC funding and CC spending accounts, call <a href="ref:post_getrtfaccountrelationship" target="_blank">Get RTF Account Relationship</a> with this parameter:

  • `accountNo:` PRN of the CC funding account, which returns all of the spending accounts that are associated with it.

Alternatively, you can call the endpoint with a CC spending account PRN for `accountNo` to return the associated CC funding account.

## Perform transactions

  1. To simulate a simple card transaction in CV, call the <a href="ref:post_createsimulatedcardauthorization" target="_blank">Create Simulated Card Authorization</a> endpoint with these parameters:

ParameterValue
`accountNo`PAN or CAD of the CC spending card
`amount``10`
`association``mc_auth`
`merchantName``Central Market`
`currencyCode`Populate this parameter only when the currency of the program is not `840` (U.S. dollar): `124` (Canada), `484` (Mexico), or `170` (Colombia).
  1. Capture the `auth_id` for future use.

  2. Settle the transaction by calling the <a href="ref:post_createsimulatedcardsettlement" target="_blank">Create Simulated Card Settlement</a> endpoint with these parameters:

ParameterValue
`accountNo`PAN or CAD of the CC spending card
`authId`The `auth_id` from the previous endpoint response.
`association``mc_auth`
`amount``10` or _blank_

### View the CC transactions

To see the transactions that were created, call <a href="ref:post_getalltranshistory" target="_blank">Get All Transaction History</a> twice:

  1. `accountNo` — PRN of the CC funding account

  2. `accountNo` — PRN of the CC spending account

For the CC spending account you should see four transactions. The `auth_id` and `source_id` are example values only.

`trans_code``amt``auth_id``source_id``calculated_balance`
ADSY102222444510
AUA-10222222220
BO510None222210
SE5-10222222220

For the CC funding account, you should see one transaction.

`trans_code``amt``auth_id``source_id``calculated_balance`
ADFY-1022224444-10

## Check the credit limit

For the funding account, call <a href="page:corporate-credit-limits-endpoint-reference#post-get-corporate-credit-summary" target="_blank">Get Corporate Credit Summary</a>. This should be the result:

  • `available_credit: 990`

  • `credit_limit: 1000`

The cards can continue spending until the `available_credit` reaches 0. After that, all authorization requests are denied until one of these events happens:

  • The credit limit is increased.

  • Funds are added to the funding account, such as to pay some or all of the balance.

## Pay off the balance

For the CC funding account, call <a href="ref:post_getbalance" target="_blank">Get Balance</a>. This should be the result:

  • `balance: -10`

That is the amount owed on the CC funding account. To pay it off, you can apply the funds to either the spending account or the funding account. If you apply funds to the spending account, they will be transferred into the funding account.

For this example, call <a href="ref:post_createadjustment" target="_blank">Create Adjustment</a> for the CC spending account with these parameters:

ParameterValue
`transactionId`Any unique 64-bit integer. In Postman you can use the `{{$randomInt}}` variable. (This is only for the Create Adjustment endpoint. All other endpoints can use a UUID or other format.)
`accountNo`PAN or PRN of the CC spending account
`amount``10`
`type``RL`
`debitCreditIndicator``C`
`includeRtfTransfer``1` or blank so that the funds will be automatically moved to the funding account.

Alternatively, you can use <a href="ref:post_createpayment" target="_blank">Create Payment</a> to apply the funds, using the same `type`.

## Add funds to the funding account

You do not need to add funds to the funding account for the spending cards to have available funds—setting a credit limit is enough. However, you can add funds in excess of the balance owed, which increases the available amount to spend.

Call <a href="ref:post_createadjustment" target="_blank">Create Adjustment</a> for the CC funding account with these parameters:

ParameterValue
`transactionId`Any unique 64-bit integer.
`accountNo`PRN of the CC funding account
`amount``500`
`type``RL`
`debitCreditIndicator``C`
`includeRtfTransfer``0` so that the adjustment will not affect the spending accounts.

Call <a href="page:corporate-credit-limits-endpoint-reference#post-get-corporate-credit-summary" target="_blank">Get Corporate Credit Summary</a> for the funding account. This should be the result:

  • `available_credit: 1500`

  • `credit_limit: 1000`

The available credit is higher than the credit limit by 500.00. The spending cards now have a 1500.00 spending limit, without your needing to change the credit limit.

Alternatively, you can call <a href="page:corporate-credit-limits-endpoint-reference#post-set-corporate-credit" target="_blank">Set Corporate Credit</a> to set the credit limit to 1500.00 or any other limit.

### Simulate a Visa transaction

To simulate a Visa transaction instead of the Mastercard transaction shown above, pass `association: visa`. In the response to Get All Transaction History, the transaction codes will be:

  • **VIA** — Authorization

  • **BVA** — Backout

  • **VSA** — Settlement

Note

For other types of transactions, see the <a href="doc:simulating-card-transactions" target="_blank">Simulating Card Transactions</a> guide.